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

GMRYPSIV.m

Go to the documentation of this file.
GMRYPSIV ;HIRMFO/YH-DISPLAY ACTIVE PATIENT IV ORDER ;5/22/96
 ;;4.0;Intake/Output;;Apr 25, 1997
GETIV(GDFN,GTYP,GY) ;
 ;INPUT VARIABLES:
 ;GDFN - DFN. POINTER TO THE PATIENT FILE (#2).
 ;GTYP -TYPE OF IV - 'A' FOR ADMIXTURE
 ;                   'B' FOR BLOOD/BLOOD PRODUCT
 ;                   'H' FOR HYPERAL
 ;                   'P' FOR PIGGYBACK
 ;OUTPUT ARRAY
 ;GY - CONTAINS ACTIVE IV ORDER INFORMATION
 N I,J,GSOL,GRATE,GVOL,GADDI S GY=0
 ;GET IV Sub-File (#55.01) ORDER NUMBER AND STATUS LISTING FOR A SELECTED 
 ;PATIENT.
 D LIST^DIC(55.01,","_GDFN_",",".01;100;","","","","","","","") I '$D(^TMP("DILIST",$J)) Q
 ;GET ORDER NUMBER, START DATE/TIME, TYPE, INFUSION RATE, SOLUTION AND
 ;ADDITIVES FOR EACH ACTIVE IV ORDER
 S I=0 F  S I=$O(^TMP("DILIST",$J,"ID",I)) Q:I'>0  D
 .I +$G(^TMP("DILIST",$J,"ID",I,.01))>0,$G(^TMP("DILIST",$J,"ID",I,100))["ACTIVE" D
 ..S I(1)=+^TMP("DILIST",$J,"ID",I,.01),I(2)=I(1)_","_GDFN_","
 ..K GARY D GETS^DIQ(55.01,I(2),".01;.02;.04;.08;1*;3*;","E","GARY")
 ..I $E($G(GARY(55.01,I(2),.04,"E")))=GTYP D  ;TYPE OF SOLUTION
 ...S GRATE=$G(GARY(55.01,I(2),.08,"E")) ;INFUSION RATE
 ...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"))
 ...S (GADDI,J)="" F  S J=$O(GARY(55.02,J)) Q:J=""  D
 ....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:"")
 ...S GSOL=GSOL_$S(GADDI'="":";"_GADDI,1:"")
 ...S GY=GY+1,GY(GY)=$S($L(GSOL)>60:$E(GSOL,1,60)_"...",1:GSOL)_"^"_GVOL_"^"_GTYP_"^"_GRATE
 K GARY,^TMP("DILIST",$J) Q