GMVER0 ;HOIFO/FT-VITALS ENTERED IN ERROR FOR A PATIENT ;10/25/02 10:26
;;5.0;GEN. MED. REC. - VITALS;**23**;Oct 31, 2002;Build 25
;
; This routine uses the following IAs:
; #10061 - ^VADPT calls (supported)
; #10103 - ^XLFDT calls (supported)
; #10104 - ^XLFSTR calls (supported)
;
EN1(RESULT,GMVDATA) ; GMV ENTERED IN ERROR-PATIENT [RPC entry point]
; Queues a report to a printer
; GMVDATA=DFN^START DT^END DT^TYPE OF GRAPH^DEVICE^DEVICE IEN(#3.5)^
; DATE/TIME TO PRINT REPORT
;
N DFN,GMVBEG,GMVEND,GMVDEV,GMVIEN,GMVPDT
S DFN=+$P(GMVDATA,"^",1),GMVBEG=$P(GMVDATA,"^",2),GMVEND=$P(GMVDATA,"^",3),GMVDEV=$P(GMVDATA,"^",5),GMVIEN=+$P(GMVDATA,"^",6),GMVPDT=$P(GMVDATA,"^",7)
S ZTIO=GMVDEV ;device
S ZTDTH=$S($G(GMVPDT)>0:GMVPDT,1:$$NOW^XLFDT()) ;date/time to print
S (ZTSAVE("DFN"),ZTSAVE("GMVBEG"),ZTSAVE("GMVEND"))=""
S ZTDESC="Entered in error vital/measurement report"
S ZTRTN="START^GMVER0"
D ^%ZTLOAD
S RESULT=$S($G(ZTSK)>0:"Report sent to device. Task #: "_ZTSK,1:"Unable to task the report.")
K ZTDESC,ZTDTH,ZTIO,ZTRTN,ZTSAVE,ZTSK
D ^%ZISC
Q
START ; Start the report output
U IO
S:$D(ZTQUEUED) ZTREQ="@"
S GMVPAGE=0
S GMVDASH=$$REPEAT^XLFSTR("-",80) ;line of dashes
S GMVNOW=$$NOW^XLFDT() ;current date/time
S GMVNOW=$$FMTE^XLFDT(GMVNOW)
S GMVRANGE=$$FMTE^XLFDT(GMVBEG)_"-"_$$FMTE^XLFDT(GMVEND) ;date range in
; external format (for header)
D DEM^VADPT ;get patient demographic data
S GMVNAME=VADM(1) ;patient name
S GMVSSN=$P(VADM(2),"^",2) ;patient ssn
D EN1^GMVER1(.GMVARRAY,DFN,GMVBEG,GMVEND) ;get entered-in-error data
D HEADER
S GMVNONE=$G(^TMP($J,"ERRORS",0))
I $L(GMVNONE)>0 W !,GMVNONE D KILL Q
S GMVDATE=0
F S GMVDATE=$O(^TMP($J,"ERRORS",GMVDATE)) Q:'GMVDATE D
.S GMVITY=0
.F S GMVITY=$O(^TMP($J,"ERRORS",GMVDATE,GMVITY)) Q:'GMVITY D
..S GMVDA=0
..F S GMVDA=$O(^TMP($J,"ERRORS",GMVDATE,GMVITY,GMVDA)) Q:'GMVDA D
...S GMVLOOP=0
...F S GMVLOOP=$O(^TMP($J,"ERRORS",GMVDATE,GMVITY,GMVDA,GMVLOOP)) Q:'GMVLOOP D
....S GMVNODE=^TMP($J,"ERRORS",GMVDATE,GMVITY,GMVDA,GMVLOOP)
....I $Y+6>IOSL D HEADER
....W !,GMVNODE
....I GMVLOOP=4 W !
....Q
...Q
..Q
.Q
KILL ; Kill variables
D KVAR^VADPT ;clean up VADPT variables
K ^TMP($J,"ERRORS")
K GMVDASH,GMVNAME,GMVNOW,GMVPAGE,GMVSSN,X,Y
D ^%ZISC
Q
W:$Y>0 @IOF
S GMVPAGE=GMVPAGE+1
W !,GMVNOW,?22,"ENTERED IN ERROR VITAL/MEASUREMENT REPORT",?70,"PAGE: ",GMVPAGE
W !?22,GMVRANGE
W !?22,"Patient: ",GMVNAME,?$X+5,$E(GMVSSN,8,11)
W !!,"Date Vit./Meas. taken",?58,"User who made error"
W !,GMVDASH,!
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HGMVER0 2645 printed Dec 13, 2024@01:58:41 Page 2
GMVER0 ;HOIFO/FT-VITALS ENTERED IN ERROR FOR A PATIENT ;10/25/02 10:26
+1 ;;5.0;GEN. MED. REC. - VITALS;**23**;Oct 31, 2002;Build 25
+2 ;
+3 ; This routine uses the following IAs:
+4 ; #10061 - ^VADPT calls (supported)
+5 ; #10103 - ^XLFDT calls (supported)
+6 ; #10104 - ^XLFSTR calls (supported)
+7 ;
EN1(RESULT,GMVDATA) ; GMV ENTERED IN ERROR-PATIENT [RPC entry point]
+1 ; Queues a report to a printer
+2 ; GMVDATA=DFN^START DT^END DT^TYPE OF GRAPH^DEVICE^DEVICE IEN(#3.5)^
+3 ; DATE/TIME TO PRINT REPORT
+4 ;
+5 NEW DFN,GMVBEG,GMVEND,GMVDEV,GMVIEN,GMVPDT
+6 SET DFN=+$PIECE(GMVDATA,"^",1)
SET GMVBEG=$PIECE(GMVDATA,"^",2)
SET GMVEND=$PIECE(GMVDATA,"^",3)
SET GMVDEV=$PIECE(GMVDATA,"^",5)
SET GMVIEN=+$PIECE(GMVDATA,"^",6)
SET GMVPDT=$PIECE(GMVDATA,"^",7)
+7 ;device
SET ZTIO=GMVDEV
+8 ;date/time to print
SET ZTDTH=$SELECT($GET(GMVPDT)>0:GMVPDT,1:$$NOW^XLFDT())
+9 SET (ZTSAVE("DFN"),ZTSAVE("GMVBEG"),ZTSAVE("GMVEND"))=""
+10 SET ZTDESC="Entered in error vital/measurement report"
+11 SET ZTRTN="START^GMVER0"
+12 DO ^%ZTLOAD
+13 SET RESULT=$SELECT($GET(ZTSK)>0:"Report sent to device. Task #: "_ZTSK,1:"Unable to task the report.")
+14 KILL ZTDESC,ZTDTH,ZTIO,ZTRTN,ZTSAVE,ZTSK
+15 DO ^%ZISC
+16 QUIT
START ; Start the report output
+1 USE IO
+2 if $DATA(ZTQUEUED)
SET ZTREQ="@"
+3 SET GMVPAGE=0
+4 ;line of dashes
SET GMVDASH=$$REPEAT^XLFSTR("-",80)
+5 ;current date/time
SET GMVNOW=$$NOW^XLFDT()
+6 SET GMVNOW=$$FMTE^XLFDT(GMVNOW)
+7 ;date range in
SET GMVRANGE=$$FMTE^XLFDT(GMVBEG)_"-"_$$FMTE^XLFDT(GMVEND)
+8 ; external format (for header)
+9 ;get patient demographic data
DO DEM^VADPT
+10 ;patient name
SET GMVNAME=VADM(1)
+11 ;patient ssn
SET GMVSSN=$PIECE(VADM(2),"^",2)
+12 ;get entered-in-error data
DO EN1^GMVER1(.GMVARRAY,DFN,GMVBEG,GMVEND)
+13 DO HEADER
+14 SET GMVNONE=$GET(^TMP($JOB,"ERRORS",0))
+15 IF $LENGTH(GMVNONE)>0
WRITE !,GMVNONE
DO KILL
QUIT
+16 SET GMVDATE=0
+17 FOR
SET GMVDATE=$ORDER(^TMP($JOB,"ERRORS",GMVDATE))
if 'GMVDATE
QUIT
Begin DoDot:1
+18 SET GMVITY=0
+19 FOR
SET GMVITY=$ORDER(^TMP($JOB,"ERRORS",GMVDATE,GMVITY))
if 'GMVITY
QUIT
Begin DoDot:2
+20 SET GMVDA=0
+21 FOR
SET GMVDA=$ORDER(^TMP($JOB,"ERRORS",GMVDATE,GMVITY,GMVDA))
if 'GMVDA
QUIT
Begin DoDot:3
+22 SET GMVLOOP=0
+23 FOR
SET GMVLOOP=$ORDER(^TMP($JOB,"ERRORS",GMVDATE,GMVITY,GMVDA,GMVLOOP))
if 'GMVLOOP
QUIT
Begin DoDot:4
+24 SET GMVNODE=^TMP($JOB,"ERRORS",GMVDATE,GMVITY,GMVDA,GMVLOOP)
+25 IF $Y+6>IOSL
DO HEADER
+26 WRITE !,GMVNODE
+27 IF GMVLOOP=4
WRITE !
+28 QUIT
End DoDot:4
+29 QUIT
End DoDot:3
+30 QUIT
End DoDot:2
+31 QUIT
End DoDot:1
KILL ; Kill variables
+1 ;clean up VADPT variables
DO KVAR^VADPT
+2 KILL ^TMP($JOB,"ERRORS")
+3 KILL GMVDASH,GMVNAME,GMVNOW,GMVPAGE,GMVSSN,X,Y
+4 DO ^%ZISC
+5 QUIT
+1 if $Y>0
WRITE @IOF
+2 SET GMVPAGE=GMVPAGE+1
+3 WRITE !,GMVNOW,?22,"ENTERED IN ERROR VITAL/MEASUREMENT REPORT",?70,"PAGE: ",GMVPAGE
+4 WRITE !?22,GMVRANGE
+5 WRITE !?22,"Patient: ",GMVNAME,?$X+5,$EXTRACT(GMVSSN,8,11)
+6 WRITE !!,"Date Vit./Meas. taken",?58,"User who made error"
+7 WRITE !,GMVDASH,!
+8 QUIT