GMRVWT1 ;HIRMFO/YH-KYOCERA WEIGHT GRAPH - GRAPH DATA ;5/14/97
;;4.0;Vitals/Measurements;**1**;Apr 25, 1997
GRAPH ;
D DEM^VADPT,INP^VADPT S SNN=$P(VADM(2),"^",2)
S GPG=0 D SETV F GK="H","W" S ^TMP($J,"GTNM",GK)=0 F GI=0:0 S GI=$O(^TMP($J,"GMRVG",GK,GI)) Q:GI'>0 S GJ="" F X=0:0 S GJ=$O(^TMP($J,"GMRVG",GK,GI,GJ)) Q:GJ="" S ^TMP($J,"GTNM",GK)=^TMP($J,"GTNM",GK)+1,^TMP($J,"GDT",GI)=""
S GTNM=0 F X=0:0 S X=$O(^TMP($J,"GDT",X)) Q:X'>0 S GTNM=GTNM+1
S GPG=$S(GTNM=0:1,1:GTNM\10+''(GTNM#10)),GDT1=0,GINI=0.4
F GPGS=1:1:GPG K GMRQUAL S ^TMP($J,"GMRK","G199")="Page "_GPGS D SETP,DATE,PAGE D ^GMRVWT2,^GMRVWT3,^GMRVWT4 S GINI=0.4
D KVAR^VADPT K VA Q
PAGE I ^TMP($J,"GMRK","G141")="" F GI=2:1:10 S ^TMP($J,"GMRK","G141")=^TMP($J,"GMRK","G"_(140+GI)),GINI=GINI+1.6 Q:^TMP($J,"GMRK","G141")'=""
I $D(GMRQUAL) D LEGEND^GMRVLGQU
K GG,I,J,GMRQUAL,GSYNO Q
SETV S GMVNM=$S(VADM(1)'="":VADM(1),1:" ")_" "_$S(VADM(2)'="":$P(VADM(2),"^",2),1:" "),GDOB=$S($D(VADM(3)):$P(VADM(3),"^",2),1:" "),GAGE=$S($D(VADM(4)):VADM(4),1:" ")
S GMVGEN=$S($D(VADM(5)):$P(VADM(5),"^",2),1:" "),GMVWRD=$S($D(GMRWARD(1)):"Unit: "_GMRWARD(1),1:"Unit: "),GMVDIAG=$S(VAIN(9)'="":$P(VAIN(9),"^"),1:" ")
S GMVRMBD=$S('(VAIN(5)=""):"Room: "_$P(VAIN(5),"-",1,2),1:"Room: "),GMVDOB=$S($D(GDOB)&($D(GAGE)):GDOB_" ("_GAGE_")",1:" ")
I '$D(GMRVHLOC) S GMRVHLOC=$P($G(^DIC(42,+$G(VAIN(4)),44)),"^")
S GMRDIV="Division: "_$S(GMRVHLOC>0:$$GET1^DIQ(4,+$$GET1^DIQ(44,+GMRVHLOC,3,"I"),.01,"I"),1:"")
Q
DATE F GCNTD=1:1:10 S:$L(GDT1) GDT1=$O(^TMP($J,"GDT",GDT1)) S ^TMP($J,"GMRK","G"_GCNTD)=$S($L(GDT1):$E(GDT1,4,5)_"-"_$E(GDT1,6,7)_"-"_$E(GDT1,2,3),1:"") D DATE1
Q
DATE1 S Y=$E($P(GDT1,".",2)_"0000",1,4),^TMP($J,"GMRK","G"_(GCNTD+16))=$S($L(GDT1):$E(Y,1,2)_":"_$E(Y,3,4),1:"") D SETD
Q
SETD F GI="H","W" S GJ=$S(GI="W":100,1:160),GK=$S($L(GDT1):$O(^TMP($J,"GMRVG",GI,GDT1,"")),1:"") D SETA
Q
SETP ;INITIALIZE ^TMP FOR HEIGHT AND WEIGHT
;100+I - WEIGHT IN LB 120+I - WEIGHT IN KG
;140+I - WEIGHT GRAPH POSITION 160+I - "W" OR "W**"
;180+I - QUALIFIERS 300+I - HEIGHT 320+I - HEIGHT IN CM
;210+I - BODY MASS INDEX 340+I - HEIGHT QUALIFIER
F I=1:1:10 S (^TMP($J,"GMRK","G"_(100+I)),^("G"_(120+I)),^("G"_(140+I)),^("G"_(160+I)),^("G"_(180+I)),^("G"_(300+I)),^("G"_(320+I)),^("G"_(210+I)),^("G"_(340+I)))=""
Q
SETA ;
I GK="Unavailable" S GK="Unavail"
S (GMRSITE,GMRSITE(1),GMRSITE(2),GMRINF,GMRVJ)=""
I GK'="" D
. S GMRSITE(1)=$P($G(^TMP($J,"GMRVG",GI,GDT1,GK)),"^"),GMRVJ=$P($G(^(GK)),"^",2),GMRINF=$P($G(^(GK)),"^",4)
. I GMRSITE(1)'="" D SYNOARY^GMRVLGQU
I GI="H" S ^TMP($J,"GMRK","G"_(300+GCNTD))=GK,^("G"_(340+GCNTD))=GMRSITE,^TMP($J,"GMRK","G"_(320+GCNTD))=$S(GK>0:$J(GK*2.54,0,2),1:"") S:GK>0 GMRHT=GK*2.54/100 Q
S ^TMP($J,"GMRK","G"_(180+GCNTD))=GMRSITE
S ^TMP($J,"GMRK","G"_(100+GCNTD))=GK,^TMP($J,"GMRK","G"_(120+GCNTD))=$S(GK>0:$J(GK/2.2,0,2),1:"")
S ^TMP($J,"GMRK","G"_(140+GCNTD))=$S(GK>0:+$P(GWT(1),"/")-GK+10/5,1:"") S:GK>0 ^TMP($J,"GMRK","G"_(160+GCNTD))="W"
I GK>0 D
. S GMRBMI="",GMRBMI(1)=GDT1,GMRBMI(2)=GK D CALBMI^GMRVBMI(.GMRBMI)
. S ^TMP($J,"GMRK","G"_(210+GCNTD))=$S(GMRBMI>0:GMRBMI,1:"") K GMRBMI
I GK>0 S ^TMP($J,"GMRK","G"_(140+GCNTD))=$S(^TMP($J,"GMRK","G"_(140+GCNTD))<1.4:1.3,^("G"_(140+GCNTD))>17.5:17.6,1:^("G"_(140+GCNTD))) S:^("G"_(140+GCNTD))<1.4!(^("G"_(140+GCNTD))>17.5) ^TMP($J,"GMRK","G"_(160+GCNTD))="W**"
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HGMRVWT1 3399 printed Dec 13, 2024@01:57:49 Page 2
GMRVWT1 ;HIRMFO/YH-KYOCERA WEIGHT GRAPH - GRAPH DATA ;5/14/97
+1 ;;4.0;Vitals/Measurements;**1**;Apr 25, 1997
GRAPH ;
+1 DO DEM^VADPT
DO INP^VADPT
SET SNN=$PIECE(VADM(2),"^",2)
+2 SET GPG=0
DO SETV
FOR GK="H","W"
SET ^TMP($JOB,"GTNM",GK)=0
FOR GI=0:0
SET GI=$ORDER(^TMP($JOB,"GMRVG",GK,GI))
if GI'>0
QUIT
SET GJ=""
FOR X=0:0
SET GJ=$ORDER(^TMP($JOB,"GMRVG",GK,GI,GJ))
if GJ=""
QUIT
SET ^TMP($JOB,"GTNM",GK)=^TMP($JOB,"GTNM",GK)+1
SET ^TMP($JOB,"GDT",GI)=""
+3 SET GTNM=0
FOR X=0:0
SET X=$ORDER(^TMP($JOB,"GDT",X))
if X'>0
QUIT
SET GTNM=GTNM+1
+4 SET GPG=$SELECT(GTNM=0:1,1:GTNM\10+''(GTNM#10))
SET GDT1=0
SET GINI=0.4
+5 FOR GPGS=1:1:GPG
KILL GMRQUAL
SET ^TMP($JOB,"GMRK","G199")="Page "_GPGS
DO SETP
DO DATE
DO PAGE
DO ^GMRVWT2
DO ^GMRVWT3
DO ^GMRVWT4
SET GINI=0.4
+6 DO KVAR^VADPT
KILL VA
QUIT
PAGE IF ^TMP($JOB,"GMRK","G141")=""
FOR GI=2:1:10
SET ^TMP($JOB,"GMRK","G141")=^TMP($JOB,"GMRK","G"_(140+GI))
SET GINI=GINI+1.6
if ^TMP($JOB,"GMRK","G141")'=""
QUIT
+1 IF $DATA(GMRQUAL)
DO LEGEND^GMRVLGQU
+2 KILL GG,I,J,GMRQUAL,GSYNO
QUIT
SETV SET GMVNM=$SELECT(VADM(1)'="":VADM(1),1:" ")_" "_$SELECT(VADM(2)'="":$PIECE(VADM(2),"^",2),1:" ")
SET GDOB=$SELECT($DATA(VADM(3)):$PIECE(VADM(3),"^",2),1:" ")
SET GAGE=$SELECT($DATA(VADM(4)):VADM(4),1:" ")
+1 SET GMVGEN=$SELECT($DATA(VADM(5)):$PIECE(VADM(5),"^",2),1:" ")
SET GMVWRD=$SELECT($DATA(GMRWARD(1)):"Unit: "_GMRWARD(1),1:"Unit: ")
SET GMVDIAG=$SELECT(VAIN(9)'="":$PIECE(VAIN(9),"^"),1:" ")
+2 SET GMVRMBD=$SELECT('(VAIN(5)=""):"Room: "_$PIECE(VAIN(5),"-",1,2),1:"Room: ")
SET GMVDOB=$SELECT($DATA(GDOB)&($DATA(GAGE)):GDOB_" ("_GAGE_")",1:" ")
+3 IF '$DATA(GMRVHLOC)
SET GMRVHLOC=$PIECE($GET(^DIC(42,+$GET(VAIN(4)),44)),"^")
+4 SET GMRDIV="Division: "_$SELECT(GMRVHLOC>0:$$GET1^DIQ(4,+$$GET1^DIQ(44,+GMRVHLOC,3,"I"),.01,"I"),1:"")
+5 QUIT
DATE FOR GCNTD=1:1:10
if $LENGTH(GDT1)
SET GDT1=$ORDER(^TMP($JOB,"GDT",GDT1))
SET ^TMP($JOB,"GMRK","G"_GCNTD)=$SELECT($LENGTH(GDT1):$EXTRACT(GDT1,4,5)_"-"_$EXTRACT(GDT1,6,7)_"-"_$EXTRACT(GDT1,2,3),1:"")
DO DATE1
+1 QUIT
DATE1 SET Y=$EXTRACT($PIECE(GDT1,".",2)_"0000",1,4)
SET ^TMP($JOB,"GMRK","G"_(GCNTD+16))=$SELECT($LENGTH(GDT1):$EXTRACT(Y,1,2)_":"_$EXTRACT(Y,3,4),1:"")
DO SETD
+1 QUIT
SETD FOR GI="H","W"
SET GJ=$SELECT(GI="W":100,1:160)
SET GK=$SELECT($LENGTH(GDT1):$ORDER(^TMP($JOB,"GMRVG",GI,GDT1,"")),1:"")
DO SETA
+1 QUIT
SETP ;INITIALIZE ^TMP FOR HEIGHT AND WEIGHT
+1 ;100+I - WEIGHT IN LB 120+I - WEIGHT IN KG
+2 ;140+I - WEIGHT GRAPH POSITION 160+I - "W" OR "W**"
+3 ;180+I - QUALIFIERS 300+I - HEIGHT 320+I - HEIGHT IN CM
+4 ;210+I - BODY MASS INDEX 340+I - HEIGHT QUALIFIER
+5 FOR I=1:1:10
SET (^TMP($JOB,"GMRK","G"_(100+I)),^("G"_(120+I)),^("G"_(140+I)),^("G"_(160+I)),^("G"_(180+I)),^("G"_(300+I)),^("G"_(320+I)),^("G"_(210+I)),^("G"_(340+I)))=""
+6 QUIT
SETA ;
+1 IF GK="Unavailable"
SET GK="Unavail"
+2 SET (GMRSITE,GMRSITE(1),GMRSITE(2),GMRINF,GMRVJ)=""
+3 IF GK'=""
Begin DoDot:1
+4 SET GMRSITE(1)=$PIECE($GET(^TMP($JOB,"GMRVG",GI,GDT1,GK)),"^")
SET GMRVJ=$PIECE($GET(^(GK)),"^",2)
SET GMRINF=$PIECE($GET(^(GK)),"^",4)
+5 IF GMRSITE(1)'=""
DO SYNOARY^GMRVLGQU
End DoDot:1
+6 IF GI="H"
SET ^TMP($JOB,"GMRK","G"_(300+GCNTD))=GK
SET ^("G"_(340+GCNTD))=GMRSITE
SET ^TMP($JOB,"GMRK","G"_(320+GCNTD))=$SELECT(GK>0:$JUSTIFY(GK*2.54,0,2),1:"")
if GK>0
SET GMRHT=GK*2.54/100
QUIT
+7 SET ^TMP($JOB,"GMRK","G"_(180+GCNTD))=GMRSITE
+8 SET ^TMP($JOB,"GMRK","G"_(100+GCNTD))=GK
SET ^TMP($JOB,"GMRK","G"_(120+GCNTD))=$SELECT(GK>0:$JUSTIFY(GK/2.2,0,2),1:"")
+9 SET ^TMP($JOB,"GMRK","G"_(140+GCNTD))=$SELECT(GK>0:+$PIECE(GWT(1),"/")-GK+10/5,1:"")
if GK>0
SET ^TMP($JOB,"GMRK","G"_(160+GCNTD))="W"
+10 IF GK>0
Begin DoDot:1
+11 SET GMRBMI=""
SET GMRBMI(1)=GDT1
SET GMRBMI(2)=GK
DO CALBMI^GMRVBMI(.GMRBMI)
+12 SET ^TMP($JOB,"GMRK","G"_(210+GCNTD))=$SELECT(GMRBMI>0:GMRBMI,1:"")
KILL GMRBMI
End DoDot:1
+13 IF GK>0
SET ^TMP($JOB,"GMRK","G"_(140+GCNTD))=$SELECT(^TMP($JOB,"GMRK","G"_(140+GCNTD))<1.4:1.3,^("G"_(140+GCNTD))>17.5:17.6,1:^("G"_(140+GCNTD)))
if ^("G"_(140+GCNTD))<1.4!(^("G"_(140+GCNTD))>17.5)
SET ^TMP($JOB,"GMRK","G"_(160+GCNTD))="W**"
+14 QUIT