source: WorldVistAEHR/trunk/r/GEN_MED_REC_VITALS-GMRV/GMRVED4.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: 4.7 KB
RevLine 
[613]1GMRVED4 ;HIRMFO/RM,YH-VITAL SIGNS SHORT FORM ;3/15/99 14:24
2 ;;4.0;Vitals/Measurements;**1,7,11**;Apr 25, 1997
3DSPOV ; DISPLAY OLD VITALS ALREADY ENTERED FOR PATIENT AND SET GMRSTR(0)
4 ; TO THE SUBSET OF GMRSTR THAT HASN'T BEEN ENTERED.
5 K GMROV S (GLAST,GLAST(1))=0,GDT=GMRVIDT,GMRSTR(0)=";"_GMRSTR I $E(GMRSTR(0),$L(GMRSTR(0)))'=";" S GMRSTR(0)=GMRSTR(0)_";"
6 S Y=0 F S Y=$O(^GMR(120.5,"AA",DFN,Y)) Q:Y'>0 I $D(^GMR(120.5,"AA",DFN,Y,9999999-GDT)) S X=0 F S X=$O(^GMR(120.5,"AA",DFN,Y,9999999-GDT,X)) Q:X'>0 I $S('$D(^GMR(120.5,X,2)):1,'$P(^(2),"^"):1,1:0) S GCT=0 D STOV
7 I GMRSTR["BP",'$D(GMROV("BP")) S GTYPE="BP",GCT=0 D MULTIBP S:$D(GMROV(GTYPE)) GMRP=";"_GTYPE_";",GMRSTR(0)=$P(GMRSTR(0),GMRP)_";"_$P(GMRSTR(0),GMRP,2)
8 I GMRSTR["P",'$D(GMROV("P")),GMRENTY=6 S GTYPE="P",GCT=0,GMRTYPE=$O(^GMRD(120.51,"C",GTYPE,0)) D MULTIBP S:$D(GMROV(GTYPE)) GMRP=";"_GTYPE_";",GMRSTR(0)=$P(GMRSTR(0),GMRP)_";"_$P(GMRSTR(0),GMRP,2)
9 G:$O(GMROV(""))="" Q
10 W !!,"The patient has data for this date/time for the following vital/measurements.",!,"To change this data, please use the Entered in Error Module.",!!
11 F GMRX=1:1:$L(GMRSTR,";") S X=$P(GMRSTR,";",GMRX) Q:X="" I $D(GMROV(X)) S X(1)=0 F Y=0:0 S X(1)=$O(GMROV(X,X(1))) Q:X(1)'>0 D PROV
12Q S GMRVIDT=GDT W ! K X Q
13STOV ; STORE OLD VITALS FOR A PATIENT
14 S GFLAG=0,GMROV=$S($D(^GMR(120.5,X,0)):^(0),1:""),GMRTYPE=+$P(GMROV,"^",3) I $D(^GMRD(120.51,GMRTYPE,0)) S GTYPE=$P(^(0),"^",2),GMRP=";"_GTYPE_";"
15 I $S('$D(^GMRD(120.51,GMRTYPE,0)):0,";"_GMRSTR[GMRP:1,1:0) S GCT=GCT+1,GFLAG=1 S:GCT=1 GMRSTR(0)=$P(GMRSTR(0),GMRP)_";"_$P(GMRSTR(0),GMRP,2) D
16 . K GMRVARY S GMRVARY="" D CHAR^GMRVCHAR(X,.GMRVARY,GMRTYPE) S GMRINF=$$WRITECH^GMRVCHAR(X,.GMRVARY,9) Q
17 I GFLAG S GMROV(GTYPE,GCT)=$P(GMROV,"^",8) D
18 .S GMROV(GTYPE,GCT)=GMROV(GTYPE,GCT)_"^"_$S(GMRINF'="":" "_GMRINF,1:"")_"^"_GMRVIDT
19 .S:GTYPE="BP"!(GTYPE="P") GLAST(1)=1,GLAST=GMRVIDT D:GTYPE="BP"!(GTYPE="P") MULTIBP S GMRVIDT=GDT
20 S GCT=0 K GFLAG Q
21PROV ; PRINT OUT OLD VITAL
22 K GDATA S GMRVX=X,GMRVX(0)=$P(GMROV(X,X(1)),"^") G:GMRVX(0)'>0 PRT
23 I GMRVX(0)>0 D EN1^GMRVSAS0 S X(2)=GMRVX(0)
24 I X="T" S GMRVX(0)=GMRVX(0)_$S(GMRVX(0)>0:"F"_" ("_$J(X(2)-32*5/9,0,1)_"C)",1:"")
25 I X="PN" D
26 . I "UNAVAILABLEPASSREFUSED"[$$UP^XLFSTR(GMRVX(0)) Q
27 . I GMRVX(0)=0 S GMRVX(0)="No pain " Q
28 . I GMRVX(0)=99 S GMRVX(0)="Unable to respond "
29 . I GMRVX(0)=10 S GMRVX(0)=GMRVX(0)_" - Worst imaginable pain " Q
30 . Q
31 I X="WT" S GMRVX(0)=GMRVX(0)_$S(GMRVX(0)>0:" lb"_" ("_$J(X(2)/2.2,0,2)_" kg)",1:"")
32 I X="HT" S GMRVX(0)=(GMRVX(0)\12)_$S(GMRVX(0)>0:" ft "_$S(X(2)#12:X(2)#12_" in",1:"")_" ("_$J(X(2)*2.54,0,2)_" cm)",1:"")
33 I X="CG" S GMRVX(0)=GMRVX(0)_$S(GMRVX(0)>0:" in ("_$J(X(2)/.3937,0,2)_" cm)",1:"")
34 I X="CVP" S GMRVX(0)=GMRVX(0)_$S(GMRVX(0)>0:" cmH2O ("_$J(X(2)/1.36,0,0)_" mmHg)",1:"")
35 I X="PO2" D
36 .N GMRVPO S GMRVPO=$P(GMROV,"^",10)
37 .S GMRVX(0)=$S(GMRVX(0)>0:"O2 sat. via oximetry "_GMRVX(0)_"%",1:"")_$S(GMRVPO'="":" with O2 "_$S(GMRVPO["l/min":$P(GMRVPO," l/min")_"L/min",1:"")_$S(GMRVPO["l/min":$P(GMRVPO," l/min",2),1:GMRVPO),1:"")_$S(GMRINF'="":" via",1:"")
38 .Q
39PRT W:X(1)=1 !,?$X+2,$S(X="T":"Temp.",X="P":"Pulse",X="R":"Resp.",X="BP":"B/P",X="HT":"Ht.",X="WT":"Wt.",X="CG":"Circumference/Girth",X="PO2":"Pulse Oximetry",X="PN":"Pain",1:X),": "
40 W:X(1)>1 !
41 I X="P" D
42 . I GMRINF'="",GMRVX(0)=1 S:$F(GMRINF,"DORSALIS PEDIS")>0 GMRVX(1)=""
43 . I GMRINF'="",GMRVX(0)=0 S:$F(GMRINF,"DORSALIS PEDIS")>0 GMRVX(1)=1
44 . Q
45 S GDATA(1)=$P(GMROV(X,X(1)),"^",2),GDATA(2)=$P(GMROV(X,X(1)),"^",3)
46 W:X="BP" ?8," " W:X="P" ?8,$S(X(1)>1:" ",1:"") W GMRVX(0),$S('$D(GMRVX(1)):"",'GMRVX(1):"",1:"*"),GDATA(1)
47 K GDATA,GMRVX Q
48EXITACT ; VITAL OPTIONS EXIT ACTION
49 K:'$L(GMRVFLAG) GMRVFLAG,GMRVDBA
50 K G,GBLNK,GCAT,GCHA,GCHART,GCOL,GCOUNT,GCT,GDA,GDT,GENTR,GLAST,GLN,GMAX,GMRDAT,GMRENTR,GMRHELP,GMRINF,GMRINPTR,GMRLAST,GMRO2,GMRPRMT,GMRRET,GMRSCR,GMRSITE,GMRSTAR,GMRSTR
51 K GMRV,GMRVDFLT,GMRVHLOC,GMRVIDT,GMRVIT,GMRVITY,GMRVLST,GMRVODR,GMRVWLOC,GMRW,GMRWARD,GMRX,GMRY,GORDER,GQUAL,GREASON,GSIDE,GTXT,GTYPE
52 Q
53ENTACT ; NURSING VITAL OPTIONS ENTRY ACTION
54 S:'$D(GMRVFLAG) GMRVFLAG=2 I GMRVFLAG S GMRVFLAG=$S(GMRVFLAG=1:0,1:""),GMROUT=0 D DATE^GMRVED0 S:'GMROUT GMRVDBA=GMROUT_"^"_GMRVIDT S:GMROUT XQUIT=1 K GMROUT,GMRVIDT
55 Q
56MULTIBP ;DISPLAY MULTIPLE B/P
57 Q:'$D(GMRTYPE) S GDATE=GDT S:'$D(GLAST) GLAST=0 S GDT(3)=9999999-(GDT+.00000001),GDT(2)=9999999-(GDT+.00000014) K GDATE
58 F S GDT(2)=$O(^GMR(120.5,"AA",DFN,GMRTYPE,GDT(2))) Q:GDT(2)>GDT(3)!(GDT(2)="") S GDA=0 F S GDA=$O(^GMR(120.5,"AA",DFN,GMRTYPE,GDT(2),GDA)) Q:GDA'>0 I $D(^GMR(120.5,GDA,0)),'$D(^GMR(120.5,GDA,2)) S GMRVIDT=9999999-GDT(2) D
59 .S GDATA=^GMR(120.5,GDA,0),(GLAST(1),GCT)=GCT+1
60 .K GMRVARY S GMRVARY="" D CHAR^GMRVCHAR(GDA,.GMRVARY,GMRTYPE) S GMRINF=$$WRITECH^GMRVCHAR(GDA,.GMRVARY,9)
61 .S GMROV(GTYPE,GCT)=$P(GDATA,"^",8)_"^"_$S(GMRINF'="":" "_GMRINF,1:"")_"^"_GMRVIDT
62 .S:GMRVIDT>GLAST GLAST=GMRVIDT
63 Q
Note: See TracBrowser for help on using the repository browser.