File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import AuthorizationToken from '../entities/AuthorizationToken';
55import Settings from '../entities/Settings' ;
66import db from '../utils/db' ;
77import { getAccessToken , generateAuthorizeUrl } from '../utils/bb2' ;
8- import { getBenefitData } from './Data' ;
8+ import { getBenefitReturnData } from './Data' ;
99
1010const BENE_DENIED_ACCESS = 'access_denied' ;
1111
@@ -58,7 +58,7 @@ export async function authorizationCallback(req: Request, res: Response) {
5858 * You could also request data for the Patient endpoint and/or the Coverage endpoint here
5959 * using similar functionality
6060 */
61- const eobData = await getBenefitData ( req , res ) ;
61+ const eobData = await getBenefitReturnData ( req , res ) ;
6262 loggedInUser . eobData = eobData ;
6363 } else {
6464 // send generic error message to FE
Original file line number Diff line number Diff line change @@ -18,15 +18,21 @@ function getURL(path: string): string {
1818
1919// this function is used to query eob data for the authenticated Medicare.gov
2020// user and returned - we are then storing in a mocked DB
21- export async function getBenefitData ( req : Request , res : Response ) {
21+ export async function getBenefitReturnData ( req : Request , res : Response ) {
2222 const loggedInUser = getLoggedInUser ( db ) ;
2323 // get EOB end point
2424 const response = await get ( getURL ( 'fhir/ExplanationOfBenefit/' ) ,
2525 req . query ,
2626 `${ loggedInUser . authToken ?. accessToken || 'no access token' } ` ) ;
27- res . json ( response . data ) ;
27+ return response . data as Record < string , unknown > ;
2828}
2929
30+ // for bene-direct call
31+ export async function getBenefitData ( req : Request , res : Response ) {
32+ const eob_data = await getBenefitReturnData ( req , res ) ;
33+ res . json ( eob_data ) ;
34+ }
35+
3036/*
3137* DEVELOPER NOTES:
3238* this function is used directly by the front-end to
You can’t perform that action at this time.
0 commit comments