You can use iHRIS relationships to define howto to cache data form a FHIR Server (e.g. HAPI) into a datamart and search engine (e.g. ElasticSearch) through utilities such as fhir2es.
The iHRIS relationships are used to flatten the graph-like data model of FHIR to tablular data. To achieve this you need to define a relationship which is a rooted sub-graph of the FHIR data model. You start with definining a primary resource (the root resource) and then you join other resources to it.
-
The primary resource is defined under the iHRISReportDetails extension
- name must be unique
- label is the field name to be created in elasticsearch and must be unique
- resource is just the resource name that you are adding to the relationship
- query is a FHIR path on how you want the resource you are adding to be filtered
- cachingDisabled
- displayCheckbox
-
The fields of any joined resources in the relationship are defined under the iHRISReportElement extension.
- label is the field name to be created in elasticsearch and must be unique
- display is the human readable field name and it is used by the datamart (e.g. ElasticSaerch) to be displayed to systems
- name is the FHIR path to the resource field
- filter is used tell if a field should be displayed as a filter. This is not required if you dont want to use the iHRIS reporting engine to display ElasticSearch data
- dropDownFilter is used to tell if a field should be displayed as a filter with a list of drop down of values. This is not required if you dont want to use the iHRIS reporting engine to display ElasticSearch data
-
You join other resources to the primary resource by using the iHRISReportLink extension.
- name must be unique
- resource is just the resource name that you are adding to the relationship
- query is a FHIR path on how you want the resource you are adding to be filtered
- linkElement is the field that this resource uses to link to the resource in the relationship
- linkTo is the name of the resource it links to (this isnt a resource name but it is the name extension under either iHRISReportLink or iHRISReportDetails, which is unique in the relationship)
- linkElementSearchParameter is used for reverse linked resources. For example only, if you start with Practitioner and then join PractitionerRole, you will need to tell the search parameter for practitioner in PractitionerRole, which is 'practitioner', but if you start with PractitionerRole and then join Practitioner then you don't need this.
There is an example of one of the relationships that can be loaded into HAPI and fhir2es will index data based on the definition