133 lines
4.8 KiB
Mathematica
133 lines
4.8 KiB
Mathematica
SCMCHLR2 ;ALB/KCL - PCMM HL7 Reject Processing - Build List Area; 10-JAN-2000
|
|
;;5.3;Scheduling;**210,272,297**;AUG 13, 1993
|
|
;
|
|
EN(SCARY,SCBEG,SCEND,SCEPS,SCSORTBY,SCCNT) ;
|
|
; Description: This entry point is used to build list area for
|
|
; PCMM Transmission Errors.
|
|
;
|
|
; The following variables are 'system wide variables' in the
|
|
; PCMM Transmission Error Processing List Manager application:
|
|
; Input:
|
|
; SCARY - Global array subscript
|
|
; SCBEG - Begin date for date range
|
|
; SCEND - End date for date range
|
|
; SCEPS - Error processing statuses
|
|
; 1 -> New
|
|
; 2 -> Checked
|
|
; 3 -> Both
|
|
; SCSORTBY - Sort by criteria
|
|
; N -> Patient Name
|
|
; D -> Date/Time Ack Received
|
|
; P -> Provider
|
|
;
|
|
; Output:
|
|
; SCCNT - Contains number of lines in the list, pass by reference
|
|
;
|
|
;Display FM wait msg
|
|
D WAIT^DICD
|
|
;
|
|
;Get PCMM HL7 Trans Log errors
|
|
D GET(SCARY,SCBEG,SCEND,SCEPS,SCSORTBY)
|
|
;
|
|
;Build list area for PCMM HL7 Trans Log errors
|
|
D BLDLIST^SCMCHLR3(SCSORTBY,SCEPS,.SCCNT)
|
|
;
|
|
;If no PCMM HL7 Trans Log errors, display msg in list area
|
|
I 'SCCNT D
|
|
.D SET^SCMCHLR3(SCARY,1,"",1,36,0,,,,.SCCNT)
|
|
.D SET^SCMCHLR3(SCARY,2,"No 'PCMM Transmission Errors' to display.",4,41,0,,,,.SCCNT)
|
|
Q
|
|
;
|
|
;
|
|
GET(SCARY,SCBEG,SCEND,SCEPS,SCSORTBY) ;
|
|
; Description: Get PCMM HL7 Transmission Log errors.
|
|
;
|
|
; Input:
|
|
; SCARY - Global array subscript
|
|
; SCBEG - Begin date for date range
|
|
; SCEND - End date for date range
|
|
; SCEPS - Error processing status
|
|
; SCSORTBY - Sort by criteria
|
|
;
|
|
; Output:
|
|
; PCMM transmission log error list sorted by:
|
|
;
|
|
; Patient Name: ^TMP("SCERRSRT",$J,<sort by>,<patient name>,<trans log IEN>,<err code ien>)
|
|
; OR,
|
|
; Date/Time Ack Rec'd: ^TMP("SCERRSRT",$J,<sort by>,<date/time ack rec'd>,<trans log IEN>,<err code ien>)
|
|
; OR,
|
|
; Provider: ^TMP("SCERRSRT",$J,<sort by>,<provider>,<trans log IEN>,<err code ien>)
|
|
;
|
|
N SCDFN,SCDTR,SCERIEN,SCTLIEN,SCSTAT
|
|
;
|
|
;Loop thru PCMM HL7 Trans Log for selected date range
|
|
F SCDTR=SCBEG:0 S SCDTR=$O(^SCPT(404.471,"AST",SCDTR)) Q:'SCDTR!($P(SCDTR,".")>SCEND) D
|
|
.;loop thru status
|
|
.S SCSTAT=0
|
|
.F S SCSTAT=$O(^SCPT(404.471,"AST",SCDTR,SCSTAT)) Q:SCSTAT="" D
|
|
..;loop thru patients
|
|
..S SCDFN=0
|
|
..F S SCDFN=$O(^SCPT(404.471,"AST",SCDTR,SCSTAT,SCDFN)) Q:SCDFN="" D
|
|
...;loop through (#404.471) ien's
|
|
...S SCTLIEN=0
|
|
...F S SCTLIEN=$O(^SCPT(404.471,"AST",SCDTR,SCSTAT,SCDFN,SCTLIEN)) Q:'SCTLIEN D
|
|
....;loop thru ien's of error code mult. and setup sort array
|
|
....S SCERIEN=0
|
|
....F S SCERIEN=$O(^SCPT(404.471,SCTLIEN,"ERR",SCERIEN)) Q:'SCERIEN D SORT(SCSORTBY,SCDTR,SCDFN,SCEPS,SCTLIEN,SCERIEN)
|
|
;
|
|
Q
|
|
;
|
|
;
|
|
SORT(SCSORTBY,SCDTR,SCDFN,SCEPS,SCTLIEN,SCERIEN) ;
|
|
; Description: Used to set up sort array based on 'Sort Criteria' and
|
|
; 'Error Processing Status' for PCMM Transmission Errors list display.
|
|
;
|
|
; Input:
|
|
; SCSORTBY - Sort by criteria
|
|
; SCDTR - PCMM transmission log date/time ack received
|
|
; SCDFN - Patient IEN
|
|
; SCEPS - Error processing status
|
|
; SCTLIEN - PCMM transmission log IEN
|
|
; SCERIEN - IEN of record in Error Code (#404.47142) multiple
|
|
;
|
|
; Output: None
|
|
;
|
|
N SCTLOG
|
|
;
|
|
;If sort by criteria is 'Date/Time Ack Received'
|
|
I SCSORTBY="D" D
|
|
.;get data from PCMM HL7 Trans Log
|
|
.I $$GETLOG^SCMCHLA(SCTLIEN,SCERIEN,.SCTLOG) D
|
|
..;if Error Proc Status matches selected Error Proc Status
|
|
..I (SCEPS=$G(SCTLOG("ERR","EPS"))!(SCEPS>2)) D
|
|
...;setup ^tmp array sorted by date/time ack rec'd
|
|
...S ^TMP("SCERRSRT",$J,SCSORTBY,SCDTR,SCTLIEN,SCERIEN)=""
|
|
;
|
|
;If sort by criteria is 'Provider'
|
|
I SCSORTBY="P" D
|
|
.N SCPTR,SCPROV,SCHL
|
|
.;get data from PCMM HL7 Trans Log
|
|
.I $$GETLOG^SCMCHLA(SCTLIEN,SCERIEN,.SCTLOG) D
|
|
..;if Error Proc Status matches selected Error Proc Status
|
|
..I (SCEPS=$G(SCTLOG("ERR","EPS"))!(SCEPS>2)) D
|
|
...;get data from PCMM HL7 ID file
|
|
...I $$GETHL7ID^SCMCHLA2($G(SCTLOG("ERR","ZPCID")),.SCHL)
|
|
...;get provider from POSITION ASSIGNMENT HISTORY file
|
|
...S SCPTR=$P($G(SCHL("HL7ID")),"-",2) ; pointer to PCMM HL7 ID file
|
|
...I $G(SCTLOG("WORK")) S SCPROV=$$PROV^SCMCHLP(SCTLOG("WORK"))
|
|
...I '$G(SCTLOG("WORK")) S SCPROV=$P($G(^SCTM(404.52,+SCPTR,0)),"^",3)
|
|
...;setup ^tmp array sorted by provider
|
|
...S ^TMP("SCERRSRT",$J,SCSORTBY,$S($G(SCPROV)'="":$$EXTERNAL^DILFD(404.52,.03,,SCPROV),1:"ZZZUNKNOWN"),SCTLIEN,SCERIEN)=""
|
|
;
|
|
;If sort by criteria is 'Patient' (default)
|
|
I SCSORTBY="N" D
|
|
.;get data from PCMM HL7 Trans Log
|
|
.I $$GETLOG^SCMCHLA(SCTLIEN,SCERIEN,.SCTLOG) D
|
|
..;if Error Proc Status matches selected Error Proc Status
|
|
..I (SCEPS=$G(SCTLOG("ERR","EPS"))!(SCEPS>2)) D
|
|
...;setup ^tmp array sorted by patient
|
|
...I SCDFN="W" I $G(SCTLOG("WORK"))="" S SCDFN=""
|
|
...S ^TMP("SCERRSRT",$J,SCSORTBY,$S($P($G(^DPT(+SCDFN,0)),U)'="":$P(^(0),U),SCDFN="W":"Workload Message",1:"UNKNOWN"),SCTLIEN,SCERIEN)=""
|
|
;
|
|
Q
|