SCMCHLR8 ;ALB/KCL - PCMM HL7 Reject Transmission Report; 22-FEB-2000
;;5.3;Scheduling;**210**;AUG 13, 1993
;
TERPRT ; Description: Main entry point for the PCMM HL7 Reject Transmission Report.
;
;Control variables used in generating report:
; SCRP("BEGIN")=<begining of the date range for error list>
; SCRP("END")=<ending date of range>
; SCRP("SELCT")=<select 'A'->all errors or 'D'->Date Range>
; SCRP("SORT")=<used to determine sort criteria>
; SCRP("EPS")=<used to determine the error processing status>
;
N SCRP
;
;Get report parameters
Q:'$$SELECT(.SCRP)
Q:'$$ASKRANGE(.SCRP)
Q:'$$SORTBY(.SCRP)
Q:'$$EPS(.SCRP)
;
;Print report
I $$DEVICE() D PRINT^SCMCHLR9
;
Q
;
;
DEVICE() ; Description: Allows the user to select a device.
;
; Input: None
;
; Output:
; Function Value - Returns 0 if the user decides not to print or
; to queue the report, 1 otherwise.
;
N OK
S OK=1
S %ZIS="MQ"
D ^%ZIS
S:POP OK=0
D:OK&$D(IO("Q"))
.S ZTRTN="PRINT^SCMCHLR9",ZTDESC="PCMM Transmission Error REPORT",ZTSAVE("SCRP(")=""
.D ^%ZTLOAD
.W !,$S($D(ZTSK):"REQUEST QUEUED TASK="_ZTSK,1:"REQUEST CANCELLED")
.D HOME^%ZIS
.S OK=0
;
Q OK
;
;
SELECT(SCRP) ; Description: Ask the user to select 'all errors' or errors for a 'date range'.
;
; Input: None
;
; Output:
; Function value - 1 if user selected all errors, 0 otherwise
; SCRP("SELCT") - (pass by reference) used to return list filter
;
N DIR,DTOUT,DUOUT,X,Y
;
;Ask user to select all errors or date range
S DIR(0)="SMO^A:All Errors;D:Date Range"
S DIR("A")="Select all errors or a date range"
S DIR("?",1)="You have a choice of selecting all errors to be printed,"
S DIR("?")="or errors may be printed for a specified date range."
D ^DIR
;Process user response
Q:$D(DIRUT) 0
S SCRP("SELCT")=Y
Q 1
;
;
ASKRANGE(SCRP) ;
; Description: Asks the user to enter a date range for report.
;
;If user selected ALL errors, init begin and end dates and quit
I $G(SCRP("SELCT"))="A" D Q 1
.S SCRP("BEGIN")=0
.S SCRP("END")=DT
;Otherwise, ask user for date range
Q:'$$ASKBEGIN(.SCRP) 0
Q:'$$ASKEND(.SCRP) 0
Q 1
;
;
ASKBEGIN(SCRP) ;
;Description: Asks the user to enter a begin date.
;
; Input: None
;
; Output:
; Function value - 1 if user selected a date, 0 otherwise
; SCRP("BEGIN")=(pass by reference) used to return date selected
;
N DIR,DTOUT,DUOUT,X,Y
S DIR(0)="D^::EX"
S DIR("A")="Enter Beginning Date"
S DIR("B")=$$FMTE^XLFDT($$FMADD^XLFDT(DT,-14),"D")
S DIR("?")="Enter the first day to begin searching for PCMM Transmission Errors."
REPEAT D ^DIR
Q:$D(DIRUT) 0
I Y>DT W !,"Date can not be latter than today!" G REPEAT
S SCRP("BEGIN")=Y
Q 1
;
;
ASKEND(SCRP) ;
; Description: Asks the user to enter an end date.
;
; Input:
; SCRP("BEGIN") - the earliest possible date
;
; Output:
; Function value - 1 if user selected a date, 0 otherwise
; SCRP("END")=(pass by reference) used to return date selected
;
N DIR,DTOUT,DUOUT,X,Y
S DIR(0)="D^::EX"
S DIR("A")="Enter Ending Date"
;S DIR("B")=$$FMTE^XLFDT(SCRP("BEGIN"),"D")
S DIR("B")=$$FMTE^XLFDT(DT,"D")
S DIR("?")="Enter the last day to list transmission errors for."
AGAIN D ^DIR
Q:$D(DIRUT) 0
I (Y<$G(SCRP("BEGIN"))) W !,"Date must not be earlier than "_DIR("B") G AGAIN
S SCRP("END")=Y
Q 1
;
;
SORTBY(SCRP) ; Description: Ask the user to enter a sort criteria for printing errors.
;
; Input: None
;
; Output:
; Function value - 1 if user selected a sort, 0 otherwise
; SCRP("SORT") - (pass by reference) used to return sort by criteria
;
N DIR,DTOUT,DUOUT,X,Y
;Ask user to select sort by criteria
S DIR(0)="SMO^N:Patient Name;D:Date Error Received;P:Provider"
S DIR("A")="Select sort criteria for listing PCMM Transmission Errors"
S DIR("?")="Enter how the error list should be sorted by."
D ^DIR
;Process user response
Q:$D(DIRUT) 0
S SCRP("SORT")=Y
Q 1
;
;
EPS(SCRP) ; Description: Ask user to enter a error processing status.
;
; Input: None
;
; Output:
; Function value - 1 if user selected an error processin status, 0 otherwise
; SCRP("EPS") - (pass by reference) used to return Error Processing
; Status: 1->New, 2->Checked, 3->Both
;
N DIR,DTOUT,DUOUT,X,Y
;Ask user to select error processing status
S DIR(0)="SMO^1:New;2:Checked;3:Both"
S DIR("A")="Select Error Processing Status"
S DIR("?",1)="Enter an error processing status. Only those errors matching"
S DIR("?")="the error processing status selected will be listed."
D ^DIR
;Process user response
Q:$D(DIRUT) 0
S SCRP("EPS")=+Y
Q 1
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HSCMCHLR8 4764 printed Nov 22, 2024@17:50:36 Page 2
SCMCHLR8 ;ALB/KCL - PCMM HL7 Reject Transmission Report; 22-FEB-2000
+1 ;;5.3;Scheduling;**210**;AUG 13, 1993
+2 ;
TERPRT ; Description: Main entry point for the PCMM HL7 Reject Transmission Report.
+1 ;
+2 ;Control variables used in generating report:
+3 ; SCRP("BEGIN")=<begining of the date range for error list>
+4 ; SCRP("END")=<ending date of range>
+5 ; SCRP("SELCT")=<select 'A'->all errors or 'D'->Date Range>
+6 ; SCRP("SORT")=<used to determine sort criteria>
+7 ; SCRP("EPS")=<used to determine the error processing status>
+8 ;
+9 NEW SCRP
+10 ;
+11 ;Get report parameters
+12 if '$$SELECT(.SCRP)
QUIT
+13 if '$$ASKRANGE(.SCRP)
QUIT
+14 if '$$SORTBY(.SCRP)
QUIT
+15 if '$$EPS(.SCRP)
QUIT
+16 ;
+17 ;Print report
+18 IF $$DEVICE()
DO PRINT^SCMCHLR9
+19 ;
+20 QUIT
+21 ;
+22 ;
DEVICE() ; Description: Allows the user to select a device.
+1 ;
+2 ; Input: None
+3 ;
+4 ; Output:
+5 ; Function Value - Returns 0 if the user decides not to print or
+6 ; to queue the report, 1 otherwise.
+7 ;
+8 NEW OK
+9 SET OK=1
+10 SET %ZIS="MQ"
+11 DO ^%ZIS
+12 if POP
SET OK=0
+13 if OK&$DATA(IO("Q"))
Begin DoDot:1
+14 SET ZTRTN="PRINT^SCMCHLR9"
SET ZTDESC="PCMM Transmission Error REPORT"
SET ZTSAVE("SCRP(")=""
+15 DO ^%ZTLOAD
+16 WRITE !,$SELECT($DATA(ZTSK):"REQUEST QUEUED TASK="_ZTSK,1:"REQUEST CANCELLED")
+17 DO HOME^%ZIS
+18 SET OK=0
End DoDot:1
+19 ;
+20 QUIT OK
+21 ;
+22 ;
SELECT(SCRP) ; Description: Ask the user to select 'all errors' or errors for a 'date range'.
+1 ;
+2 ; Input: None
+3 ;
+4 ; Output:
+5 ; Function value - 1 if user selected all errors, 0 otherwise
+6 ; SCRP("SELCT") - (pass by reference) used to return list filter
+7 ;
+8 NEW DIR,DTOUT,DUOUT,X,Y
+9 ;
+10 ;Ask user to select all errors or date range
+11 SET DIR(0)="SMO^A:All Errors;D:Date Range"
+12 SET DIR("A")="Select all errors or a date range"
+13 SET DIR("?",1)="You have a choice of selecting all errors to be printed,"
+14 SET DIR("?")="or errors may be printed for a specified date range."
+15 DO ^DIR
+16 ;Process user response
+17 if $DATA(DIRUT)
QUIT 0
+18 SET SCRP("SELCT")=Y
+19 QUIT 1
+20 ;
+21 ;
ASKRANGE(SCRP) ;
+1 ; Description: Asks the user to enter a date range for report.
+2 ;
+3 ;If user selected ALL errors, init begin and end dates and quit
+4 IF $GET(SCRP("SELCT"))="A"
Begin DoDot:1
+5 SET SCRP("BEGIN")=0
+6 SET SCRP("END")=DT
End DoDot:1
QUIT 1
+7 ;Otherwise, ask user for date range
+8 if '$$ASKBEGIN(.SCRP)
QUIT 0
+9 if '$$ASKEND(.SCRP)
QUIT 0
+10 QUIT 1
+11 ;
+12 ;
ASKBEGIN(SCRP) ;
+1 ;Description: Asks the user to enter a begin date.
+2 ;
+3 ; Input: None
+4 ;
+5 ; Output:
+6 ; Function value - 1 if user selected a date, 0 otherwise
+7 ; SCRP("BEGIN")=(pass by reference) used to return date selected
+8 ;
+9 NEW DIR,DTOUT,DUOUT,X,Y
+10 SET DIR(0)="D^::EX"
+11 SET DIR("A")="Enter Beginning Date"
+12 SET DIR("B")=$$FMTE^XLFDT($$FMADD^XLFDT(DT,-14),"D")
+13 SET DIR("?")="Enter the first day to begin searching for PCMM Transmission Errors."
REPEAT DO ^DIR
+1 if $DATA(DIRUT)
QUIT 0
+2 IF Y>DT
WRITE !,"Date can not be latter than today!"
GOTO REPEAT
+3 SET SCRP("BEGIN")=Y
+4 QUIT 1
+5 ;
+6 ;
ASKEND(SCRP) ;
+1 ; Description: Asks the user to enter an end date.
+2 ;
+3 ; Input:
+4 ; SCRP("BEGIN") - the earliest possible date
+5 ;
+6 ; Output:
+7 ; Function value - 1 if user selected a date, 0 otherwise
+8 ; SCRP("END")=(pass by reference) used to return date selected
+9 ;
+10 NEW DIR,DTOUT,DUOUT,X,Y
+11 SET DIR(0)="D^::EX"
+12 SET DIR("A")="Enter Ending Date"
+13 ;S DIR("B")=$$FMTE^XLFDT(SCRP("BEGIN"),"D")
+14 SET DIR("B")=$$FMTE^XLFDT(DT,"D")
+15 SET DIR("?")="Enter the last day to list transmission errors for."
AGAIN DO ^DIR
+1 if $DATA(DIRUT)
QUIT 0
+2 IF (Y<$GET(SCRP("BEGIN")))
WRITE !,"Date must not be earlier than "_DIR("B")
GOTO AGAIN
+3 SET SCRP("END")=Y
+4 QUIT 1
+5 ;
+6 ;
SORTBY(SCRP) ; Description: Ask the user to enter a sort criteria for printing errors.
+1 ;
+2 ; Input: None
+3 ;
+4 ; Output:
+5 ; Function value - 1 if user selected a sort, 0 otherwise
+6 ; SCRP("SORT") - (pass by reference) used to return sort by criteria
+7 ;
+8 NEW DIR,DTOUT,DUOUT,X,Y
+9 ;Ask user to select sort by criteria
+10 SET DIR(0)="SMO^N:Patient Name;D:Date Error Received;P:Provider"
+11 SET DIR("A")="Select sort criteria for listing PCMM Transmission Errors"
+12 SET DIR("?")="Enter how the error list should be sorted by."
+13 DO ^DIR
+14 ;Process user response
+15 if $DATA(DIRUT)
QUIT 0
+16 SET SCRP("SORT")=Y
+17 QUIT 1
+18 ;
+19 ;
EPS(SCRP) ; Description: Ask user to enter a error processing status.
+1 ;
+2 ; Input: None
+3 ;
+4 ; Output:
+5 ; Function value - 1 if user selected an error processin status, 0 otherwise
+6 ; SCRP("EPS") - (pass by reference) used to return Error Processing
+7 ; Status: 1->New, 2->Checked, 3->Both
+8 ;
+9 NEW DIR,DTOUT,DUOUT,X,Y
+10 ;Ask user to select error processing status
+11 SET DIR(0)="SMO^1:New;2:Checked;3:Both"
+12 SET DIR("A")="Select Error Processing Status"
+13 SET DIR("?",1)="Enter an error processing status. Only those errors matching"
+14 SET DIR("?")="the error processing status selected will be listed."
+15 DO ^DIR
+16 ;Process user response
+17 if $DATA(DIRUT)
QUIT 0
+18 SET SCRP("EPS")=+Y
+19 QUIT 1