source: WorldVistAEHR/trunk/r/PHARMACY_PRESCRIPTION_PRACTICE-PPP/PPPPRT24.m@ 1639

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

initial load of WorldVistAEHR

File size: 2.6 KB
Line 
1PPPPRT24 ;ALB/JFP - FFX PRINT ROUTINES ; 3/16/92
2 ;;V1.0;PHARMACY PRESCRIPTION PRACTICE;;APR 7,1995
3 ;;Per VHA Directive 10-93-142, this routine should not be modified.
4 ;
5DATASUM ;
6 ;
7 N PPPMRT,PRTFFXST,PRTFFXND
8 N STANUM,VISITS,STARS,PPPARRY,TMP,I,DR,DIR,TPATS,TVIS,TSTA,PATFILE
9 N NUMVIS,ENDING,NUMPATS,NUMVISIT
10 N HDRCNT,DROOT,HROOT,X,BLINE,JOIN
11 ;
12 S PPPMRT="DATASUM_PPPPRT24"
13 S PRTFFXST=1017
14 S PRTFFXND=1018
15 S (VALMCNT,HDRCNT)=0
16 ;
17 S DROOT="^TMP(""PPPL6"",$J)"
18 S HROOT="^TMP(""PPPL6"",$J,""HDR"")"
19 S PPPARRY="^TMP(""PPP"",$J,""HIST"")"
20 ;
21 S TMP=$$LOGEVNT^PPPMSC1(PRTFFXST,PPPMRT,"STATION HISTOGRAMS")
22 D VISHISTA(PPPARRY)
23 ;
24 D HEADING1
25 D ORDER3
26 S X=$$SETSTR^VALM1(" ","",1,79) D TMP
27 S X=$$SETSTR^VALM1("Listing Complete.","",1,79) D TMP
28 K @PPPARRY
29 S TMP=$$LOGEVNT^PPPMSC1(PRTFFXND,PPPMRT)
30 Q
31 ;
32HEADING1 ; Write the page heading, Pause if a crt.
33 S BLINE=$$SETSTR^VALM1(" ","",1,80)
34 ;
35 S X=BLINE D HDRTMP
36 S X=$$CENTER^PPPUTL1(BLINE,"Pharmacy Prescription Practices")
37 D HDRTMP
38 S X=$$CENTER^PPPUTL1(BLINE,"Data Summary")
39 D HDRTMP
40 S X=$$CENTER^PPPUTL1(BLINE,"As Of --> "_$$I2EDT^PPPCNV1(DT))
41 D HDRTMP
42 Q
43 ;
44ORDER3 ;
45 ;
46 S PATFILE=$P($G(^DPT(0)),"^",4)
47 S X=$$SETSTR^VALM1("Total Number Of Patients In Patient File........................"_PATFILE,"",1,79)
48 D TMP
49 S X=$$SETSTR^VALM1("Total Patients In Other Facility Xref File......................"_TPATS,"",1,79)
50 D TMP
51 S X=$$SETSTR^VALM1("Total Number Of Stations Visited................................"_TSTA,"",1,79)
52 D TMP
53 S X=$$SETSTR^VALM1("Total Number Of Entries In Other Facility Xref File............."_TVIS,"",1,79)
54 D TMP
55 S X=$$SETSTR^VALM1(" ","",1,79) D TMP
56 F NUMVIS=0:0 D Q:NUMVIS'>0
57 .S NUMVIS=$O(@PPPARRY@(NUMVIS)) Q:NUMVIS'>0
58 .S NUMPATS=@PPPARRY@(NUMVIS)
59 .S ENDING=$E(NUMVIS_" Other Station"_$S(NUMVIS>1:"s",1:"")_"............",1,24)
60 .S JOIN=ENDING_NUMPATS
61 .S X=$$SETSTR^VALM1("Total Number Of Patients With Visits To "_JOIN,"",1,68)
62 .S X=$$SETSTR^VALM1(" ("_$FN(((NUMPATS/PATFILE)*100),"",2)_"%)",X,69,11)
63 .D TMP
64 Q
65 ;
66VISHISTA(TMPARY) ;
67 ;
68 N STAPTR,STANUM,PATDFN
69 ;
70 S (TPATS,TVIS,TSTA)=0
71 F PATDFN=0:0 D Q:PATDFN=""
72 .S PATDFN=$O(^PPP(1020.2,"APOV",PATDFN)) Q:PATDFN=""
73 .S NUMVISIT=0
74 .S TPATS=TPATS+1
75 .F STAPTR=0:0 D Q:STAPTR=""
76 ..S STAPTR=$O(^PPP(1020.2,"APOV",PATDFN,STAPTR)) Q:STAPTR=""
77 ..S NUMVISIT=NUMVISIT+1
78 ..S TVIS=TVIS+1
79 ..I '$D(@TMPARY@("STA",STAPTR)) D
80 ...S @TMPARY@("STA",STAPTR)=""
81 ...S TSTA=TSTA+1
82 .S @TMPARY@(NUMVISIT)=+$G(@TMPARY@(NUMVISIT))+1
83 Q
84 ;
85TMP ; -- Sets up data display array
86 S VALMCNT=VALMCNT+1
87 S @DROOT@(VALMCNT,0)=$E(X,1,79)
88 QUIT
89 ;
90HDRTMP ; -- Sets up header display array
91 S HDRCNT=HDRCNT+1
92 S @HROOT@(HDRCNT)=$E(X,1,79)
93 QUIT
94 ;
Note: See TracBrowser for help on using the repository browser.