PXEDIM ;ISL/PKR - Main driver for letting users look at PCE device interface errors. ;6/7/96
;;1.0;PCE PATIENT CARE ENCOUNTER;;Aug 12, 1996
;
;Give the user a choice on how to look up errors.
N TEMP,X,Y
K DIRUT,DTOUT,DUOUT
S DIR(0)="SO"_U_"ERN:Error Number;PDT:Processing Date and Time;EDT:Encounter Date and Time;PAT:Patient Name"
S DIR("A")="Look up PCE device interface errors based on"
S DIR("B")="ERN"
S TEMP="You may look up PCE device interface errors by Error Number, Error Date and Time,"
S TEMP=TEMP_" Encounter Date and Time, or by Patient Name."
S DIR("?")=TEMP
D ^DIR K DIR
I Y=(U_U) S DTOUT=1
I ($D(DTOUT))!($D(DUOUT)) Q
;
;Get the detailed look up information.
N BERN,BENDT,BERDT,EERN,EENDT,EERDT
N OPT,PATIENT,NPATIENT
S OPT=Y
I OPT="EDT" D DT^PXEDILUD(.BENDT,.EENDT,"ENCOUNTER")
I OPT="ERN" D EN^PXEDILUD(.BERN,.EERN)
I OPT="PAT" D PAT^PXEDILUD
I OPT="PDT" D DT^PXEDILUD(.BERDT,.EERDT,"PROCESSING")
I ($D(DTOUT))!($D(DUOUT)) Q
;
;Make sure the scratch array is initialized.
K ^TMP("PXEDI",$J)
;
;Look up the errors.
I OPT="ERN" D ERN^PXEDIELU
I OPT="PDT" D PDT^PXEDIELU
I OPT="EDT" D EDT^PXEDIELU
I OPT="PAT" D PAT^PXEDIELU
;
I '$D(^TMP("PXEDI",$J)) D Q
. W !!,"There are no PCE device interface errors to process!",!
;
;Determine where the listing will be printed.
S %ZIS="QM"
W !
D ^%ZIS
I POP G END
;
;Queue the report.
N DESC,IODEV
I $D(IO("Q")) D
. S DESC="Print PCE device interface errors"
. S IODEV=ION_";"_IOST_";"_IOM_";"_IOSL
. S ZTSAVE("^TMP(""PXEDI"",$J,")=""
. S ZTSAVE("BERN")="",ZTSAVE("EERN")=""
. S ZTSAVE("BENDT")="",ZTSAVE("EENDT")=""
. S ZTSAVE("BERDT")="",ZTSAVE("EERDT")=""
. S ZTSAVE("PATIENT(")="",ZTSAVE("NPATIENT")=""
. S ZTSAVE("OPT")=""
. S ZTDESC=DESC
. S ZTIO=IODEV
. S ZTDTH=$$NOW^XLFDT
. S ZTRTN="PR^PXEDIP"
. D ^%ZTLOAD
. I $D(ZTSK)[0 W !!,DESC_" cancelled"
. E W !!,DESC_" has been queued, task number "_ZTSK
;Non queued output.
E D PR^PXEDIP
;
END ;
D HOME^%ZIS
K IO("Q")
K POP
K ^TMP("PXEDI",$J)
Q
PXEDIM ;ISL/PKR - Main driver for letting users look at PCE device interface errors. ;6/7/96
+1 ;;1.0;PCE PATIENT CARE ENCOUNTER;;Aug 12, 1996
+2 ;
+3 ;Give the user a choice on how to look up errors.
+4 NEW TEMP,X,Y
+5 KILL DIRUT,DTOUT,DUOUT
+6 SET DIR(0)="SO"_U_"ERN:Error Number;PDT:Processing Date and Time;EDT:Encounter Date and Time;PAT:Patient Name"
+7 SET DIR("A")="Look up PCE device interface errors based on"
+8 SET DIR("B")="ERN"
+9 SET TEMP="You may look up PCE device interface errors by Error Number, Error Date and Time,"
+10 SET TEMP=TEMP_" Encounter Date and Time, or by Patient Name."
+11 SET DIR("?")=TEMP
+12 DO ^DIR
KILL DIR
+13 IF Y=(U_U)
SET DTOUT=1
+14 IF ($DATA(DTOUT))!($DATA(DUOUT))
QUIT
+15 ;
+16 ;Get the detailed look up information.
+17 NEW BERN,BENDT,BERDT,EERN,EENDT,EERDT
+18 NEW OPT,PATIENT,NPATIENT
+19 SET OPT=Y
+20 IF OPT="EDT"
DO DT^PXEDILUD(.BENDT,.EENDT,"ENCOUNTER")
+21 IF OPT="ERN"
DO EN^PXEDILUD(.BERN,.EERN)
+22 IF OPT="PAT"
DO PAT^PXEDILUD
+23 IF OPT="PDT"
DO DT^PXEDILUD(.BERDT,.EERDT,"PROCESSING")
+24 IF ($DATA(DTOUT))!($DATA(DUOUT))
QUIT
+25 ;
+26 ;Make sure the scratch array is initialized.
+27 KILL ^TMP("PXEDI",$JOB)
+28 ;
+29 ;Look up the errors.
+30 IF OPT="ERN"
DO ERN^PXEDIELU
+31 IF OPT="PDT"
DO PDT^PXEDIELU
+32 IF OPT="EDT"
DO EDT^PXEDIELU
+33 IF OPT="PAT"
DO PAT^PXEDIELU
+34 ;
+35 IF '$DATA(^TMP("PXEDI",$JOB))
Begin DoDot:1
+36 WRITE !!,"There are no PCE device interface errors to process!",!
End DoDot:1
QUIT
+37 ;
+38 ;Determine where the listing will be printed.
+39 SET %ZIS="QM"
+40 WRITE !
+41 DO ^%ZIS
+42 IF POP
GOTO END
+43 ;
+44 ;Queue the report.
+45 NEW DESC,IODEV
+46 IF $DATA(IO("Q"))
Begin DoDot:1
+47 SET DESC="Print PCE device interface errors"
+48 SET IODEV=ION_";"_IOST_";"_IOM_";"_IOSL
+49 SET ZTSAVE("^TMP(""PXEDI"",$J,")=""
+50 SET ZTSAVE("BERN")=""
SET ZTSAVE("EERN")=""
+51 SET ZTSAVE("BENDT")=""
SET ZTSAVE("EENDT")=""
+52 SET ZTSAVE("BERDT")=""
SET ZTSAVE("EERDT")=""
+53 SET ZTSAVE("PATIENT(")=""
SET ZTSAVE("NPATIENT")=""
+54 SET ZTSAVE("OPT")=""
+55 SET ZTDESC=DESC
+56 SET ZTIO=IODEV
+57 SET ZTDTH=$$NOW^XLFDT
+58 SET ZTRTN="PR^PXEDIP"
+59 DO ^%ZTLOAD
+60 IF $DATA(ZTSK)[0
WRITE !!,DESC_" cancelled"
+61 IF '$TEST
WRITE !!,DESC_" has been queued, task number "_ZTSK
End DoDot:1
+62 ;Non queued output.
+63 IF '$TEST
DO PR^PXEDIP
+64 ;
END ;
+1 DO HOME^%ZIS
+2 KILL IO("Q")
+3 KILL POP
+4 KILL ^TMP("PXEDI",$JOB)
+5 QUIT