[613] | 1 | PSJMPRTU ;BIR/MV-SETUP AND PRINT UD ORDER ;25 NOV 96 / 1:34 PM
|
---|
| 2 | ;;5.0; INPATIENT MEDICATIONS ;**34**;16 DEC 97
|
---|
| 3 | START ;
|
---|
| 4 | S (PPN1,PSJATME1,PID1,PSGWN1,PRB1,TM1)=""
|
---|
| 5 | N SP S $P(SP," ",20)=" " S:ON["*" PSJATMEO=0
|
---|
| 6 | D NEWPG
|
---|
| 7 | Q
|
---|
| 8 | NEWPG ;
|
---|
| 9 | 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
|
---|
| 10 | I PSJLN+PSJNEED>$S($E(IOST)="E":23,1:60) D SETALL,@PSGSS Q
|
---|
| 11 | D @PSGSS
|
---|
| 12 | Q
|
---|
| 13 | SETALL ;
|
---|
| 14 | S (PSJADTO,PSJADT1)=PSJADT,(PPNO,PPN1)=PPN,(PSJATMEO,PSJATME1)=PSJATME,(PRBO,PRB1)=PRB S:PSJATME1]"88" PSJATME1=" "
|
---|
| 15 | S PID1=PID,PSGWN1=PSGWN
|
---|
| 16 | S TMO=TM
|
---|
| 17 | S:$G(PSGTM)!$G(PSGTMALL) TM1=$S(TM="ZZ":"NOT FOUND",1:TM),PSJHL1=$P(PSJHL1,", ")_", "_TM1
|
---|
| 18 | S PSJLN=66
|
---|
| 19 | Q
|
---|
| 20 | P ;
|
---|
| 21 | D:(PSJLN+PSJNEED)>PSJTOTLN SETALL
|
---|
| 22 | D:PPN'=PPNO SETALL
|
---|
| 23 | S:PSJATME'=PSJATMEO (PSJATMEO,PSJATME1)=PSJATME
|
---|
| 24 | S:PSJATME1["99" PSJATME1=" " S:PSJATME1["88" PSJATME1=" "
|
---|
| 25 | D SETPVAR,PSJPRT($P(PPN1,U),PRB1,PSJATME1,PID1,"","",PSGWN1,"","")
|
---|
| 26 | Q
|
---|
| 27 | G ;
|
---|
| 28 | W ;
|
---|
| 29 | D:(PSJLN+PSJNEED)>PSJTOTLN SETALL
|
---|
| 30 | D:TM'=TMO SETALL
|
---|
| 31 | S:PSJATME'=PSJATMEO (PSJATMEO,PSJATME1)=PSJATME
|
---|
| 32 | S:PRB'=PRBO (PRBO,PRB1)=PRB
|
---|
| 33 | S:PPN'=PPNO (PPNO,PPN1)=PPN,PID1=PID,PSGWN1=PSGWN,PRB1=PRB
|
---|
| 34 | D SETPVAR
|
---|
| 35 | D:PSGRBADM="A" PSJPRT(PSJATME1,PRB1,PPN1," ",$E(SP,1,11),PID1," ",$E(SP,1,11),PSGWN1)
|
---|
| 36 | D:PSGRBADM="P" PSJPRT($P(PPN1,U),PRB1,PSJATME1,PID1,"","",PSGWN1,"","")
|
---|
| 37 | D:PSGRBADM="R" PSJPRT(PRB1,PPN1,PSJATME1,$E(SP,1,11),PID1," ",$E(SP,1,11),PSGWN1," ")
|
---|
| 38 | Q
|
---|
| 39 | ;
|
---|
| 40 | PSJPRT(C1,C2,C3,C4,C5,C6,C7,C8,C9) ;
|
---|
| 41 | S PSJPRT(1)=C1_" "_C2_" "_C3
|
---|
| 42 | S PSJPRT(2)=C4_" "_C5_" "_C6
|
---|
| 43 | S PSJPRT(3)=C7_" "_C8_" "_C9
|
---|
| 44 | Q
|
---|
| 45 | SETPVAR ;
|
---|
| 46 | S PPN1=$E($P(PPN1,U)_SP,1,20),PID1=$E(PID1_SP,1,20)
|
---|
| 47 | S PRB1=$E(PRB1_SP,1,11),PSGWN1=$E(PSGWN1_SP,1,20)
|
---|
| 48 | S X=PSJATME1 I ON["*" S PSJATME1="* " Q
|
---|
| 49 | S:X>0 X=$S($L(X)=3:"0"_X,1:X),X=$E(X,1,2)_":"_$E(X,3,4)
|
---|
| 50 | S PSJATME1=$E(X_SP,1,5)
|
---|
| 51 | Q
|
---|
| 52 | PRT ;
|
---|
| 53 | D:(PSJLN+PSJNEED)>PSJTOTLN HDR Q:$G(PSJSTOP)
|
---|
| 54 | W !,PSJPRT(1),?39,PSGLOD," | "
|
---|
| 55 | I QST["Z" W "P E N D I N G"
|
---|
| 56 | E W PSGLSD," | ",PSGLFD
|
---|
| 57 | NEW X,MARX
|
---|
| 58 | D DRGDISP^PSJLMUT1(PSGP,+ON_$S(QST["Z":"P",1:"U"),41,35,.MARX,0)
|
---|
| 59 | NEW X F X=0:0 S X=$O(MARX(X)) Q:'X W !,$G(PSJPRT(X+1)) W ?39,MARX(X)
|
---|
| 60 | I PSJSI]"" W !?39 F Y=1:1:$L(PSJSI," ") S Y1=$P(PSJSI," ",Y) W:($L(Y1)+$X)>79 !?39 W Y1_" "
|
---|
| 61 | W:PSJHOLD !?39,"*** ON HOLD ***"
|
---|
| 62 | W:PSJONETM !?39,"*** ONE TIME ***"
|
---|
| 63 | W:PSJONCAL !?39,"*** ON CALL ***"
|
---|
| 64 | W !?39,"RN/LPN Init: ________"
|
---|
| 65 | W !
|
---|
| 66 | S PSJLN=PSJLN+PSJNEED
|
---|
| 67 | Q
|
---|
| 68 | HDR ;
|
---|
| 69 | I PSGPG,$G(PSJASTR) S X=$Y D
|
---|
| 70 | . F X=X:1:PSJTOTLN W !
|
---|
| 71 | . W PSJHL62 S PSJASTR=0
|
---|
| 72 | Q:$$PRTCHK^PSJMUTL(PSGPG)
|
---|
| 73 | W:($E(IOST)="C"!PSGPG)&($Y) @IOF
|
---|
| 74 | S PSJLN=5,PSGPG=PSGPG+1
|
---|
| 75 | W !,PSJHL1,?66,"Page: ",PSGPG,!,PSJHL2
|
---|
| 76 | W:$E(PSJADT,1,2)="88" ! W !,PSJHL3,!
|
---|
| 77 | I ((PSJADT1'["9999")&(PSJADT1'["8888")) W !,"For date: ",$E($$ENDTC^PSGMI(PSJADT1),1,8),!
|
---|
| 78 | Q
|
---|