Renombrados metodos del controlador de Patient para mayor claridad
This commit is contained in:
parent
d2a6132f11
commit
a873231843
@ -8,7 +8,7 @@ const { searchPatient, getPatientById } = require('../services/patient');
|
||||
* GET /fhir/Patient
|
||||
* Forwards the raw FHIR query parameters to the Bus and returns the Bundle result.
|
||||
*/
|
||||
async function queryPatientDemographics(req, res, next) {
|
||||
async function listPatient(req, res, next) {
|
||||
try {
|
||||
const token = await getBusToken(config.bus.url, config.bus.jwtSecret, config.bus.issuer, config.bus.mpiScope);
|
||||
const response = await searchPatient(token, req.query);
|
||||
@ -22,7 +22,7 @@ async function queryPatientDemographics(req, res, next) {
|
||||
* GET /fhir/Patient/:id
|
||||
* Forwards the request to the Bus and returns the Patient resource.
|
||||
*/
|
||||
async function findPatientById(req, res, next) {
|
||||
async function getPatientById(req, res, next) {
|
||||
try {
|
||||
const { id } = req.params;
|
||||
const token = await getBusToken(config.bus.url, config.bus.jwtSecret, config.bus.issuer, config.bus.mpiScope);
|
||||
@ -33,4 +33,4 @@ async function findPatientById(req, res, next) {
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = { queryPatientDemographics, getPatientById: findPatientById };
|
||||
module.exports = { listPatient, getPatientById };
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
const express = require('express');
|
||||
const router = express.Router();
|
||||
const { queryPatientDemographics, getPatientById } = require('../controllers/iti78');
|
||||
const { listPatient, getPatientById } = require('../controllers/iti78');
|
||||
|
||||
// ITI-78: Mobile Patient Demographics Query
|
||||
// TOOD: Cambiar ruta por ITI78
|
||||
router.get('/iti78', queryPatientDemographics);
|
||||
router.get('/iti78', listPatient);
|
||||
router.get('/iti78/:id', getPatientById);
|
||||
|
||||
module.exports = router;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user