source: FOIAVistA/trunk/r/GEN_MED_REC_IO-GMRY/GMRYPSIV.m@ 1397

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

initial load of FOIAVistA 6/30/08 version

File size: 1.6 KB
Line 
1GMRYPSIV ;HIRMFO/YH-DISPLAY ACTIVE PATIENT IV ORDER ;5/22/96
2 ;;4.0;Intake/Output;;Apr 25, 1997
3GETIV(GDFN,GTYP,GY) ;
4 ;INPUT VARIABLES:
5 ;GDFN - DFN. POINTER TO THE PATIENT FILE (#2).
6 ;GTYP -TYPE OF IV - 'A' FOR ADMIXTURE
7 ; 'B' FOR BLOOD/BLOOD PRODUCT
8 ; 'H' FOR HYPERAL
9 ; 'P' FOR PIGGYBACK
10 ;OUTPUT ARRAY
11 ;GY - CONTAINS ACTIVE IV ORDER INFORMATION
12 N I,J,GSOL,GRATE,GVOL,GADDI S GY=0
13 ;GET IV Sub-File (#55.01) ORDER NUMBER AND STATUS LISTING FOR A SELECTED
14 ;PATIENT.
15 D LIST^DIC(55.01,","_GDFN_",",".01;100;","","","","","","","") I '$D(^TMP("DILIST",$J)) Q
16 ;GET ORDER NUMBER, START DATE/TIME, TYPE, INFUSION RATE, SOLUTION AND
17 ;ADDITIVES FOR EACH ACTIVE IV ORDER
18 S I=0 F S I=$O(^TMP("DILIST",$J,"ID",I)) Q:I'>0 D
19 .I +$G(^TMP("DILIST",$J,"ID",I,.01))>0,$G(^TMP("DILIST",$J,"ID",I,100))["ACTIVE" D
20 ..S I(1)=+^TMP("DILIST",$J,"ID",I,.01),I(2)=I(1)_","_GDFN_","
21 ..K GARY D GETS^DIQ(55.01,I(2),".01;.02;.04;.08;1*;3*;","E","GARY")
22 ..I $E($G(GARY(55.01,I(2),.04,"E")))=GTYP D ;TYPE OF SOLUTION
23 ...S GRATE=$G(GARY(55.01,I(2),.08,"E")) ;INFUSION RATE
24 ...S GVOL=0,(GSOL,J)="" F S J=$O(GARY(55.11,J)) Q:J="" S GSOL=GSOL_$S(GSOL'="":";",1:"")_$G(GARY(55.11,J,.01,"E")),GVOL=GVOL+$G(GARY(55.11,J,1,"E"))
25 ...S (GADDI,J)="" F S J=$O(GARY(55.02,J)) Q:J="" D
26 ....S GADDI=GADDI_$S(GADDI'="":";",1:"")_$G(GARY(55.02,J,.01,"E"))_$S($G(GARY(55.02,J,.02,"E"))'="":" "_$G(GARY(55.02,J,.02,"E")),1:"")
27 ...S GSOL=GSOL_$S(GADDI'="":";"_GADDI,1:"")
28 ...S GY=GY+1,GY(GY)=$S($L(GSOL)>60:$E(GSOL,1,60)_"...",1:GSOL)_"^"_GVOL_"^"_GTYP_"^"_GRATE
29 K GARY,^TMP("DILIST",$J) Q
Note: See TracBrowser for help on using the repository browser.