54 lines
1.8 KiB
Mathematica
54 lines
1.8 KiB
Mathematica
PSOSDRAP ;BHAM ISC/FLS - action/info profile replacement for print template ;09/22/03 8:24
|
|
;;7.0;OUTPATIENT PHARMACY;**155,176**;SEP 2003
|
|
;External reference to GETPLIST^SDAMA202 is supported by DBIA 3869
|
|
;External reference to ^SC supported by DBIA 10040
|
|
;called from PSOSD
|
|
Q ; Call from tag
|
|
CLINALL ; All clinics
|
|
N ALL,APIFLDS,CLN,D0,GOTDATA,CHK,SEQ,DFN,CAN,LIST,PAGE,BDT,EDT,IOP
|
|
;D DEV Q:POP
|
|
S APIFLDS="1;2;3;4;5;6;7;8;9;10;11;12",ALL=1
|
|
S (CLN,GOTDATA)=0
|
|
F S CLN=$O(^SC(CLN)) Q:'CLN D
|
|
.S CHK=$G(^SC(CLN,"I"))
|
|
.I $P(CHK,"^",1)'="",$P(CHK,"^",2)'>$P(CHK,"^",1) Q
|
|
.S $P(FR,",",1)=CLN D CLIN1
|
|
I 'GOTDATA U IO W !?10,"*** NO RECORDS TO PRINT ***"
|
|
D ^%ZISC
|
|
Q
|
|
CLINIC ; Individual Clinics
|
|
N ALL,APIFLDS,D0,SEQ,DFN,CAN,LIST,PAGE,BDT,EDT,IOP
|
|
;D DEV Q:POP
|
|
S APIFLDS="1;2;3;4;5;6;7;8;9;10;11;12",ALL=0
|
|
CLIN1 ;
|
|
S BDT=$P(FR,",",2),EDT=$P(TO,",",2),D0=$P(FR,",",1)
|
|
I '$D(CLDT) S CLDT=BDT
|
|
D FIND^DIC(44,"","","AX",D0)
|
|
S CLINICX=$G(^TMP("DILIST",$J,1,1))
|
|
K DIC,^TMP("DILIST",$J),^TMP($J,"SDAMA202")
|
|
D GETPLIST^SDAMA202(D0,APIFLDS,"",BDT,EDT,.RSLT)
|
|
I ALL,$D(^TMP($J,"SDAMA202")) S GOTDATA=1
|
|
I 'ALL,'$D(^TMP($J,"SDAMA202")) U IO W !?10,"*** NO RECORDS TO PRINT ***" Q
|
|
S SEQ="",LIST="GETPLIST"
|
|
F S SEQ=$O(^TMP($J,"SDAMA202",LIST,SEQ)) Q:SEQ="" D PAT Q:$D(DIRUT)
|
|
I 'ALL D ^%ZISC
|
|
Q
|
|
PAT ; Individual Patients
|
|
S LIST=$G(LIST) S:LIST="" LIST="GETAPPT" S SEQ=$G(SEQ) S:SEQ="" SEQ=1 S PAGE=1
|
|
S DFN=$P($G(^TMP($J,"SDAMA202",LIST,SEQ,4)),"^",1)
|
|
S CAN=$G(^TMP($J,"SDAMA202",LIST,SEQ,12))
|
|
Q:CAN=""
|
|
I DFN>0 D Q:$D(DIRUT)
|
|
.D HD^PSOSD2 Q:$D(DIRUT)
|
|
.D PAT^PSOSD Q:$D(DIRUT)
|
|
.D RXPAD^PSOSD1:PSTYPE Q:$D(DIRUT)
|
|
.W:'$G(PSTYPE)&('$D(^TMP("PSOD",$J))) @IOF
|
|
.D ENSTUFF^PSODACT
|
|
D ^PSOSD3
|
|
Q
|
|
DEV ;
|
|
S PSOION=ION,%ZIS="QM",%ZIS("B")=""
|
|
D ^%ZIS K %ZIS
|
|
I POP S IOP=PSOION D ^%ZIS K IOP,PSOION
|
|
Q
|