source: WorldVistAEHR/trunk/r/GEN_MED_REC_VITALS-GMRV/GMRVGR1.m@ 1432

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

initial load of WorldVistAEHR

File size: 6.4 KB
RevLine 
[613]1GMRVGR1 ;HIRMFO/YH-SET ^TMP($J) GLOBAL ;5/5/99 11:33
2 ;;4.0;Vitals/Measurements;**1,9,11**;Apr 25, 1997
3 ;CONTINUTATION OF GMRVGR0
4GRAPH S (GCNT,GCNTD,GPG)=0 D DEM^VADPT,INP^VADPT,SETV
5 F GK="H","W","T","P","R","B","I","O","PO2","CVP","CG","PN" D
6 . 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)=""
7 S GTNM=0 F X=0:0 S X=$O(^TMP($J,"GDT",X)) Q:X'>0 S GTNM=GTNM+1
8 S GPG=$S(GTNM=0:1,1:GTNM\10+''(GTNM#10)),GDT1=0
9 F GPGS=1:1:GPG D
10 . F GI=1:1:200 S ^TMP($J,"GMRK","G"_GI)=""
11 . K GMRQUAL S ^TMP($J,"GMRK","G199")="Page "_GPGS D SETP,DATE S ^TMP($J,"GMRK","G200")=GMRRMBD
12 . D PAGE,EN1^GMRVGR2,EN2^GMRVGR3,EN3^GMRVGR4,EN4^GMRVGR6 S ^TMP($J,"GMRK","G50M")=0.2,^TMP($J,"GMRK","G82M")=0.6
13 D KVAR^VADPT K VA Q
14PAGE ;Set temp. and pulse starting point in the graph
15 D SETV
16 I ^TMP($J,"GMRK","G50")="" F GI=51:1:59 S ^TMP($J,"GMRK","G50")=^TMP($J,"GMRK","G"_GI),^TMP($J,"GMRK","G50M")=0.2+(1.6*(GI-50)) Q:^TMP($J,"GMRK","G50")'=""
17 I ^TMP($J,"GMRK","G82")="" F GI=83:1:91 S ^TMP($J,"GMRK","G82")=^TMP($J,"GMRK","G"_GI),^TMP($J,"GMRK","G82M")=0.6+(1.6*(GI-82)) Q:^TMP($J,"GMRK","G82")'=""
18 I $D(GMRQUAL) D LEGEND^GMRVLGQU
19 K GG,GI,GMRVJ,GSYNO Q
20SETV ;Set patient data in ^TMP($J,"GMRK" global
21 S ^TMP($J,"GMRK","G194")=$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:" ")
22 S ^TMP($J,"GMRK","G197")=$S($D(VADM(5)):$P(VADM(5),"^",2),1:" "),^TMP($J,"GMRK","G198")=$S($D(GMRWARD(1)):"Unit: "_GMRWARD(1),1:"Unit: ")
23 S GMRRMBD=$S('(VAIN(5)=""):"Room: "_$P(VAIN(5),"-",1,2),1:"Room: "),^TMP($J,"GMRK","G196")=$S($D(GDOB)&($D(GAGE)):GDOB_" ("_GAGE_")",1:" ")
24 I '$D(GMRVHLOC) S GMRVHLOC=$P($G(^DIC(42,+$G(VAIN(4)),44)),"^")
25 S GMRDIV="Division: "_$S(GMRVHLOC>0:$$GET1^DIQ(4,+$$GET1^DIQ(44,+GMRVHLOC,3,"I"),.01,"I"),1:"")
26 Q
27DATE 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
28 Q
29DATE1 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
30 Q
31SETD F GI="H","W","T","P","R","B","I","O","C","PN" S GJ=$F("WTXPXRBIOCH",GI),GK=$S($L(GDT1):$O(^TMP($J,"GMRVG",GI,GDT1,"")),1:"") D SETA
32 F GI="PO2","CVP","CG" S GJ=0,GK=$S($L(GDT1):$O(^TMP($J,"GMRVG",GI,GDT1,"")),1:"") D SETA
33 Q
34SETA ;Store measurements in ^TMP($J,"GMRK" global
35 I GK="Unavailable" S GK="Unavail"
36 I GI="PN" S ^TMP($J,"GMRK","G"_(1660+GCNTD))=GK Q
37 S (GMRSITE,GMRSITE(1),GMRINF,GMRVJ)=""
38 I GK'="" D
39 . S GMRSITE(1)=$P($G(^TMP($J,"GMRVG",GI,GDT1,GK)),"^"),GMRVJ=$P($G(^(GK)),"^",2),GMRINF=$P($G(^(GK)),"^",4)
40 . I GMRSITE(1)'="" D SYNOARY^GMRVLGQU
41 I GI="H" D Q
42 . S ^TMP($J,"GMRK","G"_(270+GCNTD))=GK_" "_GMRSITE,^TMP($J,"GMRK","G"_(290+GCNTD))=$S(GK>0:$J(GK*2.54,0,2),1:"") S:GK>0 GMRHT=(GK*2.54)/100
43 I GI="C" S ^TMP($J,"GMRK","G"_(1640+GCNTD))=GK_" "_^TMP($J,"GMRK","G"_(1640+GCNTD)) Q
44 I GI="PO2"!(GI="CVP")!(GI="CG") D Q
45 . I GI="PO2" D
46 . . S (GMRINF(1),GMRINF(2))="" I GMRINF'="" D PO2^GMRVLGQU(.GMRINF)
47 . . S ^TMP($J,"GMRK","G"_(1100+GCNTD))=GK_$S(GMRVJ=1:"*",1:" ")
48 . . S ^TMP($J,"GMRK","G"_(1130+GCNTD))=GMRINF(1)
49 . . S ^TMP($J,"GMRK","G"_(1150+GCNTD))=GMRINF(2)
50 . . S ^TMP($J,"GMRK","G"_(1170+GCNTD))=GMRSITE
51 . . Q
52 . I GI="CVP" D
53 . . S ^TMP($J,"GMRK","G"_(1200+GCNTD))=$S(GK>0!(GK<0):$J(GK,0,1),1:GK)_$S(GMRVJ=1:"*",1:" ")
54 . . S ^TMP($J,"GMRK","G"_(1230+GCNTD))=$S(GK>0!(GK<0)!($E(GK)="0"):$J(GK/1.36,0,1),1:"")_$S(GMRVJ=1:"*",1:" ")
55 . . Q
56 . I GI="CG" D
57 . . S ^TMP($J,"GMRK","G"_(1250+GCNTD))=GK_" "_GMRSITE,^TMP($J,"GMRK","G"_(1320+GCNTD))=$S(GK>0:$J(GK/.3937,0,2),1:"")
58 . . Q
59 I GI="B",GK'="" S ^TMP($J,"GMRK","G"_(250+GCNTD))=$S($L(GMRSITE," ")>3:$P(GMRSITE," ",2,4),1:GMRSITE) S:$L(GMRSITE," ")>3 ^TMP($J,"GMRK","G"_(1640+GCNTD))=$P(GMRSITE," ")
60 I '(GI="T"!(GI="P")) D Q
61 . I GI="C" S GMRSITE=$S($L(GMRSITE," ")>3:" "_$P(GMRSITE," "),1:"")
62 . S ^TMP($J,"GMRK","G"_(GJ*16+GCNTD+1))=GK_$S(GMRVJ=1&(GI'="C"):"*",1:" ")_$S(GI="B":"",1:GMRSITE) S:GI="W" ^TMP($J,"GMRK","G"_(310+GCNTD))=$S(GK>0:$J(GK/2.2,0,2),1:"")
63 . I GK>0,GI="W" D
64 . . S GMRBMI="",GMRBMI(1)=GDT1,GMRBMI(2)=GK D CALBMI^GMRVBMI(.GMRBMI)
65 . . S ^TMP($J,"GMRK","G"_(330+GCNTD))=GMRBMI K GMRBMI
66 I GI="T",GK>0 S ^TMP($J,"GMRK","G"_(GJ*16+GCNTD+1))=106-GK
67 I GK'="",GI="P","UNAVAILABLEPASSREFUSED"'[$$UP^XLFSTR(GK) D
68 . I GMRSITE(1)["RADIAL"!(GMRSITE(1)["APICAL")!(GMRSITE(1)["BRACHIAL") D
69 . . S ^TMP($J,"GMRK","G"_(GJ*16+GCNTD+1))=170-GK/10
70 S ^TMP($J,"GMRK","G"_(GJ+1*16+GCNTD+1))=GK_$S(GMRVJ=1:"*",1:" ")_$S(GI="T":GMRSITE,GI="P"&($L(GMRSITE," ")>3):" "_$P(GMRSITE," "),1:"")
71 I GI="T",GK>0 S ^TMP($J,"GMRK","G"_(210+GCNTD))=$S(GMRVJ=1:"T*",1:"T")
72 I GI="P",GK'="","UNAVAILABLEPASSREFUSED"'[$$UP^XLFSTR(GK) D
73 . I GMRSITE(1)["RADIAL"!(GMRSITE(1)["APICAL")!(GMRSITE(1)["BRACHIAL") S ^TMP($J,"GMRK","G"_(230+GCNTD))=$S(GMRVJ=1:"P*",1:"P")
74 . S ^TMP($J,"GMRK","G"_(1300+GCNTD))=$S($L(GMRSITE," ")>3:$P(GMRSITE," ",2,4),1:GMRSITE)
75 I GK>0,GI="T" S ^TMP($J,"GMRK","G"_(GJ*16+GCNTD+1))=$S(^("G"_(GJ*16+GCNTD+1))<1.5:1.5,^("G"_(GJ*16+GCNTD+1))>12.7:12.7,1:^("G"_(GJ*16+GCNTD+1))) S:^("G"_(GJ*16+GCNTD+1))<1.6!(^("G"_(GJ*16+GCNTD+1))>12.6) ^TMP($J,"GMRK","G"_(210+GCNTD))="T**"
76 I GK'="",GI="P","UNAVAILABLEPASSREFUSED"'[$$UP^XLFSTR(GK) D
77 . I GMRSITE(1)["RADIAL"!(GMRSITE(1)["APICAL")!(GMRSITE(1)["BRACHIAL") D
78 . . S ^TMP($J,"GMRK","G"_(GJ*16+GCNTD+1))=$S(^("G"_(GJ*16+GCNTD+1))<1.5:1.5,^("G"_(GJ*16+GCNTD+1))>12.7:12.7,1:^("G"_(GJ*16+GCNTD+1)))
79 . . S:^("G"_(GJ*16+GCNTD+1))<1.6!(^("G"_(GJ*16+GCNTD+1))>12.6) ^TMP($J,"GMRK","G"_(230+GCNTD))="P**"
80 Q
81SETP ;INITIALIZE ^TMP FOR HEIGHT, WEIGHT AND V/M QUALIFIERS
82 ;250+I: BP QUALIFIER 270+I: HEIGHT IN INCH 290+I: HEIGHT IN CM
83 ;310+I:WEIGHT IN KG 330+I: BMI
84 ;1100+I: PULSE OXIMETRY DATA 1130+I: PULSE OX. L/MIN
85 ;1150+I: PULSE OX. % 1170+I: PULSE OX. METHOD
86 ;1200+I: CVP DATA IN CM H2O 1230+I: CVP DATA IN MMHG
87 ;1250+I: C/G DATA IN INCH 1270+I: C/G QUALIFIER 1300+I: PULSE QUALIFIER
88 ;1320+I: C/G DATA IN CM 1640+I: THIRD PIECE OF BP 1660+I: PAIN
89 F I=1:1:10 D
90 . S (^TMP($J,"GMRK","G"_(210+I)),^("G"_(230+I)),^("G"_(250+I)),^("G"_(270+I)),^("G"_(290+I)),^("G"_(310+I)),^("G"_(330+I)),^("G"_(1300+I)))=""
91 . S (^TMP($J,"GMRK","G"_(1100+I)),^("G"_(1130+I)),^("G"_(1150+I)),^("G"_(1170+I)),^("G"_(1200+I)),^("G"_(1230+I)),^("G"_(1250+I)),^("G"_(1270+I)))=""
92 . S (^TMP($J,"GMRK","G"_(1320+I)),^("G"_(1640+I)),^("G"_(1660+I)))=""
93 Q
Note: See TracBrowser for help on using the repository browser.