source: FOIAVistA/trunk/r/GEN_MED_REC_VITALS-GMRV/GMRVDS0.m@ 1068

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

initial load of FOIAVistA 6/30/08 version

File size: 4.1 KB
Line 
1GMRVDS0 ;HIRMFO/YH,FT-DISPLAY LATEST VITALS/MEASUREMENTS ;6/13/01 15:03
2 ;;4.0;Vitals/Measurements;**1,7,11,13**;Apr 25, 1997
3 ;
4 ; This routine uses the following IAs:
5 ; #10061 ^VADPT calls (supported)
6 ;
7EN2 ;ENTRY TO DISPLAY THE LATEST VITALS/MEASUREMENTS IF DFN IS UNKNOWN
8 S DIC(0)="AEM",DIC="^DPT(" D ^DIC K DIC Q:+Y'>0 S DFN=+Y
9EN3 ; ENTRY TO DISPLAY THE LATEST VITALS/MEASUREMENTS IF DFN IS KNOWN
10 Q:'$D(DFN)
11 S GMREDB="P" D PAT^GMRVDS1 D Q
12 Q
13EN1 ; ENTRY TO DISPLAY VITALS
14 N GAPICAL,GRADIAL,GBRACHI,OK
15 S GAPICAL=$O(^GMRD(120.52,"B","APICAL",0)),GRADIAL=$O(^GMRD(120.52,"B","RADIAL",0)),GBRACHI=$O(^GMRD(120.52,"B","BRACHIAL",0))
16 F GMRX=1:1:$L(GMRSTR,";") S X=$P(GMRSTR,";",GMRX) Q:'$D(^GMRD(120.51,"C",X)) S GMR(X)=$O(^GMRD(120.51,"C",X,"")),Y=$P($G(^GMRD(120.51,GMR(X),0)),"^") Q:Y=""
17 K GMRDT,GMRVWT,GMRVHT S X="" F S X=$O(GMR(X)) Q:X="" S GMRDATS="" I GMR(X)'="" F GMRDAT=0:0 S GMRDAT=$O(^GMR(120.5,"AA",DFN,+GMR(X),GMRDAT)) Q:$S(GMRDAT'>0:1,GMRDATS>0:1,1:0) D SETDATAR
18 I '($D(GMRDATA)\10) W !,"There are no results to report " G Q
19 F X="T","P","R","PO2","BP","HT","WT","CVP","CG","PN" I $D(GMRDATA(X)) S GMRVDT="",(GMRVDT(1),GMVD)=0 F S GMVD=$O(GMRDATA(X,GMVD)) Q:GMVD'>0 D WRTDT S GMVD(1)=0 F S GMVD(1)=$O(GMRDATA(X,GMVD,GMVD(1))) Q:GMVD(1)'>0 D
20 . S GMRVX(0)=GMRDATA(X,GMVD,GMVD(1)) S GMRVX=X D EN1^GMRVSAS0
21 . W ! W:GMRVDT(1)=0 $S(X="BP":"B/P",X="P":"Pulse",X="R":"Resp.",X="T":"Temp.",X="HT":"Ht.",X="CG":"Circ/Girth",X="WT":"Wt.",X="PO2":"Pulse Ox",X="PN":"Pain",1:X)_": "
22 . I GMRVDT(1)=0 W ?12,"("_GMRVDT_") " S GMRVDT(1)=1
23 . I X="T" W ?29,GMRVX(0)_" F ("_$J(+GMRVX(0)-32*5/9,0,1)_" C)"
24 . I X="WT" W ?29,GMRVX(0)_" lb ("_$J(GMRVX(0)/2.2,0,2)_" kg)" S GMRVWT=GMRVX(0)/2.2
25 . I X="HT" W ?29,$S(GMRVX(0)\12:GMRVX(0)\12_" ft ",1:"")_$S(GMRVX(0)#12:GMRVX(0)#12_" in",1:"")_" ("_$J(GMRVX(0)*2.54,0,2)_" cm)" S GMRVHT=(GMRVX(0)*2.54)/100
26 . I X="CG" W ?29,GMRVX(0)_" in ("_$J(+GMRVX(0)/.3937,0,2)_" cm)"
27 . I X="CVP" W ?29,GMRVX(0)_" cmH2O ("_$J(GMRVX(0)/1.36,0,1)_" mmHg)"
28 . I X="PO2" W ?29,GMRVX(0)_"% "
29 . I X="P"!(X="R")!(X="BP") W ?29,GMRVX(0)
30 . I X="PN" D
31 . . I "UNAVAILABLEPASSREFUSED"[$$UP^XLFSTR(GMRVX(0)) W ?9,GMRVX(0) Q
32 . . I GMRVX(0)=0 W ?29,GMRVX(0)_" - No pain " Q
33 . . I GMRVX(0)=99 W ?29,GMRVX(0)_" - Unable to respond " Q
34 . . I GMRVX(0)=10 W ?29,GMRVX(0)_" - Worst imaginable pain " Q
35 . . W ?29,GMRVX(0) Q
36 . W $S('$D(GMRVX(1)):"",'GMRVX(1):"",1:"*") K GMRVX
37 . D CHAR
38 . I X="WT",$G(GMRVWT)>0,$G(GMRVHT)>0 W !,"BMI: " S GMRVHT(1)=$J(GMRVWT/(GMRVHT*GMRVHT),0,0) W ?29,GMRVHT(1)_$S(GMRVHT(1)>27:"*",1:"")
39 . Q
40Q W ! K GMRVWT,GMRVHT,GMR,GMVD,GBP,GMRVARY,GMRVDA,GMRDATA,GMVDM,GLIN,GMRZZ Q:$D(GLOC)
41 K GMRVDT,GMROUT,DFN,%Y,GMRL,GMRDT,DIC,GMRDAT,GMRDATS,GMRSTR,GMRX,GMRVX,POP D KVAR^VADPT K VA
42 Q
43SETDATAR ;
44 S Y=0 F S Y=$O(^GMR(120.5,"AA",DFN,GMR(X),GMRDAT,Y)) Q:Y'>0!GMRDATS I '$D(^GMR(120.5,Y,2)),$P(^GMR(120.5,Y,0),"^",8)'="" D SETNODE
45 D:X="BP"!(X="P") SETBP^GMRVDS2 Q
46SETNODE ;
47 N G S GMRL=$S($D(^GMR(120.5,Y,0)):^(0),1:"")
48 ;N G S G=$P(GMRL,"^",8) Q:'(G>0!(G<0)!($E(G)="0"))
49 I X'="P" S G=$P(GMRL,"^",8) Q:"REFUSEDPASSUNAVAILABLE"[$$UP^XLFSTR(G)
50 I X="P" S OK=0,G=$P(GMRL,"^",8) D Q:'OK
51 . I "REFUSEDPASSUNAVAILABLE"[$$UP^XLFSTR(G) Q
52 . I '$D(^GMR(120.5,Y,5,"B")) S OK=1 Q
53 . I $D(^GMR(120.5,Y,5,"B",GAPICAL)) S OK=1 Q
54 . I $D(^GMR(120.5,Y,5,"B",GBRACHI)) S OK=1 Q
55 . I $D(^GMR(120.5,Y,5,"B",GRADIAL)) S OK=1
56 S GMRL1=$P(GMRL,"^") ;adding trailing zeros to time if necessary
57 S $P(GMRL1,".",2)=$P(GMRL1,".",2)_"0000"
58 S $P(GMRL1,".",2)=$E($P(GMRL1,".",2),1,4)
59 S $P(GMRL,"^")=GMRL1
60 K GMRL1
61 I GMRL'="" S GMRDATA(X,$P(GMRL,"^"),Y)=$P(GMRL,"^",8),GMRDATS=1 I $P($G(^GMR(120.5,Y,5,0)),"^",4)>0 D CHAR^GMRVCHAR(Y,.GMRVARY,GMR(X))
62 Q
63WRTDT ;
64 S GMRVDT=$E(GMVD,4,5)_"/"_$E(GMVD,6,7)_"/"_$E(GMVD,2,3)_"@"_$E($P(GMVD,".",2),1,2)_$S($E($P(GMVD,".",2),3,4)'="":":"_$E($P(GMVD,".",2),3,4),1:"")
65 Q
66CHAR ;
67 S GMRZZ=$$WRITECH^GMRVCHAR(GMVD(1),.GMRVARY,5) S:GMRZZ'=""&(X'="PO2") GMRZZ="("_GMRZZ_")"
68 I X="PO2",$P(^GMR(120.5,GMVD(1),0),"^",10)'="" S GMRVPO=$P(^(0),"^",10) W "with supplemental O2 "_$S(GMRVPO["l/min":$P(GMRVPO," l/min")_"L/min",1:"")_$S(GMRVPO["l/min":$P(GMRVPO," l/min",2),1:GMRVPO)_" " W:GMRZZ'="" !,?29,"- ",GMRZZ K GMRZZ Q
69 W:GMRZZ'="" GMRZZ K GMRZZ
70 Q
Note: See TracBrowser for help on using the repository browser.