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

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

initial load of WorldVistAEHR

File size: 4.1 KB
Line 
1DGPFRPI ;ALB/RBS - PRF PRINCIPAL INVEST REPORT ; 7/26/05 3:39pm
2 ;;5.3;Registration;**554,730**;Aug 13, 1993;Build 2
3 ;
4 ;This routine will be used for selecting sort parameters to produce
5 ;the DGPF PRINCIPAL INVEST REPORT for Patient Record Flags.
6 ;
7 ; Selection options will provide the ability to report by:
8 ; PRINCIPAL INVESTIGATOR
9 ; CATEGORY
10 ; STATUS (ASSIGNMENTS)
11 ; BEGINNING DATE
12 ; ENDING DATE
13 ;
14 ; The following reporting sort array will be built by user prompts:
15 ; DGSORT("DGPRINC") = pointer to NEW PERSON (#200) file^Person Name
16 ; or
17 ; = "A" = All Principal Investigator's
18 ; DGSORT("DGCAT") = CATEGORY
19 ; 2^Category II (Local)
20 ; DGSORT("DGSTATUS") = Assignment Status to report on
21 ; 1^Active
22 ; 2^Inactive
23 ; 3^Both
24 ; DGSORT("DGBEG") = BEGINNING DATE (internal FileMan date)
25 ; DGSORT("DGEND") = ENDING DATE (internal FileMan date)
26 ;
27 ;-- no direct entry
28 QUIT
29 ;
30EN ;Entry point
31 ;-- user prompts for report selection sorts
32 ; Input: none
33 ; Output: Report generated using user selected parameters
34 ;
35 N DGABORT ;abort flag
36 N DGASK ;return value from $$ANSWER^DGPFUT call
37 N DGDIRA ;DGDIRA - DIR("A") string
38 N DGDIRB ;DGDIRB - DIR("B") string
39 N DGDIRH ;DGDIRH - DIR("?") string
40 N DGDIRO ;DGDIR0 - DIR(0) string
41 N DGDIRS ;DGDIRS - DIR("S") string
42 N DGFIRST ;first assignment date
43 N DGQ ;quit flag
44 N DGSEL ;help text var
45 N DGSORT ;array or report parameters
46 N ZTSAVE ;open array reference of input parameters used by tasking
47 ;
48 ;check for database
49 S DGFIRST=$P(+$O(^DGPF(26.14,"D","")),".") ;first assignment date
50 I 'DGFIRST D Q
51 . W !?2,">>> No Patient Record Flag Assignments have been found.",*7
52 . I $$ANSWER^DGPFUT("Enter RETURN to continue","","E") ;pause
53 ;
54 ;-- prompt for selection of an approved by person
55 S DGDIRA="Select to report on a (S)ingle Principal Investigator or (A)ll"
56 S DGDIRB="Single"
57 S DGDIRH="Enter one of the selections to report on"
58 S DGDIRO="S^S:Single Principal Investigator;A:All Principal Investigators"
59 S DGASK=$$ANSWER^DGPFUT(DGDIRA,DGDIRB,DGDIRO,DGDIRH)
60 Q:DGASK=-1!(DGASK=0)
61 ;
62 S:DGASK="A" DGSORT("DGPRINC")="A"
63 ;
64 D:DGASK="S"
65 .S (DGQ,DGABORT)=0
66 .N DIC,D,X,Y,I
67 .S DIC="^DGPF(26.11,"
68 .S DIC(0)="AEQZ"
69 .S D="C"
70 .S DIC("A")="Select Principal Investigator's name: "
71 .D IX^DIC
72 .I Y<0 S DGABORT=1 Q
73 .S I=0
74 .F S I=$O(^DGPF(26.11,+Y,2,"B",I)) Q:'I I $P(^VA(200,I,0),U)[X Q
75 .I '$G(I) S DGABORT=1 Q
76 .S DGSORT("DGPRINC")=I_U_$$EXTERNAL^DILFD(26.112,.01,"F",I)
77 .S DGQ=1
78 ;
79 Q:$G(DGABORT)
80 ;
81 ;-- prompt for selection of a flag category
82 ; only Cat II (Local) file (#26.11) has Research Flags
83 S DGSORT("DGCAT")=2_U_"Category II (Local)"
84 ;
85 ;-- prompt for selection of the assignment status to report on
86 S DGDIRA="Select Assignment Status to report on"
87 S DGDIRB="Both"
88 S DGDIRH="Enter one of the status selections to report on"
89 S DGDIRO="S^1:Active;2:Inactive;3:Both"
90 S DGASK=$$ANSWER^DGPFUT(DGDIRA,DGDIRB,DGDIRO,DGDIRH)
91 Q:(DGASK<1)
92 S DGSORT("DGSTATUS")=DGASK_U_$S(DGASK=1:"Active",DGASK=2:"Inactive",DGASK=3:"Both",1:3)
93 ;
94 ;-- prompt for beginning date
95 S DGDIRA="Select Beginning Date"
96 S DGDIRB=""
97 S DGDIRH="^D HELP^DGPFRPI(1)"
98 S DGDIRO="D^"_DGFIRST_":DT:EX"
99 S DGASK=$$ANSWER^DGPFUT(DGDIRA,DGDIRB,DGDIRO,DGDIRH)
100 Q:(DGASK=-1)
101 S DGSORT("DGBEG")=DGASK
102 ;
103 ;-- prompt for ending date
104 S DGDIRA="Select Ending Date"
105 S DGDIRB=""
106 S DGDIRH="^D HELP^DGPFRPI(2)"
107 S DGDIRO="D^"_DGSORT("DGBEG")_":DT:EX"
108 S DGASK=$$ANSWER^DGPFUT(DGDIRA,DGDIRB,DGDIRO,DGDIRH)
109 Q:(DGASK=-1)
110 S DGSORT("DGEND")=DGASK
111 ;
112 K DGDIRA,DGDIRB,DGDIRO,DGDIRH,DGDIRS,DGASK,DGQ,DGABORT
113 ;
114 ;-- prompt for device
115 S ZTSAVE("DGSORT(")=""
116 D EN^XUTMDEVQ("START^DGPFRPI1","Assignments By Principle Investigator Report",.ZTSAVE)
117 D HOME^%ZIS
118 Q
119 ;
120HELP(DGSEL) ;provide extended DIR("?") help text.
121 ;
122 ; Input: DGSEL - prompt var for help text word selection
123 ; Output: none
124 ;
125 W !," Enter the "_$S(DGSEL=1:"earliest",1:"latest")_" Assignment Date to include in the report."
126 W !," Please enter a date from the specified date range displayed."
127 Q
Note: See TracBrowser for help on using the repository browser.