Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: SCMCHLR3

SCMCHLR3.m

Go to the documentation of this file.
  1. SCMCHLR3 ;ALB/KCL - PCMM HL7 Reject Processing - Build List Area con't; 10-JAN-2000
  1. ;;5.3;Scheduling;**210,272,505**;AUG 13, 1993;Build 20
  1. ;
  1. BLDLIST(SCSORTBY,SCEPS,SCCNT) ; Description: Build list area for for PCMM Transmission errors.
  1. ;
  1. ; Input:
  1. ; SCSORTBY - Sort by criteria
  1. ; N -> Patient Name
  1. ; D -> Date/Time Ack Received
  1. ; P -> Provider
  1. ; I -> Institution
  1. ; SCEPS - Error processing status
  1. ;
  1. ; Output:
  1. ; SCCNT - Number of lines in the list
  1. ;
  1. N DFN,SCSUB,SCTEXT,SCTLIEN,SCERIEN,SCTLOG,SCHL
  1. ;
  1. ;Init line counter and selection number
  1. S (SCLINE,SCNUM)=0
  1. ;
  1. ;Quit if unable to determine col/width for caption flds in List Template
  1. Q:'$$CAPFLD(.SCCOL,.SCWID)
  1. ;
  1. ;Loop thru sort array by pat name, OR date ack rec'd, OR provider, OR Institution
  1. S SCSUB=$S(SCSORTBY="N":"",SCSORTBY="P":"",SCSORTBY="I":"",1:0)
  1. F S SCSUB=$O(^TMP("SCERRSRT",$J,SCSORTBY,SCSUB)) Q:SCSUB="" D
  1. .;loop through PCMM HL7 Transmission Log ien(s)
  1. .S SCTLIEN=0
  1. .F S SCTLIEN=$O(^TMP("SCERRSRT",$J,SCSORTBY,SCSUB,SCTLIEN)) Q:'SCTLIEN D
  1. ..;loop through Error Code subfile ien(s)
  1. ..S SCERIEN=0
  1. ..F S SCERIEN=$O(^TMP("SCERRSRT",$J,SCSORTBY,SCSUB,SCTLIEN,SCERIEN)) Q:'SCERIEN D
  1. ...;
  1. ...;write dot to screen as list is being built (every 50 lines)
  1. ...W:'(SCLINE#50) "."
  1. ...;
  1. ...;get data for PCMM HL7 Trans Log entry
  1. ...I $$GETLOG^SCMCHLA(SCTLIEN,SCERIEN,.SCTLOG) D
  1. ....;
  1. ....;increment selection number
  1. ....S SCNUM=SCNUM+1
  1. ....;
  1. ....;increment line counter
  1. ....S SCLINE=SCLINE+1
  1. ....;
  1. ....;set selection number in display array
  1. ....D SET(SCARY,SCLINE,SCNUM,SCCOL("NUM"),SCWID("NUM"),SCNUM,SCTLIEN,SCTLOG("DFN"),SCERIEN,.SCCNT)
  1. ....;
  1. ....;set retransmit flag in display array
  1. ....S SCTEXT=$S($G(SCTLOG("STATUS"))="M":"*",1:" ")
  1. ....D SET(SCARY,SCLINE,SCTEXT,SCCOL("RET"),SCWID("RET"),SCNUM,,,,.SCCNT)
  1. ....;set patient name in display array
  1. ....S SCTEXT=$$LOWER^VALM1($S($G(SCTLOG("WORK")):"WORKLOAD",$G(SCTLOG("DFN")):$P($G(^DPT(SCTLOG("DFN"),0)),"^",1),1:"UNKNOWN"))
  1. ....D SET(SCARY,SCLINE,SCTEXT,SCCOL("PAT"),SCWID("PAT"),SCNUM,,,,.SCCNT)
  1. ....;
  1. ....;set patient id in display array
  1. ....S DFN=+SCTLOG("DFN") D PID^VADPT
  1. ....D SET(SCARY,SCLINE,VA("BID"),SCCOL("PATID"),SCWID("PATID"),SCNUM,,,,.SCCNT)
  1. ....;
  1. ....;set date ack received in display array
  1. ....S SCTEXT=$$LOWER^VALM1($S($G(SCTLOG("ACK DT/TM")):$E($$FDATE^VALM1(SCTLOG("ACK DT/TM")),1,8),1:"UNKNOWN"))
  1. ....D SET(SCARY,SCLINE,SCTEXT,SCCOL("DTR"),SCWID("DTR"),SCNUM,,,,.SCCNT)
  1. ....;
  1. ....;set provider in display array
  1. ....S SCPROV=""
  1. ....K SCHL
  1. ....;I workload get provider
  1. ....I $G(SCTLOG("WORK")) S SCPROV=$$PROV^SCMCHLP(SCTLOG("WORK"))
  1. ....;get provider if ZPC segment error
  1. ....I $G(SCTLOG("ERR","SEG"))="ZPC" D
  1. .....I $$GETHL7ID^SCMCHLA2($G(SCTLOG("ERR","ZPCID")),.SCHL)
  1. .....S SCPTR=$P($G(SCHL("HL7ID")),"-",2)
  1. .....S SCPROV=$P($G(^SCTM(404.52,+$G(SCPTR),0)),"^",3)
  1. ....S SCTEXT=$$LOWER^VALM1($S($G(SCPROV)'="":$$EXTERNAL^DILFD(404.52,.03,,SCPROV),1:"N/A"))
  1. ....D SET(SCARY,SCLINE,SCTEXT,SCCOL("PROV"),SCWID("PROV"),SCNUM,,,,.SCCNT)
  1. ....;
  1. ....;set provider type in display array
  1. ....S SCTYPE=$P($G(SCHL("HL7ID")),"-",4)
  1. ....I $G(SCTLOG("WORK")) S SCTYPE="PC"
  1. ....S SCTEXT=$S(SCTYPE'="":SCTYPE,1:"N/A")
  1. ....D SET(SCARY,SCLINE,SCTEXT,SCCOL("TYPE"),SCWID("TYPE"),SCNUM,,,,.SCCNT)
  1. ....;
  1. ....;set error processing status in display array
  1. ....S SCTEXT=$$LOWER^VALM1($S($G(SCTLOG("ERR","EPS")):$$EXTERNAL^DILFD(404.47142,.06,,SCTLOG("ERR","EPS")),1:"UNKNOWN"))
  1. ....D SET(SCARY,SCLINE,SCTEXT,SCCOL("STA"),SCWID("STA"),SCNUM,,,,.SCCNT)
  1. ....;
  1. ....;set INSTITUTION in display array
  1. ....I SCSORTBY="I" D
  1. .....;numeric version of institution SD*5.3*505
  1. .....S SCTEXT=$G(SCSUB)
  1. .....D SET(SCARY,SCLINE,SCTEXT,SCCOL("INST"),SCWID("INST"),SCNUM,,,,.SCCNT)
  1. ....;increment line counter
  1. ....S SCLINE=SCLINE+1
  1. ....;
  1. ....;set error code/desc in display array
  1. ....I $$GETEC^SCMCHLA2($G(SCTLOG("ERR","CODE")),.SCERR)
  1. ....S SCTEXT="Error: "_$S($G(SCERR("CODE"))'="":SCERR("CODE")_" - "_$G(SCERR("SHORT")),1:$$LOWER^VALM1("UNKNOWN"))
  1. ....K X S $P(X," ",160)=""
  1. ....S SCTEXT=$E(SCTEXT_X,1,150)
  1. ....D SET(SCARY,SCLINE,SCTEXT,10,$L(SCTEXT),SCNUM,,,,.SCCNT)
  1. ;
  1. Q
  1. ;
  1. ;
  1. SET(SCARY,SCLINE,SCTEXT,SCCOL,SCWID,SCNUM,SCTLIEN,SCDFN,SCERIEN,SCCNT) ;
  1. ; Description: Set display array.
  1. ;
  1. ; Input:
  1. ; SCARY - Global array subscript
  1. ; SCLINE - Line number
  1. ; SCTEXT - Text
  1. ; SCCOL - Column to start at
  1. ; SCWID - Column or text width
  1. ; SCNUM - Selection number
  1. ; SCTLIEN - PCMM HL7 Transmission Log IEN
  1. ; SCERIEN - IEN of record in Error Code (#404.47142) multiple
  1. ; SCDFN Patient IEN
  1. ;
  1. ; Output:
  1. ; SCCNT - Number of lines in the list
  1. ;
  1. N X
  1. S:SCLINE>SCCNT SCCNT=SCLINE
  1. S X=$S($D(^TMP(SCARY,$J,SCLINE,0)):^(0),1:"")
  1. S ^TMP(SCARY,$J,SCLINE,0)=$$SETSTR^VALM1(SCTEXT,X,SCCOL,SCWID)
  1. S ^TMP(SCARY,$J,"IDX",SCLINE,SCNUM)=""
  1. ;
  1. ;Set special index used in retransmitting patient
  1. I $G(SCTLIEN),$G(SCERIEN) D
  1. .I '$G(SCTLOG("WORK")) Q:'SCDFN
  1. .S ^TMP(SCARY_"IDX",$J,SCNUM)=SCLINE_"^"_SCTLIEN_"^"_SCERIEN
  1. .S ^TMP(SCARY_"IDX",$J,"PT",$S(SCDFN:SCDFN,1:"W"),SCLINE)=SCTLIEN_"^"_SCERIEN
  1. Q
  1. ;
  1. ;
  1. CAPFLD(SCCOL,SCWID) ; Description: Used to determine column/width of caption fields in the List Template.
  1. ;
  1. ; Input:
  1. ; VALMDDF - Array available at run-time of list template. This array
  1. ; is subscripted by caption field name of List Template.
  1. ;
  1. ; Output:
  1. ; Function value: Returns 1 on success, 0 on failure
  1. ; SCCOL - array subscripted by abbreviation of caption field name containing the column number where the data/caption starts, pass by reference
  1. ; SCWID - array subscripted by abbreviation of caption field name containing the number of charaters the data/caption will use, pass by reference
  1. ;
  1. ;Quit if VALMDDF array is not defined
  1. Q:'$D(VALMDDF) 0
  1. ;
  1. N X
  1. S X=VALMDDF("NUMBER"),SCCOL("NUM")=$P(X,"^",2),SCWID("NUM")=$P(X,"^",3)
  1. S X=VALMDDF("RETRANS"),SCCOL("RET")=$P(X,"^",2),SCWID("RET")=$P(X,"^",3)
  1. S X=VALMDDF("PATIENT"),SCCOL("PAT")=$P(X,"^",2),SCWID("PAT")=$P(X,"^",3)
  1. S X=VALMDDF("PATID"),SCCOL("PATID")=$P(X,"^",2),SCWID("PATID")=$P(X,"^",3)
  1. S X=VALMDDF("DATE"),SCCOL("DTR")=$P(X,"^",2),SCWID("DTR")=$P(X,"^",3)
  1. S X=VALMDDF("PROV"),SCCOL("PROV")=$P(X,"^",2),SCWID("PROV")=$P(X,"^",3)
  1. S X=VALMDDF("TYPE"),SCCOL("TYPE")=$P(X,"^",2),SCWID("TYPE")=$P(X,"^",3)
  1. S X=VALMDDF("STATUS"),SCCOL("STA")=$P(X,"^",2),SCWID("STA")=$P(X,"^",3)
  1. S X=VALMDDF("INST"),SCCOL("INST")=$P(X,"^",2),SCWID("INST")=$P(X,"^",3)
  1. Q 1