File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -31,16 +31,18 @@ export default function Records({ }) {
3131 . then ( res => {
3232 return res . json ( ) ;
3333 } ) . then ( eobData => {
34- const records : EOBRecord [ ] = eobData . entry . map ( ( resourceData : any ) => {
35- const resource = resourceData . resource ;
36- return {
37- id : resource . id ,
38- code : resource . item [ 0 ] ?. productOrService ?. coding [ 0 ] ?. code || 'Unknown' ,
39- display : resource . item [ 0 ] ?. productOrService ?. coding [ 0 ] ?. display || 'Unknown Prescription Drug' ,
40- amount : resource . item [ 0 ] ?. adjudication [ 7 ] ?. amount ?. value || '0'
41- }
42- } ) ;
43- setRecords ( records ) ;
34+ if ( eobData && eobData . entry ) {
35+ const records : EOBRecord [ ] = eobData . entry . map ( ( resourceData : any ) => {
36+ const resource = resourceData . resource ;
37+ return {
38+ id : resource . id ,
39+ code : resource . item [ 0 ] ?. productOrService ?. coding [ 0 ] ?. code || 'Unknown' ,
40+ display : resource . item [ 0 ] ?. productOrService ?. coding [ 0 ] ?. display || 'Unknown Prescription Drug' ,
41+ amount : resource . item [ 0 ] ?. adjudication [ 7 ] ?. amount ?. value || '0'
42+ }
43+ } ) ;
44+ setRecords ( records ) ;
45+ }
4446 } ) ;
4547 } , [ ] )
4648
Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ export async function do_retry() {
4949 break ;
5050 }
5151 else if ( r . tried ( ) ) {
52- // max not reached yet
52+ // max not reached yet (not expired)
5353 RetryableRequests . enQ ( r ) ;
5454 }
5555 }
Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ export default class Retryable {
5151 console . log ( "count=" , this . count )
5252 this . count = this . count + 1 ;
5353 console . log ( "after count=" , this . count )
54- return this . expired ( ) ;
54+ return ! this . expired ( ) ;
5555 }
5656
5757 expired ( ) {
You can’t perform that action at this time.
0 commit comments