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

GMRYUT3.m

Go to the documentation of this file.
GMRYUT3 ;HIRMFO/YH-PATIENT I/O UTILITIES - DIC CALL ;11/6/96
 ;;4.0;Intake/Output;;Apr 25, 1997
LIST ;LIST I/O RECORDS FOR THE SELECTED TYPE IN THE DATABASE
 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
 S GN(1)=GN I '$D(GMRDATA) W !,?5,$C(7),"No records in the database within the last 48 hours" G NEW
 I $D(GMRDATA) D SELECT S:GX["^^" GMROUT=1 I GMROUT!($E(GX)="^") S DA=DFN G Q
 I "Nn"[GX&(GX'="") S GX="" G NEW
 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
NEW D DT G:GX=""!GMROUT Q
 S GMROUT(1)=0,GMROUT(1)=$$ADM^GMRYUT12(.GMROUT,DFN,GX) Q:GMROUT
 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:"")
 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)
 K DIC,DLAYGO,DD S X=GDATE S DA=+$G(Y) I GMROUT!($G(Y)'>0) S GMROUT=1,DA=DA(1) G Q
 D @GNANS S DA=DA(1)
Q W ! K GMRX,GMRY,GHLOC,GMRDC,GMRYTYP,GEDIT,GY,D0,D1,GX,GN,X,Y,GMRDEL,GMRVOL,GMRDATA,GDATE,GMRDT,DIC,Y Q
DT 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
 Q
SELECT S GN(2)=1 W !
RESEL 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
 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
 G:GX=9999 SELECT I GX>0,'$D(GMRDATA(+GX)) G SELECT
 Q
OUT ;
 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
 S Y=+GX X ^DD("DD") W !!,"Enter "_GLABEL_" dated "_$P(Y,":",1,2) W !,?5,"Unit ml is not required",!
 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
 . I $P((GX),"^",2)="" D KILLRC^GMRYINTK
 W !,"Enter numeric value for measured output in cc/ml or ",!,"enter S(mall), M(edium) or L(arge) for estimated output.",!
 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:"")
 I GLABEL["OTHER" S DR=DR_"4"
 D WAIT^GMRYUT0 I GMROUT K DIE,DR Q
 D ^DIE L -^GMR(126,DFN) K DIE,DR,GMRZ I $P(^GMR(126,DA(1),GNANS,DA,0),"^",4)="" D KILLRC^GMRYINTK Q
 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
 Q
IN ;EDIT OR DELETE INPUT RECORD
 D INTAKE^GMRYINTK
 Q
SETDA 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
 Q