source: FOIAVistA/trunk/r/SCHEDULING-SD-SC/SCMCHLR2.m@ 1203

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

initial load of FOIAVistA 6/30/08 version

File size: 4.8 KB
Line 
1SCMCHLR2 ;ALB/KCL - PCMM HL7 Reject Processing - Build List Area; 10-JAN-2000
2 ;;5.3;Scheduling;**210,272,297**;AUG 13, 1993
3 ;
4EN(SCARY,SCBEG,SCEND,SCEPS,SCSORTBY,SCCNT) ;
5 ; Description: This entry point is used to build list area for
6 ; PCMM Transmission Errors.
7 ;
8 ; The following variables are 'system wide variables' in the
9 ; PCMM Transmission Error Processing List Manager application:
10 ; Input:
11 ; SCARY - Global array subscript
12 ; SCBEG - Begin date for date range
13 ; SCEND - End date for date range
14 ; SCEPS - Error processing statuses
15 ; 1 -> New
16 ; 2 -> Checked
17 ; 3 -> Both
18 ; SCSORTBY - Sort by criteria
19 ; N -> Patient Name
20 ; D -> Date/Time Ack Received
21 ; P -> Provider
22 ;
23 ; Output:
24 ; SCCNT - Contains number of lines in the list, pass by reference
25 ;
26 ;Display FM wait msg
27 D WAIT^DICD
28 ;
29 ;Get PCMM HL7 Trans Log errors
30 D GET(SCARY,SCBEG,SCEND,SCEPS,SCSORTBY)
31 ;
32 ;Build list area for PCMM HL7 Trans Log errors
33 D BLDLIST^SCMCHLR3(SCSORTBY,SCEPS,.SCCNT)
34 ;
35 ;If no PCMM HL7 Trans Log errors, display msg in list area
36 I 'SCCNT D
37 .D SET^SCMCHLR3(SCARY,1,"",1,36,0,,,,.SCCNT)
38 .D SET^SCMCHLR3(SCARY,2,"No 'PCMM Transmission Errors' to display.",4,41,0,,,,.SCCNT)
39 Q
40 ;
41 ;
42GET(SCARY,SCBEG,SCEND,SCEPS,SCSORTBY) ;
43 ; Description: Get PCMM HL7 Transmission Log errors.
44 ;
45 ; Input:
46 ; SCARY - Global array subscript
47 ; SCBEG - Begin date for date range
48 ; SCEND - End date for date range
49 ; SCEPS - Error processing status
50 ; SCSORTBY - Sort by criteria
51 ;
52 ; Output:
53 ; PCMM transmission log error list sorted by:
54 ;
55 ; Patient Name: ^TMP("SCERRSRT",$J,<sort by>,<patient name>,<trans log IEN>,<err code ien>)
56 ; OR,
57 ; Date/Time Ack Rec'd: ^TMP("SCERRSRT",$J,<sort by>,<date/time ack rec'd>,<trans log IEN>,<err code ien>)
58 ; OR,
59 ; Provider: ^TMP("SCERRSRT",$J,<sort by>,<provider>,<trans log IEN>,<err code ien>)
60 ;
61 N SCDFN,SCDTR,SCERIEN,SCTLIEN,SCSTAT
62 ;
63 ;Loop thru PCMM HL7 Trans Log for selected date range
64 F SCDTR=SCBEG:0 S SCDTR=$O(^SCPT(404.471,"AST",SCDTR)) Q:'SCDTR!($P(SCDTR,".")>SCEND) D
65 .;loop thru status
66 .S SCSTAT=0
67 .F S SCSTAT=$O(^SCPT(404.471,"AST",SCDTR,SCSTAT)) Q:SCSTAT="" D
68 ..;loop thru patients
69 ..S SCDFN=0
70 ..F S SCDFN=$O(^SCPT(404.471,"AST",SCDTR,SCSTAT,SCDFN)) Q:SCDFN="" D
71 ...;loop through (#404.471) ien's
72 ...S SCTLIEN=0
73 ...F S SCTLIEN=$O(^SCPT(404.471,"AST",SCDTR,SCSTAT,SCDFN,SCTLIEN)) Q:'SCTLIEN D
74 ....;loop thru ien's of error code mult. and setup sort array
75 ....S SCERIEN=0
76 ....F S SCERIEN=$O(^SCPT(404.471,SCTLIEN,"ERR",SCERIEN)) Q:'SCERIEN D SORT(SCSORTBY,SCDTR,SCDFN,SCEPS,SCTLIEN,SCERIEN)
77 ;
78 Q
79 ;
80 ;
81SORT(SCSORTBY,SCDTR,SCDFN,SCEPS,SCTLIEN,SCERIEN) ;
82 ; Description: Used to set up sort array based on 'Sort Criteria' and
83 ; 'Error Processing Status' for PCMM Transmission Errors list display.
84 ;
85 ; Input:
86 ; SCSORTBY - Sort by criteria
87 ; SCDTR - PCMM transmission log date/time ack received
88 ; SCDFN - Patient IEN
89 ; SCEPS - Error processing status
90 ; SCTLIEN - PCMM transmission log IEN
91 ; SCERIEN - IEN of record in Error Code (#404.47142) multiple
92 ;
93 ; Output: None
94 ;
95 N SCTLOG
96 ;
97 ;If sort by criteria is 'Date/Time Ack Received'
98 I SCSORTBY="D" D
99 .;get data from PCMM HL7 Trans Log
100 .I $$GETLOG^SCMCHLA(SCTLIEN,SCERIEN,.SCTLOG) D
101 ..;if Error Proc Status matches selected Error Proc Status
102 ..I (SCEPS=$G(SCTLOG("ERR","EPS"))!(SCEPS>2)) D
103 ...;setup ^tmp array sorted by date/time ack rec'd
104 ...S ^TMP("SCERRSRT",$J,SCSORTBY,SCDTR,SCTLIEN,SCERIEN)=""
105 ;
106 ;If sort by criteria is 'Provider'
107 I SCSORTBY="P" D
108 .N SCPTR,SCPROV,SCHL
109 .;get data from PCMM HL7 Trans Log
110 .I $$GETLOG^SCMCHLA(SCTLIEN,SCERIEN,.SCTLOG) D
111 ..;if Error Proc Status matches selected Error Proc Status
112 ..I (SCEPS=$G(SCTLOG("ERR","EPS"))!(SCEPS>2)) D
113 ...;get data from PCMM HL7 ID file
114 ...I $$GETHL7ID^SCMCHLA2($G(SCTLOG("ERR","ZPCID")),.SCHL)
115 ...;get provider from POSITION ASSIGNMENT HISTORY file
116 ...S SCPTR=$P($G(SCHL("HL7ID")),"-",2) ; pointer to PCMM HL7 ID file
117 ...I $G(SCTLOG("WORK")) S SCPROV=$$PROV^SCMCHLP(SCTLOG("WORK"))
118 ...I '$G(SCTLOG("WORK")) S SCPROV=$P($G(^SCTM(404.52,+SCPTR,0)),"^",3)
119 ...;setup ^tmp array sorted by provider
120 ...S ^TMP("SCERRSRT",$J,SCSORTBY,$S($G(SCPROV)'="":$$EXTERNAL^DILFD(404.52,.03,,SCPROV),1:"ZZZUNKNOWN"),SCTLIEN,SCERIEN)=""
121 ;
122 ;If sort by criteria is 'Patient' (default)
123 I SCSORTBY="N" D
124 .;get data from PCMM HL7 Trans Log
125 .I $$GETLOG^SCMCHLA(SCTLIEN,SCERIEN,.SCTLOG) D
126 ..;if Error Proc Status matches selected Error Proc Status
127 ..I (SCEPS=$G(SCTLOG("ERR","EPS"))!(SCEPS>2)) D
128 ...;setup ^tmp array sorted by patient
129 ...I SCDFN="W" I $G(SCTLOG("WORK"))="" S SCDFN=""
130 ...S ^TMP("SCERRSRT",$J,SCSORTBY,$S($P($G(^DPT(+SCDFN,0)),U)'="":$P(^(0),U),SCDFN="W":"Workload Message",1:"UNKNOWN"),SCTLIEN,SCERIEN)=""
131 ;
132 Q
Note: See TracBrowser for help on using the repository browser.