[613] | 1 | PSJLIORD ;BIR/MV-INPATIENT ORDER ENTRY FOR IV ;10 Mar 98 / 4:19 PM
|
---|
| 2 | ;;5.0; INPATIENT MEDICATIONS ;**1,16,29,58,85,110,149**;16 DEC 97
|
---|
| 3 | ;
|
---|
| 4 | ; Reference to ^PS(55 is supported by DBIA #2191.
|
---|
| 5 | ; Reference to EN1^ORCFLAG is supported by DBIA #3620.
|
---|
| 6 | ; Reference to AND^ORX8 is supported by DBIA #3632.
|
---|
| 7 | ;
|
---|
| 8 | EN(DFN,PSJORD) ; Display order with numbers.
|
---|
| 9 | ;N ON,ON55,P,PSIVAC,PSGEBN,PSGLI,PSJSTAR
|
---|
| 10 | N ON55,P,PSIVAC,PSGEBN,PSGLI,PSJSTAR
|
---|
| 11 | D UDVARS
|
---|
| 12 | S (PSGEBN,PSGLI)=""
|
---|
| 13 | ;* S PSIVAC="C" S (P("PON"),ON,ON55)=+PSJORD_"V"
|
---|
| 14 | S PSIVAC="E" S (P("PON"),ON,ON55)=+PSJORD_"V"
|
---|
| 15 | S PSIVUP=+$$GTPCI^PSIVUTL D GT55^PSIVORFB
|
---|
| 16 | D:'$D(P("OT")) GTOT^PSIVUTL(P(4))
|
---|
| 17 | NEW PSJL
|
---|
| 18 | N PSIVNUM S PSIVNUM=1
|
---|
| 19 | ;;I $E(P("OT"))'="F" S PSJSTAR="(1)^(4)^(5)^(6)^(7)^(9)^(10)"
|
---|
| 20 | I $E(P("OT"))="I" S PSJSTAR="(1)^(4)^(5)^(6)^(7)^(9)^(10)"
|
---|
| 21 | E S PSJSTAR="(1)^(2)^(3)^(4)^(5)^(6)^(7)^(9)" D GTDATA^PSJLIFN
|
---|
| 22 | NEW PSGACT D PSGACT
|
---|
| 23 | ;* Only allow activity logs for non pharmacist/RN personel if coming
|
---|
| 24 | ;* from the Non-verify/pending option.
|
---|
| 25 | I '+$P(PSJSYSU,";"),$G(PSJPNV) S PSGACT="L"
|
---|
| 26 | D EN^VALM("PSJ LM IV INPT ACTIVE") ; Call to EN^PSJLIVMD
|
---|
| 27 | S VALMBCK="Q"
|
---|
| 28 | Q
|
---|
| 29 | ;
|
---|
| 30 | PSGACT ;Setup selectable actions based on order's status
|
---|
| 31 | S (X,XKEYS)=$$CHKKEYS()
|
---|
| 32 | N PSGR S PSGACT=""
|
---|
| 33 | S PSJCOM=$P($G(^PS(55,DFN,"IV",+ON55,.2)),U,8)
|
---|
| 34 | I PSJCOM S PSGR=0
|
---|
| 35 | I PSJCOM S PSGR=$$AND^ORX8(PSJCOM) S:PSGR=1 PSGR=$$RNEWOK^PSJUTL2(PSJCOM,DFN)
|
---|
| 36 | I 'PSJCOM S PSGR='$$EXPIRED^PSGOER(DFN,ON55)
|
---|
| 37 | S X=XKEYS
|
---|
| 38 | ;I P(17)="A" S PSGACT=$S(PSJCOM:"L",1:"EL") S:+X PSGACT=PSGACT_"DO"_$S(P(10):"",1:"H")_$S(PSGR:"R",1:"")
|
---|
| 39 | ;I P(17)="A" S PSGACT="L" S:+X PSGACT=$S(P(10):"DROL",1:"DHROL")
|
---|
| 40 | I P(17)="A" S PSGACT="EL" S:+X PSGACT=PSGACT_"DO"_$S(P(10):"",1:"H")_$S(PSGR:"R",1:"")
|
---|
| 41 | I P(17)="H" S PSGACT="L" S:+X PSGACT=$S(P(10):"DL",1:"DHL")
|
---|
| 42 | I P(17)="R" S PSGACT="L" ;S:+X PSGACT="DL" PSJ*5*149
|
---|
| 43 | I P(17)="D" S PSGACT="L"
|
---|
| 44 | I P(17)="D"&P(12) S PSGACT="L" S:+X PSGACT="L"_$S(PSGR:"R",1:"")
|
---|
| 45 | I P(17)="E" S PSGACT="L" D:+X
|
---|
| 46 | . I $P($G(^PS(55,DFN,"IV",+ON55,.2)),U,4)="D" Q
|
---|
| 47 | . S PSGACT="L"_$S($P($G(^PS(55,DFN,"IV",+ON55,2)),U,6):"",PSGR:"R",1:"")
|
---|
| 48 | I P(17)="O" S PSGACT="L" S:+X PSGACT="DOL"
|
---|
| 49 | I P(17)="N" S PSGACT="EL" S:+X PSGACT="DELV"
|
---|
| 50 | S PSGACT=PSGACT_$P(X,U,2)
|
---|
| 51 | Q
|
---|
| 52 | UDVARS ;* Remove un-use variables.
|
---|
| 53 | K PSGCANFL,PSGDI,PSGDO,PSGEB,PSGEBN,PSGFD,PSGFDN,PSHSM,PSGLI
|
---|
| 54 | K PSGLIN,PSGLMT,PSGMR,PSGMRN,PSGNEF,PSGOAT
|
---|
| 55 | K PSGODO,PSGODT,PSGOEA,PSGOEAV,PSGOEEWF,PSGOENG,PSGOFD,PSGOFDN
|
---|
| 56 | K PSGOHSM,PSGOINST,PSGOMR,PSGOMRN,PSGONC,PSGOPD,PSGOPDN,PSGOPR
|
---|
| 57 | K PSGOPRN,PSGOSCH,PSGOSD,PSGOSDN,PSGOSI,PSGOSM,PSGOST,PSGOSTN
|
---|
| 58 | K PSGPD,PSGPDN,PSGPI,PSGPR,PSGPRIO,PSGPRN,PSGPTMP,PSGRRF,PSGS0XT
|
---|
| 59 | K PSGS0Y,PSGSCH,PSGSD,PSGSDN,PSGSI,PSGSM,PSGST,PSGSTAT,PSGSTN
|
---|
| 60 | K PSGEFN,PSGOEFN,PSGOEEF,PSGOEEG,PSGOEEND,PSGPDRG,PSGPDRGN
|
---|
| 61 | K PSGNESDO,PSGNODE,PSGOEDMR,PSGOEPR,PSGPEN,PSGPENWS
|
---|
| 62 | Q
|
---|
| 63 | CHKKEYS() ;* Check for users' key to set up appropriate actions
|
---|
| 64 | ;Output:
|
---|
| 65 | ; X=a^b
|
---|
| 66 | ; a=1 for either RN or Pharmacist; 0 for other
|
---|
| 67 | ; b="V" if not verified by key owner
|
---|
| 68 | S XX=$G(^PS(55,DFN,"IV",+ON,4)),X=0
|
---|
| 69 | I +PSJSYSU=3 S X=1 D
|
---|
| 70 | . I '+$P(XX,U,4) S $P(X,U,2)="V"
|
---|
| 71 | . I $L($T(EN1^ORCFLAG)) S $P(X,U,2)=$P(X,U,2)_"G"
|
---|
| 72 | I +PSJSYSU=1 S X=1 D
|
---|
| 73 | . I '+XX S $P(X,U,2)="V"
|
---|
| 74 | Q X
|
---|