[613] | 1 | IVMLERR1 ;ALB/RMO - IVM Transmission Error Processing - Build List area; 15-SEP-1997
|
---|
| 2 | ;;2.0;INCOME VERIFICATION MATCH;**9**; 21-OCT-94
|
---|
| 3 | ;
|
---|
| 4 | EN(IVMARY,IVMBEG,IVMEND,IVMEPSTA,IVMSRTBY,IVMCNT) ;Entry point to build list area for IVM transmission errors
|
---|
| 5 | ;The following variables are 'system wide variables' in the
|
---|
| 6 | ;IVM Transmission Error Processing List Manager application:
|
---|
| 7 | ; Input -- IVMARY Global array subscript
|
---|
| 8 | ; IVMBEG Begin date
|
---|
| 9 | ; IVMEND End date
|
---|
| 10 | ; IVMEPSTA Error processing statuses
|
---|
| 11 | ; 1 - New
|
---|
| 12 | ; 2 - Checked
|
---|
| 13 | ; 1^2 - Both
|
---|
| 14 | ; IVMSRTBY Sort by criteria
|
---|
| 15 | ; P - patient name
|
---|
| 16 | ; D - date/time ack received
|
---|
| 17 | ; Output -- IVMCNT Number of lines in the list
|
---|
| 18 | D WAIT^DICD
|
---|
| 19 | ;
|
---|
| 20 | ;Get IVM transmission log errors
|
---|
| 21 | D GET(IVMARY,IVMBEG,IVMEND,IVMEPSTA,IVMSRTBY)
|
---|
| 22 | ;
|
---|
| 23 | ;Build list area for for IVM transmission log errors
|
---|
| 24 | D BLD(IVMSRTBY,.IVMCNT)
|
---|
| 25 | ;
|
---|
| 26 | ;Print message if no IVM transmission log errors meet selection criteria
|
---|
| 27 | I 'IVMCNT D
|
---|
| 28 | . D SET(IVMARY,1,"",1,60,0,,,.IVMCNT)
|
---|
| 29 | . D SET(IVMARY,2,"No 'Transmission Errors' meet the selection criteria.",4,60,0,,,.IVMCNT)
|
---|
| 30 | Q
|
---|
| 31 | ;
|
---|
| 32 | GET(IVMARY,IVMBEG,IVMEND,IVMEPSTA,IVMSRTBY) ;Get IVM transmission log errors
|
---|
| 33 | ; Input -- IVMARY Global array subscript
|
---|
| 34 | ; IVMBEG Begin date
|
---|
| 35 | ; IVMEND End date
|
---|
| 36 | ; IVMEPSTA Error processing statuses
|
---|
| 37 | ; IVMSRTBY Sort by criteria
|
---|
| 38 | ; Output -- IVM Transmission log error list sorted by patient name
|
---|
| 39 | ; ^TMP("IVMERRSRT",$J,<sort by>,<patient name>,<trans log IEN>)
|
---|
| 40 | ; or date/time ack received
|
---|
| 41 | ; ^TMP("IVMERRSRT",$J,<sort by>,<date/time ack received>,<trans log IEN>)
|
---|
| 42 | N IVMDFN,IVMDTR,IVMTLIEN,PCE,STA
|
---|
| 43 | ;
|
---|
| 44 | ;Loop through IVM transmission log for selected date range
|
---|
| 45 | F IVMDTR=IVMBEG:0 S IVMDTR=$O(^IVM(301.6,"AEPS",IVMDTR)) Q:'IVMDTR!($P(IVMDTR,".")>IVMEND) D
|
---|
| 46 | . ;Loop through selected error processing statuses
|
---|
| 47 | . F PCE=1:1 S STA=$P(IVMEPSTA,U,PCE) Q:STA="" D
|
---|
| 48 | . . ;Loop through patients
|
---|
| 49 | . . S IVMDFN=0
|
---|
| 50 | . . F S IVMDFN=$O(^IVM(301.6,"AEPS",IVMDTR,STA,IVMDFN)) Q:'IVMDFN D
|
---|
| 51 | . . . ;Loop though internal entry numbers
|
---|
| 52 | . . . S IVMTLIEN=0
|
---|
| 53 | . . . F S IVMTLIEN=$O(^IVM(301.6,"AEPS",IVMDTR,STA,IVMDFN,IVMTLIEN)) Q:'IVMTLIEN D SORT(IVMSRTBY,IVMDTR,IVMDFN,IVMTLIEN)
|
---|
| 54 | Q
|
---|
| 55 | ;
|
---|
| 56 | SORT(IVMSRTBY,IVMDTR,IVMDFN,IVMTLIEN) ;Set array based on sort criteria for IVM transmission log error list display
|
---|
| 57 | ; Input -- IVMSRTBY Sort by criteria
|
---|
| 58 | ; IVMDTR IVM transmission log date/time ack received
|
---|
| 59 | ; IVMDFN IVM patient IEN
|
---|
| 60 | ; IVMTLIEN IVM transmission log IEN
|
---|
| 61 | ; Output -- None
|
---|
| 62 | N IVMTLOG
|
---|
| 63 | I IVMSRTBY="P" D ;patient name
|
---|
| 64 | . I $$GET^IVMTLOG(IVMTLIEN,.IVMTLOG) D
|
---|
| 65 | . . S ^TMP("IVMERRSRT",$J,IVMSRTBY,$S($P($G(^DPT(+IVMTLOG("DFN"),0)),U)'="":$P(^(0),U),1:"UNKNOWN"),IVMTLIEN)=""
|
---|
| 66 | ELSE D ;default date/time ack received
|
---|
| 67 | . S ^TMP("IVMERRSRT",$J,IVMSRTBY,IVMDTR,IVMTLIEN)=""
|
---|
| 68 | Q
|
---|
| 69 | ;
|
---|
| 70 | BLD(IVMSRTBY,IVMCNT) ;Build list area for for IVM transmission log errors
|
---|
| 71 | ; Input -- IVMSRTBY Sort by criteria
|
---|
| 72 | ; P - patient name
|
---|
| 73 | ; D - date/time ack received
|
---|
| 74 | ; Output -- IVMCNT Number of lines in the list
|
---|
| 75 | N DFN,IVMCOL,IVMSUB,IVMTEXT,IVMTLIEN,IVMTLOG,IVMWID,X,VA
|
---|
| 76 | ;
|
---|
| 77 | ;Initialize variables
|
---|
| 78 | S (IVMLINE,IVMNUM)=0
|
---|
| 79 | S X=VALMDDF("NUMBER"),IVMCOL("NUM")=$P(X,U,2),IVMWID("NUM")=$P(X,U,3)
|
---|
| 80 | S X=VALMDDF("RETRANSMIT"),IVMCOL("RET")=$P(X,U,2),IVMWID("RET")=$P(X,U,3)
|
---|
| 81 | S X=VALMDDF("PATIENT"),IVMCOL("PAT")=$P(X,U,2),IVMWID("PAT")=$P(X,U,3)
|
---|
| 82 | S X=VALMDDF("PTID"),IVMCOL("PTID")=$P(X,U,2),IVMWID("PTID")=$P(X,U,3)
|
---|
| 83 | S X=VALMDDF("DATE/TIME"),IVMCOL("DTR")=$P(X,U,2),IVMWID("DTR")=$P(X,U,3)
|
---|
| 84 | S X=VALMDDF("STATUS"),IVMCOL("STA")=$P(X,U,2),IVMWID("STA")=$P(X,U,3)
|
---|
| 85 | ;
|
---|
| 86 | ;Loop through by patient name or date/time ack received
|
---|
| 87 | S IVMSUB=$S(IVMSRTBY="P":"",1:0)
|
---|
| 88 | F S IVMSUB=$O(^TMP("IVMERRSRT",$J,IVMSRTBY,IVMSUB)) Q:IVMSUB="" D
|
---|
| 89 | . ;Loop through IVM transmission log IEN(s)
|
---|
| 90 | . S IVMTLIEN=0
|
---|
| 91 | . F S IVMTLIEN=$O(^TMP("IVMERRSRT",$J,IVMSRTBY,IVMSUB,IVMTLIEN)) Q:'IVMTLIEN D
|
---|
| 92 | . . W:'(IVMLINE#50) "."
|
---|
| 93 | . . ;Get information for IVM transmission log entry
|
---|
| 94 | . . I $$GET^IVMTLOG(IVMTLIEN,.IVMTLOG) D
|
---|
| 95 | . . . ;Increment selection number
|
---|
| 96 | . . . S IVMNUM=IVMNUM+1
|
---|
| 97 | . . . ;Increment line counter
|
---|
| 98 | . . . S IVMLINE=IVMLINE+1
|
---|
| 99 | . . . ;Set selection number in display array
|
---|
| 100 | . . . D SET(IVMARY,IVMLINE,IVMNUM,IVMCOL("NUM"),IVMWID("NUM"),IVMNUM,IVMTLIEN,IVMTLOG("PAT"),.IVMCNT)
|
---|
| 101 | . . . ;Set retransmit flag in display array
|
---|
| 102 | . . . S IVMTEXT=$S('$G(IVMTLOG("PAT")):" ",'$$STATUS^IVMPLOG(IVMTLOG("PAT")):"*",1:" ")
|
---|
| 103 | . . . D SET(IVMARY,IVMLINE,IVMTEXT,IVMCOL("RET"),IVMWID("RET"),IVMNUM,,,.IVMCNT)
|
---|
| 104 | . . . ;Set patient name in display array
|
---|
| 105 | . . . S IVMTEXT=$$LOWER^VALM1($S($G(IVMTLOG("PAT")):$$EXT^IVMTLOG("PAT",IVMTLOG("PAT")),1:"UNKNOWN"))
|
---|
| 106 | . . . D SET(IVMARY,IVMLINE,IVMTEXT,IVMCOL("PAT"),IVMWID("PAT"),IVMNUM,,,.IVMCNT)
|
---|
| 107 | . . . ;Set patient id in display array
|
---|
| 108 | . . . S DFN=+IVMTLOG("DFN") D PID^VADPT
|
---|
| 109 | . . . D SET(IVMARY,IVMLINE,VA("BID"),IVMCOL("PTID"),IVMWID("PTID"),IVMNUM,,,.IVMCNT)
|
---|
| 110 | . . . ;Set date/time ack received in display array
|
---|
| 111 | . . . S IVMTEXT=$$LOWER^VALM1($S($G(IVMTLOG("DT/TM ACK")):$$EXT^IVMTLOG("DT/TM ACK",IVMTLOG("DT/TM ACK")),1:"UNKNOWN"))
|
---|
| 112 | . . . D SET(IVMARY,IVMLINE,IVMTEXT,IVMCOL("DTR"),IVMWID("DTR"),IVMNUM,,,.IVMCNT)
|
---|
| 113 | . . . ;Set error processing status in display array
|
---|
| 114 | . . . S IVMTEXT=$$LOWER^VALM1($S($G(IVMTLOG("ERROR STATUS")):$$EXT^IVMTLOG("ERROR STATUS",IVMTLOG("ERROR STATUS")),1:"UNKNOWN"))
|
---|
| 115 | . . . D SET(IVMARY,IVMLINE,IVMTEXT,IVMCOL("STA"),IVMWID("STA"),IVMNUM,,,.IVMCNT)
|
---|
| 116 | . . . ;Increment line counter
|
---|
| 117 | . . . S IVMLINE=IVMLINE+1
|
---|
| 118 | . . . ;Set error message in display array
|
---|
| 119 | . . . S IVMTEXT="Error: "_$S($G(IVMTLOG("ERROR"))'="":$$EXT^IVMTLOG("ERROR",IVMTLOG("ERROR")),1:"UNKNOWN")
|
---|
| 120 | . . . K X S $P(X," ",160)=""
|
---|
| 121 | . . . S IVMTEXT=$E(IVMTEXT_X,1,160)
|
---|
| 122 | . . . D SET(IVMARY,IVMLINE,IVMTEXT,3,$L(IVMTEXT),IVMNUM,,,.IVMCNT)
|
---|
| 123 | Q
|
---|
| 124 | ;
|
---|
| 125 | SET(IVMARY,IVMLINE,IVMTEXT,IVMCOL,IVMWID,IVMNUM,IVMTLIEN,IVMDFN,IVMCNT) ;Set display array
|
---|
| 126 | ; Input -- IVMARY Global array subscript
|
---|
| 127 | ; IVMLINE Line number
|
---|
| 128 | ; IVMTEXT Text
|
---|
| 129 | ; IVMCOL Column to start at
|
---|
| 130 | ; IVMWID Column or text width
|
---|
| 131 | ; IVMNUM Selection number
|
---|
| 132 | ; IVMTLIEN IVM transmission log IEN
|
---|
| 133 | ; IVMDFN IVM patient IEN
|
---|
| 134 | ; Output -- IVMCNT Number of lines in the list
|
---|
| 135 | N X
|
---|
| 136 | S:IVMLINE>IVMCNT IVMCNT=IVMLINE
|
---|
| 137 | S X=$S($D(^TMP(IVMARY,$J,IVMLINE,0)):^(0),1:"")
|
---|
| 138 | S ^TMP(IVMARY,$J,IVMLINE,0)=$$SETSTR^VALM1(IVMTEXT,X,IVMCOL,IVMWID)
|
---|
| 139 | S ^TMP(IVMARY,$J,"IDX",IVMLINE,IVMNUM)=""
|
---|
| 140 | ;
|
---|
| 141 | ;Set special index used in retransmitting patient
|
---|
| 142 | I $G(IVMTLIEN),$G(IVMDFN) D
|
---|
| 143 | . S ^TMP(IVMARY_"IDX",$J,IVMNUM)=IVMLINE_U_IVMTLIEN
|
---|
| 144 | . S ^TMP(IVMARY_"IDX",$J,"PT",IVMDFN,IVMLINE)=IVMTLIEN
|
---|
| 145 | Q
|
---|