source: WorldVistAEHR/trunk/r/GEN_MED_OTHER-GMV/GMVGGR2.m@ 846

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

initial load of WorldVistAEHR

File size: 3.7 KB
Line 
1GMVGGR2 ;HOIFO/YH,FT-SET ^TMP($J) GLOBAL ;9/30/02 14:58
2 ;;5.0;GEN. MED. REC. - VITALS;**3**;Oct 31, 2002
3 ;CONTINUTATION OF GMVGGR1
4 ;
5 ; This routine uses the following IAs:
6 ; #10061 - ^VADPT calls (supported)
7 ;
8GRAPH ;
9 D:GMR=0 SETV
10 I '$D(^TMP($J,"GMRVG")) S GN=GN+1,^TMP($J,GN)="NO DATA",RESULT=$NA(^TMP($J)) Q
11 K GMRQUAL S GDT=0 F S GDT=$O(^TMP($J,"GMRVG",GDT)) Q:GDT'>0 D
12 . S:GMR=0 GN=GN+1,^TMP($J,GN)="^^^^^^^^^^^^^^^^^^^^^" D DATE
13 . S GI="" F S GI=$O(^TMP($J,"GMRVG",GDT,GI)) Q:GI="" D
14 . . S GK="" F S GK=$O(^TMP($J,"GMRVG",GDT,GI,GK)) Q:GK="" D SETA
15 D KVAR^VADPT K VA
16 ;RETURN CALL ROUTINE WITH QUALIFIERS
17 I GMR=1,$D(GMRQUAL) D
18 . S (GQ,GQ(1))=""
19 . F S GQ=$O(GMRQUAL(GQ)) Q:GQ="" D
20 . . S I=0,GQ(1)=$S(GQ="T":"TEMPERATURE",GQ="P":"PULSE",GQ="R":"RESPIRATION",GQ="B":"BLOOD PRESSURE",GQ="H":"HEIGHT",GQ="W":"WEIGHT",GQ="CVP":"CVP",GQ="PO2":"PULSE OXIMETRY",GQ="CG":"CIRCUMFERENCE/GIRTH",1:"")
21 . . Q:GQ(1)="" S GN=GN+1,^TMP($J,GN)=GQ(1)_"--- "
22 . . S GQ(2)="" F S GQ(2)=$O(GMRQUAL(GQ,GQ(2))) Q:GQ(2)="" S I=I+1 S:I>1 ^TMP($J,GN)=^(GN)_"," S ^TMP($J,GN)=^TMP($J,GN)_" "_GQ(2)
23 K GQ,GG,GI,GMRVJ,GSYNO,GHOLD,GLINE,GMRQUAL
24 K ^TMP($J,"GMR"),^TMP($J,"GMRVG")
25 S RESULT=$NA(^TMP($J))
26 Q
27SETV ;Set patient data in ^TMP($J,"GMRK" global
28 D DEM^VADPT,INP^VADPT
29 S GN=1,^TMP($J,GN)=$S(VADM(1)'="":VADM(1),1:" ")_" "_$S(VADM(2)'="":$P(VADM(2),"^",2),1:" ")_" "_$S($D(VADM(3)):$P(VADM(3),"^",2),1:" ")_" "_$S($D(VADM(4)):VADM(4),1:" ")_" (Yrs)"
30 S ^TMP($J,GN)=^(GN)_" "_$S($D(VADM(5)):$P(VADM(5),"^",2),1:" ")
31 S GN=2,^TMP($J,GN)="Unit: "_$P($G(VAIN(4)),"^",2)_" Room: "_$P($G(VAIN(5)),"-",1,2)
32 I '$D(GMRVHLOC) S GMRVHLOC=$$HOSPLOC^GMVUTL1(+$G(VAIN(4)))
33 S GN=3,^TMP($J,GN)="Division: "_$$DIVISION^GMVUTL1(+GMRVHLOC)
34 S GN=4,^TMP($J,GN)=GSTRFIN
35 Q
36DATE S:GMR=0 $P(^TMP($J,GN),"^")=$E(GDT,4,5)_"-"_$E(GDT,6,7)_"-"_$E(GDT,2,3)
37 S:GMR=0 Y=$E($P(GDT,".",2)_"000000",1,6),$P(^TMP($J,GN),"^",2)=$E(Y,1,2)_":"_$E(Y,3,4)_":"_$E(Y,5,6)
38 Q
39SETA ;Store measurements in ^TMP($J, global
40 N GMVNODE
41 S GMVNODE=$G(^TMP($J,"GMRVG",GDT,GI,GK))
42 S $P(^TMP($J,GN),"^",22)=$P(GMVNODE,U,5)
43 S $P(^TMP($J,GN),"^",23)=$P(GMVNODE,U,6)
44 S GK(1)=GK
45 I GK(1)="Unavailable" S GK(1)="Unavail"
46 I GI="I" S:GMR=0 $P(^TMP($J,GN),"^",17)=GK(1) Q
47 I GI="O" S:GMR=0 $P(^TMP($J,GN),"^",18)=GK(1) Q
48 I GI="PN" S:GMR=0 $P(^TMP($J,GN),"^",19)=GK(1) Q
49 S (GMRSITE,GMRSITE(1),GINF,GMRVJ)=""
50 I GK(1)'="" D Q:GMR=1
51 . S GMRSITE(1)=$P(GMVNODE,U,1),GMRVJ=$P(GMVNODE,U,2),GINF=$P(GMVNODE,U,4)
52 . I GMRSITE(1)'="" D SYNOARY^GMVLGQU
53 I GI="R" S $P(^TMP($J,GN),"^",5)=GK(1)_$S(GMRVJ=1:"*",1:"")_"- "_GMRSITE Q
54 I GI="H" D Q
55 . S $P(^TMP($J,GN),"^",11)=GK(1)_"- "_GMRSITE,$P(^TMP($J,GN),"^",12)=$S(GK(1)>0:$J(GK(1)*2.54,0,2),1:"") S:GK(1)>0 GMRHT=(GK(1)*2.54)/100
56 I GI="PO2" D Q
57 . S (GINF(1),GINF(2))="" I GINF'="" D PO2^GMVLGQU(.GINF)
58 . S $P(^TMP($J,GN),"^",6)=GK(1)_$S(GMRVJ=1:"*",1:"")_"- "_GMRSITE_"-"_GINF(1)_"-"_GINF(2)
59 I GI="CVP" D Q
60 . S $P(^TMP($J,GN),"^",15)=$S(GK(1)>0!(GK(1)<0):$J(GK(1),0,1),1:GK(1))_$S(GMRVJ=1:"*",1:"")
61 . S $P(^TMP($J,GN),"^",16)=$S(GK(1)>0!(GK(1)<0)!($E(GK(1))="0"):$J(GK(1)/1.36,0,1),1:"")_$S(GMRVJ=1:"*",1:"")
62 I GI="CG" D Q
63 . S $P(^TMP($J,GN),"^",13)=GK(1)_"- "_GMRSITE,$P(^TMP($J,GN),"^",14)=$S(GK(1)>0:$J(GK(1)/.3937,0,2),1:"")
64 I GI="B",GK(1)'="" S $P(^TMP($J,GN),"^",7)=GK(1)_$S(GMRVJ=1:"*",1:"")_"- "_GMRSITE
65 I GI="W" S $P(^TMP($J,GN),"^",8)=GK(1)_"- "_GMRSITE,$P(^(GN),"^",9)=$S(GK(1)>0:$J(GK(1)*.45359237,0,2),1:"")
66 I GK(1)>0,GI="W" D Q
67 . S GHOLD=GI,GMRBMI="",GMRBMI(1)=GDT,GMRBMI(2)=GK(1) D CALBMI^GMVBMI(.GMRBMI) S GI=GHOLD
68 . S $P(^TMP($J,GN),"^",10)=GMRBMI K GMRBMI
69 I GI="T" S $P(^TMP($J,GN),"^",3)=GK(1)_$S(GMRVJ=1:"*",1:"")_"- "_GMRSITE Q
70 I GI="P" S $P(^TMP($J,GN),"^",4)=GK(1)_$S(GMRVJ=1:"*",1:"")_"- "_GMRSITE
71 Q
Note: See TracBrowser for help on using the repository browser.