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

GMVWT1.m

Go to the documentation of this file.
GMVWT1 ;HIOFO/YH,FT-KYOCERA WEIGHT GRAPH - GRAPH DATA ;9/30/02  15:27
 ;;5.0;GEN. MED. REC. - VITALS;;Oct 31, 2002
 ;
 ; This routine uses the following IAs:
 ; #10061 - ^VADPT calls           (supported)
 ;
GRAPH ;
 D DEM^VADPT,INP^VADPT S SSN=$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 ^GMVWT2,^GMVWT3,^GMVWT4 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^GMVLGQU
 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=$$HOSPLOC^GMVUTL1(+$G(VAIN(4)))
 S GMRDIV="Division: "_$$DIVISION^GMVUTL1(+GMRVHLOC)
 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^GMVLGQU
 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^GMVBMI(.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