source: WorldVistAEHR/trunk/r/GEN_MED_REC_IO-GMRY/GMRYED1.m@ 1442

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

initial load of WorldVistAEHR

File size: 4.2 KB
Line 
1GMRYED1 ;HIRMFO/YH-ENTER/EDIT PATIENT INTAKE/OUTPUT ;1/17/97
2 ;;4.0;Intake/Output;;Apr 25, 1997
3EN1 ;ENTER/EDIT OUTPUT
4OUTPUT ;
5LIST 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),"^")
6 I GNN'>0 W !,"NO OUTPUT FILE!!!",! G Q1
7 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
8 D VALIDAT G:'$D(GTYP)!(GMROUT(1)) LIST
9 S GP=0,GNANS="OUT" D NOW^%DTC S X1=%,X2=-2 D C^%DTC S GMREND=9999999-X
10 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
11Q1 K DD,DR,DIE,DD,DLAYGO,DIC,GP,GMRDEL,GMREND,GMRDC,GLABEL,GTYPE,GTP,GNN,GNI,GTYP,GNANS,GN,GNUR,X,Y,GMRVOL,GNEW,%
12YN1 I 'GMROUT W !,"Do you want to enter another output" S %=1 D YN^DICN G:%=0 YN1 I %=1 G LIST
13 Q:$D(GOPT) Q:$D(GNUROP) D Q^GMRYED2,KILLV^GMRYUT0 Q
14 ;
15EN2 ;ENTER/EDIT INTAKE
16INPUT S GNN=0,GSITE="" F GNI="PO","IV ACCESS" D SETARY
17 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)
18 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)
19LIST2 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),"^")
20QUES2 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
21 D VALIDAT G:'$D(GTYP)!(GMROUT(1)) LIST2
22 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
23Q2 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
24 K GREC,GSTAR,GLEFT,GMRVOL,GTUBE,GDRESS,GSDC,GSITE
25YN 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
26 D Q^GMRYED2,KILLV^GMRYUT0 Q ;Q:$D(GNUROP) G:'GMROUT EN2 K POP Q
27 ;
28INTAKE I '($P(GNN(GNI),"^")["IV ACCESS") G NOGNIV
29IV S GSOL="",DA=DFN D IVACCSS^GMRYED5 Q:GMROUT!(GN'>0)!(GSOL="")
30 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)
31 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
32 Q
33NOGNIV ;ENTER/EDIT NON-IV INTAKE
34 S GTYP=$P(GNN(GNI),"^"),GNANS="IN",GTP=$P(GNN(GNI),"^",2) D LIST^GMRYUT3 Q
35 ;
36SETARY S GNN=GNN+1,GNN(GNN)=GNI_"^"_$S(GNI["PO":$O(^GMRD(126.56,"B",GNI,0)),1:"")
37 Q
38VALIDAT ;
39 S GMROUT(1)=0 F GNUR(1)=1:1 S GNUR(2)=$P(GNI,",",GNUR(1)) Q:GNUR(2)="" D VAL1
40 Q
41VAL1 ;
42 I GNUR(2)["-" D VAL2 Q
43 S:'$D(GNN(+GNUR(2))) GMROUT(1)=1 Q:GMROUT(1) S GTYP(GNUR(2))="" Q
44VAL2 ;
45 S GNUR(3)=$P(GNUR(2),"-") I GNUR(3)<1!(GNUR(3)>GNN)!'$D(GNN(+GNUR(3))) S GMROUT(1)=1 Q
46 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))=""
47 Q
48EN3 ;START NEW IV
49 D STARTIV^GMRYED2
50Q3 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
51 ;
52STARTIV ;START IV IF NO IV RUNGNING
53 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
54 I %=1 D NEWIV^GMRYED2 S DA=DFN,GMRVTYP=$P(GNN(GNI),"^",2) D IVTYP^GMRYUT1 Q
55 I %=0 W !,?5,"You have to start a line of "_GLABEL_" before you record intake.",! G STARTIV
56 Q
Note: See TracBrowser for help on using the repository browser.