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

PSJLIORD.m

Go to the documentation of this file.
PSJLIORD ;BIR/MV-INPATIENT ORDER ENTRY FOR IV ;10 Mar 98 / 4:19 PM
 ;;5.0;INPATIENT MEDICATIONS;**1,16,29,58,85,110,149,267**;16 DEC 97;Build 158
 ;
 ; Reference to ^PS(55 is supported by DBIA #2191.
 ; Reference to EN1^ORCFLAG is supported by DBIA #3620.
 ; Reference to AND^ORX8 is supported by DBIA #3632.
 ;
EN(DFN,PSJORD) ; Display order with numbers.
 ;N ON,ON55,P,PSIVAC,PSGEBN,PSGLI,PSJSTAR
 N ON55,P,PSIVAC,PSGEBN,PSGLI,PSJSTAR K ^PS(53.45,+$G(PSJSYSP),6)
 D UDVARS
 S (PSGEBN,PSGLI)=""
 ;* S PSIVAC="C" S (P("PON"),ON,ON55)=+PSJORD_"V"
 S PSIVAC="E" S (P("PON"),ON,ON55)=+PSJORD_"V"
 S PSIVUP=+$$GTPCI^PSIVUTL D GT55^PSIVORFB
 D:'$D(P("OT")) GTOT^PSIVUTL(P(4))
 NEW PSJL
 N PSIVNUM S PSIVNUM=1
 ;;I $E(P("OT"))'="F" S PSJSTAR="(1)^(4)^(5)^(6)^(7)^(9)^(10)"
 I $E(P("OT"))="I" S PSJSTAR="(1)^(4)^(5)^(6)^(7)^(9)^(10)"
 E  S PSJSTAR="(1)^(2)^(3)^(4)^(5)^(6)^(7)^(9)" D GTDATA^PSJLIFN
 NEW PSGACT D PSGACT
 ;* Only allow activity logs for non pharmacist/RN personel if coming
 ;* from the Non-verify/pending option.
 I '+$P(PSJSYSU,";"),$G(PSJPNV) S PSGACT="L"
 D EN^VALM("PSJ LM IV INPT ACTIVE") ; Call to EN^PSJLIVMD
 S VALMBCK="Q"
 K ^PS(53.45,+$G(PSJSYSP),6)
 Q
 ;
PSGACT ;Setup selectable actions based on order's status
 S (X,XKEYS)=$$CHKKEYS()
 N PSGR S PSGACT=""
 S PSJCOM=$P($G(^PS(55,DFN,"IV",+ON55,.2)),U,8)
 I PSJCOM S PSGR=0
 I PSJCOM S PSGR=$$AND^ORX8(PSJCOM) S:PSGR=1 PSGR=$$RNEWOK^PSJUTL2(PSJCOM,DFN)
 I 'PSJCOM S PSGR='$$EXPIRED^PSGOER(DFN,ON55)
 S X=XKEYS
 ;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:"")
 ;I P(17)="A" S PSGACT="L" S:+X PSGACT=$S(P(10):"DROL",1:"DHROL")
 I P(17)="A" S PSGACT="EL" S:+X PSGACT=PSGACT_"DO"_$S(P(10):"",1:"H")_$S(PSGR:"R",1:"")
 I P(17)="H" S PSGACT="L" S:+X PSGACT=$S(P(10):"DL",1:"DHL")
 I P(17)="R" S PSGACT="L" ;S:+X PSGACT="DL"  PSJ*5*149
 I P(17)="D" S PSGACT="L"
 I P(17)="D"&P(12) S PSGACT="L" S:+X PSGACT="L"_$S(PSGR:"R",1:"")
 I P(17)="E" S PSGACT="L" D:+X
 . I $P($G(^PS(55,DFN,"IV",+ON55,.2)),U,4)="D" Q
 . S PSGACT="L"_$S($P($G(^PS(55,DFN,"IV",+ON55,2)),U,6):"",PSGR:"R",1:"")
 I P(17)="O" S PSGACT="L" S:+X PSGACT="DOL"
 I P(17)="N" S PSGACT="EL" S:+X PSGACT="DELV"
 S PSGACT=PSGACT_$P(X,U,2)
 Q
UDVARS ;* Remove un-use variables.
 K PSGCANFL,PSGDI,PSGDO,PSGEB,PSGEBN,PSGFD,PSGFDN,PSHSM,PSGLI
 K PSGLIN,PSGLMT,PSGMR,PSGMRN,PSGNEF,PSGOAT
 K PSGODO,PSGODT,PSGOEA,PSGOEAV,PSGOEEWF,PSGOENG,PSGOFD,PSGOFDN
 K PSGOHSM,PSGOINST,PSGOMR,PSGOMRN,PSGONC,PSGOPD,PSGOPDN,PSGOPR
 K PSGOPRN,PSGOSCH,PSGOSD,PSGOSDN,PSGOSI,PSGOSM,PSGOST,PSGOSTN
 K PSGPD,PSGPDN,PSGPI,PSGPR,PSGPRIO,PSGPRN,PSGPTMP,PSGRRF,PSGS0XT
 K PSGS0Y,PSGSCH,PSGSD,PSGSDN,PSGSI,PSGSM,PSGST,PSGSTAT,PSGSTN
 K PSGEFN,PSGOEFN,PSGOEEF,PSGOEEG,PSGOEEND,PSGPDRG,PSGPDRGN
 K PSGNESDO,PSGNODE,PSGOEDMR,PSGOEPR,PSGPEN,PSGPENWS
 Q
CHKKEYS()  ;* Check for users' key to set up appropriate actions
 ;Output:
 ;  X=a^b
 ;  a=1 for either RN or Pharmacist; 0 for other
 ;  b="V" if not verified by key owner
 S XX=$G(^PS(55,DFN,"IV",+ON,4)),X=0
 I +PSJSYSU=3 S X=1 D
 . I '+$P(XX,U,4) S $P(X,U,2)="V"
 . I $L($T(EN1^ORCFLAG)) S $P(X,U,2)=$P(X,U,2)_"G"
 I +PSJSYSU=1 S X=1 D
 . I '+XX S $P(X,U,2)="V"
 Q X