source: WorldVistAEHR/trunk/r/GEN_MED_REC_IO-GMRY/GMRYUT10.m@ 1154

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

initial load of WorldVistAEHR

File size: 4.4 KB
Line 
1GMRYUT10 ;HIRMFO/YH-IV RESTART ;6/11/93
2 ;;4.0;Intake/Output;;Apr 25, 1997
3OTHRSOL ;ENTER OTHER NAME OF SOLUTION
4 W !!,"Please SPECIFY the name of the solution",!,?2,"(maximum 75 characters): " S X="" R X:DTIME I '$T!(X["^") S GMROUT=1 Q
5 I X=""!(X["?")!($L(X)>75) W !,"Enter the name of this IV solution or ^ to quit",! G OTHRSOL
6YN W !,X_" " S %=1 D YN^DICN W:%=0 !!,"Enter Y(es) or N(o) to confirm your entry is correct or not.",! G:%=0 YN I %=1 S $P(Y(0),"^")=X Q
7 S:%<0 GMROUT=1 Q:GMROUT G OTHRSOL
8EDTSOL ;
9 W !,"Enter additional vitamins/electrolytes using a ; to separate additives",! S $P(Y(0),"^")=$$RW^GMRYDIR($P(Y(0),"^"),75) Q:GMROUT
10YN2 W !,$P(Y(0),"^")_" " S %=1 D YN^DICN W:%=0 !!,"Enter Y(es) or N(o) to confirm your entry is correct or not.",! G:%=0 YN2 Q:%=1
11 S:%<0 GMROUT=1 Q:GMROUT G EDTSOL
12RESTART ;RESTART IV
13 K GMRXX S GMRXX=0,GDR=1 D NOW^%DTC S GNOW=%,X1=%,X2=-1 D C^%DTC S GDT(1)=X,GDT=9999999-X D SEARCH Q:GMROUT
14 I GMRXX=0 D
15 .W !!,"An IV can't be restarted for one or more of the following reasons:",!,?5,"1. The specific item has been running over 24 hrs.",!,?5,"2. The solution has been discontinued for over 8 hrs.",!,?5,"3. The remaining solution is under 5 mls."
16 .W !,?5,"4. The reason for discontinuation is 'INFUSED'.",!! S GMROUT=1
17 Q:GMROUT D WRITE
18 K GTIME Q
19SEARCH ;SEARCH THE IV STARTED WITHIN 24 HRS DC'D WITHIN 8 HRS
20 I '$D(^GMR(126,DFN,"IV","C")) W !!,"There are no IVs in the database for this patient!",! S GMROUT=1 Q
21 S GIVDT=0 F S GIVDT=$O(^GMR(126,DFN,"IV","C",GIVDT)) Q:GIVDT'>0 Q:GIVDT>GDT D SCREEN
22 Q
23SCREEN S GDA=0 F S GDA=$O(^GMR(126,DFN,"IV","C",GIVDT,GDA)) Q:GDA'>0 D SAVE
24 Q
25SAVE S GDATA=^GMR(126,DFN,"IV",GDA,0),GDC=+$P(GDATA,"^",9) Q:(GNOW-GDC)>8!(GDC'>0) Q:$P($G(^GMR(126,DFN,"IV",GDA,1)),"^")>0
26 S GDA(1)=0,GDA(1)=$S('$D(^GMR(126,DFN,"IV",GDA,"IN",0)):0,1:+$P(^(0),"^",3)),GVOL=$S(GDA(1)'>0:0,'$D(^GMR(126,DFN,"IV",GDA,"IN",GDA(1),0)):0,1:$P(^(0),"^",2)) I '(GVOL["*"!(GVOL>4)) Q
27 S GREASON=$P(GDATA,"^",11) Q:GREASON["INFUSED"!(GREASON["Infused")!(GREASON["infused") S GMRXX=GMRXX+1,GMRXX(GMRXX)=$P(GDATA,"^",1,5)_"^"_$P(GDATA,"^",12)_"^"_GDC_"^"_GREASON_"^"_GVOL_"^"_GDA Q
28WRITE Q:GMROUT W !!,"Select one of the following IV(s) to restart",! F I=1:1:GMRXX W !,I_". " D WRT
29 W !!,"Please enter your choice: " S I="" R I:DTIME I '$T!(I["^")!(I="") S GMROUT=1 Q
30 I I=""!(I["?")!(I'?.N) W @IOF,!!,"Enter the number of the IV solution you want to restart",! G WRITE
31 S I=+I
32YN1 D SET
33 I GMRXX>0 S GDR=2 W @IOF G WRITE
34 K GCATH,GDC,GHLOC,GMRXX,GMRYY,II,I,GNOW,GREASON,GSDC,GVOL,GX Q
35WRT W $P(GMRXX(I),"^",3)_" ("_$P(GMRXX(I),"^",4)_") "_$P(GMRXX(I),"^",5)_" ml "_$S($P(GMRXX(I),"^",6)'="":$P(GMRXX(I),"^",6)_" ml/hr ",1:"") S Y=$P(GMRXX(I),"^") X ^DD("DD") W !,?4,"started on "_$P(Y,":",1,2)
36 S (GTIME,Y)=$P(GMRXX(I),"^",7) X ^DD("DD") W !,?4,"DC'd on "_$P(Y,":",1,2)_" "_$P(GMRXX(I),"^",9)_" ml left",!,?4,"DC reason: "_$P(GMRXX(I),"^",8) Q
37SET S GDATA=GMRXX(+I),GHLOC=GMRHLOC,GMRZ=$P(GDATA,"^",3),(GMRZ(1),GMRVTYP)=$P(GDATA,"^",4),GMRZ(2)=$P(GDATA,"^",9),GMRZ(3)=$P(GDATA,"^",6),GSAVE(1)=+$P(GDATA,"^",10) K GMRXX(+I) S GMRXX=GMRXX-1
38 D:GMRXX>0 RESET S:GMRZ(2)'>0 GMRZ(2)="" S GSAVE=GMRZ(2) S:GSAVE="" GSAVE=+$P(GDATA,"^",5)
39ASK S GMRX="" D ASK1^GMRYUT6 Q:GMROUT G:GMRX="N" ASK
40ASK2 I GDR=1 D DT^GMRYUT3 S:GX="" GMROUT=1 Q:GMROUT W:GX<GTIME !!,"Start date/time comes before the DC'd date/time.",! G:GX<GTIME ASK2 D
41 . S GMROUT(1)=0,GMROUT(1)=$$ADM^GMRYUT12(.GMROUT,DFN,GX) Q:GMROUT
42 . S (GSITE,GCATH,GCATH(1))="" D SITECATH^GMRYSTCA
43 . Q
44 Q:GMROUT S GSAVE=GMRVTYP K DD S X=+GX,DLAYGO=126.03,DA(1)=DFN,DIC="^GMR(126,"_DA(1)_",""IV"",",DIC(0)="ML" D WAIT^GMRYUT0 Q:GMROUT D FILE^DICN L -^GMR(126,DFN) K DIC,DLAYGO,DD
45 I Y'>0 S GMROUT=1 Q
46 S DA=+Y,GMRVTYP=GSAVE
47 S DIE="^GMR(126,"_DA(1)_",""IV"",",DR="2///^S X=GMRZ;3///^S X=GMRZ(1);4///^S X=GMRZ(2);11///^S X=GMRZ(3);6///^S X=""`""_DUZ;7///^S X=""`""_GHLOC;"_$S(GDR=1:"1///^S X=GSITE;5///^S X=GCATH;17///^S X=GCATH(1)",GDR=2:"1///^S X=GSITE",1:"")
48 D WAIT^GMRYUT0 I GMROUT K DIE,DR Q
49 D ^DIE L -^GMR(126,DFN) K DIE,DR I $P(^GMR(126,DA(1),"IV",DA,0),"^",2)=""!($P(^(0),"^",3)="")!($P(^(0),"^",5)="") W !!,"Undefined value in the record.",!! D DELIV^GMRYED2 S GMROUT=1 Q
50 S $P(^GMR(126,DFN,"IV",GSAVE(1),1),"^")=GX,$P(^(1),"^",2)=DA,GLINE=DA D RESTART^GMRYED2 Q
51RESET ;
52 K GMRYY S (GMRYY,II)=0 F S II=$O(GMRXX(II)) Q:II'>0 S GMRYY=GMRYY+1,GMRYY(GMRYY)=GMRXX(II)
53 K GMRXX S GMRXX=0 F II=1:1:GMRYY S GMRXX(II)=GMRYY(II),GMRXX=GMRXX+1
Note: See TracBrowser for help on using the repository browser.