Resources

Various resources are used in storing data in the HDR FHIR repository.

Resource Master Table

The table called HFJ_RESOURCE indicates a single resource of any type in the database. For example, the resource Patient/1 will have exactly one row in this table, representing all versions of the resource.

Resource Versions and Contents

The table called HFJ_RES_VER contains individual versions of a resource. If the resource Patient/1 has 3 versions, there will be 3 rows in this table.

The complete raw contents of the resource is stored in either the RES_TEXT or the RES_TEXT_VC column of the resource specific extended table OHF_FHIR_xxx, using the encoding specified in the RES_ENCODING column of the HFJ_RES_VER.

Example: Resource Extended Table OHF_FHIR_PATIENT

The following property decides whether to store the resource as plain text in RES_TEXT_VC column or not.

If the resource size is below the size as set in the following property, it goes to RES_TEXT_VC column and RES_ENCODING columns value is JSON.

If the resource size is larger than the property set value, it goes to RES_TEXT as a compressed blob.

inline_resource_storage_below_size: 0

Encoding

The resource is serialized using FHIR JSON encoding, and then compressed into a byte stream using GZIP compression. This will be controlled using the following property:

resource_compression_enabled: true

If the above property is set to true, the resource is serialized and then compressed into byte stream using GZIP compression. Then the compressed resource is stored into RES_TEXT column as a blob value with RES_ENCODING set to JSONC.

If the above property is set to false, the resource is not compressed and the plain text resource is stored into RES_TEXT column as a blob with RES_ENCODING set to JSON.

Client Assigned Resource IDs

By default, the HFJ_RESOURCE.RES_ID column is used as the resource ID for all server-assigned IDs. For example, if a Patient resource is created in a completely empty database, it will be assigned the ID Patient/1 by the server and RES_ID will have a value of 1.

However, when client-assigned IDs are used, these may contain text values to allow a client to create an ID such as Patient/ABC. When a client-assigned ID is given to a resource, a row is created in the HFJ_RESOURCE table. When an HFJ_FORCED_ID row exists corresponding to the equivalent HFJ_RESOURCE row, the RES_ID value is no longer visible or usable by FHIR clients and it becomes purely an internal ID to the JPA server.

If the server has been configured with a Resource Client ID Strategy of ANY, the server use the Resource Server ID Strategy of UUID and will create a Forced ID for all resources (not only resources having textual IDs).

Propety:
client_id_strategy: ANY

Resource Links

Resource links will be established between the two resources. When a resource is created or updated, it is indexed for searching. Any search parameters of type Reference are resolved, and one or more rows may be created in the HFJ_RES_LINK table between source Resource Id and Target Resource ID.