source: WorldVistAEHR/trunk/r/GEN_MED_OTHER-GMV/GMVWT1.m@ 724

Last change on this file since 724 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 3.3 KB
Line 
1GMVWT1 ;HIOFO/YH,FT-KYOCERA WEIGHT GRAPH - GRAPH DATA ;9/30/02 15:27
2 ;;5.0;GEN. MED. REC. - VITALS;;Oct 31, 2002
3 ;
4 ; This routine uses the following IAs:
5 ; #10061 - ^VADPT calls (supported)
6 ;
7GRAPH ;
8 D DEM^VADPT,INP^VADPT S SSN=$P(VADM(2),"^",2)
9 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)=""
10 S GTNM=0 F X=0:0 S X=$O(^TMP($J,"GDT",X)) Q:X'>0 S GTNM=GTNM+1
11 S GPG=$S(GTNM=0:1,1:GTNM\10+''(GTNM#10)),GDT1=0,GINI=0.4
12 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
13 D KVAR^VADPT K VA Q
14PAGE 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")'=""
15 I $D(GMRQUAL) D LEGEND^GMVLGQU
16 K GG,I,J,GMRQUAL,GSYNO Q
17SETV 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:" ")
18 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:" ")
19 S GMVRMBD=$S('(VAIN(5)=""):"Room: "_$P(VAIN(5),"-",1,2),1:"Room: "),GMVDOB=$S($D(GDOB)&($D(GAGE)):GDOB_" ("_GAGE_")",1:" ")
20 I '$D(GMRVHLOC) S GMRVHLOC=$$HOSPLOC^GMVUTL1(+$G(VAIN(4)))
21 S GMRDIV="Division: "_$$DIVISION^GMVUTL1(+GMRVHLOC)
22 Q
23DATE 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
24 Q
25DATE1 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
26 Q
27SETD 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
28 Q
29SETP ;INITIALIZE ^TMP FOR HEIGHT AND WEIGHT
30 ;100+I - WEIGHT IN LB 120+I - WEIGHT IN KG
31 ;140+I - WEIGHT GRAPH POSITION 160+I - "W" OR "W**"
32 ;180+I - QUALIFIERS 300+I - HEIGHT 320+I - HEIGHT IN CM
33 ;210+I - BODY MASS INDEX 340+I - HEIGHT QUALIFIER
34 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)))=""
35 Q
36SETA ;
37 I GK="Unavailable" S GK="Unavail"
38 S (GMRSITE,GMRSITE(1),GMRSITE(2),GMRINF,GMRVJ)=""
39 I GK'="" D
40 . S GMRSITE(1)=$P($G(^TMP($J,"GMRVG",GI,GDT1,GK)),"^"),GMRVJ=$P($G(^(GK)),"^",2),GMRINF=$P($G(^(GK)),"^",4)
41 . I GMRSITE(1)'="" D SYNOARY^GMVLGQU
42 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
43 S ^TMP($J,"GMRK","G"_(180+GCNTD))=GMRSITE
44 S ^TMP($J,"GMRK","G"_(100+GCNTD))=GK,^TMP($J,"GMRK","G"_(120+GCNTD))=$S(GK>0:$J(GK/2.2,0,2),1:"")
45 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"
46 I GK>0 D
47 . S GMRBMI="",GMRBMI(1)=GDT1,GMRBMI(2)=GK D CALBMI^GMVBMI(.GMRBMI)
48 . S ^TMP($J,"GMRK","G"_(210+GCNTD))=$S(GMRBMI>0:GMRBMI,1:"") K GMRBMI
49 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**"
50 Q
Note: See TracBrowser for help on using the repository browser.