Skip to content

Handling Attribute Groups Directly

Torch uses directly loaded attribute groups to handle the extraction of resources. Other resources are loaded by reference chains, which means that resources are loaded based on their references to other resources. This is controlled by the flag IncludeReferenceOnly in the CRTDL.

When using directly loaded attribute groups, TORCH will load all resources that are part of the specified attribute group. I.e. resources are loaded based on the Fhir Profile specified in the attribute group and the filters applied to the attribute group.

The processing has two separate workflows due to the different nature of the resources:

  1. Core Resources: These are resources that are outside the patient compartment.
  2. Patient Resources: These are resources that are directly loaded and processed for each patient.

1. Directly Loaded Core Attribute Groups

Core attributes are simply loaded and processed in a single step.

This means that all resources that are part of the core attribute group are loaded and processed in a single fhir search request.

  • After that a profile and must-have check is done on the resources.
    • Must-have conditions are violated if not a single resource passes this check.
  • If any must-have condition is violated, the extraction is fully stopped for the job.
  • At the same time the must-have conditions is fulfilled for a single "global" resource.

2. Directly Loaded Patient Attribute Groups

Patient attribute groups are loaded and processed for each patient.

All resources from a patient attribute group are loaded and processed in a single fhir search request and then assigned to their patient.

  • First a consent check is done on the patient resources, which means that only resources that are allowed by the consent are processed further.

    • When no consent key is defined, all resources are considered to be consenting by default.
  • A profile and must-have check is done on every resource.

  • If after the group processing a must-have condition is violated, the patient is marked for deletion. Once all patients are processed, the patient resources are deleted from the batch and if no patient resources are left, the batch is deleted.