Skip to content

FHIR data flow

The FHIR Transformer is a separate healthtag/fhir-transformer image. It reads hospital/HosXP data according to its own mapping and database configuration, creates FHIR resources, and writes them to FHIR_SERVER_URL (normally the internal HAPI URL).

  1. A HealthTAG Lambda function running on AWS posts promptCareId and token to the Hospital API.

  2. The API posts { promptCareId } to HEALTHTAG_API_URL/validate-access and forwards token in Authorization.

  3. The response is expected to include readerPublicKey, ownerPublicKey, and ownerPHR.

  4. The API searches HAPI through FHIR_URL. It sends the hospital-managed FHIR_API_KEY in the apikey header:

    Patient?identifier=https%3A%2F%2Fhealthtag.io%7C<PROMPT_CARE_ID>&_format=json
  5. It takes the first Patient entry and requests:

    Patient/<FHIR_ID>/$everything?_format=json&_count=9999
  6. It returns { "resources": <bundle.entry> }.

The code does not paginate past _count=9999, distinguish multiple matching patients, or return a standard OperationOutcome for lookup failures. Integrations must account for these current limitations.

The lookup depends on the exact identifier system https://healthtag.io. Validate transformed Patient resources before testing the API.

See Kong routes and authentication for the gateway configuration used by these requests.