VistA-WorldVistAEHR/r/PHARMACY_PRESCRIPTION_PRACT.../PPPPRT23.m

88 lines
2.2 KiB
Mathematica

PPPPRT23 ;ALB/JFP - FFX PRINT ROUTINES ; 3/16/92
;;V1.0;PHARMACY PRESCRIPTION PRACTICE;;APR 7,1995
;;Per VHA Directive 10-93-142, this routine should not be modified.
;
VISHISTP ;
;
N PPPMRT,PRTFFXST,PRTFFXND
N STANUM,VISITS,STARS,PPPARRY,TMP,I,DR,DIR,TPATS,TVIS,TSTA,PATFILE
N NUMVIS,ENDING,NUMPATS,NUMVISIT,DIE
N VALMVNT,HDRCNT,DROOT,HROOT,X,BLINE
;
S PPPMRT="VISHISTP_PPPPRT23"
S PRTFFXST=1017
S PRTFFXND=1018
S (VALMCNT,HDRCNT)=0
;
S DROOT="^TMP(""PPPL6"",$J)"
S HROOT="^TMP(""PPPL6"",$J,""HDR"")"
S PPPARRY="^TMP(""PPP"",$J,""HIST"")"
;
S TMP=$$LOGEVNT^PPPMSC1(PRTFFXST,PPPMRT,"STATION HISTOGRAMS")
D VISHISTA(PPPARRY)
;
D HEADING1
D ORDER2
S X=$$SETSTR^VALM1(" ","",1,79) D TMP
S X=$$SETSTR^VALM1("Listing Complete.","",1,79) D TMP
K @PPPARRY
S TMP=$$LOGEVNT^PPPMSC1(PRTFFXND,PPPMRT)
Q
;
HEADING1 ; Write the page heading, Pause if a crt.
;
S BLINE=$$SETSTR^VALM1(" ","",1,80)
;
S X=BLINE D HDRTMP
S X=$$CENTER^PPPUTL1(BLINE,"Pharmacy Prescription Practices")
D HDRTMP
S X=$$CENTER^PPPUTL1(BLINE,"Foreign Facility Histograms")
D HDRTMP
S X=$$CENTER^PPPUTL1(BLINE,"Number of Stations Visited Vs. Number Of Patients")
D HDRTMP
S X=$$CENTER^PPPUTL1(BLINE,"As Of --> "_$$I2EDT^PPPCNV1(DT))
D HDRTMP
Q
;
ORDER2 ;
;
F NUMVIS=0:0 D Q:NUMVIS'>0
.S NUMVIS=$O(@PPPARRY@(NUMVIS)) Q:NUMVIS'>0
.S NUMPATS=@PPPARRY@(NUMVIS)
.I NUMPATS>(IOM-20) S NUMPATS=(IOM-20)
.S STARS=""
.F I=1:1:NUMPATS S STARS=STARS_"*"
.S X=$$SETSTR^VALM1($E(NUMVIS_" ",1,3)_" -|- "_STARS_" ("_@PPPARRY@(NUMVIS)_")","",1,79)
.D TMP
Q
;
VISHISTA(TMPARY) ;
;
N STAPTR,STANUM,PATDFN
;
S (TPATS,TVIS,TSTA)=0
F PATDFN=0:0 D Q:PATDFN=""
.S PATDFN=$O(^PPP(1020.2,"APOV",PATDFN)) Q:PATDFN=""
.S NUMVISIT=0
.S TPATS=TPATS+1
.F STAPTR=0:0 D Q:STAPTR=""
..S STAPTR=$O(^PPP(1020.2,"APOV",PATDFN,STAPTR)) Q:STAPTR=""
..S NUMVISIT=NUMVISIT+1
..S TVIS=TVIS+1
..I '$D(@TMPARY@("STA",STAPTR)) D
...S @TMPARY@("STA",STAPTR)=""
...S TSTA=TSTA+1
.S @TMPARY@(NUMVISIT)=+$G(@TMPARY@(NUMVISIT))+1
Q
;
TMP ; -- Sets up data display array
S VALMCNT=VALMCNT+1
S @DROOT@(VALMCNT,0)=$E(X,1,79)
QUIT
;
HDRTMP ; -- Sets up header display array
S HDRCNT=HDRCNT+1
S @HROOT@(HDRCNT)=$E(X,1,79)
QUIT
;