source: WorldVistAEHR/trunk/r/GEN_MED_OTHER-GMV/GMVSC2.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: 3.1 KB
RevLine 
[613]1GMVSC2 ;HIRMFO/YH,FT-CUMULATIVE V/M - CONTINUED ;12/18/01 10:54
2 ;;5.0;GEN. MED. REC. - VITALS;;Oct 31, 2002
3 ;
4 ; This routine uses the following IAs:
5 ; #10104 - ^XLFSTR calls (supported)
6 ;
7SETLN ; {called from GMVSC1}
8 S GMRVER=^TMP($J,"GMRV",GMRDATE,GMRVTY,GMRVDA) N GMRVPO
9 D:IOSL<($Y+9) HDR Q:GMROUT W ! W:GMRVER "(E)"
10 I GPRT(GMRVTY)=0 D
11 . W ?4,$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:"")
12 . I GMRVTY="PN" W ?4,"Pain: "
13 S GPRT(GMRVTY)=1
14 S GMRDAT=$G(^GMR(120.5,GMRVDA,0))
15 I "PRBPCVPCGPO2PN"[GMRVTY S GMRVX=GMRVTY,GMRVX(0)=$P(GMRDAT,"^",8) D
16 . I "UNAVAILABLEPASSREFUSED"[$$UP^XLFSTR(GMRVX(0)) W ?9,GMRVX(0) Q
17 . I GMRVTY="PN" D
18 . . I GMRVX(0)=0 W ?9,GMRVX(0)_" - No pain" Q
19 . . I GMRVX(0)=99 W ?9,GMRVX(0)_" - Unable to respond" Q
20 . . I GMRVX(0)=10 W ?9,GMRVX(0)_" - Worst imaginable pain" Q
21 . . W ?9,GMRVX(0) Q
22 . ;I GMRVTY'="PN" W ?9,GMRVX(0)
23 . D EN1^GMVSAS0
24 . I GMRVTY="P",$D(^GMR(120.5,GMRVDA,5,"B",GPEDIS)),$P(GMRDAT,"^",8)=1 S GMRVX(1)=""
25 . 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 W:GMRVTY'="PN" ?9,Z_$S('$D(GMRVX(1)):" ",'GMRVX(1):"",1:"*")
26 . I GMRVTY="CG" W " in ("_$J(Z/.3937,0,2)_" cm)"
27 . I GMRVTY="CVP" W " cmH2O ("_$J(Z/1.36,0,1)_" mmHg)"
28 . I GMRVTY="PO2" S GMRVPO=$P(GMRDAT,"^",10) W "%"_$S(GMRVPO'="":" 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),1:"")
29 I GMRVTY="T" S X=$P(GMRDAT,"^",8) D
30 . I X'>0 W ?9,X Q
31 . S GMRVX=GMRVTY,GMRVX(0)=X D EN1^GMVSAS0
32 . D EN1^GMVUTL S:'Y Y="" S Z=$J(X,5,1) D BLNK W ?9,Z_" F " S Z=$J(Y,4,1) D BLNK W "("_Z_" C)"_$S('$D(GMRVX(1)):" ",'GMRVX(1):"",1:"*")
33 I GMRVTY="HT" S X=$P(GMRDAT,"^",8) D
34 . I X'>0 W ?9,X Q
35 . D EN2^GMVUTL S:'Y Y="" S Z=$J(X,5,2) D BLNK W ?9,Z_" in " S Z=$J(Y,5,2) D BLNK W "("_Z_" cm)" I 'GMRVER S GMRVHT=Z/100
36 I GMRVTY="WT" S X=$P(GMRDAT,"^",8) D
37 . I X'>0 W ?9,X Q
38 . D EN3^GMVUTL S:'Y Y="" S Z=$J(X,7,2) D BLNK W ?9,Z_" lb " S Z=$J(Y,6,2) D BLNK W "("_Z_" kg)"
39 Q:+$P(GMRDAT,"^",8)'>0&(+$P($G(^GMR(120.5,GMRVDA,5,0)),"^",4)'>0) S GMRVITY=+$P(GMRDAT,"^",3)
40 K GMRVARY S (GMRZZ,GMRVARY)="" I $P($G(^GMR(120.5,GMRVDA,5,0)),"^",4)>0 D
41 . D CHAR^GMVCHAR(GMRVDA,.GMRVARY,GMRVITY) S GMRZZ=$$WRITECH^GMVCHAR(GMRVDA,.GMRVARY,9) S:GMRZZ'=""&(GMRVTY'="PO2") GMRZZ=" ("_GMRZZ_")"
42 . W:GMRVTY="PO2" !,?8," via " W GMRZZ
43 I GMRVTY="WT",'GMRVER S GMRBMI="",GMRBMI(1)=$P(GMRDAT,"^"),GMRBMI(2)=+$P(GMRDAT,"^",8) D CALBMI^GMVBMI(.GMRBMI) W:GMRBMI>0 !,?4,"Body Mass Index: "_GMRBMI
44 K Z
45 Q
46HDR ; Report header
47 I 'GMR1ST D FOOTER^GMVSC0
48 W:$Y>0 @IOF
49 S GMRPG=GMRPG+1,GFLAG=1 ;what is GFLAG?
50 W !,GMRPDT,?25,"Cumulative Vitals/Measurements Report",?70,"Page ",GMRPG
51 W !?25,GMVRANGE ;report date range
52 W !,$E(GMRDSH,1,78)
53 I 'GMR1ST,$P(GMRDATE,".")=GMRDATE(0) W !,$E(GMRDATE(0),4,5)_"/"_$E(GMRDATE(0),6,7)_"/"_$E(GMRDATE,2,3)_" (continued)",!
54 ; include date range in header
55 S GMR1ST=0
56 Q
57BLNK ;
58 F I=1:1:$L(Z) Q:$E(Z,I)'=" "
59 S Z=$E(Z,I,$L(Z))
60 Q
Note: See TracBrowser for help on using the repository browser.