Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: GMRVED4

GMRVED4.m

Go to the documentation of this file.
GMRVED4 ;HIRMFO/RM,YH-VITAL SIGNS SHORT FORM ;3/15/99  14:24
 ;;4.0;Vitals/Measurements;**1,7,11**;Apr 25, 1997
DSPOV ; DISPLAY OLD VITALS ALREADY ENTERED FOR PATIENT AND SET GMRSTR(0)
 ; TO THE SUBSET OF GMRSTR THAT HASN'T BEEN ENTERED.
 K GMROV S (GLAST,GLAST(1))=0,GDT=GMRVIDT,GMRSTR(0)=";"_GMRSTR I $E(GMRSTR(0),$L(GMRSTR(0)))'=";" S GMRSTR(0)=GMRSTR(0)_";"
 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
 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)
 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)
 G:$O(GMROV(""))="" Q
 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.",!!
 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
Q S GMRVIDT=GDT W ! K X Q
STOV ; STORE OLD VITALS FOR A PATIENT
 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_";"
 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
 . K GMRVARY S GMRVARY="" D CHAR^GMRVCHAR(X,.GMRVARY,GMRTYPE) S GMRINF=$$WRITECH^GMRVCHAR(X,.GMRVARY,9) Q
 I GFLAG S GMROV(GTYPE,GCT)=$P(GMROV,"^",8) D
 .S GMROV(GTYPE,GCT)=GMROV(GTYPE,GCT)_"^"_$S(GMRINF'="":" "_GMRINF,1:"")_"^"_GMRVIDT
 .S:GTYPE="BP"!(GTYPE="P") GLAST(1)=1,GLAST=GMRVIDT D:GTYPE="BP"!(GTYPE="P") MULTIBP S GMRVIDT=GDT
 S GCT=0 K GFLAG Q
PROV ; PRINT OUT OLD VITAL
 K GDATA S GMRVX=X,GMRVX(0)=$P(GMROV(X,X(1)),"^") G:GMRVX(0)'>0 PRT
 I GMRVX(0)>0 D EN1^GMRVSAS0 S X(2)=GMRVX(0)
 I X="T" S GMRVX(0)=GMRVX(0)_$S(GMRVX(0)>0:"F"_" ("_$J(X(2)-32*5/9,0,1)_"C)",1:"")
 I X="PN" D
 . I "UNAVAILABLEPASSREFUSED"[$$UP^XLFSTR(GMRVX(0)) Q
 . I GMRVX(0)=0 S GMRVX(0)="No pain " Q
 . I GMRVX(0)=99 S GMRVX(0)="Unable to respond "
 . I GMRVX(0)=10 S GMRVX(0)=GMRVX(0)_" - Worst imaginable pain " Q
 . Q
 I X="WT" S GMRVX(0)=GMRVX(0)_$S(GMRVX(0)>0:" lb"_" ("_$J(X(2)/2.2,0,2)_" kg)",1:"")
 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:"")
 I X="CG" S GMRVX(0)=GMRVX(0)_$S(GMRVX(0)>0:" in ("_$J(X(2)/.3937,0,2)_" cm)",1:"")
 I X="CVP" S GMRVX(0)=GMRVX(0)_$S(GMRVX(0)>0:" cmH2O ("_$J(X(2)/1.36,0,0)_" mmHg)",1:"")
 I X="PO2" D
 .N GMRVPO S GMRVPO=$P(GMROV,"^",10)
 .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:"")
 .Q
PRT 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),": "
 W:X(1)>1 !
 I X="P" D
 . I GMRINF'="",GMRVX(0)=1 S:$F(GMRINF,"DORSALIS PEDIS")>0 GMRVX(1)=""
 . I GMRINF'="",GMRVX(0)=0 S:$F(GMRINF,"DORSALIS PEDIS")>0 GMRVX(1)=1
 . Q
 S GDATA(1)=$P(GMROV(X,X(1)),"^",2),GDATA(2)=$P(GMROV(X,X(1)),"^",3)
 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)
 K GDATA,GMRVX Q
EXITACT ; VITAL OPTIONS EXIT ACTION
 K:'$L(GMRVFLAG) GMRVFLAG,GMRVDBA
 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
 K GMRV,GMRVDFLT,GMRVHLOC,GMRVIDT,GMRVIT,GMRVITY,GMRVLST,GMRVODR,GMRVWLOC,GMRW,GMRWARD,GMRX,GMRY,GORDER,GQUAL,GREASON,GSIDE,GTXT,GTYPE
 Q
ENTACT ; NURSING VITAL OPTIONS ENTRY ACTION
 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
 Q
MULTIBP ;DISPLAY MULTIPLE B/P
 Q:'$D(GMRTYPE)  S GDATE=GDT S:'$D(GLAST) GLAST=0 S GDT(3)=9999999-(GDT+.00000001),GDT(2)=9999999-(GDT+.00000014) K GDATE
 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
 .S GDATA=^GMR(120.5,GDA,0),(GLAST(1),GCT)=GCT+1
 .K GMRVARY S GMRVARY="" D CHAR^GMRVCHAR(GDA,.GMRVARY,GMRTYPE) S GMRINF=$$WRITECH^GMRVCHAR(GDA,.GMRVARY,9)
 .S GMROV(GTYPE,GCT)=$P(GDATA,"^",8)_"^"_$S(GMRINF'="":" "_GMRINF,1:"")_"^"_GMRVIDT
 .S:GMRVIDT>GLAST GLAST=GMRVIDT
 Q