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

GMRVER1.m

Go to the documentation of this file.
GMRVER1 ;HIRMFO/RM,YH-REPORT OF VITALS ENTERED IN ERROR FOR A PATIENT ;5/26/99  08:57
 ;;4.0;Vitals/Measurements;**1,7,11**;Apr 25, 1997
EN1 ; ENTRY TO REPORT FROM TASKMAN
 D DEM^VADPT D NOW^%DTC S Y=% X ^DD("DD") S GMRPDT=$P(Y,"@")_" ("_$P($P(Y,"@",2),":",1,2)_")",(GMROUT,GMRPG)=0,GMR1ST=1,$P(GMRDSH,"-",81)=""
 F GMRVITY=0:0 S GMRVITY=$O(^GMR(120.5,"AA",DFN,GMRVITY)) Q:GMRVITY'>0  F GMRVDT=0:0 S GMRVDT=$O(^GMR(120.5,"AA",DFN,GMRVITY,GMRVDT)) Q:GMRVDT'>0  S GMRVDATE=9999999-GMRVDT I GMRVDATE'<GMRVSDT,GMRVDATE'>GMRVFDT D SORT
 U IO D HDR I $O(^TMP($J,0))'>0 W !,"THERE IS NO DATA FOR THIS REPORT" G QT
 F GMRDATE=0:0 S GMRDATE=$O(^TMP($J,GMRDATE)) Q:GMRDATE'>0!GMROUT  F GMRVITY=0:0 S GMRVITY=$O(^TMP($J,GMRDATE,GMRVITY)) Q:GMRVITY'>0!GMROUT  F GMRVDA=0:0 S GMRVDA=$O(^TMP($J,GMRDATE,GMRVITY,GMRVDA)) Q:GMRVDA'>0  D WRT Q:GMROUT
QT ;
 I IOSL'<($Y+8) F X=1:1 W ! Q:IOSL<($Y+8)
 I 'GMROUT,$E(IOST)'="P" W !!,"Press return to continue ""^"" to escape " R X:DTIME
Q ; KILL VARIBLES
 S:$D(ZTQUEUED) ZTREQ="@" K ^TMP($J),DFN,GMR1ST,GMRDAT,GMRDATE,GMRDSH,GMROUT,GMRPDT,GMRPG,GMRPR,GMRSITE,GMRVDA,GMRVDATE,GMRVDT,GMRVERR,GMRVFDT,GMRVITY,GMRVSDT,GMRVX,POP,DIPGM,GMRP,GMRTYPE,GMROV,DIPGM,%T D KVAR^VADPT K VA W:$E(IOST)'="C" @IOF
 K GREASON,GMRZZ,GMRVARY,GX,GMRQUAL,GMRVPO D ^%ZISC Q
SORT ;
 F GMRVERR=0:0 S GMRVERR=$O(^GMR(120.5,"AA",DFN,GMRVITY,GMRVDT,GMRVERR)) Q:GMRVERR'>0  I '$D(^GMR(120.5,GMRVERR,2)) Q
 F GMRVDA=0:0 S GMRVDA=$O(^GMR(120.5,"AA",DFN,GMRVITY,GMRVDT,GMRVDA)) Q:GMRVDA'>0  I $D(^GMR(120.5,GMRVDA,2)) S ^TMP($J,GMRVDATE,GMRVITY,GMRVDA)=GMRVERR
 Q
WRT ;
 D:IOSL<($Y+8) HDR Q:GMROUT  K GMRPR
 S GMRVERR=^TMP($J,GMRDATE,GMRVITY,GMRVDA),GMRDAT("GOOD")=$S($D(^GMR(120.5,+GMRVERR,0)):^(0),1:"")
 I $D(^GMR(120.5,+GMRVERR,0)) D
 . K GMRVX S GMRVX=$P(^GMRD(120.51,GMRVITY,0),"^",2),GMRVX(0)=$P(GMRDAT("GOOD"),"^",8) D:GMRVX(0)>0!(GMRVX(0)=0) EN1^GMRVSAS0 S GMRVX(1)=$S('$D(GMRVX(1)):"",'GMRVX(1):"",1:"*")
 . S GMRVX(0)=$$WRTDAT^GMRVER0(GMRVX,GMRVX(0))
 . S GMRZZ="" I $P($G(^GMR(120.5,GMRVERR,5,0)),"^",4)>0 K GMRVARY S GMRVARY="" D CHAR^GMRVCHAR(GMRVERR,.GMRVARY,GMRVITY) S GMRZZ=$$WRITECH^GMRVCHAR(GMRVERR,.GMRVARY,9) S:GMRZZ'=""&(GMRVX'="PO2") GMRZZ=" ("_GMRZZ_")"
 . I GMRVX="P" D
 .. I GMRZZ'="",GMRVX(0)=1 S:$F(GMRZZ,"DORSALIS PEDIS")>0 GMRVX(1)=""
 .. I GMRZZ'="",GMRVX(0)=0 S:$F(GMRZZ,"DORSALIS PEDIS")>0 GMRVX(1)="*"
 .. Q
 . S GMRVPO=$P(^GMR(120.5,GMRVERR,0),"^",10)
 . S $P(GMRDAT("GOOD"),"^",8)=GMRVX(0)_GMRVX(1)_$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:"")_$S(GMRZZ'=""&(GMRVX="PO2"):" via ",1:"")_GMRZZ
 . Q
 I $D(^GMR(120.5,+GMRVDA,0)) D
 . S GMRDAT("BAD")=$S($D(^GMR(120.5,+GMRVDA,0)):^(0),1:"")
 . K GMRVX,GMRVX(0),GMRVX(1) S GMRVX=$P(^GMRD(120.51,GMRVITY,0),"^",2),GMRVX(0)=$P(GMRDAT("BAD"),"^",8) D:GMRVX(0)>0 EN1^GMRVSAS0 S GMRVX(1)=$S('$D(GMRVX(1)):"",'GMRVX(1):"",1:"*")
 . S GMRVX(0)=$$WRTDAT^GMRVER0(GMRVX,GMRVX(0))
 . S GMRZZ="" I $P($G(^GMR(120.5,GMRVDA,5,0)),"^",4)>0 K GMRVARY S GMRVARY="" D CHAR^GMRVCHAR(GMRVDA,.GMRVARY,GMRVITY) S GMRZZ=$$WRITECH^GMRVCHAR(GMRVDA,.GMRVARY,9) S:GMRZZ'=""&(GMRVX'="PO2") GMRZZ=" ("_GMRZZ_")"
 . I GMRVX="P" D
 .. I GMRZZ'="",GMRVX(0)=1 S:$F(GMRZZ,"DORSALIS PEDIS")>0 GMRVX(1)=""
 .. I GMRZZ'="",GMRVX(0)=0 S:$F(GMRZZ,"DORSALIS PEDIS")>0 GMRVX(1)="*"
 .. Q
 . S GMRVPO=$P(^GMR(120.5,GMRVDA,0),"^",10)
 . S $P(GMRDAT("BAD"),"^",8)=GMRVX(0)_GMRVX(1)_$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:"")_$S(GMRZZ'=""&(GMRVX="PO2"):" via ",1:"")_GMRZZ
 . S GREASON="" D ERREASON^GMRVER0
 S Y=GMRDATE D D^DIQ S GMRPR("VSDT")=Y
 S GMRPR("ENUS")=$S($P(GMRDAT("BAD"),"^",6)="":"",$D(^VA(200,$P(GMRDAT("BAD"),"^",6),0)):$E($P(^(0),"^"),1,21),1:"")
 S GMRPR("TYPE")=$S(GMRVITY="":"",$D(^GMRD(120.51,GMRVITY,0)):$P(^(0),"^"),1:"")
 W !,GMRPR("VSDT"),?21,GMRPR("TYPE"),?58,GMRPR("ENUS"),!,?3,"Reason: ",GREASON
 I $G(GMRVERR)>0 W !,?3,"(Revised)  ",$P(GMRDAT("GOOD"),"^",8)
 I GMRVX="PN" D
 . I $P(GMRDAT("GOOD"),"^",8)=0 W " No pain" Q
 . I $P(GMRDAT("GOOD"),"^",8)=99 W " Unable to respond" Q
 . I $P(GMRDAT("GOOD"),"^",8)=10 W " Worst imaginable pain" Q
 I GMRVDA>0 W !,?3,"(Bad data)  ",$P(GMRDAT("BAD"),"^",8)
 I GMRVX="PN" D
 . I $P(GMRDAT("BAD"),"^",8)=0 W " No pain" Q
 . I $P(GMRDAT("BAD"),"^",8)=99 W " Unable to respond" Q
 . I $P(GMRDAT("BAD"),"^",8)=10 W " Worst imaginable pain" Q
 W ! Q
HDR ;
 I $E(IOST)'="P",'GMR1ST W !,"Press return to continue ""^"" to escape " R X:DTIME I X="^"!'$T S GMROUT=1 Q
 W:'($E(IOST)'="C"&'GMRPG) @IOF S GMR1ST=0,GMRPG=GMRPG+1
 W !,GMRPDT,?22,"ENTERED IN ERROR VITAL/MEASUREMENT REPORT",?70,"PAGE ",GMRPG
 W !,"Patient: ",VADM(1),?$X+5,$P(VADM(2),"^",2),!!,"Date Vit./Meas. taken",?58,"User who made error",!,GMRDSH,!
 Q