Renombrado el metodo download de iti68.js por getBundleById

This commit is contained in:
Alejandro Gomez Auad 2026-04-30 03:40:33 +00:00
parent 28acb2b130
commit d2a6132f11
2 changed files with 9 additions and 9 deletions

View File

@ -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 };

View File

@ -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;