FHIR4THIM - Data Model

Working Draft

Latest version:
http://iot.ee.surrey.ac.uk/tihm/models/fhir4tihm/ , FHIR-JSON samples (v2.2), HyperCat-JSON samples (v1.0), Terminologies (v2.4), Remarks (v1.0)
Last Update:
Date: 11:00:00 23/03/2017 BST

Authors:

Shirin Enshaeifar, Institute for Communication Systems, University of Surrey
Andreas Markides, Institute for Communication Systems, University of Surrey
Severin Skillman, Institute for Communication Systems, University of Surrey
Payam Barnaghi, Institute for Communication Systems, University of Surrey
Tarek Elsaleh, Institute for Communication Systems, University of Surrey
Contributors:
Alex Jadavji
See Acknowledgements

Abstract

Health Level-7or HL7 refers to a set of international standards for transfer of clinical and administrative data between software applications used by various healthcare providers.HL7 specifies a number of flexible standards, guidelines, and methodologies by which various healthcare systems can communicate with each other. Such guidelines or data standards are a set of rules that allow information to be shared and processed in a uniform and consistent manner.

In particular, the Fast Healthcare Interoperability Resources (FHIR) is a new standard from HL7 International designed to be easier to implement, more open and more extensible than other versions of HL7. The FHIR leverages a modern web-based suite of API technology, including a HTTP-based RESTful protocol, HTML and Cascading Style Sheets for user interface integration, and a choice of JSON or XML for data representation.

Status of this Document

This is a work in progress and as such is subject to change. Comments are very welcome, please send them to First Author.

1. Introduction
1.1 Types of elements
1.2 Cardinality
2. FHIR UML Diagrams
2.1 Patient
2.2 Device
2.3 Observation
2.4 Flag
3. Simplified model: FHIR4TIHM
3.1 Best practices (Examples)
4. Tools to Convert CSV to FHIR-JSON
4.1 TIHM-FHIR-v1
5. Tools to Convert CSV to HyperCat
5.1 TIHM-HyperCat-v1
6. Communication via Message bus

1. Introduction

FHIR is a healthcare information exchange standard that makes use of an HL7-defined set of "resources" to support information sharing by a variety of means, including documents, messages, services and RESTful interfaces. Thus, FHIR is suitable for use in a wide variety of contexts - mobile phone apps, cloud communications, server communication in large institutional healthcare providers, and much more.

FHIR defines resources for clinical and administrative content (e.g. Patient,Device, Observation, Location, Organisation, etc.) as well as resources for infrastructure purposes. FHIR resources are small reusable structures where each resource has logical table, UML definition, and XML or JSON template. To exploit FHIR standard for the TIHM project, resources will be first represented using the UML diagrams in which elements are followed by their types and cardinalities. Thus, it is important to understand the concept of data types and cardinality prior to the UML diagrams.

1.1 Types of elements

The FHIR specification defines a set of data types that are used for the resource elements. In general, data types are categorized into two groups: (i) primitive types which are single elements, and (ii) complex types which are re-usable clusters of elements. Lists of data types are summarized below:

Primitive data types: FHIR name

Value Domain

boolean

true | false

intege

A signed 32-bit integer (for larger values, use decimal)

string:

  • code
  • id

A sequence of Unicode characters.

  • A value which is taken from a set of controlled strings defined elsewhere.
  • Any combination of alphabets ('A..Z' or 'a...z'), numbers ('0...9'), '-' and '.' upto 64 characters.

decimal

Rational numbers that have a decimal representation

uri

A Uniform Resource Identifier Reference. Note that URIs are case sensitive. 

instant

An instant in time - known at least to the second and always includes a time zone. Note that this is intended for precisely observed times, i.e. this type is for system times, not human times.

date

A date, or partial date (e.g. just year or year + month) as used in human communication. There is no time zone.

dateTime

A date, date-time or partial date (e.g. just year or year + month) as used in human communication. If hours and minutes are specified, a time zone SHALL be populated. Seconds must be provided due to schema type constraints but may be zero-filled and may be ignored. Dates SHALL be valid dates and the time "24:00" is not allowed.

time

A time during the day, with no date specified. Seconds must be provided due to schema type constraints but may be zero-filled and may be ignored. The time "24:00" is not allowed, and neither is a time zone.

code

A value which is taken from a set of controlled strings defined elsewhere.

id

Any combination of alphabets ('A..Z' or 'a...z'), numbers ('0...9'), '-' and '.' upto 64 characters.

 

1.2 Cardinality

The notation for cardinality, used for attributes, are defines as below:

Cardinality value

description

0..1

No instance or just one (optional, but no more than one)

0..* or *

Zero or more instances (optional, and any number of instances is allowed)

1..1  or 1

Mandatory with exatly one instance

1..*

Mandatory with at least one instance 



2. FHIR UML Diagrams

To exploit the FHIR standard for the THIM project, we start with four major resources: Patient, Device, Observation, and Flag.

2.1 Patient

The Patient resource covers data about patients and animals involved in a wide range of health-related activities, including:
  • Curative activities
  • Psychiatric care
  • Social services
  • Pregnancy care
  • Nursing and assisted living
  • Dietary services
  • Tracking of personal health and exercise data

A Patient record is generally created and maintained by each organisation providing care for a patient. Not all concepts are included within the base resource (such as race, ethnicity, organ donor status, nationality, etc.)

patient_UML



Brief descriptions for a subset of elements in the Patient resource are explained below:

Patient

Definition

Demographics and other administrative information about an individual or animal receiving care or other health-related services.

Requirements

Tracking patient is the center of the healthcare process.


Patinet.identifier

Definition

An identifier for this patient.

Requirements

Patients are almost always assigned specific numerical identifiers.


Patient.name

Definition

A name associated with the individual.

Requirements

Need to be able to track the patient by multiple names. Examples are your official name and a partner name.

Patient.telecom

Definition

A contact detail (e.g. a telephone number or an email address) by which the individual may be contacted.

Requirements

People have (primary) ways to contact them in some way such as phone, email.


Patient.gender

Definition

Administrative Gender - the gender that the patient is considered to have for administration and record keeping purposes.

Requirements

Needed for identification of the individual, in combination with (at least) name and birth date. Gender of individual drives many clinical processes.


Patient.birthDate

Definition

The date of birth for the individual.

Requirements

Age of the individual drives many clinical processes.


Patient.address

Definition

Addresses for the individual.

Requirements

May need to keep track of patient addresses for contacting, billing or reporting requirements and also to help with identification.


Patient.contact

Definition

A contact party (e.g. guardian, partner, friend) for the patient.

Requirements

Need to track people you can contact about the patient.

2.2 Device

This resource identifies an instance of a manufactured item that is used in the provision of healthcare without being substantially changed through that activity. The device may be a medical or non-medical device. In other words, this resource is primarily used for recording which device performed an action and can also be used to track device location. 

device_UML



Brief descriptions for a subset of elements in the Device resource are explained below:

Device

Definition

This resource identifies an instance of a manufactured item that is used in the provision of healthcare without being substantially changed through that activity. The device may be a medical or non-medical device. Medical devices includes durable (reusable) medical equipment, implantable devices, as well as disposable equipment used for diagnostic, treatment, and research for healthcare and public health. Non-medical devices may include items such as a machine, cellphone, computer, application, etc.

Comments

Allows institutions to track their devices.


Device.identifier

Definition

Unique instance identifiers assigned to a device by organizations like manufacturers or owners. If the identifier identifies the type of device, Device.type should be used.

Comments

Often fixed to the device as a barcode and may include names given to the device in local usage. Note that some of the barcodes affixed to the device identify its type, not its instance. For the FDA mandated Unique Device Identifier (UDI) use the Device.udi element.

Device.type

Definition

Code or identifier to identify a kind of device.


Device.manufacturer

Definition

A name of the manufacturer.


Device.contact

Definition

Contact details for an organization or a particular human that is responsible for the device.

Comments

used for troubleshooting etc.

Device.note

Definition

Descriptive information, usage information or implantation information that is not captured in an existing element.


Device.patient

Definition

Patient information, if the resource is affixed to a person. 


Device.location

Definition

The place where the device can be found.

2.3 Observation

Observations are central elements in healthcare, used to support diagnosis, monitor progress, determine baselines and patterns and even capture demographic characteristics. Most observations are simple name/value pair assertions with metadata, but some observations are multi-component observations. Some of the expected uses for the Observation resource include:
  • Vital signs: temperature, blood pressure, respiration rate
  • Devices Measurements such as ECG data or Pulse Oximetry data
  • Personal characteristics: height and weight

Observation_UML


Brief descriptions for a subset of elements in the Observation resource are explained below:

Observation

Definition

Measurements and simple assertions made about a patient, device or other subject.

Requirements

Observations are a key aspect of healthcare. This resource is used to capture those that do not require more sophisticated mechanisms.


Observation.identifier

Definition

A unique identifier for the simple observation instance.

Requirements

Allows observations to be distinguished and referenced.


Observation.status

Definition

The status of the result value.

Requirements

Need to track the status of individual results. Some results are finalized before the whole report is finalized.

Observation.code

Definition

Describes what was observed. Sometimes this is called the observation "name".

Requirements

Knowing what kind of observation is being made is essential to understanding the observation.


Observation.subject

Definition

The patient, or group of patients, location, or device whose characteristics (direct or indirect) are described by the observation and into whose record the observation is placed. Comments: Indirect characteristics may be those of a specimen, fetus, donor, other observer (for example a relative or EMT), or any observation made about the subject.

Requirements

Observations have no value if you don't know who or what they're about.


Observation.issued

Definition

The date and time this observation was made available to providers, typically after the results have been reviewed and verified.


Observation.performer

Definition

Who was responsible for asserting the observed value as "true".

Requirements

May give a degree of confidence in the observation and also indicates where follow-up questions should be directed.


Observation.value[x]

Definition

The information determined as a result of making the observation, if the information has a simple value.

Type

Quantity|CodeableConcept|string|Range|Ratio|SampledData|Attachment|time|dateTime|Period

Requirements

An observation exists to have a value, though it may not if it is in error, or it represents a group of observations.

Comments

Normally, an observation will have either a value or a set of related observations. A few observations (e.g. Apgar score) may have both a value and related observations (for an Apgar score, the observations from which the measure is derived). If a value is present, the datatype for this element should be determined by Observation.code. This element has a variable name depending on the type as follows: valueQuantity, valueCodeableConcept, valueString, valueRange, valueRatio, valueSampledData, valueAttachment, valueTime, valueDateTime, or valuePeriod. (The name format is "'value' + the type name" with a capital on the first letter of the type).

If the data element is usually coded or if the type associated with the Observation.value defines a coded value, use CodeableConcept instead of string datatype even if the value is uncoded text. A value set is bound to the ValueCodeableConcept element. For boolean values use valueCodeableConcept and select codes from HL7 Version 2 Table 0136. These "yes/no" concepts can be mapped to the display name "true/false" or other mutually exclusive terms that may be needed. For further discussion and examples see the notes section below.


Observation.interpretation

Definition

The assessment made based on the result of the observation. Intended as a simple compact code often placed adjacent to the result value in reports and flow sheets to signal the meaning of the result. Otherwise known as abnormal flag.

Requirements

For some results, particularly numeric results, an interpretation is necessary to fully understand the significance of a result.


Observation.device

Definition

The device used to generate the observation data.

Comments

An extension should be used if further typing of the device is needed. Devices used to support obtaining an observation can be represented using either extension or through the Observation.related element.


Observation.referenceRange

Definition

Guidance on how to interpret the value by comparison to a normal or recommended range.

Requirements

Knowing what values are considered "normal" can help evaluate the significance of a particular result. Need to be able to provide multiple reference ranges for different contexts.

Comments

Most observations only have one generic reference range. Systems MAY choose to restrict to only supplying the relevant reference range based on knowledge about the patient (e.g. specific to the patient's age, gender, weight and other factors), but this may not be possible or appropriate. Whenever more than one reference range is supplied, the differences between them SHOULD be provided in the reference range and/or age properties.


Observation.component

Definition

Some observations have multiple component observations. These component observations are expressed as separate code value pairs that share the same attributes. Examples include systolic and diastolic component observations for blood pressure measurement and multiple component observations for genetics observations.

Requirements

Component observations share the same attributes in the Observation resource as the primary observation and are always treated a part of a single observation (they are not separable). However, the reference range for the primary observation value is not inherited by the component values and is required when appropriate for each component observation.

Comments

For a discussion on the ways Observations can assembled in groups together see Notes below.

2.4 Flag

A flag is a warning or notification of some sort presented to the user - who may be a clinician or some other person involve in patient care. It usually represents something of sufficient significance to be warrant a special display of some sort - rather than just a note in the resource. For instance, risks to the patient can be represented in terms of flags.

The purpose of a Flag is to alert practitioners to information that is important to influence their interaction with a Patient prior to detailed review of the record.


flag_UML



Brief descriptions for a subset of elements in the Flag resource are explained below:

Flag

Definition

Prospective warnings of potential issues when providing care to the patient.

Flag.identifier

Definition

Identifier assigned to the flag for external use

Flag.status

Definition

Supports basic workflow.

Biding

FlagStatus: Indicates whether this flag is active and needs to be displayed to a user, or whether it is no longer needed or entered in error. (Required)

Flag.period

Definition

The period of time from the activation of the flag to inactivation of the flag. If the flag is active, the end of the period should be unspecified.

Flag.subject

Definition

The patient, location, group , organization , or practitioner this is about record this flag is associated with.

Flag.author

Definition

The person, organization or device that created the flag.

Flag.code

Definition

The coded value or textual component of the flag to display to the user.

Binding

Flag Code: Detail codes identifying specific flagged issues.



3. Simplified Model: FHIR4TIHM

In summary, Patient, Device, Observation, and Flagresources used in the TIHM project can be represented through the following diagrams. In addition, the structure of two other resources, i.e. MedicationAdministration and QuestionnaireResponse, are included - as they are provided by some innovators in the TIHM project. "Note that some of the cardinalities might have been adjusted according to the requirements of TIHM project."

yellow block is a data type which describes an element that has a value attribute/property.
orange block is a data type which describes an element that has other elements.
red block is an element which can have one of a several different types.
blue block is an element that is part of the resource and has elements within it defines in the same resource or profile.
green block is an element that contains a reference to another resource.
** Symbol represents the mandatory items. This will be used for the validation process.

To generate the 'Obsevation's Identifier', please use fully random UUID v4.

Note that 'Issued' represents TimeDate which follows the ISO 8601 format.

Patient
patient_block

Device
device_block

Observation
observation_block

Flag
flag_block

MedicationAdministration
medication_block

QuestionnaireResponse
QR_block


3.1 Best Practices (Examples)

To utilise the FHIR specification for data recorded in the TIHM project, we can represent our measurements using five major elements:


  • Device: An instance of a manufactured item that is used in the provision of healthcare without being substantially changed through that activity.
    Example (Humidity meter){
        "resourceType": "Bundle",
        "type": "transaction",
        "entry": [{
            "resource": {
                "resourceType": "Device",
                "identifier": [{
                        "value":"UUID1"
                }],
                "patient": {
                    "reference": "TIHM-P1"
                },
                  "type": {
                     "coding": [ {
                      "system":"http://snomed.info/sct",
                      "code": "470090000",
                      "display" : "Humidity meter"
                    }]
                },
                  "location": {
                  "display": "Living room"
                },
                  "manufacturer" : "CompanyB",
                  "contact": [
                {
                     "system": "phone",
                      "value": "676767"
                 }, {
                       "system": "email",
                      "value": "company-email"
                 }
                 ],
                  "note" : [{
                  "time": "2016-07-28T16:03:32+10:00",
                  "text": "QA Checked"
                }]
            }
        }]
    }
  • Flag: Prospective warnings of potential issues when providing care to the patient.
    Example (High body temperature){
        "resourceType": "Bundle",
        "type": "transaction",
        "entry": [{
            "resource": {
                "resourceType": "Flag",
                "identifier": [{
                        "value":"0248830f-5d8c-11e6-a9fc-180373bf7644"
                }],
                "status": "active",
                "subject":{
                    "reference": "TIHM-P1"
                },
                "author":{
                    "reference": "UUID2"
                },
                "period":{
                    "start":"03/08/2016"
                },
                "code":{
                    "coding":  [{
                        "system":"http://snomed.info/sct",
                        "code": "50177009",
                        "display": "High body temperature"
                    }] ,
                    "text": "Severity:Low"
                }
            }
        }]
    }
  • Observation - value[x] / valueQuantity: Data which are represented as a single value, such as body/room temperature, weight, and humidity.
    Example (Room temperate){
        "resourceType": "Bundle",
        "type": "transaction",
        "entry": [{
            "resource": {
                "resourceType": "Observation",
                "identifier": [{
                        "value":"dfeeeef0-5d7a-11e6-a5a8-180373bf7644"
                }],
                "subject": {
                    "reference": "TIHM-P1"
                },
                  "device": {
                    "display": "Battery:90%-Location:Bedroom",
                    "reference": "UUID1"
                },
                "code": {
                    "coding": [{
                        "system": "http://lonic.org",
                        "code": "60832-3",
                        "display" : "Room Temperature"
                      }]
                },
                "valueQuantity": {
                    "value": 18.0,
                    "unit": "Cel",
                    "system": "http://unitsofmeasure.org"
                },
                "status": "final",
                "issued":"2015-02-19T09:30:35+01:00",
                "comments":"comment about the measurement"
            }
        }]
    }

  • Observation - value[x] / valueSampledData: Data that come from a series of measurements taken by a device, e.g. ECG data.
    Example (ECG){
        "resourceType": "Bundle",
        "type": "transaction",
        "entry": [{
            "resource": {
                "resourceType": "Observation",
                "identifier": [{
                        "value":"dffcaa8f-5d7a-11e6-b77d-180373bf7644"
                }],
                "subject": {
                    "reference": "TIHM-P1"
                },
                  "device": {
                    "display": "Battery:50%",
                    "reference": "UUID#"
                },
                "code": {
                    "coding": [{
                        "system": "http://snomed.info/sct",
                        "code": "    468281001",
                        "display" : "Electrocardiographic monitor"
                      }]
                },
                "valueSampledData": {
                    "period": 10,
                    "factor": 1.612,
                    "lowerLimit": -3300,
                    "upperLimit": 3300,
                    "dimentions": 1,
                    "data": "2041 2043 2036 2023 2034 2059 2134 2012"
                },
                "status": "final",
                "issued":"2017-02-19T09:30:35+01:00"
            }
        }]
    }

  • Observation - value[x] / valueCodeableConcept: Data that are represented using boolean values, such as motion detection alarms.
    Example (Fall detection){
        "resourceType": "Bundle",
        "type": "transaction",
        "entry": [{
            "resource": {
                "resourceType": "Observation",
                "identifier": [{
                        "value":"dff7a180-5d7a-11e6-a836-180373bf7644"
                }],
                "subject": {
                    "reference": "TIHM-P1"
                },
                  "device": {
                    "display": "Battery:40%",
                    "reference": "UUID#"
                },
                "code": {
                    "coding": [{
                        "system": "http://snomed.info/sct",
                        "code": "1912002",
                        "display" : "Fall"
                      }]
                },
                 "valueCodeableConcept": {
                    "text":"False"
                },
                "status": "final",
                "issued":"2016-02-19T09:30:35+01:11"
            }
        }]
    }

  • Observation - Component / value[x] / valueQuantity: Data which have multiple component observations. These component observations are expressed as separate code value pairs that share the same attributes. These data includes systolic and diastolic blood pressure. "We are considering to represent GPS location and questionnaireResponses as Component type."
    Example (Blood pressure){
        "resourceType": "Bundle",
        "type": "transaction",
        "entry": [{
            "resource": {
                "resourceType": "Observation",
                "identifier": [{
                        "value":"dff382cf-5d7a-11e6-a4ee-180373bf7644"
                }],
                "subject": {
                    "reference": "TIHM-P1"
                },
                  "device": {
                    "reference": "UUID#"
                },
                "code": {
                    "coding": [{
                        "system": "http://loinc.org",
                        "code": "55284-4",
                        "display" : "Blood Pressure Systolic & Diastolic"
                      }]
                },
                "component": [{
               "code": {
                  "coding": [{
                     "system": "http://loinc.org",
                     "code": "8480-6",
                     "display": "Systolic blood pressure"
                  }]
               },
               "valueQuantity": {
                  "value": 150,
                  "unit": "mm[Hg]",
                  "system": "http://unitsofmeasure.org"
               }
            },{
               "code": {
                  "coding": [{
                     "system": "http://loinc.org",
                     "code": "8462-4",
                     "display": "Diastolic blood pressure"
                  }]
               },
               "valueQuantity": {
                  "value": 16,
                  "unit": "mm[Hg]",
                  "system": "http://unitsofmeasure.org"
               }
            },{
               "code": {
                  "coding": [{
                     "system": "http://loinc.org",
                     "code": "8867-4",
                     "display": "Heart rate
                  }]
               },
               "valueQuantity": {
                  "value": 70
                  "unit": "beats/min",
                  "system": "http://snomed.info/sct
               }
            }],
                "status": "final",
                "issued":"2016-02-19T09:30:35+01:03"
            }
        }]
    }

    Example (GPS){
        "resourceType": "Bundle",
        "type": "transaction",
        "entry": [{
            "resource": {
                "resourceType": "Observation",
                "identifier": [{
                        "value":"dff641ee-5d7a-11e6-bb01-180373bf7644"
                }],
                "subject": {
                    "reference": "TIHM-P1"
                },
                  "device": {
                    "display": "Battery:80%-Location:Wearable-State:Poor Location",
                    "reference": "UUID#"
                },
                "code": {
                    "coding": [{
                        "system": "http://loinc.org",
                        "code": "56816-2",
                        "display" : "Patient Location"
                      }]
                },
                "component": [{
                    "code": {
                        "coding": [{
                            "system": "http://loinc.org",
                            "code": "64011-0",
                            "display": "Longitude"
                        }]
                    },
                    "valueQuantity": {
                        "value": 1
                    }},{
                    "code": {
                        "coding": [{
                            "system": "http://loinc.org",
                            "code": "64010-2",
                            "display": "Latitude"
                        }]
                    },
                    "valueQuantity": {
                        "value": 2
                    }},{
                    "code": {
                        "coding": [{
                            "system": "http://iot.ee.surrey.ac.uk/tihm/models/fhir4tihm",
                            "display": "HeadingCode"
                        }]
                    },
                    "valueString": "SSW"
                }],
                "status": "final",
                "issued":"2016-02-19T09:30:35+01:04",
                "comments":"0.3 km from Alresford Road, Guildford, GU2 7XS, United Kingdom"
            }
        }]
    }
  • Observation - value[x] / valueAttachment: To contain or reference attachments. This can be used for any data that has a MIME type.
  • QuestionnaireResponse: To provide a complete or partial list of answers to a set of questions filled when responding to a questionnaire.
    Example{
        "resourceType": "Bundle",
        "type": "transaction",
        "entry": [{
            "resource": {
                "resourceType": "QuestionnaireResponse",
                "identifier": [{
                        "value":"e3fe83c1-5d7a-11e6-af4e-180373bf7644"
                }],
                "source": {
                    "reference": "TIHM-P1"
                },
                  "author": {
                    "display": "Battery:50%",
                    "reference": "UUID#"
                },
                "group" : {
                   "linkId" : "TIHM-L:EN#QR",
                   "title" : "TIHM-L:EN-Questionnaire",
                   "question": [{
                        "linkId" : "TIHM-L:EN#Q1",
                        "text" : "How are you feeling today?",
                        "answer" : [{
                           "valueCoding": {
                                   "display": "like yesterday",
                                   "code": "TIHM-L:EN#R2",
                                   "system": "http://iot.ee.surrey.ac.uk/TIHM-L:EN#QR/Responses"
                           }
                       }]
                        },{
                        "linkId" : "TIHM-QR-L:En#2",
                        "text" : "How well did you sleep last night?",
                        "answer" : [{
                           "valueCoding": {
                                   "display": "like yesterday",
                                   "code": "TIHM-L:EN#R2",
                                   "system": "http://iot.ee.surrey.ac.uk/TIHM-L:EN#QR/Responses"
                           }
                          }]
                     }]
                },
                "status": "completed",
                "authored":"2018-02-19T09:30:35+01:00"
            }
        }]
    }
  • MedicationAdministration: Describes the event of a patient consuming or otherwise being administered a medication.
    Example{
        "resourceType": "Bundle",
        "type": "transaction",
        "entry": [{
            "resource": {
                "resourceType": "MedicationDispense",
                "identifier": [{
                        "value":"e6c1c270-5d7a-11e6-bf16-180373bf7644"
                }],
                "patient": {
                    "reference": "TIHM-P1"
                },
                "device": [{
                    "reference": "UUID#"
                }],
                "medicationReference": {
                "reference": "Medication:Paracetamol",
                "display": "Prescription:1024x"
                },
                "effectiveTimeDateTime": "2016-02-19T09:30:35+01:12",
                "dosage": {
                  "route": {
                    "coding": [{
                        "system": "http://snomed.info/sct",
                        "code": "26643006",
                        "display": "Oral Route"
                      }]
                },
                "quantity": {
                  "value": 1,
                  "code": "TAB",
                  "system": "http://hl7.org/fhir/v3/orderableDrugForm"
                }
              },
                "status": "completed"
            }
        }]
    }

4. Tools to Convert CSV to FHIR-JSON

4.1 TIHM-FHIR-v1

To generate a common data model for TIHM project, we have developed a Python program (v2.2) to map a CSV file into the JSON format which complies the FHIR4TIHM specification. Our developments were inspired by this link.

Note that six major resources (i.e. Patient, Device, Observation, Flag, MedicationAdministration, andQuestionnaireResponse ) are considered in the new version, and more resources may be added over time. The Python folder includes:
  • CSV samples for all resources. To provide the extendibility and interoperability, each row in the Observation.csv represents a data sample recorded with a specific device at a single time instant.
  • FHIR-JSON templates for each resource. These are particularly useful for companies who intend to develop their own programs for generating the FHIR-JSON.
  • Python code to convert all CSV files to JSON, complying the FHIR specification.
  • Generated FHIR-JSON files, to provide samples for developers.
  • Terminology file (v2.4)
  • which includes common terms and codes for devices, observations, andalerts - mostly based on LOINC or SNOMED website. Our innovators need to follow these common terminologies. Please let us know if further terminologies are required. This file is a work in progress and as such is subject to change.

Please note that:

  • In terms of observation, each JSON file represents a single resource. However, the default structure is defined as "Bundle" to allow sending multiple resources, if necessary.
  • Each observation has its unique uuid, which can be used for acknowledgment receipt.
  • The ID of each device is defined as: "CompanyName/DeviceID" (This has been considered in case devices from different companies have same DeviceID.
  • The battery level and location (e.g bedroom, living room, etc) of devices can be recorded in each observation.


5. Tools to Convert CSV to HyperCat

5.1 TIHM-HyperCat-v1

Innovators involved in the TIHM project are required to provide/support their own device catalogue, i.e. HyperCat. In other words, each company provides a catalogue which has a full list of devices, used in the TIHM project, along with their description and a link to their latest observations.

Note that generated catalogues should follow the adapted HyperCat format introduced for TIHM project. To this end, we have developed a Python program (v1.0) to map a CSV file into the JSON format which complies the HyperCat specification.

Please note that:

  • Each company will have a main catalogue which contains the list of items (devices) provided by that company, see "~/Generated/H.json" in the Python folder.
  • Example{
        "catalogue-metadata": [
            {
                "rel": "urn:CompanyName",
                "val": "CompanyA"
            },
            {
                "rel": "urn:ProjectName",
                "val": "TIHM2016"
            },
            {
                "rel": "urn:NumberOfDevices",
                "val": "2"
            }
        ],
        "items": [
        {
           
                "href": "/cat/CompanyA/UUID1",
                "item-metadata": [{
                        "rel": "urn:ReadingType",
                        "val": "Room Temperature"
                }]
        },{
           
                "href": "/cat/CompanyA/UUID2",
                "item-metadata": [{
                        "rel": "urn:ReadingType",
                        "val": "Body Temperature"
                }]
        }
        ]
    }
  • The "href link" for each item will provide a JSON file which includes its description and a link to the latest recording, see "~/Generated/H_#1.json".
  • Example{
      "catalogue-metadata": [{
          "rel": "urn:TIHM2016-companyA/UniqID1-SensorDescription",
          "val": {
                   "resourceType": "Bundle",
                   "type": "transaction",
                   "entry": [{
                       "resource": {
                           "resourceType": "Device",
                           "identifier": [{
                                 "value":"UUID1"
                           }],
                           "patient": {
                               "reference": "TIHM-P1"
                           },
                             "type": {
                                "coding": [{
                                 "display" : "Room Temperature"
                               }]
                           },
                             "location": {
                             "display": "Bedroom"
                           },
                             "manufacturer" : "CompanyA",
                             "contact": [
                           {
                                 "system": "phone",
                                 "value": "74545"
                          },
                           {
                                 "system": "email",
                                 "value": "company-email"
                           }
                         ],
                             "note" : [{
                             "time": "2016-06-28T14:03:32+10:00",
                             "text": "Repair"
                           }]
                       }
                   }]
               }
        }

     }],
      "items": [{
                "href": "URL link to the JSON data - server or backend",
                "item-metadata": [
                    {
                    "rel": "urn:ContentFormat",
                    "val": "FHIR-Lite JSON"
                    },
                    {
                    "rel": "urn:ReadingType",
                    "val": "Room Temperature "                
                    }
                ]
            }]
    }

  • The term "val" in our HyperCat specification is adapted to accept both "string" and "object". Thus, to provide the device description, the initial FHIR-JSON device resource can be used as an object.

6. Communication via Message bus

The exchange of data in the TIHM project will be done using the AMQP protocol. The server we choose is the RabbitMQ which is offers reliability and versatility. We provide a sample consumer and producer code in Python (v1.0) to enable message exchange, but the RabbitMQ web page provides examples in most programming languages.

The folder includes:

  • A python code to send a message/resource
  • A python code to receive messages/resources based on a topic
  • A sample device TIHM-FHIR resource for transmitting
  • A readme file explaining how to run the code

Please note:

  • The RabbitMQ server should be installed prior to testing the provided code.
  • The code is just for understanding the operation of the message bus at a local machine.
  • For the project we will provide further configuration details to the innovators involved.

Acknowledgements

This work is part of Technology Integrated Health Management (TIHM) project at the Institution for Communication Systems University of Surrey.