diff --git a/bus-gateway/controllers/iti68.js b/bus-gateway/controllers/iti68.js index 38d1078..50351eb 100644 --- a/bus-gateway/controllers/iti68.js +++ b/bus-gateway/controllers/iti68.js @@ -2,12 +2,12 @@ const createError = require('http-errors'); const axios = require('axios'); -async function getRemoteDocument(url){ +async function getRemoteDocument(url) { const response = await axios.get(parsedUrl.toString(), { - responseType: 'arraybuffer', - headers: { - Accept: req.headers['accept'] || '*/*', - }, + responseType: 'arraybuffer', + headers: { + Accept: req.headers['accept'] || '*/*', + }, }); return response } @@ -23,7 +23,7 @@ async function getRemoteDocument(url){ * 2. This gateway performs a P2P GET to that URL, bypassing the Bus. * 3. The raw document (PDF, XML, etc.) is forwarded back to HIS_A. */ -async function download(req, res, next) { +async function getBundleById(req, res, next) { try { const url = req.query.url; if (!url) { @@ -52,4 +52,4 @@ async function download(req, res, next) { } } -module.exports = { download }; +module.exports = { getBundleById }; diff --git a/bus-gateway/routes/iti68.js b/bus-gateway/routes/iti68.js index a4fffa7..fd2046c 100644 --- a/bus-gateway/routes/iti68.js +++ b/bus-gateway/routes/iti68.js @@ -1,8 +1,8 @@ const express = require('express'); const router = express.Router(); -const { download } = require('../controllers/iti68'); +const { getBundleById } = require('../controllers/iti68'); // ITI-68: Retrieve Document → GET /fhir/Binary?url=[URL_Directa] -router.get('/Binary', download); +router.get('/Bundle', getBundleById); module.exports = router;