source: WorldVistAEHR/trunk/r/GEN_MED_REC_IO-GMRY/GMRYFLW0.m@ 824

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

initial load of WorldVistAEHR

File size: 3.0 KB
RevLine 
[613]1GMRYFLW0 ;HIRMFO/YH-INTRAVENOUS INFUSION FLOW SHEET ;1/25/93
2 ;;4.0;Intake/Output;;Apr 25, 1997
3EN1 ;IV FLOW SHEET
4 S GMROUT=0,GRPT=8 D DATE^GMRYRP1 G:GMROUT Q S GMROP(1)=$S($D(GMRNUR):"WARDPAT^GMRYUT4",1:"MASPT^GMRYRP5") D @GMROP(1) G:GMROUT Q
5DEV W !,$C(7),"** THIS REPORT NEEDS 132 COLUMNS - PORT/LAND **" D DEV^GMRYRP0 I POP G Q
6 I IOM<81 D ^%ZISC G DEV
7 I $D(IO("Q")) K IO("Q"),IO("C") S ZTDESC="IV FLOW SHEET",ZTRTN="START^GMRYFLW0",ZTIO=ION_";"_IOM_";"_IOSL D LOOP,^%ZTLOAD D Q2^GMRYRP0 K GMRNAM,GMRWARD Q
8START ;
9 U IO
10 S GPC=0,GDASH="",$P(GDASH,"-",132)="",GBLNK="",$P(GBLNK," ",132)="",GMROUT=0
11 S GLINE="" F I=8,5,20,4,4,5,16,16,4,4,5,13 S GLINE=GLINE_$E(GBLNK,1,I)_"|"
12 S GLINE=$E(GLINE_GBLNK,1,132),GQT=0,GQ=0
13 I "Pp"[GMREDB D PATIENT^GMRYUT9,SETARRY,REPORT^GMRYFLW1,Q,Q2^GMRYRP0 Q
14 I "SsWw"[GMREDB D:$D(GMRNUR) PATIENT^GMRYUT11
15 G:'$D(^TMP("GMRPT",$J)) Q
16 S GROOM="" F J=0:0 S GROOM=$O(^TMP("GMRPT",$J,GROOM)) Q:GROOM=""!GMROUT S GBED="" F J=0:0 S GBED=$O(^TMP("GMRPT",$J,GROOM,GBED)) Q:GBED=""!GMROUT S DFN=0 F J=0:0 S DFN=$O(^TMP("GMRPT",$J,GROOM,GBED,DFN)) Q:DFN'>0!GMROUT D PRNT Q:GMROUT
17 D Q D Q2^GMRYRP0 K GMRNAM,GMRWARD Q
18LOOP F X="GNRMBD(","^TMP(""GMRPT"",$J,","GMROUT","GMRNUR","GMRFIN","GMRSTRT","GMREDB","GRPT","DFN","GMRCOL","GMRWARD","GMRWARD(" S ZTSAVE(X)=""
19 Q
20PRNT S (GQ,GQT)=0 D PT^GMRYUT0,SETARRY,REPORT^GMRYFLW1
21 Q
22Q ;
23 K GMRVHLOC,GMRVWLOC,GMROP,GMROUT,GMREDB,GMRFIN,GST,GDC,GDTIME,GTOTAL,GSTM,GMRSTRT,GCATH,GBLNK,GDASH,GSDA,GSDAY,GDATE,GLEFT,GABSORB,GRPT,GSTAR,GDA,GMRY,GSAVE,GSAVEH,GMRHLOC,GDATA D Q^GMRYRP0
24 K SSN,GMRAGE,GMRBED,GMRBTH,GMRDIAG,GMRHLOC,GMRNAM,GMRSEX,GMRADM,GMRWARD,VAROOT,I,X,Y,DFN Q
25SETARRY ;SET IV DATA IN ^TMP($J,"GMR" AND SITE CARE IN ^TMP($J,"GMRY", FOR EACH PATIENT
26 K ^TMP($J) I $D(^GMR(126,"B",DFN)) S GSAVEH=0,DA(1)=$O(^GMR(126,"B",DFN,0)) D SAVEIV,IVM
27 Q
28IVM ;SET IV MAINTENANCE IN ^TMP($J,"GMRY"
29 Q:'$D(^GMR(126,DFN,"IVM","B"))
30 S GSITE="" F S GSITE=$O(^GMR(126,DA(1),"IVM","B",GSITE)) Q:GSITE="" S DA=$O(^(GSITE,0)) Q:DA'>0 D SCARE
31 Q
32SCARE ;
33 Q:'$D(^GMR(126,DA(1),"IVM",DA,1,"C"))
34 S GSTRT=0 F S GSTRT=$O(^GMR(126,DA(1),"IVM",DA,1,"C",GSTRT)) Q:GSTRT'>0 S GMRINDT=9999999-GSTRT I '(GMRINDT<GMRSTRT!(GMRINDT>GMRFIN)) S GDA=0 F S GDA=$O(^GMR(126,DA(1),"IVM",DA,1,"C",GSTRT,GDA)) Q:GDA'>0 D SETUT
35 Q
36SETUT S GDATA=^GMR(126,DA(1),"IVM",DA,1,GDA,0) I $P(GDATA,"^",7)'="" S ^TMP($J,"GMR",+$P(GDATA,"^",7),GMRINDT,999)=^(0) Q
37 S ^TMP($J,"GMRY",GSITE,GMRINDT,999)=GDATA Q
38SAVEIV ;SET ^TMP($J,"GMR" FOR IV INTAKE
39 I '$D(^GMR(126,DA(1),"IV","C")) Q
40 S GIVSTRT=0 F JJ=0:0 S GIVSTRT=$O(^GMR(126,DA(1),"IV","C",GIVSTRT)) Q:GIVSTRT'>0 S GMRINDT=9999999-GIVSTRT Q:GMRINDT<GMRSTRT I GMRINDT'>GMRFIN D IV
41 Q
42IV ;
43 S DA=0 F S DA=$O(^GMR(126,DA(1),"IV","C",GIVSTRT,DA)) Q:DA'>0 Q:'$D(^GMR(126,DA(1),"IV",DA,0)) D IVDA
44 Q
45IVDA ;
46 S GSITE=$P($G(^GMR(126,DA(1),"IV",DA,0)),"^",2),GSTRT=$P($G(^(0)),"^") Q:GSITE="" S ^TMP($J,"GMRY",GSITE,GMRINDT,DA)=$P(^(0)_"^^^^^","^",1,13)
47 S $P(^TMP($J,"GMRY",GSITE,GMRINDT,DA),"^",13)=$P($G(^GMR(126,DA(1),"IV",DA,3)),"^") ;IV PORT
48 Q
Note: See TracBrowser for help on using the repository browser.