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

GMRYED1.m

Go to the documentation of this file.
GMRYED1 ;HIRMFO/YH-ENTER/EDIT PATIENT INTAKE/OUTPUT ;1/17/97
 ;;4.0;Intake/Output;;Apr 25, 1997
EN1 ;ENTER/EDIT OUTPUT
OUTPUT ;
LIST S GNN=0 F GNI=0:0 S GNI=$O(^GMRD(126.58,"C",GNI)) Q:GNI'>0  S GNI(1)=$O(^GMRD(126.58,"C",GNI,0)) Q:GNI(1)'>0  S GNN=GNN+1,GNN(GNN)=$P(^GMRD(126.58,GNI(1),0),"^")_"^"_GNI(1) W !,?3,GNN,?10,$P(GNN(GNN),"^")
 I GNN'>0 W !,"NO OUTPUT FILE!!!",! G Q1
 K GTYP S GNI=0 W !,"Select from 1 to ",GNN," (enter 1,3-5 etc.) or ""^"" to quit: URINE// " R GNI:DTIME S:'$T!(GNI["^") GMROUT=1 G:GMROUT Q1 S:GNI="" GNI=1 I GNI["?" W !!,"Select the number(s) you want to enter/edit data",! G LIST
 D VALIDAT G:'$D(GTYP)!(GMROUT(1)) LIST
 S GP=0,GNANS="OUT" D NOW^%DTC S X1=%,X2=-2 D C^%DTC S GMREND=9999999-X
 F  S GP=$O(GTYP(GP)) Q:GP'>0  Q:'$D(GNN(GP))  S GTYP=$P(GNN(GP),"^",2),GLABEL=$P(GNN(GP),"^") W !,"Enter output: ",GLABEL,! S GTP=GTYP D LIST^GMRYUT3 D KILLV^GMRYUT0 K GN,GNUR Q:GMROUT
Q1 K DD,DR,DIE,DD,DLAYGO,DIC,GP,GMRDEL,GMREND,GMRDC,GLABEL,GTYPE,GTP,GNN,GNI,GTYP,GNANS,GN,GNUR,X,Y,GMRVOL,GNEW,%
YN1 I 'GMROUT W !,"Do you want to enter another output" S %=1 D YN^DICN G:%=0 YN1 I %=1 G LIST
 Q:$D(GOPT)  Q:$D(GNUROP)  D Q^GMRYED2,KILLV^GMRYUT0 Q
 ;
EN2 ;ENTER/EDIT INTAKE
INPUT S GNN=0,GSITE="" F GNI="PO","IV ACCESS" D SETARY
 F GNI=0:0 S GNI=$O(^GMRD(126.56,"C",GNI)) Q:GNI'>0  S GNI(1)=$O(^GMRD(126.56,"C",GNI,0)) Q:GNI(1)'>0  I $P(^GMRD(126.56,GNI(1),0),"^")'["PO" S GNN=GNN+1,GNN(GNN)=$P(^(0),"^")_"^"_GNI(1)
 S GMRYITM=GNN,GNI=0 F  S GNI=$O(^GMRD(126.56,"C",GNI)) Q:GNI'>0  S GNI(1)=$O(^GMRD(126.56,"C",GNI,0)) Q:GNI(1)'>0  S GNN=GNN+1,GNN(GNN)=$P(^GMRD(126.56,GNI(1),0),"^")_"^"_GNI(1)
LIST2 W !,?43,"Detailed input from "_(GMRYITM+1)_" to "_GNN F GNI=1:1:GMRYITM W !,?3,GNI,?10,$P(GNN(GNI),"^") W:$D(GNN(GMRYITM+GNI)) ?43,(GMRYITM+GNI),?50,$P(GNN(GMRYITM+GNI),"^")
QUES2 S GNI=0 W !,"Select from 1 to ",GNN," (enter 1,3-5 etc.) or ""^"" to quit: " R GNI:DTIME S:'$T!(GNI["^") GMROUT=1 G:GMROUT Q2 I GNI=""!(GNI["?") W !!,"Select the number(s) you want to enter/edit data",! G LIST2
 D VALIDAT G:'$D(GTYP)!(GMROUT(1)) LIST2
 D NOW^%DTC S X1=%,X2=-2 D C^%DTC S GMREND=9999999-X S GNI=0 F  S GNI=$O(GTYP(GNI)) Q:GNI'>0  Q:'$D(GNN(GNI))  S GLABEL=$P(GNN(GNI),"^") W !,"Enter intake: ",GLABEL,! D INTAKE,KILLV^GMRYUT0 K GN,GNUR Q:GMROUT
Q2 K DIE,DLAYGO,DD,DR,DIC,%,GRATE,GVOL,GTXT,GSOL,GMRST,GCATH,GMRYITM,GDCIV,GMRZ,GX,GDR,GOPT,GMRDEL,GDATA,GDCDT,GGDA,GLEFT,GIN,GMRDA,GTOTAL,GHLOC,GMRVDT,GMREND,GMRDC,GLABEL,GTYPE,GTP,GNN,GNI,GTYP,GNANS,GN,GNUR,X,Y,GSITE
 K GREC,GSTAR,GLEFT,GMRVOL,GTUBE,GDRESS,GSDC,GSITE
YN I DFN>0&'GMROUT W !,"Do you want to enter OUTPUT" S %=1 D YN^DICN W:%=0 !!,"Do you want to go on to enter/edit output for this patient?",!! G:%=0 YN I %=1 S GMROUT=0,GOPT="IN" W ! D LIST K GOPT
 D Q^GMRYED2,KILLV^GMRYUT0 Q  ;Q:$D(GNUROP)  G:'GMROUT EN2 K POP Q
 ;
INTAKE I '($P(GNN(GNI),"^")["IV ACCESS") G NOGNIV
IV S GSOL="",DA=DFN D IVACCSS^GMRYED5 Q:GMROUT!(GN'>0)!(GSOL="")
 S Y=$P(GMRDATA(+X),"^") X ^DD("DD") W !!,"Enter IV INTAKE for ",GSOL_" "_GMRVTYP_"  ",GSITE_"  "_GVOL_" mls "_GRATE,!,?10,GTXT_" @"_$P(Y,":",1,2)
 S GNANS="IV",GTP=GMRVTYP D SELIV^GMRYUT0 I GN>1 W !!,"Enter INTAKE for another IV" S %=2 D YN^DICN G:%=1 IV Q
 Q
NOGNIV ;ENTER/EDIT NON-IV INTAKE
 S GTYP=$P(GNN(GNI),"^"),GNANS="IN",GTP=$P(GNN(GNI),"^",2) D LIST^GMRYUT3 Q
 ;
SETARY S GNN=GNN+1,GNN(GNN)=GNI_"^"_$S(GNI["PO":$O(^GMRD(126.56,"B",GNI,0)),1:"")
 Q
VALIDAT ;
 S GMROUT(1)=0 F GNUR(1)=1:1 S GNUR(2)=$P(GNI,",",GNUR(1)) Q:GNUR(2)=""  D VAL1
 Q
VAL1 ;
 I GNUR(2)["-" D VAL2 Q
 S:'$D(GNN(+GNUR(2))) GMROUT(1)=1 Q:GMROUT(1)  S GTYP(GNUR(2))="" Q
VAL2 ;
 S GNUR(3)=$P(GNUR(2),"-") I GNUR(3)<1!(GNUR(3)>GNN)!'$D(GNN(+GNUR(3))) S GMROUT(1)=1 Q
 S GNUR(4)=$P(GNUR(2),"-",2) S:'$D(GNN(+GNUR(4))) GMROUT(1)=1 Q:GMROUT(1)  F GNUR(5)=GNUR(3):1:GNUR(4) S:'$D(GNN(GNUR(5))) GMROUT(1)=1 Q:GMROUT(1)  S GTYP(GNUR(5))=""
 Q
EN3 ;START NEW IV
 D STARTIV^GMRYED2
Q3 D KILLV^GMRYUT0 K GDCIV,GN,GDR,GCATH,GHLOC,POP,X,Y,GMRDEL,GDC,GMRQUAL,GX,GLABEL,GMRZ,GSDC,GTUBE,GSITE,GDRESS,GTXT,GMRDC Q
 ;
STARTIV ;START IV IF NO IV RUNGNING
 S GX="",GMRVDT=0,GMRDEL="" W !,?5,"Do you want to start a(n) "_GLABEL S %=2 D YN^DICN S:%<0 GMROUT=1 Q:GMROUT
 I %=1 D NEWIV^GMRYED2 S DA=DFN,GMRVTYP=$P(GNN(GNI),"^",2) D IVTYP^GMRYUT1 Q
 I %=0 W !,?5,"You have to start a line of "_GLABEL_" before you record intake.",! G STARTIV
 Q