Renombrado el metodo download de iti68.js por getBundleById
This commit is contained in:
parent
28acb2b130
commit
d2a6132f11
@ -2,12 +2,12 @@ const createError = require('http-errors');
|
|||||||
const axios = require('axios');
|
const axios = require('axios');
|
||||||
|
|
||||||
|
|
||||||
async function getRemoteDocument(url){
|
async function getRemoteDocument(url) {
|
||||||
const response = await axios.get(parsedUrl.toString(), {
|
const response = await axios.get(parsedUrl.toString(), {
|
||||||
responseType: 'arraybuffer',
|
responseType: 'arraybuffer',
|
||||||
headers: {
|
headers: {
|
||||||
Accept: req.headers['accept'] || '*/*',
|
Accept: req.headers['accept'] || '*/*',
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
return response
|
return response
|
||||||
}
|
}
|
||||||
@ -23,7 +23,7 @@ async function getRemoteDocument(url){
|
|||||||
* 2. This gateway performs a P2P GET to that URL, bypassing the Bus.
|
* 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.
|
* 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 {
|
try {
|
||||||
const url = req.query.url;
|
const url = req.query.url;
|
||||||
if (!url) {
|
if (!url) {
|
||||||
@ -52,4 +52,4 @@ async function download(req, res, next) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = { download };
|
module.exports = { getBundleById };
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
const express = require('express');
|
const express = require('express');
|
||||||
const router = express.Router();
|
const router = express.Router();
|
||||||
const { download } = require('../controllers/iti68');
|
const { getBundleById } = require('../controllers/iti68');
|
||||||
|
|
||||||
// ITI-68: Retrieve Document → GET /fhir/Binary?url=[URL_Directa]
|
// ITI-68: Retrieve Document → GET /fhir/Binary?url=[URL_Directa]
|
||||||
router.get('/Binary', download);
|
router.get('/Bundle', getBundleById);
|
||||||
|
|
||||||
module.exports = router;
|
module.exports = router;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user