PSIVORV2 ;BIR/MLM-VIEW AN ORDER (PHARMACY) ;05-Dec-2003 10:05;PLS
;;5.0; INPATIENT MEDICATIONS ;**15,81**;16 DEC 97
; Modified - IHS/CIA/PLS - 12/05/03 - Line ENNONUM+2
Q
;***
;V5.0 will be using ^PSJLIFN instead. Other sub-modules in this routine
;are being used by IPF...
;***
EN ; Display order with numbers.
D EN^PSJLIORD(DFN,ON) Q
N PSIVNUM S PSIVNUM=1
;
ENNONUM(DFN,PSJORD) ; Display order with no numbers.
S UL80="",$P(UL80,"=",80)=""
; IHS/CIA/PLS - 12/05/03 - Commented out next line and changed from SSN to HRN
;W:'$G(PSJPRF)&($Y) @IOF W !!,"Patient: ",VADM(1)," (",$P(VADM(2),U,2),")",?52,"Wt (kg): ",PSJPWT," ",PSJPWTD
W:'$G(PSJPRF)&($Y) @IOF W !!,"Patient: ",VADM(1)," (",$G(VA("PID")),")",?52,"Wt (kg): ",PSJPWT," ",PSJPWTD
W !?3,"Ward: ",$S(VAIN(4):$P(VAIN(4),U,2),1:"OUTPATIENT"),?52,"Ht (cm): ",PSJPHT," ",PSJPWTD
W !,?1,"Status: ",$$CODES^PSIVUTL(P(17),$S(P("PON")'["V":53.1,1:55.01),$S(P("PON")'["V":28,1:100)) W:P("PON")["V" ?47,"Order number: ",+P("PON") W !,UL80,!
;
ENPRO ; Profile view.
N PSIVAC,Y,PSGEBN,PSGLI,PSJSTAR,PSIV531
S (PSGEBN,PSGLI)=""
S PSIVAC="C",P("PON")=ON
S PSIVUP=+$$GTPCI^PSIVUTL
S P("OT")=$S(P(4)="A":"F",P(4)="H":"H",1:"I")
NEW PSJL
N PSIVNUM S PSIVNUM=1
I P("OT")="I" D
. S PSJSTAR="(1)^(4)^(5)^(6)^(7)^(9)^(10)"
. D ^PSJLIVMD
I P("OT")'="I" D
. S PSJSTAR="(1)^(2)^(3)^(4)^(5)^(6)^(7)^(9)"
. D ^PSJLIVFD
NEW PSIVX
F PSIVX=0:0 S PSIVX=$O(^TMP("PSJI",$J,PSIVX)) Q:'PSIVX W !,^(PSIVX,0)
K ^TMP("PSJI",$J)
Q
LONG(Y) ; Display long fields.
F X=1:1:$L(Y," ") D:$X+$L($P(Y," ",X))>$S(LN<11:42,1:80) RC W ?5,$P(Y," ",X)," "
Q ""
WTPC ; Write provider comments.
W ?3,Y,!
;
PAUSE ;Hold display if end screen, do FF if eop.
I $E(IOST)="C",($Y#IOSL)>20 N DIR,X,Y S DIR(0)="E" D ^DIR Q:$D(DUOUT)!$D(DTOUT) W !
Q
;
RC ; Print field by line number
N X,Y S LN=LN+1 D:LN<11 @LN W !
Q
;
1 ; Type
W ?56,"Type: " S X=$$CODES^PSIVUTL(P(4),53.1,53) W $S($E(X)="C":"CHEMO",1:X),$S(P(23)'="":" ("_P(23)_")",1:""),$S(P(5)=1:" (I)",P(5)=0:"(C)",1:"")
Q
;
2 ;Syringe Size
W:P("SYRS")]"" ?51,"Syr. Size: ",$E(P("SYRS"),1,13) W:$L(P("SYRS"))>13 "..."
Q
;
3 ; IV Room
W ?53,"IV Room: ",$P(P("IVRM"),U,2)
Q
;
4 ; Start Date
S X="" I $D(PSIVNUM) S:P("DTYP") X=$S(P(17)="P"!(PSIVAC="PN"):" ",1:"*")_$S(P("DTYP")=1:"(12)",$E(P("OT"))="I":"(10)",1:"(8)")
W ?48-$L(X),X,?50,"Start Date: ",$$WDTE^PSIVUTL(P(2))
Q
;
5 ; Stop Date
S X="" I $D(PSIVNUM) S:P("DTYP") X=$S(P(17)="P"!(PSIVAC="PN"):" ",1:"*")_$S(P("DTYP")=1:"(13)",$E(P("OT"))="I":"(11)",1:"(9)")
W ?48-$L(X),X,?51,"Stop Date: ",$$WDTE^PSIVUTL(P(3))
Q
;
6 ; Log-in Date
W ?50,"Login Date: ",$$WDTE^PSIVUTL(P("LOG"))
Q
;
7 ; Last fill date.
S Y=$$WDTE^PSIVUTL(P("LF")) W ?51,"Last Fill: ",$S(Y="******":"** Not printed **",1:Y)
Q
;
8 ;Last fill qty.
W ?52,"Quantity: ",+P("LFA")
Q
;
9 ; Entry Code
W ?50,"Entry Code: ",$S($P(P("CLRK"),U,2)]"":$E($P(P("CLRK"),U,2),1,18),1:"*** Undefined")
Q
;
10 ; Provider
S X="" I $D(PSIVNUM),P("DTYP") S X=$S(PSIVAC="PN":" ",1:"*")_$S(P("DTYP")=1:"(14)",$E(P("OT"))="I":"(12)",1:"(10)") ;I P(17)="P",(+P("CLRK")=+P(6)) S X=""
W ?48-$L(X),X,?52,"Provider: ",$S($P(P(6),U,2)]"":$E($P(P(6),U,2),1,18),1:"*** Undefined")
Q
ENNH(ON) ;
I ON'["V" D GT531^PSIVORFA(DFN,ON) S:P(4)="" P(4)="P",(P(2),P(3))="" N PSIV531 S PSIV531=1
I ON["V" D GT55^PSIVORFB
N UL S UL="",$P(UL,"-",70)="" W !!,?5,UL,!,?5,"Patient: ",PSGP(0),?54,"Status: ",$S(P(17)="DE":"DC (EDIT)",1:$$CODES^PSIVUTL(P(17),$S(ON'["V":53.1,1:55.01),$S(ON'["V":28,1:100))),!
D ENPRO
Q
PSIVORV2 ;BIR/MLM-VIEW AN ORDER (PHARMACY) ;05-Dec-2003 10:05;PLS
+1 ;;5.0; INPATIENT MEDICATIONS ;**15,81**;16 DEC 97
+2 ; Modified - IHS/CIA/PLS - 12/05/03 - Line ENNONUM+2
+3 QUIT
+4 ;***
+5 ;V5.0 will be using ^PSJLIFN instead. Other sub-modules in this routine
+6 ;are being used by IPF...
+7 ;***
EN ; Display order with numbers.
+1 DO EN^PSJLIORD(DFN,ON)
QUIT
+2 NEW PSIVNUM
SET PSIVNUM=1
+3 ;
ENNONUM(DFN,PSJORD) ; Display order with no numbers.
+1 SET UL80=""
SET $PIECE(UL80,"=",80)=""
+2 ; IHS/CIA/PLS - 12/05/03 - Commented out next line and changed from SSN to HRN
+3 ;W:'$G(PSJPRF)&($Y) @IOF W !!,"Patient: ",VADM(1)," (",$P(VADM(2),U,2),")",?52,"Wt (kg): ",PSJPWT," ",PSJPWTD
+4 IF '$GET(PSJPRF)&($Y)
WRITE @IOF
WRITE !!,"Patient: ",VADM(1)," (",$GET(VA("PID")),")",?52,"Wt (kg): ",PSJPWT," ",PSJPWTD
+5 WRITE !?3,"Ward: ",$SELECT(VAIN(4):$PIECE(VAIN(4),U,2),1:"OUTPATIENT"),?52,"Ht (cm): ",PSJPHT," ",PSJPWTD
+6 WRITE !,?1,"Status: ",$$CODES^PSIVUTL(P(17),$SELECT(P("PON")'["V":53.1,1:55.01),$SELECT(P("PON")'["V":28,1:100))
IF P("PON")["V"
WRITE ?47,"Order number: ",+P("PON")
WRITE !,UL80,!
+7 ;
ENPRO ; Profile view.
+1 NEW PSIVAC,Y,PSGEBN,PSGLI,PSJSTAR,PSIV531
+2 SET (PSGEBN,PSGLI)=""
+3 SET PSIVAC="C"
SET P("PON")=ON
+4 SET PSIVUP=+$$GTPCI^PSIVUTL
+5 SET P("OT")=$SELECT(P(4)="A":"F",P(4)="H":"H",1:"I")
+6 NEW PSJL
+7 NEW PSIVNUM
SET PSIVNUM=1
+8 IF P("OT")="I"
Begin DoDot:1
+9 SET PSJSTAR="(1)^(4)^(5)^(6)^(7)^(9)^(10)"
+10 DO ^PSJLIVMD
End DoDot:1
+11 IF P("OT")'="I"
Begin DoDot:1
+12 SET PSJSTAR="(1)^(2)^(3)^(4)^(5)^(6)^(7)^(9)"
+13 DO ^PSJLIVFD
End DoDot:1
+14 NEW PSIVX
+15 FOR PSIVX=0:0
SET PSIVX=$ORDER(^TMP("PSJI",$JOB,PSIVX))
IF 'PSIVX
QUIT
WRITE !,^(PSIVX,0)
+16 KILL ^TMP("PSJI",$JOB)
+17 QUIT
LONG(Y) ; Display long fields.
+1 FOR X=1:1:$LENGTH(Y," ")
IF $X+$LENGTH($PIECE(Y," ",X))>$SELECT(LN<11
DO RC
WRITE ?5,$PIECE(Y," ",X)," "
+2 QUIT ""
WTPC ; Write provider comments.
+1 WRITE ?3,Y,!
+2 ;
PAUSE ;Hold display if end screen, do FF if eop.
+1 IF $EXTRACT(IOST)="C"
IF ($Y#IOSL)>20
NEW DIR,X,Y
SET DIR(0)="E"
DO ^DIR
IF $DATA(DUOUT)!$DATA(DTOUT)
QUIT
WRITE !
+2 QUIT
+3 ;
RC ; Print field by line number
+1 NEW X,Y
SET LN=LN+1
IF LN<11
DO @LN
WRITE !
+2 QUIT
+3 ;
1 ; Type
+1 WRITE ?56,"Type: "
SET X=$$CODES^PSIVUTL(P(4),53.1,53)
WRITE $SELECT($EXTRACT(X)="C":"CHEMO",1:X),$SELECT(P(23)'="":" ("_P(23)_")",1:""),$SELECT(P(5)=1:" (I)",P(5)=0:"(C)",1:"")
+2 QUIT
+3 ;
2 ;Syringe Size
+1 IF P("SYRS")]""
WRITE ?51,"Syr. Size: ",$EXTRACT(P("SYRS"),1,13)
IF $LENGTH(P("SYRS"))>13
WRITE "..."
+2 QUIT
+3 ;
3 ; IV Room
+1 WRITE ?53,"IV Room: ",$PIECE(P("IVRM"),U,2)
+2 QUIT
+3 ;
4 ; Start Date
+1 SET X=""
IF $DATA(PSIVNUM)
IF P("DTYP")
SET X=$SELECT(P(17)="P"!(PSIVAC="PN"):" ",1:"*")_$SELECT(P("DTYP")=1:"(12)",$EXTRACT(P("OT"))="I":"(10)",1:"(8)")
+2 WRITE ?48-$LENGTH(X),X,?50,"Start Date: ",$$WDTE^PSIVUTL(P(2))
+3 QUIT
+4 ;
5 ; Stop Date
+1 SET X=""
IF $DATA(PSIVNUM)
IF P("DTYP")
SET X=$SELECT(P(17)="P"!(PSIVAC="PN"):" ",1:"*")_$SELECT(P("DTYP")=1:"(13)",$EXTRACT(P("OT"))="I":"(11)",1:"(9)")
+2 WRITE ?48-$LENGTH(X),X,?51,"Stop Date: ",$$WDTE^PSIVUTL(P(3))
+3 QUIT
+4 ;
6 ; Log-in Date
+1 WRITE ?50,"Login Date: ",$$WDTE^PSIVUTL(P("LOG"))
+2 QUIT
+3 ;
7 ; Last fill date.
+1 SET Y=$$WDTE^PSIVUTL(P("LF"))
WRITE ?51,"Last Fill: ",$SELECT(Y="******":"** Not printed **",1:Y)
+2 QUIT
+3 ;
8 ;Last fill qty.
+1 WRITE ?52,"Quantity: ",+P("LFA")
+2 QUIT
+3 ;
9 ; Entry Code
+1 WRITE ?50,"Entry Code: ",$SELECT($PIECE(P("CLRK"),U,2)]"":$EXTRACT($PIECE(P("CLRK"),U,2),1,18),1:"*** Undefined")
+2 QUIT
+3 ;
10 ; Provider
+1 ;I P(17)="P",(+P("CLRK")=+P(6)) S X=""
SET X=""
IF $DATA(PSIVNUM)
IF P("DTYP")
SET X=$SELECT(PSIVAC="PN":" ",1:"*")_$SELECT(P("DTYP")=1:"(14)",$EXTRACT(P("OT"))="I":"(12)",1:"(10)")
+2 WRITE ?48-$LENGTH(X),X,?52,"Provider: ",$SELECT($PIECE(P(6),U,2)]"":$EXTRACT($PIECE(P(6),U,2),1,18),1:"*** Undefined")
+3 QUIT
ENNH(ON) ;
+1 IF ON'["V"
DO GT531^PSIVORFA(DFN,ON)
IF P(4)=""
SET P(4)="P"
SET (P(2),P(3))=""
NEW PSIV531
SET PSIV531=1
+2 IF ON["V"
DO GT55^PSIVORFB
+3 NEW UL
SET UL=""
SET $PIECE(UL,"-",70)=""
WRITE !!,?5,UL,!,?5,"Patient: ",PSGP(0),?54,"Status: ",$SELECT(P(17)="DE":"DC (EDIT)",1:$$CODES^PSIVUTL(P(17),$SELECT(ON'["V":53.1,1:55.01),$SELECT(ON'["V":28,1:100))),!
+4 DO ENPRO
+5 QUIT