source: WorldVistAEHR/trunk/r/INPATIENT_MEDICATIONS-PSJ-PSIV-PSG--PSGW/PSJLIVFD.m@ 701

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

revised back to 6/30/08 version

File size: 6.1 KB
RevLine 
[623]1PSJLIVFD ;BIR/MV-SETUP LM TEMPLATE FOR IV FLUID ;4 Aug 00 / 2:37 PM
2 ;;5.0; INPATIENT MEDICATIONS ;**7,50,63,64,58,81,91,80,116,110,111,180**;16 DEC 97;Build 5
3 ;
4 ; Reference to ^VALM0 is supported by DBIA # 2615.
5 ;
6 ;NFI changes for FR# 3@AD+4
7 ;
8EN ; Build LM template to display IV order.
9 K ^TMP("PSJI",$J)
10 S UL80="",$P(UL80,"=",80)=""
11 S PSJLN=1
12AD ;
13 NEW VALMEVL S VALMEVL=1
14 S PSJL="" D FLDNO^PSJLIUTL("(1)",1)
15 S PSJL=PSJL_"Additives:"
16 S:$G(P("PON"))["V"&(P(17)'="N") PSJL=$$SETSTR^VALM1("Order number:",PSJL,30,14)_+P("PON")
17 S PSJL=$$SETSTR^VALM1("Type:",PSJL,57,6)_$$TYPE^PSJLIUTL
18 NEW PSJVD S PSJVD=$$DINFLIV^PSJDIN(.DRG)
19 S PSJL=$$SETSTR^VALM1(PSJVD,PSJL,75,6)
20 I '$D(IORVON),$D(IOST(0)) D ENS^%ZISS,TERM^VALM0
21 I $D(IORVON),(PSJVD]"") D CNTRL^VALM10(1,76,5,IORVON,IORVOFF,0) K PSJVD
22 D SETTMP^PSJLMPRU("PSJI",PSJL)
23 D:+$G(PSJLMX) CLRDSPL^PSJLIVMD
24 ;PSJLMX count number of lines needed to display the add/sol
25 S PSJLMX=0 D WRTDRG^PSJLIUTL("AD")
26SOL ;
27 S PSJL="" D FLDNO^PSJLIUTL("(2)",1)
28 S PSJL=PSJL_"Solutions:"
29 I P("SYRS")]"" D
30 . S PSJL=$$SETSTR^VALM1("Syr. Size:",PSJL,52,10)_$E(P("SYRS"),1,13)
31 . S:$L(P("SYRS"))>13 PSJL=PSJL_"..."
32 D SETTMP^PSJLMPRU("PSJI",PSJL)
33 D WRTDRG^PSJLIUTL("SOL")
34DUR ;
35 S PSJL=""
36 N DUROUT,IVLIMIT S DUROUT=$$GETDUR^PSJLIVMD(PSGP,+PSJORD,$S(PSJORD["P":"P",1:"IV"))
37 S LABEL=$S($G(IVLIMIT):"IV Limit: ",1:"Duration: ") K IVLIMIT
38 S PSJL=$$SETSTR^VALM1(LABEL,PSJL,12,10)
39 S PSJL=PSJL_DUROUT
40START ;
41 D FLDNO^PSJLIUTL("(4)",47)
42 S PSJL=$$SETSTR^VALM1("Start:",PSJL,56,7)_$$STARTDT^PSJLIUTL
43 D SETTMP^PSJLMPRU("PSJI",PSJL)
44 NEW PSGRSD,PSGRSDN,PSGRFD,PSGRFDN
45 S PSJL="" I $G(PSJORD)["P",$G(PSGRDTX) D
46 . N RSDLABL,PSJRQB,PSJRQL,PSGRSD,PSGSRSDN
47 . S RSDLABL=" REQUESTED START: ",PSJRQB=41,PSJRQL=39,PSGRSD="",PSGRSDN=""
48 . I $G(PSGRDTX(+$G(PSJORD),"PSGRSD")),$G(P(2)) S PSJRQB=51,PSJRQL=29 D
49 .. S PSGRSD=PSGRDTX(+$G(PSJORD),"PSGRSD"),PSGRSDN=$$ENDTC^PSGMI(+PSGRSD),RSDLABL="Calc Start: "
50 . I '$G(P(2)),'$P(PSGRDTX,U,3) S PSGRSD=+PSGRDTX,PSGRSDN=$$ENDTC^PSGMI(PSGRSD)
51 . I $G(PSGRSD),($G(PSGRSDN)]"") D DSPLYDT^PSJLIVMD(PSJLMX+5,.PSGRSD,.PSGRSDN,RSDLABL,1,PSJRQB,PSJRQL),SETTMP^PSJLMPRU("PSJI",PSJL)
52INFRATE ;
53 S PSJL="" D FLDNO^PSJLIUTL("(3)",1)
54 S PSJL=$$SETSTR^VALM1("Infusion Rate:",PSJL,7,15)
55 D LONG^PSJLIUTL(P(8),22,24)
56LASTREN ;
57 N PSGRNDT S PSGRNDT=$$LASTREN^PSJLMPRI(DFN,$S($G(PSJORD):PSJORD,1:$G(ON))) I PSGRNDT D
58 . S PSGRNDT=$$ENDTC^PSGMI(+PSGRNDT),PSJL=$$SETSTR^VALM1("Renewed: "_PSGRNDT,PSJL,54,32)
59 D SETTMP^PSJLMPRU("PSJI",PSJL)
60MR ;
61 S PSJL="" D FLDNO^PSJLIUTL("(5)",1)
62 S PSJL=$$SETSTR^VALM1("Med Route:",PSJL,11,11)
63 S PSJL=PSJL_$P(P("MR"),U,2)
64STOP ;
65 D FLDNO^PSJLIUTL("(6)",47)
66 ;PSJ*5*180 - If Invalid Duration/Limit - Cannot Calculate Stop Date
67 S PSJL=$$SETSTR^VALM1("Stop:",PSJL,57,6)_$S($G(PSJBADD)=1:"CANNOT CALCULATE",1:$$STOPDT^PSJLIUTL)
68 D SETTMP^PSJLMPRU("PSJI",PSJL)
69 S PSJL=""
70 N PSJBCMA S PSJBCMA=$$BCMALG^PSJUTL2(DFN,PSJORD)
71 I $G(PSJBCMA)]"" S PSJL=$$SETSTR^VALM1(PSJBCMA,PSJL,1,52)
72 ;D:$G(PSGRFD) DSPLYDT^PSJLIVMD(PSJLMX+7,.PSGRFD,.PSGRFDN," REQUESTED STOP: ",P(3)'=PSGRFD)
73 I $G(PSGRDTX(+PSJORD,"PSGRFD")) S PSGRFD=PSGRDTX(+PSJORD,"PSGRFD"),PSGRFDN=$$ENDTC^PSGMI(PSGRFD) D
74 . D DSPLYDT^PSJLIVMD(PSJLMX+7,.PSGRFD,.PSGRFDN," Calc Stop: ",0,51,29)
75 D:($G(PSJBCMA)]"")!($G(PSGRFD)]"") SETTMP^PSJLMPRU("PSJI",PSJL)
76SCH ;
77 S PSJL="" D FLDNO^PSJLIUTL("(7)",1)
78 S PSJL=$$SETSTR^VALM1("Schedule:",PSJL,12,11)
79 D LONG^PSJLIUTL(P(9),22,32) S PSJL=PSJL_$S(P(7):"@0 labels a day",1:"")
80LASTFL ;
81 S PSJL=$$SETSTR^VALM1("Last Fill:",PSJL,52,11)
82 S PSJL=PSJL_$$ENDTC^PSGMI(P("LF"))
83 D SETTMP^PSJLMPRU("PSJI",PSJL)
84ADM ;
85 S PSJL="" D FLDNO^PSJLIUTL("(8)",1)
86 S PSJL=$$SETSTR^VALM1("Admin Times:",PSJL,9,14)
87 D LONG^PSJLIUTL(P(11),22,30)
88QTY ;
89 S PSJL=$$SETSTR^VALM1("Quantity:",PSJL,53,10)_+P("LFA")
90 D SETTMP^PSJLMPRU("PSJI",PSJL)
91PROVIDER ;
92 S PSJL="" D FLDNO^PSJLIUTL("(9)",1)
93 S PSJL=$$SETSTR^VALM1("Provider:",PSJL,12,10)_$$PROVIDER^PSJLIUTL
94CUMDOSES ;
95 ;S PSJL=$$SETSTR^VALM1("Cumulative Doses:",PSJL,45,17)_P("CUM")
96 S PSJL=$$SETSTR^VALM1("Cum. Doses:",PSJL,51,12)_P("CUM")
97 D SETTMP^PSJLMPRU("PSJI",PSJL)
98OPI ;
99 S PSJL="" D FLDNO^PSJLIUTL("(10)",1)
100 S PSJL=$$SETSTR^VALM1("Other Print"_$S($P(P("OPI"),"^",2)=1:"!: ",1:": "),PSJL,9,13)_$P(P("OPI"),"^")
101 D SETTMP^PSJLMPRU("PSJI",PSJL)
102PC ;
103 S PSJL=""
104 ;S PSJL=$$SETSTR^VALM1("Provider Comments:",PSJL,3,18) D SETTMP^PSJLMPRU("PSJI",PSJL) D WTPC^PSJLIUTL
105 S PSJL=$$SETSTR^VALM1("Provider Comments:",PSJL,3,18) D WTPC^PSJLIUTL
106REMARK ;
107 D SETTMP^PSJLMPRU("PSJI","")
108 S PSJL="" D FLDNO^PSJLIUTL("(11)",1)
109 S PSJL=$$SETSTR^VALM1("Remarks :",PSJL,8,10)
110 D LONG^PSJLIUTL(P("REM"),18,62)
111 D SETTMP^PSJLMPRU("PSJI",PSJL)
112IVROOM ;
113 S PSJL=""
114 S PSJL=$$SETSTR^VALM1("IV Room:",PSJL,9,9)_$P(P("IVRM"),U,2)
115 D SETTMP^PSJLMPRU("PSJI",PSJL)
116ENTRY ;
117 S PSJL="",PSJL=$$SETSTR^VALM1("Entry By:",PSJL,8,10)
118 S PSJL=PSJL_$S($P(P("CLRK"),U,2)]"":$E($P(P("CLRK"),U,2),1,18),1:"*** Undefined")
119 S PSJL=$$SETSTR^VALM1("Entry Date:",PSJL,51,12)_$$ENDTC^PSGMI(P("LOG"))
120 D SETTMP^PSJLMPRU("PSJI",PSJL)
121 S PSJL="" S PSGLRN=$$LASTRNBY^PSJLMPRI(DFN,$S($G(PSJORD):PSJORD,1:$G(ON))) I PSGLRN D
122 . S PSJL=$$SETSTR^VALM1("Renewed By: ",PSJL,6,12)_$$ENNPN^PSGMI(PSGLRN) D SETTMP^PSJLMPRU("PSJI",PSJL) K PSGLRN
123 S VALM("TITLE")=$$CODES^PSIVUTL(P(17),$S($G(ON)["P":53.1,1:55.01),$S(ON["P":28,1:100))_" IV "
124 I $G(P("PRY"))="D"!($G(P("PON"))["P") S VALM("TITLE")=VALM("TITLE")_$S($G(P("PRY"))="":"",1:"("_$$CODES^PSIVUTL(P("PRY"),53.1,.24)_")")
125 I $G(P("PON"))["P" D ORDCHK
126 S VALMCNT=PSJLN-1,^TMP("PSJI",$J,0)=VALMCNT
127 Q
128 ;
129ORDCHK ;Display order check for pending order
130 Q:'$O(^PS(53.1,+ON,10,0))
131 NEW PSJIVX,PSJIVXX
132 F PSJIVX=0:0 S PSJIVX=$O(^PS(53.1,+ON,10,PSJIVX)) Q:'PSJIVX D
133 . D SETTMP^PSJLMPRU("PSJI","")
134 . S PSJL="Order Checks :" D LONG^PSJLIUTL($G(^PS(53.1,+ON,10,PSJIVX,0)),22,60)
135 . D SETTMP^PSJLMPRU("PSJI",PSJL)
136 . S PSJL="Overriding Provider: "_$P($G(^PS(53.1,+ON,10,PSJIVX,1)),U)
137 . D SETTMP^PSJLMPRU("PSJI",PSJL)
138 . S PSJL="Overriding Reason : "
139 . F PSJIVXX=0:0 S PSJIVXX=$O(^PS(53.1,+ON,10,PSJIVX,2,PSJIVXX)) Q:'PSJIVXX D
140 .. D LONG^PSJLIUTL($G(^PS(53.1,+ON,10,PSJIVX,2,PSJIVXX,0)),22,60)
141 .. D SETTMP^PSJLMPRU("PSJI",PSJL) S PSJL=""
142 Q
143 ;
144SCHREQ(IVAR) ;
145 I $G(IVAR(4))="P"!($G(IVAR(23))="P")!($G(IVAR(5))) Q 1
146 Q 0
Note: See TracBrowser for help on using the repository browser.