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

GMRVWT1.m

Go to the documentation of this file.
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