source: WorldVistAEHR/trunk/r/GEN_MED_REC_IO-GMRY/GMRYFLW2.m@ 1073

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

initial load of WorldVistAEHR

File size: 3.9 KB
Line 
1GMRYFLW2 ;HIRMFO/YH-IV FLOW SHEET UTILITY ;8/9/96
2 ;;4.0;Intake/Output;;Apr 25, 1997
3FOOTER ;
4 W !,GMRNAM W:SSN'="" ?17,SSN W:GMRBTH'="" ?32,GMRBTH W:GMRAGE'="" ?42,"(",GMRAGE," YRS)" W:GMRSEX'="" ?53,GMRSEX W ?93,"MEDICAL RECORD"
5 W !,"UNIT: " W:GMRWARD(1)'="" ?7,GMRWARD(1) W ?33,"RM/BED: " W:GMRBED'="" ?41,GMRBED W ?91,"FLOW SHEET-VERTICAL",!
6 D INP^VADPT S GMRVHLOC=$P($G(^DIC(42,+$G(VAIN(4)),44)),"^")
7 W "DIVISION: "_$S(GMRVHLOC>0:$$GET1^DIQ(4,+$$GET1^DIQ(44,+GMRVHLOC,3,"I"),.01,"I"),1:""),?93,"IV FLOW SHEET",!
8 Q
9BLANK F X=1:1 W ! Q:IOSL<($Y+$S($E(IOST)="P":4,1:5))
10 Q
11HEADER1 ;
12 D:GQT FOOTER^GMRYFLW2
13 I GQT,'GQ,$E(IOST)="C" W "Press return to continue or ^ to quit " R X:DTIME I '$T!(X["^") S GMROUT=1 Q
14 W:'($E(IOST)'="C"&'GPC) @IOF
15 S GQT=1,GPC=GPC+1 W !,?122,"Page: "_GPC,!,?36,"RATE AMT. AMT.",?86,"TUBE",?91,"DRSG",!
16 W "DATE |TIME |SOLUTIONS/BLOOD",?35,"|ML'S|LEFT|ABSRB|SITE",?68,"|CATHETER",?85,"|CHNG|CHNG|D/C'D|REASON D/C |SITE CONDITION",!,GDASH,!
17 Q
18WRTDT ;
19 I GSDAY'=GDATE!(GST'=GSITE) S GDATA(1)=$E(GDATE,4,5)_"/"_$E(GDATE,6,7)_"/"_$E(GDATE,2,3)_"|"_$E($P(GTIME,".",2)_"0000",1,2)_":"_$E($P(GTIME,".",2)_"0000",3,4)_$E(GDATA(1),15,132) Q
20 S GDATA(1)=" |"_$S(GHOLD'=$G(GDT):$E($P(GTIME,".",2)_"0000",1,2)_":"_$E($P(GTIME,".",2)_"0000",3,4),1:" ")_$E(GDATA(1),15,132) Q
21 Q
22LINE2 ;PRINT 2ND LINE FOR IV
23 I $L(GSOL,";")>1 N X D Q
24 .F X=2:1:$L(GSOL,";") Q:$P(GSOL,";",X)=""!GMROUT S GDATA(1)=$E(GLINE,1,15)_$E($P(GSOL,";",X)_GBLNK,1,20)_$E(GLINE,36,69)_$S(X=2:$E(GPORT_GBLNK,1,15),1:$E(GBLNK,1,15))_$E(GLINE,85,132) D WRTLINE
25 .Q:GMROUT S GDATA(1)=$E(GLINE,1,15)_$S(GNURSE'="":$E("("_GNURSE_")"_GBLNK,1,20),1:$E(GBLNK,1,20))_$E(GLINE,36,132) D WRTLINE
26 .Q
27 S GDATA(1)=$E(GLINE,1,15)_$S(GNURSE'="":$E("("_GNURSE_")"_GBLNK,1,20),1:$E(GBLNK,1,20))_$E(GLINE,36,69)_$S(GPORT="":$E(GBLNK,1,15),1:$E(GPORT_GBLNK,1,15))_$E(GLINE,85,132) D WRTLINE
28 Q
29FLUSH ;
30 S GDATA(1)=$E(GDATA(1),1,46)_$E(GBLNK,1,5)_"|"_$E($P(GDATA,"^",2)_GBLNK,1,16)_"|"_$E($P(GDATA,"^",6)_GBLNK,1,16)_$E(GLINE,86,102)_$E($S($P(GDATA,"^",11)'["INFUSED":$P(GDATA,"^",11),1:"")_GBLNK,1,13)_$E(GLINE,116,132)
31 D WRTLINE
32 Q
33GMRUT S GIN(1)=0
34 S GDT=0 F S GDT=$O(^GMR(126,DFN,"IV",GIN,"IN","B",GDT)) Q:GDT'>0 S GDA=0 F S GDA=$O(^GMR(126,DFN,"IV",GIN,"IN","B",GDT,GDA)) Q:GDA'>0 S ^TMP($J,"GMR",GIN,GDT,1)=^GMR(126,DFN,"IV",GIN,"IN",GDA,0),GIN(1)=GIN(1)+1
35 Q
36GMRTITR S GDT=0 F S GDT=$O(^GMR(126,DFN,"IV",GIN,"TITR","B",GDT)) Q:GDT'>0 S GDA=0 F S GDA=$O(^GMR(126,DFN,"IV",GIN,"TITR","B",GDT,GDA)) Q:GDA'>0 S ^TMP($J,"GMR",GIN,GDT,998)=^GMR(126,DFN,"IV",GIN,"TITR",GDA,0)
37 Q
38WRTLINE I GST'=GSITE&(GST'="") D:($Y+$S($E(IOST)="P":6,1:11))>IOSL HEADER1^GMRYFLW2 Q:GMROUT
39 D:($Y+$S($E(IOST)="P":6,1:11))>IOSL HEADER1^GMRYFLW2 Q:GMROUT W GDATA(1),! S GDATA(1)=GLINE,GSDAY=GDATE,GSTM=GTIME,GST=GSITE
40 Q
41WRT S GDATA=^TMP($J,"GMRY",GSITE,GDTIME,999),GDATE=$P(GDTIME,"."),GTIME=GDTIME S:'$D(GHOLD) GHOLD=GTIME S:'$D(GDT) GDT=0 D WRTDT^GMRYFLW2
42 S:GST'=GSITE GDATA(1)=$E(GDATA(1),1,52)_$E(GSITE_GBLNK,1,16)_$E(GDATA(1),69,132) 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(GDATA(1),96,132)
43 S GDATA(1)=$E(GDATA(1),1,96)_$S($P(GDATA,"^",6)["Y":"yes |site d/c'd ",1:" | ")_$E(GDATA(1),116,132) S:$P(GDATA,"^",2)'="" GDATA(1)=$E(GDATA(1),1,116)_$E($P(GDATA,"^",2),1,13)
44 D WRTLINE Q
45CGIVER(GDFN) ;CARE GIVER
46 N X S X=$$GET1^DIQ(200,GDFN_",","NAME")
47 I X'="" S X=$P(X,",")_","_$E($P(X,",",2)) S:$L(X)>18 X=$E(X,1,18)
48 Q X
49SCOND ;
50 F G=2:1:GLEN Q:GMROUT D
51 .S GDATA(1)=$E(GLINE,1,102)_$E($G(^UTILITY($J,"W",0,G,0))_GBLNK,1,13)_"|"_$E($P($G(GSCOND),",",G)_GBLNK,2,16)
52 .D WRTLINE^GMRYFLW2
53 K G,GSCOND,GLEN,GREASON,^UTILITY($J,"W") Q
54DC ;
55 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(GDATA(1),96,132)
56 S GSCOND=$P($G(GDATA),"^",2)
57 S GDATA(1)=$E(GDATA(1),1,116)_$S(GSCOND="":"NO REDNESS/PA",1:$E($P(GSCOND,",")_GBLNK,1,13))
58 Q
Note: See TracBrowser for help on using the repository browser.