GMVSR2 ;HIOFO/YH,FT-PATIENT VITAL SIGNS-I/O SF 511 GRAPH - 2 ;11/6/01 16:01
;;5.0;GEN. MED. REC. - VITALS;;Oct 31, 2002
;
; This routine uses the following IAs:
; <None>
;
SETT ; SET GMRT
S GMRT(1)=$S(GMRTY="B":"BLOOD PRESSURE",GMRTY="P":"PULSE",GMRTY="R":"RESPIRATION",GMRTY="T":"TEMPERATURE",GMRTY="H":"HEIGHT",GMRTY="W":"WEIGHT",GMRTY="CG":"CIRCUMFERENCE/GIRTH",GMRTY="PO2":"PULSE OXIMETRY",1:"")
I GMRT(1)="" S GMRT(1)=$S(GMRTY="CVP":"CENTRAL VENOUS PRESSURE",1:"")
I GMRT(1)="" S GMRT(1)=$S(GMRTY="PN":"PAIN",1:"")
Q:GMRT(1)=""
S GMRT=$O(^GMRD(120.51,"B",GMRT(1),""))
I GMRT>0 F GMRX=GMRS:0 S GMRX=$O(^GMR(120.5,"AA",DFN,GMRT,GMRX)) Q:GMRX>GMRQ!(GMRX'>0) F GMREN=0:0 S GMREN=$O(^GMR(120.5,"AA",DFN,GMRT,GMRX,GMREN)) Q:GMREN'>0 I '$D(^GMR(120.5,GMREN,2)) D BLDARR
Q
BLDARR ; BUILD DATA ARRAY
S GMRDAT=$S($D(^GMR(120.5,GMREN,0)):^(0),1:""),GMRVX=GMRTY,GMRVX(0)=$P(GMRDAT,"^",8) D:GMRVX(0)>0!(GMRVX(0)<0)!($E(GMRVX(0))="0") EN1^GMVSAS0
K GMRVARY S GMRVARY="" I $P($G(^GMR(120.5,GMREN,5,0)),"^",4)>0 D CHAR^GMVCHAR(GMREN,.GMRVARY,GMRT)
K GG S GG="" I $O(GMRVARY(0)) D
. S GG(1)=0 F S GG(1)=$O(GMRVARY(GG(1))) Q:GG(1)'>0 S GG(2)=0 F S GG(2)=$O(GMRVARY(GG(1),GG(2))) Q:GG(2)'>0 S GG(3)="" F S GG(3)=$O(GMRVARY(GG(1),GG(2),GG(3))) Q:GG(3)="" S GG=GG_$S(GG="":"",1:";")_GG(3)
S ^TMP($J,"GMR",GMRTY,9999999-GMRX,$P(GMRDAT,"^",8))=GG_"^"_$S('$D(GMRVX(1)):"",'GMRVX(1):"",1:1)_"^^"_$P(GMRDAT,"^",10)
K GG Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HGMVSR2 1449 printed Oct 16, 2024@18:00:39 Page 2
GMVSR2 ;HIOFO/YH,FT-PATIENT VITAL SIGNS-I/O SF 511 GRAPH - 2 ;11/6/01 16:01
+1 ;;5.0;GEN. MED. REC. - VITALS;;Oct 31, 2002
+2 ;
+3 ; This routine uses the following IAs:
+4 ; <None>
+5 ;
SETT ; SET GMRT
+1 SET GMRT(1)=$SELECT(GMRTY="B":"BLOOD PRESSURE",GMRTY="P":"PULSE",GMRTY="R":"RESPIRATION",GMRTY="T":"TEMPERATURE",GMRTY="H":"HEIGHT",GMRTY="W":"WEIGHT",GMRTY="CG":"CIRCUMFERENCE/GIRTH",GMRTY="PO2":"PULSE OXIMETRY",1:"")
+2 IF GMRT(1)=""
SET GMRT(1)=$SELECT(GMRTY="CVP":"CENTRAL VENOUS PRESSURE",1:"")
+3 IF GMRT(1)=""
SET GMRT(1)=$SELECT(GMRTY="PN":"PAIN",1:"")
+4 if GMRT(1)=""
QUIT
+5 SET GMRT=$ORDER(^GMRD(120.51,"B",GMRT(1),""))
+6 IF GMRT>0
FOR GMRX=GMRS:0
SET GMRX=$ORDER(^GMR(120.5,"AA",DFN,GMRT,GMRX))
if GMRX>GMRQ!(GMRX'>0)
QUIT
FOR GMREN=0:0
SET GMREN=$ORDER(^GMR(120.5,"AA",DFN,GMRT,GMRX,GMREN))
if GMREN'>0
QUIT
IF '$DATA(^GMR(120.5,GMREN,2))
DO BLDARR
+7 QUIT
BLDARR ; BUILD DATA ARRAY
+1 SET GMRDAT=$SELECT($DATA(^GMR(120.5,GMREN,0)):^(0),1:"")
SET GMRVX=GMRTY
SET GMRVX(0)=$PIECE(GMRDAT,"^",8)
if GMRVX(0)>0!(GMRVX(0)<0)!($EXTRACT(GMRVX(0))="0")
DO EN1^GMVSAS0
+2 KILL GMRVARY
SET GMRVARY=""
IF $PIECE($GET(^GMR(120.5,GMREN,5,0)),"^",4)>0
DO CHAR^GMVCHAR(GMREN,.GMRVARY,GMRT)
+3 KILL GG
SET GG=""
IF $ORDER(GMRVARY(0))
Begin DoDot:1
+4 SET GG(1)=0
FOR
SET GG(1)=$ORDER(GMRVARY(GG(1)))
if GG(1)'>0
QUIT
SET GG(2)=0
FOR
SET GG(2)=$ORDER(GMRVARY(GG(1),GG(2)))
if GG(2)'>0
QUIT
SET GG(3)=""
FOR
SET GG(3)=$ORDER(GMRVARY(GG(1),GG(2),GG(3)))
if GG(3)=""
QUIT
SET GG=GG_$SELECT(GG="":"",1:";")_GG(3)
End DoDot:1
+5 SET ^TMP($JOB,"GMR",GMRTY,9999999-GMRX,$PIECE(GMRDAT,"^",8))=GG_"^"_$SELECT('$DATA(GMRVX(1)):"",'GMRVX(1):"",1:1)_"^^"_$PIECE(GMRDAT,"^",10)
+6 KILL GG
QUIT