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

GMRVPS11.m

Go to the documentation of this file.
GMRVPS11 ;HIRMFO/NCA - Convert Oximetry Supplemental Data ;7/18/96
 ;;4.0;Vitals/Measurements;**11**;Apr 25, 1997
EN1 ; Convert if data is stored #% # l/min
 Q:$$PATCH^XPDUTL("GMRV*4.0*11*")
 N GMRVL,GMRX,GMRX1,GMRX2,GMRX3,GMRVOK,GMRVPO S GMRVOK=0
 F GMRVL=0:0 S GMRVL=$O(^GMR(120.5,GMRVL)) Q:GMRVL<1  S GMRVPO=$P($G(^(GMRVL,0)),"^",10) D CONV S:GMRVOK $P(^GMR(120.5,GMRVL,0),"^",10)=GMRVPO
 Q
CONV ; Process Data Convert
 S GMRVOK=0
 Q:GMRVPO=""
 I GMRVPO'["l/min" D  Q
 .I GMRVPO["%" S GMRX=+GMRVPO,GMRX1=$P(GMRVPO,GMRX,2) S:$E(GMRX1,1)=" " GMRX1=$TR(GMRX1," ",""),GMRVPO=GMRX_GMRX1,GMRVOK=1
 .Q
 I GMRVPO["l/min" D
 .S GMRX=$F(GMRVPO,"%") I 'GMRX S:$E(GMRVPO,$L(GMRVPO))=" " GMRVOK=1,GMRVPO=$E(GMRVPO,1,$L(GMRVPO)-1) Q
 .S GMRX1=$F(GMRVPO,"l/min") Q:'GMRX1
 .I GMRX<GMRX1 D
 ..S GMRVOK=1
 ..S GMRX2=$E(GMRVPO,1,GMRX-1),GMRX3=$E(GMRVPO,GMRX+1,GMRX1-1)
 ..S:GMRX2[" " GMRX2=$TR(GMRX2," ","")
 ..S GMRVPO=GMRX3_" "_GMRX2
 ..Q
 .I GMRX>GMRX1 D
 ..S GMRX2=$P(GMRVPO,"l/min ",2) Q:'GMRX2
 ..I GMRX2[" " S GMRVOK=1,GMRX2=$TR(GMRX2," ",""),$P(GMRVPO,"l/min ",2)=GMRX2
 ..Q
 .Q
 Q