diff --git a/bus-gateway/controllers/iti67.js b/bus-gateway/controllers/iti67.js index 68c1c6b..2f24cd0 100644 --- a/bus-gateway/controllers/iti67.js +++ b/bus-gateway/controllers/iti67.js @@ -20,20 +20,22 @@ function extractNationalIdentifier(patient) { * ITI-67: Find Document References (MHD) * * GET /fhir/DocumentReference?subject=:localId + * GET /fhir/DocumentReference?patient.identifier=:localId * * Flow: * 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. * 3. Return the resulting Bundle. * - * Required query parameter: - * subject — local Patient ID in the Bus. + * Required query parameter (one of): + * subject — local Patient ID in the Bus. + * patient.identifier — same semantics, alternate FHIR parameter name. */ async function listDocumentReference(req, res, next) { try { - const localPatientIdentifier = req.query.subject; + const localPatientIdentifier = req.query.subject ?? req.query['patient.identifier']; 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( config.bus.url,