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

GMRYFLW2.m

Go to the documentation of this file.
GMRYFLW2 ;HIRMFO/YH-IV FLOW SHEET UTILITY ;8/9/96
 ;;4.0;Intake/Output;;Apr 25, 1997
 W !,GMRNAM W:SSN'="" ?17,SSN W:GMRBTH'="" ?32,GMRBTH W:GMRAGE'="" ?42,"(",GMRAGE," YRS)" W:GMRSEX'="" ?53,GMRSEX W ?93,"MEDICAL RECORD"
 W !,"UNIT: " W:GMRWARD(1)'="" ?7,GMRWARD(1) W ?33,"RM/BED: " W:GMRBED'="" ?41,GMRBED W ?91,"FLOW SHEET-VERTICAL",!
 D INP^VADPT S GMRVHLOC=$P($G(^DIC(42,+$G(VAIN(4)),44)),"^")
 W "DIVISION: "_$S(GMRVHLOC>0:$$GET1^DIQ(4,+$$GET1^DIQ(44,+GMRVHLOC,3,"I"),.01,"I"),1:""),?93,"IV FLOW SHEET",!
 Q
BLANK F X=1:1 W ! Q:IOSL<($Y+$S($E(IOST)="P":4,1:5))
 Q
HEADER1 ;
 D:GQT FOOTER^GMRYFLW2
 I GQT,'GQ,$E(IOST)="C" W "Press return to continue or ^ to quit " R X:DTIME I '$T!(X["^") S GMROUT=1 Q
 W:'($E(IOST)'="C"&'GPC) @IOF
 S GQT=1,GPC=GPC+1 W !,?122,"Page: "_GPC,!,?36,"RATE AMT. AMT.",?86,"TUBE",?91,"DRSG",!
 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,!
 Q
WRTDT ;
 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
 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
 Q
LINE2 ;PRINT 2ND LINE FOR IV
 I $L(GSOL,";")>1 N X D  Q
 .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
 .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
 .Q
 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
 Q
FLUSH ;
 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)
 D WRTLINE
 Q
GMRUT S GIN(1)=0
 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
 Q
GMRTITR 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)
 Q
WRTLINE I GST'=GSITE&(GST'="") D:($Y+$S($E(IOST)="P":6,1:11))>IOSL HEADER1^GMRYFLW2 Q:GMROUT
 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
 Q
WRT 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
 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)
 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)
 D WRTLINE Q
CGIVER(GDFN) ;CARE GIVER
 N X S X=$$GET1^DIQ(200,GDFN_",","NAME")
 I X'="" S X=$P(X,",")_","_$E($P(X,",",2)) S:$L(X)>18 X=$E(X,1,18)
 Q X
SCOND ;
 F G=2:1:GLEN Q:GMROUT  D
 .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)
 .D WRTLINE^GMRYFLW2
 K G,GSCOND,GLEN,GREASON,^UTILITY($J,"W") Q
DC ;
 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)
 S GSCOND=$P($G(GDATA),"^",2)
 S GDATA(1)=$E(GDATA(1),1,116)_$S(GSCOND="":"NO REDNESS/PA",1:$E($P(GSCOND,",")_GBLNK,1,13))
 Q