source: FOIAVistA/trunk/r/OUTPATIENT_PHARMACY-PSO-APSP-HUIP/PSOSDRAP.m@ 794

Last change on this file since 794 was 628, checked in by George Lilly, 15 years ago

initial load of FOIAVistA 6/30/08 version

File size: 1.8 KB
Line 
1PSOSDRAP ;BHAM ISC/FLS - action/info profile replacement for print template ;09/22/03 8:24
2 ;;7.0;OUTPATIENT PHARMACY;**155,176**;SEP 2003
3 ;External reference to GETPLIST^SDAMA202 is supported by DBIA 3869
4 ;External reference to ^SC supported by DBIA 10040
5 ;called from PSOSD
6 Q ; Call from tag
7CLINALL ; All clinics
8 N ALL,APIFLDS,CLN,D0,GOTDATA,CHK,SEQ,DFN,CAN,LIST,PAGE,BDT,EDT,IOP
9 ;D DEV Q:POP
10 S APIFLDS="1;2;3;4;5;6;7;8;9;10;11;12",ALL=1
11 S (CLN,GOTDATA)=0
12 F S CLN=$O(^SC(CLN)) Q:'CLN D
13 .S CHK=$G(^SC(CLN,"I"))
14 .I $P(CHK,"^",1)'="",$P(CHK,"^",2)'>$P(CHK,"^",1) Q
15 .S $P(FR,",",1)=CLN D CLIN1
16 I 'GOTDATA U IO W !?10,"*** NO RECORDS TO PRINT ***"
17 D ^%ZISC
18 Q
19CLINIC ; Individual Clinics
20 N ALL,APIFLDS,D0,SEQ,DFN,CAN,LIST,PAGE,BDT,EDT,IOP
21 ;D DEV Q:POP
22 S APIFLDS="1;2;3;4;5;6;7;8;9;10;11;12",ALL=0
23CLIN1 ;
24 S BDT=$P(FR,",",2),EDT=$P(TO,",",2),D0=$P(FR,",",1)
25 I '$D(CLDT) S CLDT=BDT
26 D FIND^DIC(44,"","","AX",D0)
27 S CLINICX=$G(^TMP("DILIST",$J,1,1))
28 K DIC,^TMP("DILIST",$J),^TMP($J,"SDAMA202")
29 D GETPLIST^SDAMA202(D0,APIFLDS,"",BDT,EDT,.RSLT)
30 I ALL,$D(^TMP($J,"SDAMA202")) S GOTDATA=1
31 I 'ALL,'$D(^TMP($J,"SDAMA202")) U IO W !?10,"*** NO RECORDS TO PRINT ***" Q
32 S SEQ="",LIST="GETPLIST"
33 F S SEQ=$O(^TMP($J,"SDAMA202",LIST,SEQ)) Q:SEQ="" D PAT Q:$D(DIRUT)
34 I 'ALL D ^%ZISC
35 Q
36PAT ; Individual Patients
37 S LIST=$G(LIST) S:LIST="" LIST="GETAPPT" S SEQ=$G(SEQ) S:SEQ="" SEQ=1 S PAGE=1
38 S DFN=$P($G(^TMP($J,"SDAMA202",LIST,SEQ,4)),"^",1)
39 S CAN=$G(^TMP($J,"SDAMA202",LIST,SEQ,12))
40 Q:CAN=""
41 I DFN>0 D Q:$D(DIRUT)
42 .D HD^PSOSD2 Q:$D(DIRUT)
43 .D PAT^PSOSD Q:$D(DIRUT)
44 .D RXPAD^PSOSD1:PSTYPE Q:$D(DIRUT)
45 .W:'$G(PSTYPE)&('$D(^TMP("PSOD",$J))) @IOF
46 .D ENSTUFF^PSODACT
47 D ^PSOSD3
48 Q
49DEV ;
50 S PSOION=ION,%ZIS="QM",%ZIS("B")=""
51 D ^%ZIS K %ZIS
52 I POP S IOP=PSOION D ^%ZIS K IOP,PSOION
53 Q
Note: See TracBrowser for help on using the repository browser.