source: WorldVistAEHR/trunk/r/PCE_PATIENT_CARE_ENCOUNTER-AUTN-EFDP-PX-VSIT--PXRM/PXRRFDD.m@ 841

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

initial load of WorldVistAEHR

File size: 4.2 KB
Line 
1PXRRFDD ;ISL/PKR,ALB/Zoltan - PCE Frequency of Diagnosis report driver.;9/22/98
2 ;;1.0;PCE PATIENT CARE ENCOUNTER;**3,10,12,18,31,61**;Aug 12, 1996
3MAIN ;
4 N PXRRFDJB,PXRRFDST,PXRRIOD,PXRROPT,PXRRQUE,PXRRXTMP
5 S PXRRXTMP=$$PXRRXTMP^PXRRWLD("PXRRFD")
6 S ^XTMP(PXRRXTMP,0)=$$FMADD^XLFDT(DT,7)_U_DT_U_"PXRR Frequency of Diagnosis"
7 ;
8 ;Establish the selection criteria.
9FAC ;Get the facility list.
10 N NFAC,PXRRFAC,PXRRFACN
11 D FACILITY^PXRRLCSC
12 I $D(DTOUT)!$D(DUOUT) G EXIT
13 ;
14DR ;Get the encounter date range.
15 N PXRRBDT,PXRREDT
16 D PDR^PXRRADUT(.PXRRBDT,.PXRREDT,"ENCOUNTER")
17 I $D(DTOUT) G EXIT
18 I $D(DUOUT) G FAC
19 ;
20DIAG ;Get the diagnosis screening criteria.
21 N PXRRFDDC
22 D DIAGSC^PXRRFDSC
23 I $D(DTOUT) G EXIT
24 I $D(DUOUT) G DR
25 ;
26EATT ;Get a list of encounter screening attributes.
27 N PXRRECAT
28 D ECAT^PXRRECSC
29 I $D(DTOUT) G EXIT
30 I $D(DUOUT) G DIAG
31 ;
32 ;Process the screening attributes
33 ;
34SCAT ;Get the service categories.
35 N PXRRSCAT
36 I PXRRECAT["1" D
37 . D SCAT^PXRRECSC
38 E S PXRRSCAT="AI"
39 I $D(DTOUT) G EXIT
40 I $D(DUOUT) G EATT
41 ;
42ETYPE ;Get the encounter types.
43 ;This section is commented out so it can be easily restored if encounter
44 ;types are used later. The part of ECAT^PXRRECSC relating to this should
45 ;also be restored.
46 ;N PXRRETYP
47 ;I PXRRECAT["2" D
48 ;. D ETYPE^PXRRECSC
49 ;I $D(DTOUT) G EXIT
50 ;I $D(DUOUT) G EATT
51 ;
52LOC ;Get the locations.
53 N NCS,NHL,PXRRCS,PXRRLCHL,PXRRLCSC
54 I PXRRECAT["2" D
55 . D LOC^PXRRLCSC("Determine frequency of diagnosis for","HS")
56 I $D(DTOUT) G EXIT
57 I $D(DUOUT) G EATT
58 ;
59PRV ;Get the provider list.
60 N NCL,NPL,PXRRPECL,PXRRPRPL,PXRRPRSC
61 I PXRRECAT["3" D
62 . D PRV^PXRRPRSC
63 I $D(DTOUT) G EXIT
64 I $D(DUOUT) G EATT
65 ;
66DOB ;Get the patient age range.
67 N PXRRDOB,PXRRDOBE,PXRRDOBS,PXRRMAXA,PXRRMINA
68 I PXRRECAT["4" D
69 . S PXRRMINA=$$AGE^PXRRADUT("MINIMUM",1)
70 . I '$D(DTOUT)&'$D(DUOUT) D
71 .. S PXRRMAXA=$$AGE^PXRRADUT("MAXIMUM",0)
72 .;Convert the ages into dates of birth.
73 . I +$G(PXRRMAXA)>0 S PXRRDOBS=$$DOBFA^PXRRADUT(PXRRMAXA)
74 . I +$G(PXRRMINA)>0 S PXRRDOBE=$$DOBFA^PXRRADUT(PXRRMINA)
75 . I ($D(PXRRDOBS))!($D(PXRRDOBE)) S PXRRDOB=1
76 I $D(DTOUT) G EXIT
77 I $D(DUOUT) G EATT
78 ;
79RACE ;Get the patient race.
80 N NRACE,PXRRRACE
81 I PXRRECAT["5" D
82 . D RACE^PXRRFDSC
83 I $D(DTOUT) G EXIT
84 I $D(DUOUT) G EATT
85 ;
86PSEX ;Get the patient sex.
87 N PXRRSEX
88 I PXRRECAT["6" D
89 . D SEX^PXRRFDSC
90 I $D(DTOUT) G EXIT
91 I $D(DUOUT) G EATT
92 ;
93MAX ;Get the maximum number of diagnosis counts to include in the report.
94 N PXRRDMAX
95 D DMAX^PXRRFDSC
96 I $D(DTOUT) G EXIT
97 I $D(DUOUT) G EATT
98 ;
99 ;Determine whether the report should be queued.
100 S %ZIS="QM"
101 W !
102 D ^%ZIS
103 I POP G EXIT
104 S PXRRIOD=ION_";"_IOST_";"_IOM_";"_IOSL
105 S PXRRQUE=$G(IO("Q"))
106 ;
107 I PXRRQUE D
108 .;Queue the report.
109 . N DESC,IODEV,ROUTINE
110 . S DESC="Frequency of Diagnosis Report - sort encounters"
111 . S IODEV=""
112 . S ROUTINE="SORT^PXRRFDSE"
113 . S ^XTMP(PXRRXTMP,"SORTEZTSK")=$$QUE^PXRRQUE(DESC,IODEV,ROUTINE,"SAVE^PXRRFDD")
114 .;
115 . S DESC="Frequency of Diagnosis Report - sort diagnosis data"
116 . S IODEV=""
117 . S ROUTINE="SORT^PXRRFDSD"
118 . S ZTDTH="@"
119 . S ^XTMP(PXRRXTMP,"SORTDZTSK")=$$QUE^PXRRQUE(DESC,IODEV,ROUTINE,"SAVE^PXRRFDD")
120 .;
121 . S DESC="Frequency of diagnosis report - print"
122 . S IODEV=PXRRIOD
123 . S ROUTINE="PXRRFDP"
124 . S ZTDTH="@"
125 . S ^XTMP(PXRRXTMP,"PRZTSK")=$$QUE^PXRRQUE(DESC,IODEV,ROUTINE,"SAVE^PXRRFDD")
126 E D SORT^PXRRFDSE
127 ;
128 Q
129 ;
130 ;=======================================================================
131EXIT ;
132 D EXIT^PXRRGUT
133 Q
134 ;
135 ;=======================================================================
136SAVE ;Save the variables.
137 S ZTSAVE("PXRRBDT")="",ZTSAVE("PXRREDT")=""
138 S ZTSAVE("PXRRDOB")=""
139 S ZTSAVE("PXRRDOBE")=""
140 S ZTSAVE("PXRRDOBS")=""
141 S ZTSAVE("PXRRCS(")="",ZTSAVE("NCS")=""
142 S ZTSAVE("PXRRDMAX")=""
143 S ZTSAVE("PXRRECAT")=""
144 S ZTSAVE("PXRRETYP")=""
145 S ZTSAVE("PXRRFAC(")="",ZTSAVE("NFAC")=""
146 S ZTSAVE("PXRRFACN(")=""
147 S ZTSAVE("PXRRFDDC")=""
148 S ZTSAVE("PXRRIOD")=""
149 S ZTSAVE("PXRRLCHL(")="",ZTSAVE("NHL")=""
150 S ZTSAVE("PXRRLCSC")=""
151 S ZTSAVE("PXRRMAXA")=""
152 S ZTSAVE("PXRRMINA")=""
153 S ZTSAVE("PXRRPECL(")="",ZTSAVE("NCL")=""
154 S ZTSAVE("PXRRPRPL(")="",ZTSAVE("NPL")=""
155 S ZTSAVE("PXRRPRSC")=""
156 S ZTSAVE("PXRRQUE")=""
157 S ZTSAVE("PXRRSCAT")=""
158 S ZTSAVE("PXRRRACE(")="",ZTSAVE("NRACE")=""
159 S ZTSAVE("PXRRSEX")=""
160 S ZTSAVE("PXRRXTMP")=""
161 Q
Note: See TracBrowser for help on using the repository browser.