source: WorldVistAEHR/trunk/r/REGISTRATION-DGQE-DG-DPT-GRPX-VAD-VAF-VAS-VAT-VAU--VA-VIC--DGBT--DGJ--DGYA--VALM/DGENRPB1.m@ 1520

Last change on this file since 1520 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 2.9 KB
RevLine 
[613]1DGENRPB1 ;ALB/CJM - Pending Applications for Enrollment Report; May 4,1998
2 ;;5.3;Registration;**147**;08/13/93
3 ;
4REPORT ;
5 N DGENEND,DGENBEG,DGENINST
6 ;
7 S DGENBEG=$$ASKBEGIN()
8 G:'DGENBEG EXIT
9 S DGENEND=$$ASKEND(.DGENBEG)
10 G:'DGENEND EXIT
11 G:'$$ASKINST(.DGENINST) EXIT
12 I $$DEVICE() D PRINT^DGENRPB2
13EXIT ;
14 Q
15 ;
16DEVICE() ;
17 ;Description: allows the user to select a device.
18 ;Input: none
19 ;
20 ;Output:
21 ; Function Value - Returns 0 if the user decides not to print or to
22 ; queue the report, 1 otherwise.
23 ;
24 N OK
25 S OK=1
26 S %ZIS="MQ"
27 W !,"*** This report requires a 132 column printer. ******"
28 D ^%ZIS
29 S:POP OK=0
30 D:OK&$D(IO("Q"))
31 .S ZTRTN="PRINT^DGENRPB2",ZTDESC="Pending Applications for Enrollment REPORT",ZTSAVE("DGEN*")=""
32 .D ^%ZTLOAD
33 .W !,$S($D(ZTSK):"REQUEST QUEUED TASK="_ZTSK,1:"REQUEST CANCELLED")
34 .D HOME^%ZIS
35 .S OK=0
36 Q OK
37 ;
38ASKBEGIN() ;
39 ;Description: Asks the user to enter a beginning date.
40 ;
41 ;Input: none
42 ;Output: Returns the date as the function value, or 0 if the user does nto select a date
43 ;
44 N DIR,X,Y
45 S DIR(0)="D^::X"
46 S DIR("A")="Enter Beginning Date"
47 ;S DIR("B")=$$FMTE^XLFDT($$FMADD^XLFDT(DT,-730),"D")
48 S DIR("?",1)="Please enter a date. Veterans who applied for enrollment earlier will not"
49 S DIR("?")="be included in the report."
50 D ^DIR
51 Q:$D(DIRUT) 0
52 Q Y
53 ;
54ASKEND(DGBEGIN) ;
55 ;Description: Asks the user to enter an end date.
56 ;
57 ;Input:
58 ; DGBEGIN - the earliest possible date
59 ;
60 ;Output: Returns the date as the function value, or 0 if the user does nto select a date
61 ;
62 N DIR,X,Y
63 S DIR(0)="D^::X"
64 S DIR("A")="Enter Ending Date"
65 S DIR("B")=$$FMTE^XLFDT(DT,"D")
66 S DIR("?",1)="Please enter a date. Veterans who applied for enrollment later will not"
67 S DIR("?")="be included in the report."
68AGAIN D ^DIR
69 Q:$D(DIRUT) 0
70 I (Y<$G(DGBEGIN)) W !,"Date must be no earlier than "_$$FMTE^XLFDT(DGBEGIN,"D") G AGAIN
71 Q Y
72 ;
73ASKINST(INST) ;
74 ;Description: As the user to specify the divisions to report
75 ;Input: none
76 ;
77 ;Output:
78 ; Function Value - 0 on success, 1 on failure
79 ; INST - array of institutions selected (pass by reference)
80 ; subscripts:
81 ; ("ALL")=1 if all selected, 0 otherwise
82 ; (<ien of facility in instititution file>)=""
83 ;
84 N SUCCESS,DONE
85 S SUCCESS=1,DONE=0
86 K INST
87 ;
88 ;ask if all facilities should be included
89 D
90 .N DIR
91 .S DIR(0)="YA"
92 .S DIR("A")="Do you want the report for ALL facilities? "
93 .S DIR("B")="YES"
94 .S DIR("?")="The report will inlcude only selected instititutions, as determined by the patient's chosen preferred facility, if you select YES"
95 .D ^DIR
96 .I $D(DIRUT) S SUCCESS=0 Q
97 .S INST("ALL")=Y
98 ;
99 ;if the user wants to select particular facilities, ask for list
100 I SUCCESS,'INST("ALL") F Q:DONE Q:'SUCCESS D
101 .N DIR
102 .S DIR(0)="P^4:AEM"
103 .D ^DIR
104 .I +Y>0 S INST(+Y)=""
105 .S DIR(0)="YA"
106 .S DIR("A")="Do you want to select another facility? "
107 .S DIR("B")="YES"
108 .D ^DIR
109 .I $D(DIRUT) S SUCCESS=0
110 .I Y=0 S DONE=1
111 Q SUCCESS
Note: See TracBrowser for help on using the repository browser.