source: WorldVistAEHR/trunk/r/GEN_MED_OTHER-GMV/GMVGETD2.m@ 1258

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

initial load of WorldVistAEHR

File size: 4.0 KB
Line 
1GMVGETD2 ;HOIFO/YH-EXTRACT VITALS/MEASUREMENT RECORDS FOR A GIVEN DATE (CONT.) ;12/9/02 14:03
2 ;;5.0;GEN. MED. REC. - VITALS;**1**;Oct 31, 2002
3 ;
4 ; This routine uses the following IAs:
5 ; <None>
6 ;
7SETLN ;CALLED BY GMVGETD1
8 N GMVUSER
9 S GJ=GJ+1,GMRDAT=^GMR(120.5,GMRVDA,0),^TMP($J,"GRPC",GJ)=GMRVDA_"^"_$E(GMRDATE,4,5)_"/"_$E(GMRDATE,6,7)_"/"_$E(GMRDATE,2,3)
10 S GMVUSER=$$PERSON^GMVUTL1(+$P(GMRDAT,U,6)) ;user name
11 S ^TMP($J,"GRPC",GJ)=^TMP($J,"GRPC",GJ)_"@"_$E($P(GMRDATE,".",2)_"000000",1,2)_":"_$E($P(GMRDATE,".",2)_"000000",3,4)_" "
12 S GMRVTY(1)=$S(GMRVTY="T":"T: ",GMRVTY="P":"P: ",GMRVTY="R":"R: ",GMRVTY="BP":"B/P: ",GMRVTY="WT":"Wt: ",GMRVTY="HT":"Ht: ",GMRVTY="CG":"Circumference/Girth: ",GMRVTY="CVP":"Central Venous Pressure: ",GMRVTY="PO2":"Pulse Oximetry: ",1:"")
13 I GMRVTY(1)="" S GMRVTY(1)=$S(GMRVTY="PN":"Pain: ",1:"")
14 S GMRVTY(1)=GMRVTY(1)_" "
15 S ^TMP($J,"GRPC",GJ)=^TMP($J,"GRPC",GJ)_GMRVTY(1)
16 I GMRVTY="PN" D Q
17 . S ^TMP($J,"GRPC",GJ)=^(GJ)_$P(GMRDAT,"^",8)_" "_$S(+$P(GMRDAT,"^",8)=99:"Unable to respond",+$P(GMRDAT,"^",8)=10:"Worst imaginable pain",$P(GMRDAT,"^",8)="0":"No pain",1:"")_" _"_GMVUSER
18 I "PRBPCVPCGPO2"[GMRVTY S GMRVX=GMRVTY,GMRVX(0)=$P(GMRDAT,"^",8) D
19 . I '(GMRVX(0)<0!(GMRVX(0)>0)!($E(GMRVX(0))="0")) S ^TMP($J,"GRPC",GJ)=^TMP($J,"GRPC",GJ)_GMRVX(0)_" " Q
20 . D EN1^GMVSAS0
21 . S Z=$S(GMRVTY="CG":$J($P(GMRDAT,"^",8),0,2),GMRVTY="CVP":$J($P(GMRDAT,"^",8),0,1),GMRVTY'="BP":$J($P(GMRDAT,"^",8),3,0),1:$P(GMRDAT,"^",8)) D:GMRVTY'="BP" BLNK
22 . S ^TMP($J,"GRPC",GJ)=^TMP($J,"GRPC",GJ)_Z_$S('$D(GMRVX(1)):" ",'GMRVX(1):"",1:"*")
23 . I GMRVTY="CG" S ^TMP($J,"GRPC",GJ)=^TMP($J,"GRPC",GJ)_" in ("_$J(Z/.3937,0,2)_" cm)"
24 . I GMRVTY="CVP" S ^TMP($J,"GRPC",GJ)=^TMP($J,"GRPC",GJ)_" cmH2O ("_$J(Z/1.36,0,1)_" mmHg)"
25 . I GMRVTY="PO2" D
26 . . S ^TMP($J,"GRPC",GJ)=^TMP($J,"GRPC",GJ)_"%"
27 . . I $P(GMRDAT,"^",10)["%"!($P(GMRDAT,"^",10)[" l/min") D
28 . . . S ^TMP($J,"GRPC",GJ)=^TMP($J,"GRPC",GJ)_" with supplemental O2"
29 . . . N GMV S GMV=$P(GMRDAT,"^",10) I GMV[" l/min" S GMV=$P(GMV," l/min")_"L/min"_$P(GMV," l/min",2)
30 . . . S ^TMP($J,"GRPC",GJ)=^TMP($J,"GRPC",GJ)_" "_GMV
31 I GMRVTY="T" S X=$P(GMRDAT,"^",8) D
32 . I X'>0 S ^TMP($J,"GRPC",GJ)=^TMP($J,"GRPC",GJ)_X Q
33 . S GMRVX=GMRVTY,GMRVX(0)=X D EN1^GMVSAS0
34 . D EN1^GMVUTL S:'Y Y="" S Z=$J(X,5,1) D BLNK S ^TMP($J,"GRPC",GJ)=^TMP($J,"GRPC",GJ)_Z_" F " S Z=$J(Y,4,1) D BLNK S ^TMP($J,"GRPC",GJ)=^TMP($J,"GRPC",GJ)_"("_Z_" C)"_$S('$D(GMRVX(1)):" ",'GMRVX(1):"",1:"*")
35 I GMRVTY="HT" S X=$P(GMRDAT,"^",8) D
36 . I X'>0 S ^TMP($J,"GRPC",GJ)=^TMP($J,"GRPC",GJ)_X Q
37 . D EN2^GMVUTL S:'Y Y="" S Z=$J(X,5,2) D BLNK S ^TMP($J,"GRPC",GJ)=^TMP($J,"GRPC",GJ)_Z_" in " S Z=$J(Y,5,2) D BLNK S ^TMP($J,"GRPC",GJ)=^TMP($J,"GRPC",GJ)_"("_Z_" cm)"
38 I GMRVTY="WT" S X=$P(GMRDAT,"^",8) D
39 . I X'>0 S ^TMP($J,"GRPC",GJ)=^TMP($J,"GRPC",GJ)_X Q
40 . D EN3^GMVUTL S:'Y Y="" S Z=$J(X,7,2) D BLNK S ^TMP($J,"GRPC",GJ)=^TMP($J,"GRPC",GJ)_Z_" lb " S Z=$J(Y,6,2) D BLNK S ^TMP($J,"GRPC",GJ)=^TMP($J,"GRPC",GJ)_"("_Z_" kg)"
41 I (+$P(GMRDAT,"^",8)'>0)&($P(GMRDAT,"^",8)'="0") D Q
42 .S ^TMP($J,"GRPC",GJ)=^TMP($J,"GRPC",GJ)_" _"_GMVUSER
43 .Q
44 S GMRVITY=+$P(GMRDAT,"^",3)
45 K GMRVARY S (GMRZZ,GMRVARY)="" I $P($G(^GMR(120.5,GMRVDA,5,0)),"^",4)>0 D
46 . D CHAR^GMVCHAR(GMRVDA,.GMRVARY,GMRVITY) S GMRZZ=$$WRITECH^GMVCHAR(GMRVDA,.GMRVARY,9) S:GMRZZ'=""&(GMRVTY'="PO2") GMRZZ=" ("_GMRZZ_")"
47 . S:GMRVTY="PO2" ^TMP($J,"GRPC",GJ)=^TMP($J,"GRPC",GJ)_" "_GMRZZ
48 . I GMRVTY="P",GMRZZ["DORSALIS PEDIS",$P(GMRDAT,"^",8)=1 S ^TMP($J,"GRPC",GJ)=$P(^(GJ),"*",1)_$P(^(GJ),"*",2)
49 . S:GMRVTY'="PO2" ^TMP($J,"GRPC",GJ)=^TMP($J,"GRPC",GJ)_" "_GMRZZ
50 S ^TMP($J,"GRPC",GJ)=^TMP($J,"GRPC",GJ)_" _"_GMVUSER
51 I GMRVTY="WT" S GMRBMI="",GMRBMI(1)=$P(GMRDAT,"^"),GMRBMI(2)=+$P(GMRDAT,"^",8) D CALBMI^GMVBMI(.GMRBMI) D:GMRBMI'=""
52 . S GJ=GJ+1,^TMP($J,"GRPC",GJ)=$E(GMRDATE,4,5)_"/"_$E(GMRDATE,6,7)_"/"_$E(GMRDATE,2,3)
53 . S ^TMP($J,"GRPC",GJ)=" @"_$E($P(GMRDATE,".",2)_"000000",1,2)_":"_$E($P(GMRDATE,".",2)_"000000",3,4)_" Body Mass Index: "_GMRBMI
54 K Z,GMRBMI
55 Q
56BLNK ;
57 F I=1:1:$L(Z) Q:$E(Z,I)'=" "
58 S Z=$E(Z,I,$L(Z))
59 Q
Note: See TracBrowser for help on using the repository browser.