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

DGENRPC1.m

Go to the documentation of this file.
  1. DGENRPC1 ;ALB/CJM - Enrollees by Status, Priority, Preferred Facility Report; May 12, 1999
  1. ;;5.3;Registration;**147,232**;Aug 13,1993
  1. ;
  1. REPORT ;
  1. N DGENRP,DGENFLG
  1. ;
  1. ;Control variables used in generating report
  1. ;DGENRP("LIST")=1 if patients should be listed
  1. ;DGENRP("PRIORITY",<priority to include>)=""
  1. ;DGENRP("PRIORITY","ALL")=1 means to include all
  1. ;DGENRP("STATUS",<status to include>)=""
  1. ;DGENRP("STATUS","ALL")=1 means to include all
  1. ;DGENRP("FACILITY",<preferred facility to include>)=""
  1. ;DGENRP("FACILITY","ALL")=1 means to include all
  1. ;
  1. G:'$$ASKINST(.DGENRP) EXIT
  1. ;
  1. G:'$$ASKLIST(.DGENRP) EXIT
  1. I DGENRP("LIST") D G:'DGENFLG EXIT
  1. .S DGENFLG=$$ASKSTATS(.DGENRP) Q:'DGENFLG
  1. .S DGENFLG=$$ASKPRTY(.DGENRP)
  1. ;
  1. ;
  1. I $$DEVICE() D PRINT^DGENRPC2
  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^DGENRPC2",ZTDESC="Enrollments by Status, Priority, Preferred Facility REPORT",ZTSAVE("DGENRP(")=""
  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. ASKLIST(DGENRP) ;
  1. ;Description: Asks user if he wants patient listing and sets to DGENRP("LIST")
  1. ;
  1. ;Outpu: Function returns 1 on success, 0 on failure (i.e., user "^" out)
  1. ;
  1. N DIR
  1. S DGENRP("LIST")=0
  1. S DIR(0)="Y"
  1. S DIR("A")="Do you want a list of selected patients"
  1. S DIR("?")="Answer NO if you just want the summary statistics."
  1. S DIR("B")="NO"
  1. D ^DIR
  1. I $D(DIRUT) Q 0
  1. S DGENRP("LIST")=Y
  1. Q 1
  1. ;
  1. ASKSTATS(DGENRP) ;
  1. ;Description: ask status codes to include
  1. ;
  1. N DIR
  1. S DGENRP("STATUS","ALL")=0
  1. S DIR(0)="Y"
  1. S DIR("A")="Do you want to include all Enrollment Statuses in the patient listing"
  1. S DIR("?")="Answer NO if the report should include only selected Enrollment Statuses."
  1. S DIR("B")="NO"
  1. D ^DIR
  1. I $D(DIRUT) Q 0
  1. I Y S DGENRP("STATUS","ALL")=1 Q 1
  1. F Q:'$$STATUS(.DGENRP)
  1. I '$O(DGENRP("STATUS",0)) Q 0
  1. Q 1
  1. ;
  1. STATUS(DGENRP) ;
  1. ;Description: Ask user to select a status code
  1. N DIR
  1. S DIR(0)="27.11,.04O"
  1. D ^DIR
  1. Q:$D(DIRUT) 0
  1. S DGENRP("STATUS",+Y)=""
  1. Q 1
  1. ;
  1. ASKPRTY(DGENRP) ;
  1. ;Description: ask enrollment priorities to include
  1. ;
  1. N DIR
  1. S DGENRP("PRIORITY","ALL")=0
  1. S DIR(0)="Y"
  1. S DIR("A")="Do you want to include all Enrollment Priorities in the patient listing"
  1. S DIR("?")="Answer NO if the report should inlclude only selected Enrollment Priorities."
  1. S DIR("B")="NO"
  1. D ^DIR
  1. I $D(DIRUT) Q 0
  1. I Y S DGENRP("PRIORITY","ALL")=1 Q 1
  1. F Q:'$$PRIORITY(.DGENRP)
  1. I '$O(DGENRP("PRIORITY",0)) Q 0
  1. Q 1
  1. ;
  1. ;
  1. PRIORITY(DGENRP) ;
  1. ;Description: Asks user to select an Enrollment Priority
  1. N DIR
  1. S DIR(0)="27.11,.07O"
  1. D ^DIR
  1. Q:$D(DIRUT) 0
  1. S DGENRP("PRIORITY",Y)=""
  1. Q 1
  1. ;
  1. ASKINST(DGENRP) ;
  1. ;Description: ask preferred facilities to include
  1. ;
  1. N DIR
  1. S DGENRP("FACILITY","ALL")=0
  1. S DIR(0)="Y"
  1. S DIR("A")="Do you want to include all Preferred Facilities"
  1. S DIR("?")="Answer NO if you want all enrollments found regardless of when the patient's Preferred Facility."
  1. S DIR("B")="NO"
  1. D ^DIR
  1. I $D(DIRUT) Q 0
  1. I Y S DGENRP("FACILITY","ALL")=1 Q 1
  1. F Q:'$$FACILITY
  1. I '$O(DGENRP("FACILITY",0)) Q 0
  1. Q 1
  1. ;
  1. ;
  1. FACILITY() ;
  1. ;Description: Asks user to select an institution
  1. N DIR
  1. S DIR(0)="PO^4:AEM"
  1. S DIR("A")="Preferred Facility"
  1. S DIR("?")="Selection of Preferred Facilities to include is made from the Institution file."
  1. D ^DIR
  1. Q:$D(DIRUT) 0
  1. S:+Y DGENRP("FACILITY",+Y)=""
  1. Q 1
  1. ;