source: WorldVistAEHR/trunk/r/INPATIENT_MEDICATIONS-PSJ-PSIV-PSG--PSGW/PSIVORC.m@ 949

Last change on this file since 949 was 623, checked in by George Lilly, 15 years ago

revised back to 6/30/08 version

File size: 4.6 KB
Line 
1PSIVORC ;BIR/MLM-COMPLETE IV ORDERS ENTERED THROUGH OE/RR ;02 Mar 99 / 10:16 AM
2 ;;5.0; INPATIENT MEDICATIONS ;**23,53,80,110**;16 DEC 97
3 ;
4 ; Reference to ^DIC(42 is supported by DBIA 10039
5 ; Reference to ^DPT is supported by DBIA 10035
6 ; Reference to ^%DTC is supported by DBIA 10000
7 ; Reference to ^DID is supported by DBIA 2052
8 ;
9EN ; Set IV parameters.
10 D SITE^PSIVORE Q:'$G(PSIVQ) K PSIVQ
11 ;
12SELECT ;
13 F S PSGSSH="ORVC" D ^PSGSEL Q:U[PSGSS D GTORDRS
14 D DONE^PSIVORC1
15 Q
16GTORDRS ;
17 K ^TMP("PSIV",$J) N DIC,Y D @PSGSS Q:+$G(Y)'>0 W:PSGSS'="P" !,"...a few moments, please..." D @("G"_PSGSS)
18 I $G(Y),'$D(^TMP("PSIV",$J)) W !,$C(7),"NO PENDING ORDERS FOR ",$S(PSGSS="P":"PATIENT",1:"WARD"),$S(PSGSS="G":" GROUP",1:"")," SELECTED." Q
19 D NOW^%DTC S HDT=$$ENDTC^PSGMI(%),PSIVAC="C",DONE=0,WDN=""
20 F S WDN=$O(^TMP("PSIV",$J,WDN)) Q:WDN=""!DONE S PNME="" F S PNME=$O(^TMP("PSIV",$J,WDN,PNME)) Q:PNME=""!DONE D
21 . I PSGSS'="P" S PSGDFN=$P(PNME,";",2)_"^"_$P(PNME,";") D CHK^PSJDPT(.PSGDFN,1,1) I PSGDFN=-1 Q
22 . D PROFILE D:PSIVHD ASK
23 D:$G(PSIVHD) ASK
24 Q
25 ;
26PROFILE ; Display profile of all incomplete orders.
27 ;
28 K PSGODDD S (DFN,PSGP)=$P(PNME,";",2) D ENBOTH^PSJAC
29 S RB=PSJPRB,PG=1,PSJORL=$$ENORL^PSJUTL($G(VAIN(4))),PSJIVOF=PSJORL,PSGLMT=0,LN2="" D ENHEAD^PSJO3
30 S (DONE1,TYP)="" F S TYP=$O(^TMP("PSIV",$J,WDN,PNME,TYP)) Q:TYP=""!(DONE1) D:$Y+5'>IOSL GTYP F ON1=0:0 S ON1=$O(^TMP("PSIV",$J,WDN,PNME,TYP,ON1)) Q:'ON1!(DONE1) D DISPLAY
31 Q
32 ;
33DISPLAY ; Display order on profile.
34 I $Y+5>IOSL D ASK Q:DONE1 D ENHEAD^PSJO3,GTYP
35 S PSIVHD=1,PSGLMT=PSGLMT+1,PSIVCV(PSGLMT)=ON1,PSJC="" W !?3,PSGLMT D PIV^PSIVUTL(+ON1_"P")
36 Q
37 ;
38GTYP ; Get formatted heading for type
39 N PSJD5314 D FIELD^DID(53.1,4,"","POINTER","PSJD5314")
40 ; removed ^DD ref 3-2-99, pass ^^_set of codes value
41 ; because codes^psivutl uses the 3rd piece
42 ;S X=$$CODES^PSIVUTL(TYP,"^^"_PSJD5314("POINTER")),PSIV=$S(X]"":X,1:"UNKNOWN"),X="",$P(X,"-",40-($L(PSIV)/2))="" W !,X_PSIV_X
43 S X=$$CODES^PSIVUTL(TYP,"^^"_PSJD5314("POINTER"),"")
44 S PSIV=$S(X]"":X,1:"UNKNOWN"),X="",$P(X,"-",40-($L(PSIV)/2))="" W !,X_PSIV_X
45 Q
46 ;
47ASK ; Ask which orders to view.
48 S PSIVHD=0,ACTION="ORDER" D RD1^PSGON I X="^" S (DONE,DONE1)=1 Q
49 Q:'$D(PSGODDD) S DONE1=0 F PN=1:1:$L(PSGODDD(1),",")-1 S ON=+$P(PSGODDD(1),",",PN) Q:ON=""!DONE1 S ON=+$P(PSGODDD(1),",",PN) D SHOW
50 S DONE1=1,PSGOP=DFN D:$P(PSJSYSL,U,2)]"" ENQL^PSGLW
51 Q
52 ;
53SHOW ; Display selected order and prompt for action
54 S (P("PON"),ON)=PSIVCV(ON)
55 ;
56SHOW1 ; Entry point from backdoor.
57 S PSIVUP=+$$GTPCI^PSIVUTL D GT531^PSIVORFA(DFN,ON) I $G(PSIVAC)="PRO" D ENNONUM^PSIVORV2(DFN,ON) Q
58 I $G(PSJORD)["P" D REQDT^PSJLIVMD(PSJORD)
59 S PSJORD=+ON D ^PSJLIFN
60 Q
61 ;
62 ; look-ups on ward group, ward, or patient; depending on value of SS
63G S DIC="^PS(57.5,",DIC(0)="QEAMI",DIC("A")="Select WARD GROUP: " W ! D ^DIC S:+Y>0 WG=+Y Q
64W S DIC="^DIC(42,",DIC(0)="QEAMI",DIC("A")="Select WARD: " W ! D ^DIC S:+Y>0 WD=+Y Q
65P D ENGETP^PSIV Q:DFN<0 S Y=1 I $D(^PS(53.1,"AS","P",+DFN)) S PNME=$G(^DPT(+DFN,0)),PNME=$P(PNME,U)_";"_DFN,WDN=$S(VAIN(4)]"":$P(VAIN(4),U,2),1:"OUTPATIENT") D GP
66 Q
67 ;
68GG ; put patient(s) with incomplete orders into array
69 F WD=0:0 S WD=$O(^PS(57.5,"AC",WG,WD)) Q:'WD D GW
70 Q
71GW S WDN=$G(^DIC(42,WD,0)),WDN=$P(WDN,U) I WDN]"" F DFN=0:0 S DFN=$O(^DPT("CN",WDN,DFN)) Q:'DFN I $D(^PS(53.1,"AS","P",DFN)) S Y=$G(^DPT(+DFN,0)),PNME=$P(Y,U)_";"_DFN D:PNME]"" GP
72 Q
73GP ;
74 F ON=0:0 S ON=$O(^PS(53.1,"AS","P",DFN,ON)) Q:'ON S Y=$G(^PS(53.1,ON,0)),TYP=$S($P(Y,U,4)]"":$P(Y,U,4),1:"Z"),^TMP("PSIV",$J,WDN,PNME,TYP,ON)=""
75 Q
76DISCONT ; Cancel incomplete order
77 D:'$D(PSJIVORF) ORPARM^PSIVOREN I PSJIVORF D NATURE^PSIVOREN I '$D(P("NAT")) W !,$C(7),"Order Unchanged." Q
78 ;Prompt for requesting provider
79 W ! I '$$REQPROV^PSGOEC W !,$C(7),"Order Unchanged." Q
80 W !
81 ;
82 ;* N PSJORNAT S (PSJORIFN,ORIFN)=$P($G(^PS(53.1,+ON,0)),U,21),PSJORD=ON,PSJORNAT=P("NAT") D DC^PSIVORA ;* I PSJIVORF,PSJORIFN,(ON["V") D EN1^PSJHL2(PSGP,"OD",+ON_"V","ORDER DISCONTINUED")
83 I 'PSJCOM N PSJORNAT S PSJORIFN=$P($G(^PS(53.1,+ON,0)),U,21),PSJORD=ON,PSJORNAT=P("NAT") D DC^PSIVORA ;* I PSJIVORF,PSJORIFN,(ON["V") D EN1^PSJHL2(PSGP,"OD",+ON_"V","ORDER DISCONTINUED")
84 I PSJCOM,PSJORD["P" N O S O="" F S O=$O(^PS(53.1,"ACX",PSJCOM,O)) Q:O="" D
85 .S ON=O_"P",PSJORIFN=$P($G(^PS(53.1,+ON,0)),U,21),PSJORD=ON,PSJORNAT=P("NAT") D DC^PSIVORA
86 W !,"Order discontinued.",!
87 Q
88 ;
89EDIT ; Edit incomplete order
90 S PSIVAC="CE" L +^PS(53.1,+ON):1 E W !,$C(7),"This order LOCKED by another user." Q
91 D EDIT^PSIVORC2 L -^PS(53.1,+ON)
92 Q
93 ;
94FINISH ; Finish incomplete order
95 S PSIVAC="CF" L +^PS(53.1,+ON):1 E W !,$C(7),"This order LOCKED by another user." Q
96 D FINISH^PSIVORC2 L -^PS(53.1,+ON)
97 Q
Note: See TracBrowser for help on using the repository browser.