From a40f5744c9fa6e696fd889980e0bcb8f05dd5fb8 Mon Sep 17 00:00:00 2001 From: Alejandro Gomez Auad Date: Thu, 30 Apr 2026 16:24:13 +0000 Subject: [PATCH] Ajustadas las rutas de los servicios --- bus-gateway/app.js | 6 +----- bus-gateway/controllers/iti68.js | 21 --------------------- bus-gateway/routes/iti65.js | 2 +- bus-gateway/routes/iti68.js | 8 -------- nginx/http.conf | 3 +-- nginx/https.conf | 3 +-- 6 files changed, 4 insertions(+), 39 deletions(-) delete mode 100644 bus-gateway/controllers/iti68.js delete mode 100644 bus-gateway/routes/iti68.js diff --git a/bus-gateway/app.js b/bus-gateway/app.js index 6b5fa23..6a77ba8 100644 --- a/bus-gateway/app.js +++ b/bus-gateway/app.js @@ -6,7 +6,6 @@ var logger = require('morgan'); var iti65Router = require('./routes/iti65'); var iti67Router = require('./routes/iti67'); -var iti68Router = require('./routes/iti68'); var iti78Router = require('./routes/iti78'); var iti104Router = require('./routes/iti104'); var vhlRouter = require('./routes/vhl'); @@ -17,15 +16,12 @@ app.use(logger('dev')); app.use(express.json({ type: ['application/json', 'application/fhir+json'] })); // ITI-65: Provide Document Bundle → POST /fhir/IPSTransaction (transaction Bundle) -// POST /fhir/Bundle (IPS document Bundle) +// POST /fhir/IPSDocument (IPS document Bundle) app.use('/fhir', iti65Router); // ITI-67: Find Document References → GET /fhir/DocumentReference app.use('/fhir', iti67Router); -// ITI-68: Retrieve Document → GET /fhir/Bundle?url=[URL_Directa] -app.use('/fhir', iti68Router); - // ITI-78: Patient Demographics → GET /fhir/Patient, GET /fhir/Patient/:id app.use('/fhir', iti78Router); diff --git a/bus-gateway/controllers/iti68.js b/bus-gateway/controllers/iti68.js deleted file mode 100644 index f6a238e..0000000 --- a/bus-gateway/controllers/iti68.js +++ /dev/null @@ -1,21 +0,0 @@ -const config = require('../config'); -const { getResourceByUrl } = require('../services/fhir'); - - -/** - * ITI-68: Retrieve Document (MHD) - * - * GET /fhir/Bundle/:id - * - * Proxy transparente al servidor HAPI FHIR subyacente. - */ -async function getBundleById(req, res, next) { - try { - const bundle = await getResourceByUrl(`${config.fhir.url}/Bundle/${req.params.id}`); - res.status(200).json(bundle); - } catch (err) { - next(err); - } -} - -module.exports = { getBundleById }; diff --git a/bus-gateway/routes/iti65.js b/bus-gateway/routes/iti65.js index 0387cd7..1215498 100644 --- a/bus-gateway/routes/iti65.js +++ b/bus-gateway/routes/iti65.js @@ -6,6 +6,6 @@ const { provideIPSTransaction, provideIPSDocumentBundle } = require('../controll router.post('/IPSTransaction', provideIPSTransaction); // ITI-65: Provide Document Bundle — variante IPS document Bundle (type: document) -router.post('/Bundle', provideIPSDocumentBundle); +router.post('/IPSDocument', provideIPSDocumentBundle); module.exports = router; diff --git a/bus-gateway/routes/iti68.js b/bus-gateway/routes/iti68.js deleted file mode 100644 index e97c645..0000000 --- a/bus-gateway/routes/iti68.js +++ /dev/null @@ -1,8 +0,0 @@ -const express = require('express'); -const router = express.Router(); -const { getBundleById } = require('../controllers/iti68'); - -// ITI-68: Retrieve Document → GET /fhir/Bundle/:id -router.get('/Bundle/:id', getBundleById); - -module.exports = router; diff --git a/nginx/http.conf b/nginx/http.conf index 18084ba..491e67a 100644 --- a/nginx/http.conf +++ b/nginx/http.conf @@ -26,8 +26,7 @@ http { } # ITI-65: Provide Document Bundle — IPS document Bundle - # ITI-68: Retrieve Document - location /fhir/Bundle { + location /fhir/IPSDocument { proxy_pass http://bus_gateway; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; diff --git a/nginx/https.conf b/nginx/https.conf index 3ddefc8..e27b20f 100644 --- a/nginx/https.conf +++ b/nginx/https.conf @@ -42,8 +42,7 @@ http { } # ITI-65: Provide Document Bundle — IPS document Bundle - # ITI-68: Retrieve Document - location /fhir/Bundle { + location /fhir/IPSDocument { proxy_pass http://bus_gateway; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr;