DocumentReference.subject must be a literal reference (min=1 on
.reference per the DocumentReferenceOrigenAR profile), not an
identifier token: the Bus rejects subject.identifier. Go back to
using the Patient entry's fullUrl as the reference in both ITI-65 and
ITI-67 (ITI-65 was never committed with the identifier-based version,
so only ITI-67 needed the revert here), dropping the now-unused
extractNationalIdentifier helper.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
listDocumentReference was using the Patient entry's fullUrl as the
national ID passed to the document registry search. It now extracts
the Patient identifier whose system is the Federador national-id
system and builds a system|value token, wiring in the previously
unused extractNationalIdentifier helper.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Se saca el mapeo de etiquetas propias (IPS/MeOW/IT) a codigo LOINC:
'type' ahora se pasa tal cual al Bus como token FHIR (system|code),
consistente con la semantica estandar de busqueda por token en FHIR,
en vez de una convencion propia que solo este gateway entendia.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Find Document References ahora acepta un parametro opcional 'type'
(IPS, MeOW, IT, o un token FHIR system|code) para buscar solo el
tipo de documento pedido. Se extrae el mapa de tipos de documento a
constants/documentTypes.js para compartirlo entre ITI-65 e ITI-67.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>