Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: PSJMPRTU

PSJMPRTU.m

Go to the documentation of this file.
PSJMPRTU ;BIR/MV-SETUP AND PRINT UD ORDER ;25 NOV 96 / 1:34 PM
 ;;5.0; INPATIENT MEDICATIONS ;**34**;16 DEC 97
START ;
 S (PPN1,PSJATME1,PID1,PSGWN1,PRB1,TM1)=""
 N SP S $P(SP," ",20)=" " S:ON["*" PSJATMEO=0
 D NEWPG
 Q
NEWPG ;
 I PSJADT'=PSJADTO S:($E(PSJADT,1,2)="99") PSJHL3="PRN orders for: "_XNAME S:($E(PSJADT,1,2)="88") PSJHL3="*** No admin time could be calculated for the following orders: ***" D SETALL,@PSGSS Q
 I PSJLN+PSJNEED>$S($E(IOST)="E":23,1:60) D SETALL,@PSGSS Q
 D @PSGSS
 Q
SETALL ;
 S (PSJADTO,PSJADT1)=PSJADT,(PPNO,PPN1)=PPN,(PSJATMEO,PSJATME1)=PSJATME,(PRBO,PRB1)=PRB S:PSJATME1]"88" PSJATME1="     "
 S PID1=PID,PSGWN1=PSGWN
 S TMO=TM
 S:$G(PSGTM)!$G(PSGTMALL) TM1=$S(TM="ZZ":"NOT FOUND",1:TM),PSJHL1=$P(PSJHL1,", ")_", "_TM1
 S PSJLN=66
 Q
P ;
 D:(PSJLN+PSJNEED)>PSJTOTLN SETALL
 D:PPN'=PPNO SETALL
 S:PSJATME'=PSJATMEO (PSJATMEO,PSJATME1)=PSJATME
 S:PSJATME1["99" PSJATME1="     " S:PSJATME1["88" PSJATME1="     "
 D SETPVAR,PSJPRT($P(PPN1,U),PRB1,PSJATME1,PID1,"","",PSGWN1,"","")
 Q
G ;
W ;
 D:(PSJLN+PSJNEED)>PSJTOTLN SETALL
 D:TM'=TMO SETALL
 S:PSJATME'=PSJATMEO (PSJATMEO,PSJATME1)=PSJATME
 S:PRB'=PRBO (PRBO,PRB1)=PRB
 S:PPN'=PPNO (PPNO,PPN1)=PPN,PID1=PID,PSGWN1=PSGWN,PRB1=PRB
 D SETPVAR
 D:PSGRBADM="A" PSJPRT(PSJATME1,PRB1,PPN1,"     ",$E(SP,1,11),PID1,"     ",$E(SP,1,11),PSGWN1)
 D:PSGRBADM="P" PSJPRT($P(PPN1,U),PRB1,PSJATME1,PID1,"","",PSGWN1,"","")
 D:PSGRBADM="R" PSJPRT(PRB1,PPN1,PSJATME1,$E(SP,1,11),PID1,"     ",$E(SP,1,11),PSGWN1,"     ")
 Q
 ;
PSJPRT(C1,C2,C3,C4,C5,C6,C7,C8,C9)     ;
 S PSJPRT(1)=C1_" "_C2_" "_C3
 S PSJPRT(2)=C4_" "_C5_" "_C6
 S PSJPRT(3)=C7_" "_C8_" "_C9
 Q
SETPVAR ;
 S PPN1=$E($P(PPN1,U)_SP,1,20),PID1=$E(PID1_SP,1,20)
 S PRB1=$E(PRB1_SP,1,11),PSGWN1=$E(PSGWN1_SP,1,20)
 S X=PSJATME1 I ON["*" S PSJATME1="*    " Q
 S:X>0 X=$S($L(X)=3:"0"_X,1:X),X=$E(X,1,2)_":"_$E(X,3,4)
 S PSJATME1=$E(X_SP,1,5)
 Q
PRT ;
 D:(PSJLN+PSJNEED)>PSJTOTLN HDR Q:$G(PSJSTOP)
 W !,PSJPRT(1),?39,PSGLOD," | "
 I QST["Z" W "P E N D I N G"
 E  W PSGLSD," | ",PSGLFD
 NEW X,MARX
 D DRGDISP^PSJLMUT1(PSGP,+ON_$S(QST["Z":"P",1:"U"),41,35,.MARX,0)
 NEW X F X=0:0 S X=$O(MARX(X)) Q:'X   W !,$G(PSJPRT(X+1)) W ?39,MARX(X)
 I PSJSI]"" W !?39 F Y=1:1:$L(PSJSI," ") S Y1=$P(PSJSI," ",Y) W:($L(Y1)+$X)>79 !?39 W Y1_" "
 W:PSJHOLD !?39,"*** ON HOLD ***"
 W:PSJONETM !?39,"*** ONE TIME ***"
 W:PSJONCAL !?39,"*** ON CALL ***"
 W !?39,"RN/LPN Init: ________"
 W !
 S PSJLN=PSJLN+PSJNEED
 Q
HDR ;
 I PSGPG,$G(PSJASTR) S X=$Y D
 . F X=X:1:PSJTOTLN W !
 . W PSJHL62 S PSJASTR=0
 Q:$$PRTCHK^PSJMUTL(PSGPG)
 W:($E(IOST)="C"!PSGPG)&($Y) @IOF
 S PSJLN=5,PSGPG=PSGPG+1
 W !,PSJHL1,?66,"Page: ",PSGPG,!,PSJHL2
 W:$E(PSJADT,1,2)="88" ! W !,PSJHL3,!
 I ((PSJADT1'["9999")&(PSJADT1'["8888")) W !,"For date: ",$E($$ENDTC^PSGMI(PSJADT1),1,8),!
 Q