source: WorldVistAEHR/trunk/r/GEN_MED_REC_VITALS-GMRV/GMRVER1.m@ 703

Last change on this file since 703 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 4.7 KB
Line 
1GMRVER1 ;HIRMFO/RM,YH-REPORT OF VITALS ENTERED IN ERROR FOR A PATIENT ;5/26/99 08:57
2 ;;4.0;Vitals/Measurements;**1,7,11**;Apr 25, 1997
3EN1 ; ENTRY TO REPORT FROM TASKMAN
4 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)=""
5 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
6 U IO D HDR I $O(^TMP($J,0))'>0 W !,"THERE IS NO DATA FOR THIS REPORT" G QT
7 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
8QT ;
9 I IOSL'<($Y+8) F X=1:1 W ! Q:IOSL<($Y+8)
10 I 'GMROUT,$E(IOST)'="P" W !!,"Press return to continue ""^"" to escape " R X:DTIME
11Q ; KILL VARIBLES
12 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
13 K GREASON,GMRZZ,GMRVARY,GX,GMRQUAL,GMRVPO D ^%ZISC Q
14SORT ;
15 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
16 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
17 Q
18WRT ;
19 D:IOSL<($Y+8) HDR Q:GMROUT K GMRPR
20 S GMRVERR=^TMP($J,GMRDATE,GMRVITY,GMRVDA),GMRDAT("GOOD")=$S($D(^GMR(120.5,+GMRVERR,0)):^(0),1:"")
21 I $D(^GMR(120.5,+GMRVERR,0)) D
22 . 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:"*")
23 . S GMRVX(0)=$$WRTDAT^GMRVER0(GMRVX,GMRVX(0))
24 . 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_")"
25 . I GMRVX="P" D
26 .. I GMRZZ'="",GMRVX(0)=1 S:$F(GMRZZ,"DORSALIS PEDIS")>0 GMRVX(1)=""
27 .. I GMRZZ'="",GMRVX(0)=0 S:$F(GMRZZ,"DORSALIS PEDIS")>0 GMRVX(1)="*"
28 .. Q
29 . S GMRVPO=$P(^GMR(120.5,GMRVERR,0),"^",10)
30 . 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
31 . Q
32 I $D(^GMR(120.5,+GMRVDA,0)) D
33 . S GMRDAT("BAD")=$S($D(^GMR(120.5,+GMRVDA,0)):^(0),1:"")
34 . 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:"*")
35 . S GMRVX(0)=$$WRTDAT^GMRVER0(GMRVX,GMRVX(0))
36 . 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_")"
37 . I GMRVX="P" D
38 .. I GMRZZ'="",GMRVX(0)=1 S:$F(GMRZZ,"DORSALIS PEDIS")>0 GMRVX(1)=""
39 .. I GMRZZ'="",GMRVX(0)=0 S:$F(GMRZZ,"DORSALIS PEDIS")>0 GMRVX(1)="*"
40 .. Q
41 . S GMRVPO=$P(^GMR(120.5,GMRVDA,0),"^",10)
42 . 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
43 . S GREASON="" D ERREASON^GMRVER0
44 S Y=GMRDATE D D^DIQ S GMRPR("VSDT")=Y
45 S GMRPR("ENUS")=$S($P(GMRDAT("BAD"),"^",6)="":"",$D(^VA(200,$P(GMRDAT("BAD"),"^",6),0)):$E($P(^(0),"^"),1,21),1:"")
46 S GMRPR("TYPE")=$S(GMRVITY="":"",$D(^GMRD(120.51,GMRVITY,0)):$P(^(0),"^"),1:"")
47 W !,GMRPR("VSDT"),?21,GMRPR("TYPE"),?58,GMRPR("ENUS"),!,?3,"Reason: ",GREASON
48 I $G(GMRVERR)>0 W !,?3,"(Revised) ",$P(GMRDAT("GOOD"),"^",8)
49 I GMRVX="PN" D
50 . I $P(GMRDAT("GOOD"),"^",8)=0 W " No pain" Q
51 . I $P(GMRDAT("GOOD"),"^",8)=99 W " Unable to respond" Q
52 . I $P(GMRDAT("GOOD"),"^",8)=10 W " Worst imaginable pain" Q
53 I GMRVDA>0 W !,?3,"(Bad data) ",$P(GMRDAT("BAD"),"^",8)
54 I GMRVX="PN" D
55 . I $P(GMRDAT("BAD"),"^",8)=0 W " No pain" Q
56 . I $P(GMRDAT("BAD"),"^",8)=99 W " Unable to respond" Q
57 . I $P(GMRDAT("BAD"),"^",8)=10 W " Worst imaginable pain" Q
58 W ! Q
59HDR ;
60 I $E(IOST)'="P",'GMR1ST W !,"Press return to continue ""^"" to escape " R X:DTIME I X="^"!'$T S GMROUT=1 Q
61 W:'($E(IOST)'="C"&'GMRPG) @IOF S GMR1ST=0,GMRPG=GMRPG+1
62 W !,GMRPDT,?22,"ENTERED IN ERROR VITAL/MEASUREMENT REPORT",?70,"PAGE ",GMRPG
63 W !,"Patient: ",VADM(1),?$X+5,$P(VADM(2),"^",2),!!,"Date Vit./Meas. taken",?58,"User who made error",!,GMRDSH,!
64 Q
Note: See TracBrowser for help on using the repository browser.