82 lines
2.0 KiB
Mathematica
82 lines
2.0 KiB
Mathematica
PPPPRT22 ;ALB/JFP/DAD - FFX PRINT ROUTINES ; 3/16/92
|
|
;;V1.0;PHARMACY PRESCRIPTION PRACTICE;**17**;APR 7,1995
|
|
;;Per VHA Directive 10-93-142, this routine should not be modified.
|
|
;
|
|
STAHISTP ; Print tha station Histogram
|
|
;
|
|
N PPPMRT,PRTFFXST,PRTFFXND
|
|
N STANUM,VISITS,STARS,PPPARRY,TMP,I,DR,DIR,NUMPATS,NUMVIS,NUMVISIT
|
|
N VALMVNT,HDRCNT,DROOT,HROOT,X,BLINE
|
|
;
|
|
S PPPMRT="STAHISTP_PPPPRT22"
|
|
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 STAHISTA(PPPARRY)
|
|
;
|
|
D HEADING1
|
|
D ORDER1
|
|
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,"Stations Vs. Number Of Patients")
|
|
D HDRTMP
|
|
S X=$$CENTER^PPPUTL1(BLINE,"As Of --> "_$$I2EDT^PPPCNV1(DT))
|
|
D HDRTMP
|
|
Q
|
|
;
|
|
ORDER1 ;
|
|
;
|
|
S STANUM=""
|
|
F TMP=0:0 D Q:STANUM=""
|
|
.S STANUM=$O(@PPPARRY@(STANUM)) Q:STANUM=""
|
|
.S VISITS=@PPPARRY@(STANUM)
|
|
.I VISITS>(IOM-20) S VISITS=(IOM-20)
|
|
.S STARS=""
|
|
.F I=1:1:VISITS S STARS=STARS_"*"
|
|
.S X=$$SETSTR^VALM1($E(STANUM_" ",1,6)_" -|- "_STARS_" ("_@PPPARRY@(STANUM)_")","",1,79)
|
|
.D TMP
|
|
Q
|
|
;
|
|
STAHISTA(TMPARY) ;
|
|
;
|
|
N STAPTR,STANUM,PATDFN
|
|
;
|
|
F STAPTR=0:0 D Q:STAPTR=""
|
|
.S STAPTR=$O(^PPP(1020.2,"ARPOV",STAPTR)) Q:STAPTR=""
|
|
.S STANUM=STAPTR
|
|
.S @TMPARY@(STANUM)=0
|
|
.F PATDFN=0:0 D Q:PATDFN=""
|
|
..S PATDFN=$O(^PPP(1020.2,"ARPOV",STAPTR,PATDFN)) Q:PATDFN=""
|
|
..S @TMPARY@(STANUM)=@TMPARY@(STANUM)+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
|
|
;
|