Se agrega el parametro patient.identifier al iti67

This commit is contained in:
Alejandro Gomez Auad 2026-04-30 18:09:16 +00:00
parent 49c0485f96
commit b459e5aa86

View File

@ -20,20 +20,22 @@ function extractNationalIdentifier(patient) {
* ITI-67: Find Document References (MHD) * ITI-67: Find Document References (MHD)
* *
* GET /fhir/DocumentReference?subject=:localId * GET /fhir/DocumentReference?subject=:localId
* GET /fhir/DocumentReference?patient.identifier=:localId
* *
* Flow: * Flow:
* 1. Fetch the Patient from the Bus by local ID to obtain the national identifier. * 1. Fetch the Patient from the Bus by local ID to obtain the national identifier.
* 2. Search DocumentReferences in the Bus by that national identifier. * 2. Search DocumentReferences in the Bus by that national identifier.
* 3. Return the resulting Bundle. * 3. Return the resulting Bundle.
* *
* Required query parameter: * Required query parameter (one of):
* subject local Patient ID in the Bus. * subject local Patient ID in the Bus.
* patient.identifier same semantics, alternate FHIR parameter name.
*/ */
async function listDocumentReference(req, res, next) { async function listDocumentReference(req, res, next) {
try { try {
const localPatientIdentifier = req.query.subject; const localPatientIdentifier = req.query.subject ?? req.query['patient.identifier'];
if (!localPatientIdentifier) { if (!localPatientIdentifier) {
throw createError(400, 'Missing required query parameter: subject'); throw createError(400, 'Missing required query parameter: subject or patient.identifier');
} }
const token = await getBusToken( const token = await getBusToken(
config.bus.url, config.bus.url,