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

DGENRPB1.m

Go to the documentation of this file.
  1. DGENRPB1 ;ALB/CJM - Pending Applications for Enrollment Report; May 4,1998
  1. ;;5.3;Registration;**147,1015**;08/13/93;Build 21
  1. ;
  1. REPORT ;
  1. N DGENEND,DGENBEG,DGENINST
  1. ;
  1. S DGENBEG=$$ASKBEGIN()
  1. G:'DGENBEG EXIT
  1. S DGENEND=$$ASKEND(.DGENBEG)
  1. G:'DGENEND EXIT
  1. G:'$$ASKINST(.DGENINST) EXIT
  1. I $$DEVICE() D PRINT^DGENRPB2
  1. EXIT ;
  1. Q
  1. ;
  1. DEVICE() ;
  1. ;Description: allows the user to select a device.
  1. ;Input: none
  1. ;
  1. ;Output:
  1. ; Function Value - Returns 0 if the user decides not to print or to
  1. ; queue the report, 1 otherwise.
  1. ;
  1. N OK
  1. S OK=1
  1. S %ZIS="MQ"
  1. W !,"*** This report requires a 132 column printer. ******"
  1. D ^%ZIS
  1. S:POP OK=0
  1. D:OK&$D(IO("Q"))
  1. .S ZTRTN="PRINT^DGENRPB2",ZTDESC="Pending Applications for Enrollment REPORT",ZTSAVE("DGEN*")=""
  1. .D ^%ZTLOAD
  1. .W !,$S($D(ZTSK):"REQUEST QUEUED TASK="_ZTSK,1:"REQUEST CANCELLED")
  1. .D HOME^%ZIS
  1. .S OK=0
  1. Q OK
  1. ;
  1. ASKBEGIN() ;
  1. ;Description: Asks the user to enter a beginning date.
  1. ;
  1. ;Input: none
  1. ;Output: Returns the date as the function value, or 0 if the user does nto select a date
  1. ;
  1. N DIR,X,Y
  1. S DIR(0)="D^::X"
  1. S DIR("A")="Enter Beginning Date"
  1. ;S DIR("B")=$$FMTE^XLFDT($$FMADD^XLFDT(DT,-730),"D")
  1. S DIR("?",1)="Please enter a date. Veterans who applied for enrollment earlier will not"
  1. S DIR("?")="be included in the report."
  1. D ^DIR
  1. Q:$D(DIRUT) 0
  1. Q Y
  1. ;
  1. ASKEND(DGBEGIN) ;
  1. ;Description: Asks the user to enter an end date.
  1. ;
  1. ;Input:
  1. ; DGBEGIN - the earliest possible date
  1. ;
  1. ;Output: Returns the date as the function value, or 0 if the user does nto select a date
  1. ;
  1. N DIR,X,Y
  1. S DIR(0)="D^::X"
  1. S DIR("A")="Enter Ending Date"
  1. S DIR("B")=$$FMTE^XLFDT(DT,"D")
  1. S DIR("?",1)="Please enter a date. Veterans who applied for enrollment later will not"
  1. S DIR("?")="be included in the report."
  1. AGAIN D ^DIR
  1. Q:$D(DIRUT) 0
  1. I (Y<$G(DGBEGIN)) W !,"Date must be no earlier than "_$$FMTE^XLFDT(DGBEGIN,"D") G AGAIN
  1. Q Y
  1. ;
  1. ASKINST(INST) ;
  1. ;Description: As the user to specify the divisions to report
  1. ;Input: none
  1. ;
  1. ;Output:
  1. ; Function Value - 0 on success, 1 on failure
  1. ; INST - array of institutions selected (pass by reference)
  1. ; subscripts:
  1. ; ("ALL")=1 if all selected, 0 otherwise
  1. ; (<ien of facility in instititution file>)=""
  1. ;
  1. N SUCCESS,DONE
  1. S SUCCESS=1,DONE=0
  1. K INST
  1. ;
  1. ;ask if all facilities should be included
  1. D
  1. .N DIR
  1. .S DIR(0)="YA"
  1. .S DIR("A")="Do you want the report for ALL facilities? "
  1. .S DIR("B")="YES"
  1. .S DIR("?")="The report will inlcude only selected instititutions, as determined by the patient's chosen preferred facility, if you select YES"
  1. .D ^DIR
  1. .I $D(DIRUT) S SUCCESS=0 Q
  1. .S INST("ALL")=Y
  1. ;
  1. ;if the user wants to select particular facilities, ask for list
  1. I SUCCESS,'INST("ALL") F Q:DONE Q:'SUCCESS D
  1. .N DIR
  1. .S DIR(0)="P^4:AEM"
  1. .D ^DIR
  1. .I +Y>0 S INST(+Y)=""
  1. .S DIR(0)="YA"
  1. .S DIR("A")="Do you want to select another facility? "
  1. .S DIR("B")="YES"
  1. .D ^DIR
  1. .I $D(DIRUT) S SUCCESS=0
  1. .I Y=0 S DONE=1
  1. Q SUCCESS