source: WorldVistAEHR/trunk/r/GEN_MED_REC_IO-GMRY/GMRYUT3.m@ 841

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

initial load of WorldVistAEHR

File size: 3.3 KB
Line 
1GMRYUT3 ;HIRMFO/YH-PATIENT I/O UTILITIES - DIC CALL ;11/6/96
2 ;;4.0;Intake/Output;;Apr 25, 1997
3LIST ;LIST I/O RECORDS FOR THE SELECTED TYPE IN THE DATABASE
4 K GMRDATA S DA=DFN,GMRDC=1,GN=0,GX="",GMRDEL="" I $D(^GMR(126,DA,GNANS,"TYP")) S GMRDT=0 F S GMRDT=$O(^GMR(126,DA,GNANS,"TYP",GMRDT)) Q:GMRDT'>0 I '(GMRDT>GMREND) D SETDA
5 S GN(1)=GN I '$D(GMRDATA) W !,?5,$C(7),"No records in the database within the last 48 hours" G NEW
6 I $D(GMRDATA) D SELECT S:GX["^^" GMROUT=1 I GMROUT!($E(GX)="^") S DA=DFN G Q
7 I "Nn"[GX&(GX'="") S GX="" G NEW
8 I GX>0 S DA(1)=DA,DA=+$P(GX,"^",2) G:DA'>0 Q S GHLOC=$S(GNANS="IN":+$P($G(^GMR(126,DFN,"IN",DA,0)),"^",4),GNANS="OUT":+$P($G(^GMR(126,DFN,"OUT",DA,0)),"^",7),1:"") S:GHLOC'>0 GHLOC=GMRHLOC D @GNANS S DA=DA(1) G Q
9NEW D DT G:GX=""!GMROUT Q
10 S GMROUT(1)=0,GMROUT(1)=$$ADM^GMRYUT12(.GMROUT,DFN,GX) Q:GMROUT
11 S GMROUT(1)=0,GHLOC=GMRHLOC,X=GX I '$D(^GMR(126,DA,GNANS,0)) S ^(0)=$S(GNANS="OUT":"^126.02IDA^0^0",GNANS="IN":"^126.01IDA^0^0",1:"")
12 K DD S DLAYGO=$S(GNANS="OUT":126.02,GNANS="IN":126.01,1:""),GDATE=X,DA(1)=DA,DIC="^GMR(126,"_DA(1)_","""_GNANS_""",",DIC(0)="ML" D WAIT^GMRYUT0 D:'GMROUT FILE^DICN L:'GMROUT -^GMR(126,DFN)
13 K DIC,DLAYGO,DD S X=GDATE S DA=+$G(Y) I GMROUT!($G(Y)'>0) S GMROUT=1,DA=DA(1) G Q
14 D @GNANS S DA=DA(1)
15Q W ! K GMRX,GMRY,GHLOC,GMRDC,GMRYTYP,GEDIT,GY,D0,D1,GX,GN,X,Y,GMRDEL,GMRVOL,GMRDATA,GDATE,GMRDT,DIC,Y Q
16DT S (GX,X)="" S %DT("A")="Please enter a new DATE/TIME: ",%DT="AETXRS",%DT(0)="-NOW" S:+$G(GMRVIDT)>0 %DT("B")=GMRVIDT D ^%DT K %DT S:Y>0 (GX,X)=+Y
17 Q
18SELECT S GN(2)=1 W !
19RESEL S GX="",GN(3)=0 F GN=GN(2):1:GN(1) Q:("Nn"[GX&(GX'=""))!(GX["^")!(GX'="")!(GX["?")!GMROUT S:'GN(3) GN(3)=GN D WRITE^GMRYUT11:GMRDC=1,WRITE^GMRYUT1:GMRDC=0!(GMRDC=2) I '(GN#3)!(GN=GN(1)) D QUEST^GMRYUT1 W !! S GN(3)=0
20 G:GX["?" RESEL Q:GMROUT!(GX["^")!("Nn"[GX) G:'(GX=""!(GX>0)) SELECT S:GX>0 GMRDEL=$P(GX,+GX,2),GX=+GX I GX>0,$D(GMRDATA(+GX)) S:GX["@" GX=+$P(GX,"@"),GMRDEL="@" S GX=GMRDATA(+GX) Q
21 G:GX=9999 SELECT I GX>0,'$D(GMRDATA(+GX)) G SELECT
22 Q
23OUT ;
24 S GX(1)=+GX I GMRDEL="@" S %=1 W !!,"Are you sure you want to delete this record" D YN^DICN S:%<0 GMROUT=1 W:%=0 !!,"Enter N(o) if you do not want to delete this record or '^' to quit.",! G:%=0 OUT D:%=1 KILLRC^GMRYINTK K % Q
25 S Y=+GX X ^DD("DD") W !!,"Enter "_GLABEL_" dated "_$P(Y,":",1,2) W !,?5,"Unit ml is not required",!
26 S GMRZ=$P(^GMR(126,DA(1),"OUT",DA,0),"^",3) D:((GLABEL["URINE")!(GLABEL["DRAIN"))&(GMRZ="") DRAIN^GMRYUT7 I GMROUT!GMROUT(1) D S GMROUT(1)=0 Q
27 . I $P((GX),"^",2)="" D KILLRC^GMRYINTK
28 W !,"Enter numeric value for measured output in cc/ml or ",!,"enter S(mall), M(edium) or L(arge) for estimated output.",!
29 S DIE="^GMR(126,"_DA(1)_","""_GNANS_""",",DR="1///^S X=GLABEL;3;5///^S X=""`""_DUZ;6///^S X=""`""_GHLOC;"_$S(GLABEL["DRAIN"!(GLABEL["URINE"):"2///^S X=$S(GMRZ'="""":""`""_GMRZ,1:"""");",1:"")
30 I GLABEL["OTHER" S DR=DR_"4"
31 D WAIT^GMRYUT0 I GMROUT K DIE,DR Q
32 D ^DIE L -^GMR(126,DFN) K DIE,DR,GMRZ I $P(^GMR(126,DA(1),GNANS,DA,0),"^",4)="" D KILLRC^GMRYINTK Q
33 I GLABEL["DRAIN" W !,"Enter another DRAINAGE" S %=2 D YN^DICN Q:%'=1 D MOREDRN^GMRYUT8 S:'GMROUT X=+GX G:'GMROUT OUT S GMROUT=0 Q
34 Q
35IN ;EDIT OR DELETE INPUT RECORD
36 D INTAKE^GMRYINTK
37 Q
38SETDA S GDATE=9999999-GMRDT,GDA=0 F S GDA=$O(^GMR(126,DA,GNANS,"TYP",GMRDT,GTP,GDA)) Q:GDA'>0 S GN=GN+1,GMRDATA(GN)=GDATE_"^"_GDA
39 Q
Note: See TracBrowser for help on using the repository browser.