source: WorldVistAEHR/trunk/r/GEN_MED_REC_IO-GMRY/GMRYFLW1.m@ 762

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

initial load of WorldVistAEHR

File size: 4.7 KB
Line 
1GMRYFLW1 ;HIRMFO/YH-INTRAVENOUS INFUSION FLOW SHEET CONT. ;8/9/96
2 ;;4.0;Intake/Output;;Apr 25, 1997
3REPORT I "Pp"[GMREDB D HEADER1^GMRYFLW2 G:GMROUT Q1 I '$D(^TMP($J)) W !!,"NO DATA FOR THIS REPORT",!!!!!!!! G Q2
4 I "SsWw"[GMREDB D HEADER1^GMRYFLW2 I '$D(^TMP($J)) W !!,?5,"NO DATA FOR THIS REPORT",!!!!!!!! G Q2
5 S GST="",GDATA(1)=GLINE I $D(^TMP($J,"GMRY")) S (GSTM,GSDAY)=0,GSITE="" F S GSITE=$O(^TMP($J,"GMRY",GSITE)) Q:GSITE=""!GMROUT S GDTIME=0 F S GDTIME=$O(^TMP($J,"GMRY",GSITE,GDTIME)) Q:GDTIME'>0!GMROUT D LINE Q:GMROUT
6 I 'GMROUT,$D(^TMP($J,"GMR")) D
7 .S GNOIV=1,GIN=0 F S GIN=$O(^TMP($J,"GMR",GIN)) Q:GIN'>0 D NXT
8 W:'GMROUT GDATA(1),!
9Q I 'GMROUT&(IOSL'<($Y+$S($E(IOST)="P":6,1:11))) F X=1:1 W GLINE,! Q:IOSL<($Y+$S($E(IOST)="P":6,1:11))
10Q2 I 'GMROUT D FOOTER^GMRYFLW2 I $E(IOST)="C" W "Press return to continue or ^ to quit " S X="" R X:DTIME S:'$T!(X["^") GMROUT=1
11Q1 K ^TMP($J),GPORT,GHOLD,GREASON,GSCOND,GNOIV Q
12LINE ;
13 S GIN=0 F S GIN=$O(^TMP($J,"GMRY",GSITE,GDTIME,GIN)) Q:GIN'>0!GMROUT D IVLINE:GIN<999,WRT^GMRYFLW2:GIN=999 Q:GMROUT
14 Q
15IVLINE ;
16 S (GDATA(2),GDATA)=^TMP($J,"GMRY",GSITE,GDTIME,GIN) S GTOTAL=+$P(GDATA,"^",5),GDATE=$P(GDTIME,"."),(GHOLD,GTIME)=GDTIME,GDC=$S($P(GDATA,"^",9)'="":$P(GDATA,"^",9,11),1:"") D I Q:GMROUT D LINE2^GMRYFLW2 Q:GMROUT
17 G:$P(GDATA,"^",4)="L" NXT
18 I $D(^GMR(126,DFN,"IV",GIN,"IN",0)) D GMRUT^GMRYFLW2
19 I $D(^GMR(126,DFN,"IV",GIN,"TITR",0)) D GMRTITR^GMRYFLW2
20 I '$D(^TMP($J,"GMR",GIN)) Q
21NXT S (GIN(2),GDT)=0 F S GDT=$O(^TMP($J,"GMR",GIN,GDT)) Q:GDT'>0!GMROUT S GDA=0 F S GDA=$O(^TMP($J,"GMR",GIN,GDT,GDA)) Q:GDA'>0!GMROUT D IN:GDA<998,IC:GDA=999,TR:GDA=998
22 K ^TMP($J,"GMR",GIN) W GLINE,! Q
23I ;IV RECORD
24 S GSOL=$P(GDATA,"^",3),GPORT=$P(GDATA,"^",13),GNURSE=$$CGIVER^GMRYFLW2($P(GDATA,"^",7))
25 D WRTDT^GMRYFLW2 S GDATA(1)=$E(GDATA(1),1,15)_$E($P(GSOL,";")_GBLNK,1,20)_$E(GDATA(1),36,132)
26 S GDATA(1)=$E(GDATA(1),1,36)_$S($P(GDATA,"^",12)'="":$E($P(GDATA,"^",12)_" ",1,4),1:" ")_$E(GDATA(1),41,132)
27 I $P(GDATA,"^",4)="L" D FLUSH^GMRYFLW2 Q
28 S GDATA(1)=$E(GDATA(1),1,41)_$E($P(GDATA,"^",5)_" ",1,4)_$E(GDATA(1),46,132),GDATA(1)=$E(GDATA(1),1,46)_"0 |"_$E($P(GDATA,"^",2)_GBLNK,1,16)_"|"
29 S GCATH=$E($P(GDATA,"^",6)_GBLNK,1,16) S GDATA(1)=GDATA(1)_GCATH_$E(GLINE,86,132)
30 I '$D(^TMP($J,"GMRY",GSITE,GDTIME,999))&('$D(^TMP($J,"GMR",GIN,GDTIME,999))) D WRTLINE^GMRYFLW2 Q
31 I $D(^TMP($J,"GMRY",GSITE,GDTIME,999)) S GDATA=^(999) D TUBE Q:GMROUT K ^TMP($J,"GMRY",GSITE,GDTIME,999) Q
32 I $D(^TMP($J,"GMR",GIN,GDTIME,999)) S GDATA=^(999) D TUBE Q:GMROUT K ^TMP($J,"GMR",GIN,GDTIME,999) S GDATA=GDATA(2) Q
33 Q
34IC ;SITECARE
35 S GDATA=^TMP($J,"GMR",GIN,GDT,GDA),GDATE=$P(GDT,"."),GTIME=GDT D WRTDT^GMRYFLW2 Q:GMROUT
36 S GNURSE=$$CGIVER^GMRYFLW2($P(GDATA,"^",5)) S GNURSE=$S(GNURSE'="":$E("("_GNURSE_")"_GBLNK,1,20),1:$E(GBLNK,1,20)),GDATA(1)=$E(GDATA(1),1,15)_GNURSE_$E(GDATA(1),36,132)
37 D TUBE
38 Q
39TUBE S GDATA(1)=$E(GDATA(1),1,86)_$S($P(GDATA,"^",3)["Y":"yes ",1:"no ")_"|"_$S($P(GDATA,"^",4)["Y":"yes ",1:"no ")_$E(GLINE,96,132)
40 S GSCOND=$P($G(GDATA),"^",2),GLEN=$L(GSCOND,",")
41 S GDATA(1)=$E(GDATA(1),1,116)_$S(GLEN>0:$E($P(GSCOND,",")_GBLNK,1,13),1:"NO REDNESS/PA")
42 I $D(GNOIV) D
43 .S GSITE=$P($G(^GMR(126,DFN,"IV",GIN,0)),"^",2),GPORT=$G(^GMR(126,DFN,"IV",GIN,3))
44 .S GDATA(1)=$E(GDATA(1),1,52)_$E(GSITE_GBLNK,1,16)_"|"_$E(GPORT_GBLNK,1,15)_$E(GDATA(1),85,132)
45 .Q
46 D WRTLINE^GMRYFLW2
47 I $G(GLEN)>1 D F G=2:1:GLEN S GDATA(1)=$E(GLINE,1,116)_$E($P(GSCOND,",",G)_GBLNK,2,13) D WRTLINE^GMRYFLW2
48 Q
49TR ;INFUSION RATE
50 S GDATA=^TMP($J,"GMR",GIN,GDT,GDA),GNURSE=$$CGIVER^GMRYFLW2($P(GDATA,"^",3)),GDATE=$P(GDT,"."),GTIME=GDT D WRTDT^GMRYFLW2 Q:GMROUT
51 S GDATA(1)=$E(GDATA(1),1,15)_$S(GNURSE'="":$E("("_GNURSE_")"_GBLNK,1,20),1:$E(GBLNK,1,20))_"|"_$E($S(+$P(GDATA,"^",2)>0:$P(GDATA,"^",2)_" ",1:"* "),1,4)_$E(GLINE,41,132)
52 D WRTLINE^GMRYFLW2 Q
53IN ;
54 S GIN(2)=GIN(2)+1,GDATA=^TMP($J,"GMR",GIN,GDT,GDA),GDATE=$P(GDT,"."),GTIME=GDT D WRTDT^GMRYFLW2 Q:GMROUT
55 S GNURSE=$$CGIVER^GMRYFLW2($P(GDATA,"^",4)) S GDATA(1)=$E(GDATA(1),1,15)_$S(GNURSE'="":$E("("_GNURSE_")"_GBLNK,1,20),1:$E(GBLNK,1,20))_$E(GDATA(1),36,132)
56 S GABSORB=$S($P(GDATA,"^",2)["*":"*",1:GTOTAL-$P(GDATA,"^",2)),GDATA(1)=$E(GDATA(1),1,41)_$E($P(GDATA,"^",2)_GBLNK,1,4)_"|"_$E(GABSORB_GBLNK,1,5)_$E(GDATA(1),52,132)
57 S GREASON="",GREASON(1)=0
58 I GIN(1)=GIN(2)&(GDC'="") D K ^TMP($J,"GMRY",GSITE,+$P(GDC,"^"),999)
59 .S GREASON=$P($G(GDC),"^",3) I GREASON'="" K ^UTILITY($J,"W") S X=GREASON,DIWF="",DIWL=0,DIWR=13 D ^DIWP S GREASON(1)=+$G(^UTILITY($J,"W",0))
60 .S GDATA(1)=$E(GDATA(1),1,96)_"yes |"_$E($G(^UTILITY($J,"W",0,1,0))_GBLNK,1,13)_$E(GDATA(1),116,132)
61 .I $D(^TMP($J,"GMRY",GSITE,+$P(GDC,"^"),999)) S GDATA=^(999) D DC^GMRYFLW2
62 D WRTLINE^GMRYFLW2
63 S GLEN(1)=$L($G(GSCOND),","),GLEN=$S(GREASON(1)>GLEN(1)!(GREASON(1)=GLEN(1)):GREASON(1),GLEN(1)>GREASON(1):GLEN(1),1:0)
64 I GLEN>1 D SCOND^GMRYFLW2
65 Q
Note: See TracBrowser for help on using the repository browser.