source: WorldVistAEHR/trunk/r/ORDER_ENTRY_RESULTS_REPORTING-OR-OCX--ORRC--ORRJ/OREORV2.m@ 861

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

initial load of WorldVistAEHR

File size: 8.1 KB
RevLine 
[613]1OREORV2 ; SLC/GDU - Orderable Item Records Validation [10/15/04 09:16]
2 ;;3.0;ORDER ENTRY/RESULTS REPORTING;**217**;Dec 17, 1997
3 ;OREORV2 - Orderable Item Record Validation
4 ;
5 ;FIX FOR NOIS CASES:
6 ;DAN-0204-42157, ALB-1001-51034, SBY-0803-30443, NJH-0402-20607
7 ;
8 ;This prints a report of the results from OREORV1.
9 ;The results are stored in ^TMP($J,"OIC".
10 ;^TMP($J,"OIC" is fully documented in OREORV1.
11 ;The output is sorted and printed in the following manner:
12 ;
13 ;A report summary of the overall findings
14 ;Section 1, details of OI records with null ID field
15 ;Section 2, details of OI records without source IENs
16 ;Section 3, details of OI records without source package codes
17 ;Section 4, details of OI records with bad source package codes
18 ;Section 5, details of OI records with packages with package
19 ; codes not listed in the OE/RR Interface Specifications
20 ; of July 2001. These records have properly formatted
21 ; package codes but can not be validated with this
22 ; utility.
23 ;Section 6, summary of OI records validated with source records
24 ;Section 7, details of OI records not validated with source records
25 ;
26 ;External Variables
27 ; IOF - Standard FileMan/Kernel IO variable, Form Feed
28 ; IOM - Standard FileMan/Kernel IO variable, Margin width
29 ; IOSL - Standard FileMan/Kernel IO variable, Page Length
30 ; IOST - Standard FileMan/Kernel IO variable, Terminal type
31 ; U - Standard FileMan/Kernel delimiter variable
32 ;
33 ;External References
34 ; ^DIR DBIA 10026
35 ; $$REPEAT^XLFSTR DBIA 10104
36 ;
37MAIN ;Main entry point for this program
38 ;Local Variables
39 ; PAGE - Page number counter
40 ; STOP - Stop report execution
41 ;
42 N PAGE,STOP
43 S PAGE=1,STOP=0
44 D RPTSUM I STOP=1 G EXIT ;Report Summary
45 D PS(1) I STOP=1 G EXIT
46 D PS(2) I STOP=1 G EXIT
47 D PS(3) I STOP=1 G EXIT
48 D PS(4) I STOP=1 G EXIT
49 D PS(5) I STOP=1 G EXIT
50 D PS(6) I STOP=1 G EXIT
51 D PS(7)
52EXIT ;Exit point for this program
53 Q
54RPTSUM ;Report Summary - Summary of ZGOIRV1 findings
55 ;Local Variables
56 ; RSL - Report Summary Line, indirect variable to print summary type
57 ; X - Standard FileMan work variable
58 ;
59 N RSL,X
60 D RPH
61 W !,$P($T(RS),";",3),!
62 F X=0:1:7 D
63 . S RSL="RS"_X
64 . W !,$P($T(@RSL),";",3),?65,$J(^TMP($J,"OIC",X),10)
65 D @$S($E(IOST,1,2)="C-":"NS",1:"RPF")
66 Q
67PS(SN) ;Print Sections
68 ;Variable Passed to PS
69 ; SN - Section Number
70 ;Local Variables
71 ; SH - Section Header
72 ; SF - Section Footer
73 ; PACK - Package Code
74 ; PH - Package Subsection Header
75 ; PF - Package Subsection Footer
76 ; NAME - Orderable Item Name
77 ;
78 N SH,SF,PACK,PH,PF,NAME
79 S SH="SH"_SN,SF="SF"_SN
80 W !,$P($T(@SH),";",3)
81 W ! D LCC Q:STOP=1
82 I SN=1!(SN=2)!(SN=3) D
83 . I ^TMP($J,"OIC",SN)>0 D
84 .. W !,$P($T(@SH),";",3) D LCC Q:STOP=1
85 .. W !,$$REPEAT^XLFSTR("-",IOM) D LCC Q:STOP=1
86 .. S NAME="" F S NAME=$O(^TMP($J,"OIC",SN,"B",NAME)) Q:NAME=""!(STOP=1) D
87 ... W !,NAME,?65,$P(^TMP($J,"OIC",SN,"B",NAME),U,2)
88 I SN=4!(SN=5) D
89 . I ^TMP($J,"OIC",SN)>0 D
90 .. S PACK="" F S PACK=$O(^TMP($J,"OIC",SN,PACK)) Q:PACK=""!(STOP=1) D
91 ... S PH=$P($T(PHT),";",3)_" : "_PACK_" - "_$P($T(@$E(PACK,3,5)),";",3)
92 ... S PF=$P($T(PFT),";",3)_" : "_PACK_" - "_$P($T(@$E(PACK,3,5)),";",3)
93 ... W !,PH D LCC Q:STOP=1
94 ... W !,$P($T(CH1),";",3),?65,$P($T(CH2),";",3) D LCC Q:STOP=1
95 ... W !,$$REPEAT^XLFSTR("-",IOM) D LCC Q:STOP=1
96 ... S NAME="" F S NAME=$O(^TMP($J,"OIC",SN,PACK,"B",NAME)) Q:NAME=""!(STOP=1) D
97 .... W !,NAME,?65,$P(^TMP($J,"OIC",SN,PACK,"B",NAME),U,2) D LCC Q:STOP=1
98 ... W !,PF,?65,$J(^TMP($J,"OIC",SN,PACK),10) D LCC Q:STOP=1
99 ... W ! D LCC Q:STOP=1
100 I SN=6 D
101 . I ^TMP($J,"OIC",SN)>0 D
102 . S PACK="" F S PACK=$O(^TMP($J,"OIC",SN,PACK)) Q:PACK=""!(STOP=1) D
103 .. S PH=PACK_" - "_$P($T(@$E(PACK,3,5)),";",3)
104 .. W !,PH,?65,$J(^TMP($J,"OIC",SN,PACK),10) D LCC Q:STOP=1
105 I SN=7 D PS7
106 W ! D LCC Q:STOP=1
107 W !,$P($T(@SF),";",3),?65,$J(^TMP($J,"OIC",SN),10) D LCC Q:STOP=1
108 I SN=7 S STOP=1
109 D @$S($E(IOST,1,2)="C-":"NS",1:"RPF")
110 Q
111PS7 ;Print Section 7
112 ;Local Variables
113 ; AH - Activity Type Subsection Header
114 ; AF - Activity Type Subsection Footer
115 ; AI - Active / Inactive Indicator
116 ;
117 N AH,AF,AI
118 I ^TMP($J,"OIC",SN)=0 Q
119 S AI="" F S AI=$O(^TMP($J,"OIC",SN,AI)) Q:AI=""!(STOP=1) D
120 . S AH=AI_"HT",AF=AI_"FT"
121 . W !,$P($T(@AH),";",3) D LCC Q:STOP=1
122 . S PACK="" F S PACK=$O(^TMP($J,"OIC",SN,AI,PACK)) Q:PACK=""!(STOP=1) D
123 .. S PH=$P($T(PHT),";",3)_" : "_PACK_" - "_$P($T(@$E(PACK,3,5)),";",3)
124 .. S PF=PACK_" - "_$P($T(@$E(PACK,3,5)),";",3)
125 .. W !,PH D LCC Q:STOP=1
126 .. W !,$P($T(CH1),";",3),?65,$P($T(CH2),";",3) D LCC Q:STOP=1
127 .. W !,$$REPEAT^XLFSTR("-",IOM) D LCC Q:STOP=1
128 .. S NAME="" F S NAME=$O(^TMP($J,"OIC",SN,AI,PACK,"B",NAME)) Q:NAME=""!(STOP=1) D
129 ... W !,NAME,?65,$P(^TMP($J,"OIC",SN,AI,PACK,"B",NAME),U,2) D LCC Q:STOP=1
130 .. W !,PF,?65,$J(^TMP($J,"OIC",SN,AI,PACK),10) D LCC Q:STOP=1
131 .. W ! D LCC Q:STOP=1
132 . W ! D LCC Q:STOP=1
133 . W !,$P($T(@AF),";",3),?65,$J(^TMP($J,"OIC",SN,AI),10) D LCC Q:STOP=1
134 Q
135RPH ;Report Page Header
136 W:$E(IOST,1,2)="C-"!(PAGE>1) @IOF
137 W $P($T(RH),";",3),?65,"PAGE: ",PAGE
138 Q
139NS ;Next Screen - Advances user to next screen if output directed to
140 ;video console
141 ;Local Variables
142 ; DIR - Input array variable for ^DIR
143 ; DTOUT - Time out indicator, output variable for ^DIR
144 ; DUOUT - Up arrow out indicator, "^", output variable for ^DIR
145 ; Y - Processed User response, output variable for ^DIR
146 ;
147 N DIR,DTOUT,DUOUT,Y
148 S DIR(0)="E"
149 W ! D ^DIR I $D(DTOUT)!($D(DUOUT)) S Y=0
150 I Y=0 S STOP=1 Q
151 S PAGE=$$PCI(PAGE)
152 D:STOP=0 RPH
153 Q
154RPF ;Report Page Footer - Prints page footer if output directed to printer
155 ;Local Variables
156 ; LF - Line Feed, Advances 1 line down the page
157 ; LFC - Line Feed Count, number of lines to advance to end of page
158 N LF,LFC
159 S LFC=(IOSL-4)-$Y
160 F LF=1:1:LFC W !
161 W $P($T(RF),";",3),?65,"PAGE: ",PAGE
162 S PAGE=$$PCI(PAGE)
163 D:STOP=0 RPH
164 Q
165LCC ;Line Count Check - Determine if it is time for end of page/screen logic
166 I $Y>(IOSL-4) D @$S($E(IOST,1,2)="C-":"NS",1:"RPF") I STOP=1 G EXIT
167 Q
168PCI(PN) ;Page Counter
169 ;Variable Passed to PCI
170 ; PN - Page Number
171 S PN=PN+1 Q PN
172 ;Text used by the program to print the report
173 ;Text for the report page/screen headers
174RH ;;Orderable Items File Record Validation Report
175 ;Text for the report page footers
176RF ;;Orderable Items File Record Validation Report
177 ;Text for report summary
178RS ;;Summary of Orderable Items Validation:
179RS0 ;;Total number of records processed:
180RS1 ;;Total number of records with null ID fields:
181RS2 ;;Total number of records without source IENs:
182RS3 ;;Total number of records without source package codes:
183RS4 ;;Total number of records with bad source package codes:
184RS5 ;;Total number of records requiring manual confirmation:
185RS6 ;;Total number of records with source record matches (validated):
186RS7 ;;Total number of records without source record matches:
187 ;
188 ;Section header/footer text
189SH1 ;;Section 1, Records with null ID field
190SH2 ;;Section 2, Records without source IENs
191SH3 ;;Section 3, Records without source package codes
192SH4 ;;Section 4, Records with incorrect source package code formats
193SH5 ;;Section 5, Records with package codes not in current spec
194SH6 ;;Section 6, Records with source record matches (Validated)
195SH7 ;;section 7, Records without source record matches
196SF1 ;;Total with null ID field
197SF2 ;;Total without source IENs:
198SF3 ;;Total without source package codes:
199SF4 ;;Total with bad source package codes:
200SF5 ;;Total with package codes not in spec:
201SF6 ;;Total validated:
202SF7 ;;Total without source record matches:
203 ;
204 ;Package title text
205CON ;;Consult Request Services file
206FHD ;;Diets file
207FHT ;;Tubefeeding file
208LRT ;;Laboratory Test file
209ORD ;;Orderable Items file
210PRC ;;Consult Procedure file
211PRO ;;Protocol file
212PSP ;;Pharmacy Orderable Item file
213RAP ;;Radiology/Nuclear Medicine Procedures file
214 ;
215 ;Column Header text
216CH1 ;;OI Name
217CH2 ;;Inactive Date
218 ;
219 ;Package Header/Footer Text
220PHT ;;Records for package
221PFT ;;Sub-total for package
222 ;
223 ;Active OI records Header/Footer Text
224AHT ;;Active OI records w/o matching source record
225AFT ;;Sub-total active OI records w/o matching source record
226 ;
227 ;Inactive OI records Header/Footer Text
228IHT ;;Inactive OI records w/o matching source record
229IFT ;;Sub-total inactive OI records w/o matching source record
Note: See TracBrowser for help on using the repository browser.