FHIR Report Export for the Assessment Framework (BETA)
Description
To improve the exchange of structured data using a widely adopted standard, LogicNets has added to the Assessment Framework the option to export the collected data in HL7 FHIR (Fast Healthcare Interoperability Resources) format. For more information about the LogicNets FHIR Converter, see FHIR Converter.
Used With: This part is used in the Assessment Framework.
Configuration
To see the FHIR report, you need the FHIR Data Exchange License. Additionally, in the Framework settings, set the Generate FHIR Report on exit setting to ‘Yes’ to enable report generation.
Default Template
You can also use the Custom FHIR Template setting to allow a child project/protocol to use a custom template. This must point to a JSON file that is accessible by the runtime, and we advise putting the template in the documents folder of the project; for example, 'documents/custom_FHIR.json'. If the system experiences problems reading the template, it stores the details of the problems in temp.fhir.fhir_report_template_read_errors.
The default template is as follows:
{
"resourceType": "Bundle",
"type": "document",
"identifier": {
"system": "urn:ietf:rfc:3986",
"value": "$(_fhir_export.fhir_report_id)"
},
"timestamp": "$(_fhir_export.fhir_report_stamp)",
"entry": [
{
"resource": {
"resourceType": "Composition",
"id": "$(_fhir_export.fhir_composition_id)",
"status": "$(_fhir_export.status)",
"type": {
"coding": [
{
"system": "http://loinc.org",
"code": "80563-0"
}
],
"text": "Report"
},
"date": "$(_fhir_export.fhir_composition_stamp)",
"author": [
{
"reference": "$(_fhir_export.fhir_composition_author_reference)",
"display": "$(_fhir_export.fhir_composition_author_display)"
}
],
"title": "$(_fhir_export.fhir_composition_title)"
}
},
{
"resource": {
"resourceType": "DiagnosticReport",
"status": "$(_fhir_export.status)",
"code": {
"coding": [
{
"system": "http://loinc.org",
"code": "80563-0"
}
],
"text": "Report"
},
"contained": {}
}
}
]
}
The template uses the following interpolations:
Field | Details |
_fhir_export.status | Set to ‘final’ when pressing submit, otherwise set to ‘preliminary’. The same is used for each observation resource. |
_fhir_export.new_fhir_report_id | Generated GUID, unless already specified. |
_fhir_export.fhir_report_stamp | Timestamp of report generation, in ISO 8601 format in UTC, unless already specified. |
_fhir_export.fhir_composition_id | Generated GUID, unless already specified. |
_fhir_export.fhir_composition_stamp | Timestamp of report generation, in ISO 8601 format in UTC, unless already specified. |
_fhir_export.fhir_composition_title | Specific title, must be filled in by the protocol or deriving framework. |
_fhir_export.fhir_composition_author_reference | Specific reference, must be filled in by the protocol or deriving framework. |
_fhir_export.fhir_composition_author_display | Specific value, must be filled in by the protocol or deriving framework. |
Observation Resource
The system exports every data-log item in this report as an Observation resource and defines the status of the observation resources as it does the report. Prior to you submitting a resources, the status is 'preliminary'. When you click the Submit button, the system sets the status to 'final'.
The system generates a unique ID for each observation, and the pattern is as follows: Observation-<data-object-name>-<identifier>-<sequence-number>.
The data object name is the actual path of the object. The identifier is an optional value that is the same for all observations; for example, a report-id. You can specify this identifier by setting the value in _fhir_export.report_identifier. The sequence number is auto-generated and formatted as 00. An example of the observation identifier is Observation-complaints-T12_34567-01.
The system explicitly inserts observations into the contained array within the DiagnosticReport resource. The system expects that there is only one DiagnosticReport resource in the template and that it has the contained element at the root level of that resource, as in the following standard template:
{
"resource": {
"resourceType": "DiagnosticReport",
"status": "$(_fhir_export.status)",
"code": {
"coding": [
{
"system": "http://loinc.org",
"code": "80563-0"
}
],
"text": "Report"
},
"contained": {}
}
}
When a data-object is a collection, each individual item will lead to an individual resource with a summary resource referencing all sub resources. The id of such a resource will not have the sequence number.
The system will also include all potential data-object informatics details in the FHIR resources.
Example Report
The following is an example of a report with two answered questions, one a checklist of ‘complaints’ with three selected answers and one numeric input with a unit of measure defined.
{
"entry": [
{
"resource": {
"author": [
{
"display": "Demo",
"reference": "Demo Author Reference"
}
],
"date": "2023-07-28T07:52:03Z",
"id": "A5065541-0285-C5E4-81FE-6242BDA638F7",
"resourceType": "Composition",
"status": "final",
"title": "Example FHIR Report",
"type": {
"coding": [
{
"code": "80563-0",
"system": "http://loinc.org"
}
],
"text": "Report"
}
}
},
{
"resource": {
"code": {
"coding": [
{
"code": "80563-0",
"system": "http://loinc.org"
}
],
"text": "Report"
},
"contained": [
{
"code": {
"text": "complaints"
},
"hasMember": [
"#Observation-complaints-01",
"#Observation-complaints-02",
"#Observation-complaints-03"
],
"id": "Observation-complaints",
"resourceType": "Observation",
"status": "final"
},
{
"code": {
"coding": [
{
"code": "130461000146108",
"display": "Characteristic of complaint",
"system": "http://snomed.info/sct"
}
],
"text": "complaints"
},
"id": "Observation-complaints-01",
"resourceType": "Observation",
"status": "final",
"valueCodeableConcept": {
"coding": [
{
"code": "248980004",
"display": "Contact bleeding from cervix",
"system": "http://snomed.info/sct"
}
]
},
"valueString": "contact_bleeding"
},
{
"code": {
"coding": [
{
"code": "130461000146108",
"display": "Characteristic of complaint",
"system": "http://snomed.info/sct"
}
],
"text": "complaints"
},
"id": "Observation-complaints-02",
"resourceType": "Observation",
"status": "final",
"valueCodeableConcept": {
"coding": [
{
"code": "422910009",
"display": "Abnormal urogenital discharge",
"system": "http://snomed.info/sct"
}
]
},
"valueString": "abnormal_urogenital_discharge"
},
{
"code": {
"coding": [
{
"code": "130461000146108",
"display": "Characteristic of complaint",
"system": "http://snomed.info/sct"
}
],
"text": "complaints"
},
"id": "Observation-complaints-03",
"resourceType": "Observation",
"status": "final",
"valueCodeableConcept": {
"coding": [
{
"code": "237130006",
"display": "Bleeding between periods",
"system": "http://snomed.info/sct"
}
]
},
"valueString": "bleeding_between_periods"
},
{
"code": {
"coding": [
{
"code": "27051004",
"display": "Blood arterial pH level",
"system": "http://snomed.info/sct"
}
],
"text": "blood_ph_level"
},
"id": "Observation-blood_ph_level-01",
"resourceType": "Observation",
"status": "final",
"valueQuantity": {
"code": "[pH]",
"system": "http://unitsofmeasure.org",
"unit": "pH",
"value": 7.9
}
}
],
"resourceType": "DiagnosticReport",
"status": "final"
}
}
],
"identifier": {
"system": "urn:ietf:rfc:3986",
"value": "0A5A9BF9-7D98-2B6E-DCAB-DFF64F77F950"
},
"resourceType": "Bundle",
"timestamp": "2023-07-28T07:52:03Z",
"type": "document"
}
Assessment Test Mode
When running an assessment in test mode, the system prints FHIR output next to the standard XML report after you click Submit or Save. This makes it easier for you to determine if the system created your desired output.
NOTE: In test mode, the system will always generate the FHIR report, even if the Generate FHIR Report on exit configuration is set to ‘No’.
Starter Application Framework 2 Integration
In the session data that the system returns from the assessment to the starter application, the system adds a specific FHIR object is added with one element: report. For example:
FHIR = {
report = "{\"entry\":[{\"resource\":{\"author\"..."
},
You can use this to for further processing by the custom starter application implementation. Also, when customizing the top bar of the assessment framework, you can set the implementation to take full control of which data to convert and how that data should be converted into FHIR. You can also delegate this to the starter application if the application passes all required information to the starter.