GMRVER0 ;HIRMFO/RM,YH-REPORT OF VITALS ENTERED IN ERROR FOR A PATIENT ;2/6/99
;;4.0;Vitals/Measurements;**7**;Apr 25, 1997
EN1 ; ENTRY FROM OPTION GMRV ERROR PRINT
K ^TMP($J) S DIC="^DPT(",DIC(0)="AEQM" D ^DIC K DIC Q:+Y'>0 S DFN=+Y
DTS S %DT="AET",%DT("A")="Start with DATE (TIME optional): ",%DT("B")="T-7" D ^%DT K %DT I +Y'>0 G Q
S GMRVSDT=+Y
S %DT="AET",%DT("A")="go to DATE (TIME optional): ",%DT("B")="NOW" D ^%DT K %DT I X="^" G Q
I +Y'>0!($P(Y,".",2)'>0&(DT=Y)) D NOW^%DTC S Y=%
I $P(Y,".",2)'>0 S Y=Y_$S(Y[".":"2400",1:".2400")
I GMRVSDT>+Y W !,?3,$C(7),"THE START DATE MUST BE BEFORE THE END DATE OF THIS REPORT" G DTS
S GMRVFDT=+Y
DEV S %ZIS="Q" D ^%ZIS K %ZIS G:POP Q I $E(IOST)="P",'$D(IO("Q")),'$D(IO("S")) D ^%ZISC W !,?3,"PRINTED REPORTS MUST BE QUEUED!!",$C(7) G DEV
I $D(IO("Q")) S (ZTSAVE("DFN"),ZTSAVE("GMRVSDT"),ZTSAVE("GMRVFDT"))="",ZTIO=ION,ZTDESC="Entered in error vital/measurement report",ZTRTN="EN1^GMRVER1" D ^%ZTLOAD K IO("Q"),ZTSK,ZTIO G Q
G EN1^GMRVER1
Q G Q^GMRVER1
ERREASON ;ERROR REASON
Q:'$D(^GMR(120.5,+GMRVDA,2.1))
S GER=0 F S GER=$O(^GMR(120.5,+GMRVDA,2.1,GER)) Q:GER'>0 S GER(1)=+$G(^GMR(120.5,+GMRVDA,2.1,GER,0)) D
. S GER(2)=$S(GER(1)=1:"incorrect date/time",GER(1)=2:"incorrect reading",GER(1)=3:"incorrect patient",GER(1)=4:"invalid record",1:"")
. I GER(2)'="" S GREASON=GREASON_$S(GREASON'="":", ",1:"")_GER(2)
.Q
K GER Q
WRTDAT(TYPE,DATA) ;
I '((TYPE="BP")!(TYPE="P")!(TYPE="R")),DATA>0 D @TYPE
Q DATA
T S DATA=DATA_" F ("_$J(+DATA-32*5/9,0,1)_" C)" Q
WT S DATA=DATA_" lb ("_$J(DATA/2.2,0,2)_" kg)" Q
HT S DATA=$S(DATA\12:DATA\12_" ft ",1:"")_$S(DATA#12:DATA#12_" in",1:"")_" ("_$J(DATA*2.54,0,2)_" cm)" Q
CG S DATA=DATA_" in ("_$J(+DATA/.3937,0,2)_" cm)" Q
CVP S DATA=DATA_" cmH2O ("_$J(DATA/1.36,0,1)_" mmHg)" Q
PO2 S DATA=DATA_"%" Q
PN I DATA=0 S DATA=DATA_" No pain " Q
I DATA=99 S DATA=DATA_" Unable to respond " Q
I DATA=10 S DATA=DATA_" Worst imaginable pain " Q
Q
GMRVER0 ;HIRMFO/RM,YH-REPORT OF VITALS ENTERED IN ERROR FOR A PATIENT ;2/6/99
+1 ;;4.0;Vitals/Measurements;**7**;Apr 25, 1997
EN1 ; ENTRY FROM OPTION GMRV ERROR PRINT
+1 KILL ^TMP($JOB)
SET DIC="^DPT("
SET DIC(0)="AEQM"
DO ^DIC
KILL DIC
IF +Y'>0
QUIT
SET DFN=+Y
DTS SET %DT="AET"
SET %DT("A")="Start with DATE (TIME optional): "
SET %DT("B")="T-7"
DO ^%DT
KILL %DT
IF +Y'>0
GOTO Q
+1 SET GMRVSDT=+Y
+2 SET %DT="AET"
SET %DT("A")="go to DATE (TIME optional): "
SET %DT("B")="NOW"
DO ^%DT
KILL %DT
IF X="^"
GOTO Q
+3 IF +Y'>0!($PIECE(Y,".",2)'>0&(DT=Y))
DO NOW^%DTC
SET Y=%
+4 IF $PIECE(Y,".",2)'>0
SET Y=Y_$SELECT(Y[".":"2400",1:".2400")
+5 IF GMRVSDT>+Y
WRITE !,?3,$CHAR(7),"THE START DATE MUST BE BEFORE THE END DATE OF THIS REPORT"
GOTO DTS
+6 SET GMRVFDT=+Y
DEV SET %ZIS="Q"
DO ^%ZIS
KILL %ZIS
IF POP
GOTO Q
IF $EXTRACT(IOST)="P"
IF '$DATA(IO("Q"))
IF '$DATA(IO("S"))
DO ^%ZISC
WRITE !,?3,"PRINTED REPORTS MUST BE QUEUED!!",$CHAR(7)
GOTO DEV
+1 IF $DATA(IO("Q"))
SET (ZTSAVE("DFN"),ZTSAVE("GMRVSDT"),ZTSAVE("GMRVFDT"))=""
SET ZTIO=ION
SET ZTDESC="Entered in error vital/measurement report"
SET ZTRTN="EN1^GMRVER1"
DO ^%ZTLOAD
KILL IO("Q"),ZTSK,ZTIO
GOTO Q
+2 GOTO EN1^GMRVER1
Q GOTO Q^GMRVER1
ERREASON ;ERROR REASON
+1 IF '$DATA(^GMR(120.5,+GMRVDA,2.1))
QUIT
+2 SET GER=0
FOR
SET GER=$ORDER(^GMR(120.5,+GMRVDA,2.1,GER))
IF GER'>0
QUIT
SET GER(1)=+$GET(^GMR(120.5,+GMRVDA,2.1,GER,0))
Begin DoDot:1
+3 SET GER(2)=$SELECT(GER(1)=1:"incorrect date/time",GER(1)=2:"incorrect reading",GER(1)=3:"incorrect patient",GER(1)=4:"invalid record",1:"")
+4 IF GER(2)'=""
SET GREASON=GREASON_$SELECT(GREASON'="":", ",1:"")_GER(2)
+5 QUIT
End DoDot:1
+6 KILL GER
QUIT
WRTDAT(TYPE,DATA) ;
+1 IF '((TYPE="BP")!(TYPE="P")!(TYPE="R"))
IF DATA>0
DO @TYPE
+2 QUIT DATA
T SET DATA=DATA_" F ("_$JUSTIFY(+DATA-32*5/9,0,1)_" C)"
QUIT
WT SET DATA=DATA_" lb ("_$JUSTIFY(DATA/2.2,0,2)_" kg)"
QUIT
HT SET DATA=$SELECT(DATA\12:DATA\12_" ft ",1:"")_$SELECT(DATA#12:DATA#12_" in",1:"")_" ("_$JUSTIFY(DATA*2.54,0,2)_" cm)"
QUIT
CG SET DATA=DATA_" in ("_$JUSTIFY(+DATA/.3937,0,2)_" cm)"
QUIT
CVP SET DATA=DATA_" cmH2O ("_$JUSTIFY(DATA/1.36,0,1)_" mmHg)"
QUIT
PO2 SET DATA=DATA_"%"
QUIT
PN IF DATA=0
SET DATA=DATA_" No pain "
QUIT
+1 IF DATA=99
SET DATA=DATA_" Unable to respond "
QUIT
+2 IF DATA=10
SET DATA=DATA_" Worst imaginable pain "
QUIT
+3 QUIT