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

SCMCHLR8.m

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