CGM Measurement data - expanded FHIR

   

Case 1 - With valid CGM, trend and quality values

Sample Scenario

Data Point Value unit
CGM UUID BBBB
SessionId AAAA
CGM Glucose Concentration 118 mg/dL
CGM Trend Information -0.5 mg/dL/min
CGM Quality 90 %
Time Offset 200 min
Time Stamp 2020-08-04T15:00:16Z UTC
Flags 32 - BatteryEmpty When more than 1 flag is set the sum of those integers is sent. Possible values are LO = 1; HI = 2 ; TempHI = 4 ; TempLO = 8 ; DeviceFault = 16 ; BatteryEmpty = 32 ; SensorMalfunction = 64 ; CalibrationRequired = 128 ; RateOfChangeMin = 256 ; RateOfChangeMax = 512 ; InvalidValue = 1024 ; TypeIncorrectForDevice = 2048 ; DeviceSpecificAlert = 4096 ; CalibrationNotAllowed = 8192 ; CalibrationRecommended = 16384 ; SessionStopped = 32768 ; SensorRateDecreaseExceeded = 65536 ; SensorRateIncreaseExceeded = 131072 ;

Note: Comments are provided in green in the JSON below

Observation resource for CGM measurement

A reduced format of this resource will be sent from Confidence. See the section CGM measurement data - reduced FHIR. The facade needs to further expand that resource by adding the other relelavnt fields as per our implementation guide. Details are provided in the comments below. Additional EWM resources may have to be created by the facade for the flags


{
	"resource": {
		"resourceType": "Observation",
		"id": "bd536e45-1300-4fcb-b144-23c3466eb263", //To be managed by FHIRSTACK 
		"meta": {
			"profile": [
				"http://roche.com/fhir/rdc/StructureDefinition/vitalsigns-observation"   //To be updated by facade - FHIR profile for vital-signs observation for FHIR internal storage
			]
		},
		"identifier": [
			{
				"system": "http://roche.com/fhir/rdc/sid/observation/confidence",   
				"value": "BBBB"                //retain same identifier received from Confidence reduced FHIR
			}
		],
		"status": "final",      //retain same status received from confidence reduced FHIR
		"category": [ //To be added by facade - category for CGM will always be vital-signs
			{
				"coding": [
					{
						"system": "http://hl7.org/fhir/observation-category",  
						"code": "vital-signs",
						"display": "Vital Signs"
					}
				]
			}
		],
		"code": {
			"coding": [   //To be added by facade - system, code and display when code.text "CGMGlucoseConcentration" is received in the reduced FHIR
				{
					"system": "http://snomed.info/sct",
					"code": "434910001",
					"display": "Interstitial fluid glucose concentration (observable entity)" 
				}
				],
				"text": "CGMGlucoseConcentration"      //To be retained as is from the reduced format so that on restore it can be sent back
		},
		"subject": {
			"reference": "Patient/2P0tI8p-SF9-6850" //To be added by facade - patient link
		},
		"performer": [
			{
				"reference": "Patient/2P0tI8p-SF9-6850"  //To be added by facade - Patient link
			}
		],
		"effectiveDateTime": "2020-08-04T15:00:16Z",  //Retain same value from Confidence reduced FHIR
		"valueQuantity": {
			"value": 118,        //retain value from reduced FHIR
			"unit": "mg/dL",	 
			"system": "http://unitsofmeasure.org", //To be added by facade - the system and code details
			"code": "mg/dL"
		},
		"device": {
			"reference": "DeviceMetric/0053cfd5-a427-4691-8690-b4d956c6e658"  //To be added by facade - link to deviceMetric of relevant CGM sensor deviceComponent. The same value as in the session observation. 
		},
		"component": [
			{
				"code": {
					"coding": [ //To be added by facade - system, code and display when component.code.text "CGMTrendInformation" is received in the reduced FHIR
						{
							"system": "http://roche.com/fhir/rdc/cs", 
							"code": "CGM-rate-of-change",
							"display": "CGM rate of change" 
						}
					],
					"text": "CGMTrendInformation"      //To be retained as is from the reduced format so that on restore it can be sent back
				},
				"valueQuantity": {
					"value": -0.5,    //retain value from reduced FHIR
					"unit": "mg/dL/min",  
					"system": "http://roche.com/fhir/rdc/cs", //To be added by facade - the system and code details. Note that the system only in this case is a Roche CS (not UCUM)
					"code": "mg/dL/min"
				}
			},
			{
				"code": {
					"coding": [      //To be added by facade - system, code and display when component.code.text "CGMQuality" is received in the reduced FHIR
						{
							"system": "http://roche.com/fhir/rdc/cs",   
							"code": "CGM-quality",
							"display": "CGM quality" 
						}
					],
					"text": "CGMQuality"      //To be retained as is from the reduced format so that on restore it can be sent back
				},
				"valueQuantity": {
					"value": 90,   //retain value from reduced FHIR
					"unit": "%",  
					"system": "http://unitsofmeasure.org", //To be added by facade - the system and code details.
					"code": "%"
				}
			}
		],
		 "related":  [
                    {
                        "type": "derived-from",
                        "target": {
                            "reference": "Observation/0053cfd5-a427-4691-8690-b4d956c6e690", //To be added by facade based on the SessionID (target.display) in the reduced FHIR.  Link to the relevant session observation
				"display": "AAAA"    //To be retained as is from the reduced format so that on restore it can be sent back
                        }
                    },
					{    //To be added by the facade - link to the EWM Observation created by the facade for the flags
                        "type": "has-member",
                        "target": {
                            "reference": "Observation/1e6f0b94-1519-4f95-b50c-758fa3d4ac89" 
                        }
                    }
                ],
		 "extension":  [
        {
            "url": "http://roche.com/fhir/rdc/StructureDefinition/time-offset", 
            "valueQuantity": {
					"value": 200,  //retain value from reduced FHIR
					"unit": "min",                                 
					"system": "http://unitsofmeasure.org", //To be added by facade - the system and code details.
					"code": "min"
				}
        },
		{
            "url": "http://roche.com/fhir/rdc/StructureDefinition/patient-timezone",
            "valueString": "+02:00"   //retain same data from Confidence reduced FHIR
        },
		{
		"url": "http://roche.com/fhir/rdc/StructureDefinition/flags",
		"valueString": "32"     //retain same data from Confidence reduced FHIR for restore. Also create relevant EWM observations in FHIRSTACK
    	},
        {
            "url": "http://roche.com/fhir/rdc/StructureDefinition/provenance-channel",
            "valueString": "<channel-name>" //To be added by facade - fill channel data
        },
        {
            "url": "http://roche.com/fhir/rdc/StructureDefinition/provenance-source",
            "valueString": "<source-name>" //To be added by facade - fill source data
        }
    ]
	}
}



This resource has to be created by the facade based on the flags received from Confidence in the reduced FHIR (Observation.ext-flags)

Note: Please see the section CGM Flags for all the possible flags and how each should be handled



{
    
    "resourceType": "Observation",
	"id": "1e6f0b94-1519-4f95-b50c-758fa3d4ac89",
	"meta": {  
        "profile":  [
            "http://roche.com/fhir/rdc/StructureDefinition/observation-EWM"  
           ]
        },
    "status": "final",
    "category":  [
        {
            "coding":  [
                {
                    "system": "http://roche.com/fhir/rdc/cs",
                    "code": "EWM",
                    "display": "Error, Warning, Maintenance, Status"
                }
            ]
        }
    ],
    "code": {
        "coding":  [
            {
                "system": "http://roche.com/fhir/rdc/cs",
                "code": "ERROR",
                "display": "Error"
            }
        ]
    },
    "subject": {
        "reference": "Device/0053cfd5-a427-4691-8690-b4d956c6e698"  //link to device resource of Confidence app. this is a mandatory element in our current profile hence necessary
    },
    "effectiveDateTime": "2020-08-04T15:00:16Z", //same as the related CGM observation effectiveDateTime
    "performer":  [
        {
            "reference": "Patient/2P0tI8p-SF9-6850"
        }
    ],
    "valueCodeableConcept": {
        "coding":  [
            {
                "system": "http://roche.com/fhir/rdc/cs",
                "code": "ERROR_2",          //FHIR code for Battery Empty (32 in Confidence)
                "display": "Battery empty"
            }
        ]
    },
    "device": {
        "reference": "DeviceMetric/0053cfd5-a427-4691-8690-b4d956c6e658"  //link to deviceMetric of relevant CGM sensor deviceComponent
    },
	 "extension":  [
        {
            "url": "http://roche.com/fhir/rdc/StructureDefinition/provenance-channel",
            "valueString": "<channel-name>" //To be added by facade - fill channel data
        },
        {
            "url": "http://roche.com/fhir/rdc/StructureDefinition/provenance-source",
            "valueString": "<source-name>" //To be added by facade - fill source data
        }
    ]
}





Case 2 - With NaN for CGM value and NULL for trend and quality

Sample Scenario

Data Point Value unit
CGM UUID CCCC
SessionId AAAA
CGM Glucose Concentration NaN
CGM Trend Information NULL
CGM Quality NULL
Time Offset 200 min
Time Stamp 2020-08-04T15:15:16Z UTC
Flags 160 ( 32 - BatteryEmpty ; 128 - CalibrationRequired ) When more than 1 flag is set the sum of those integers is sent. Possible values are LO = 1; HI = 2 ; TempHI = 4 ; TempLO = 8 ; DeviceFault = 16 ; BatteryEmpty = 32 ; SensorMalfunction = 64 ; CalibrationRequired = 128 ; RateOfChangeMin = 256 ; RateOfChangeMax = 512 ; InvalidValue = 1024 ; TypeIncorrectForDevice = 2048 ; DeviceSpecificAlert = 4096 ; CalibrationNotAllowed = 8192 ; CalibrationRecommended = 16384 ; SessionStopped = 32768 ; SensorRateDecreaseExceeded = 65536 ; SensorRateIncreaseExceeded = 131072 ;

Note: Comments are provided in green in the JSON below

Observation resource for CGM measurement

A reduced format of this resource will be sent from Confidence. See the section CGM measurement data - reduced FHIR. The facade needs to further expand that resource by adding the other relelavnt fields as per our implementation guide. Details are provided in the comments below. Additional EWM resources may have to be created by the facade for the flags

{
	"resource": {
		"resourceType": "Observation",
		"id": "1e6f0b94-1519-4f95-b50c-758fa3d4ac4b", //To be managed by FHIRSTACK 
		"meta": {
			"profile": [
				"http://roche.com/fhir/rdc/StructureDefinition/vitalsigns-observation" //To be updated by facade - FHIR profile for vital-signs observation for FHIR internal storage
			]
		},
		"identifier": [
			{
				"system": "http://roche.com/fhir/rdc/sid/observation/confidence",
				"value": "CCCC"      //retain same identifier received from Confidence reduced FHIR
			}
		],
		"status": "final", //retain same status received from confidence reduced FHIR
		"category": [     //To be added by facade - category for CGM will always be vital-signs
			{
				"coding": [
					{
						"system": "http://hl7.org/fhir/observation-category", 
						"code": "vital-signs",
						"display": "Vital Signs"
					}
				]
			}
		],
		"code": {
			"coding": [ //To be added by facade - system, code and display when code.text "CGMGlucoseConcentration" is received in the reduced FHIR
				{
					"system": "http://snomed.info/sct",
					"code": "434910001",
					"display": "Interstitial fluid glucose concentration (observable entity)"
				}
			],
				"text": "CGMGlucoseConcentration"      //To be retained as is from the reduced format so that on restore it can be sent back
		},
		"subject": {
			"reference": "Patient/2P0tI8p-SF9-6850" //To be added by facade -  - patient link
		},
		"performer": [
			{
				"reference": "Patient/2P0tI8p-SF9-6850" //To be added by facade -  - patient link
			}
		],
		"effectiveDateTime": "2020-08-04T15:15:16Z", //Retain same value from Confidence reduced FHIR
		"dataAbsentReason": {  
			"coding": [  //To be adedd by the facade - system, code and display when dataAbsentReason.text "NaN" is received in the reduced FHIR
				{ 
					"system": "http://hl7.org/fhir/data-absent-reason",
					"code": "NaN",
					"display": "Not a Number" 
				}
			],
			"text": "NaN"     //To be retained as is from the reduced format so that on restore it can be sent back
		},
		"device": {
			"reference": "DeviceMetric/0053cfd5-a427-4691-8690-b4d956c6e658" //To be added by facade - link to deviceMetric of relevant CGM sensor deviceComponent
		},
		"related": [
			{
				"type": "derived-from",
				"target": {
					"reference": "Observation/0053cfd5-a427-4691-8690-b4d956c6e690", //To be added by facade based on the SessionID (target.display) in the reduced FHIR.  Link to the relevant session observation
					"display": "AAAA"    //To be retained as is from the reduced format so that on restore it can be sent back
				}
			},
			{  //To be added by the facade - link to the EWM Observation created by the facade for the flags
				"type": "has-member",
				"target": {
					"reference": "Observation/1e6f0b94-1519-4f95-b50c-758fa3d4ac89" 
				}
			},
			{  //To be added by the facade - link to the EWM Observation created by the facade for the flags
				"type": "has-member",
				"target": {
					"reference": "Observation/1e6f0b94-1519-4f95-b50c-758fa3d4ac90" //To be added by the facade - link to the EWM Observation created by the facade for the flags
				}
			}
		],
		"extension": [
			{
				"url": "http://roche.com/fhir/rdc/StructureDefinition/time-offset",
				"valueQuantity": {
					"value": 200, //retain value from reduced FHIR
					"unit": "min",                           
					"system": "http://unitsofmeasure.org", //To be added by facade - the system and code details for the unit  
					"code": "min"
				}
			},
			{
				"url": "http://roche.com/fhir/rdc/StructureDefinition/patient-timezone",
				"valueString": "+02:00" //retain same data from Confidence reduced FHIR
			},
			{
				"url": "http://roche.com/fhir/rdc/StructureDefinition/flags",
				"valueString": "160"    //retain same data from Confidence reduced FHIR for restore. Also create relevant EWM observations in FHIRSTACK
			},
			{
				"url": "http://roche.com/fhir/rdc/StructureDefinition/provenance-channel",
				"valueString": "<channel-name>" //To be added by facade - fill channel data
			},
			{
				"url": "http://roche.com/fhir/rdc/StructureDefinition/provenance-source",
				"valueString": "<source-name>" //To be added by facade - fill source data
			}
		]
	}
}


These resources have to be created by the facade based on the flags received from Confidence in the reduced FHIR (Observation.ext-flags)

Note: Please see the section CGM Flags for all the possible flags and how each should be handled



{
    
    "resourceType": "Observation",
	"id": "1e6f0b94-1519-4f95-b50c-758fa3d4ac89",
	 "meta": {  
        "profile":  [
            "http://roche.com/fhir/rdc/StructureDefinition/observation-EWM"  
           ]
        },
    "status": "final",
    "category":  [
        {
            "coding":  [
                {
                    "system": "http://roche.com/fhir/rdc/cs",
                    "code": "EWM",
                    "display": "Error, Warning, Maintenance, Status"
                }
            ]
        }
    ],
    "code": {
        "coding":  [
            {
                "system": "http://roche.com/fhir/rdc/cs",
                "code": "ERROR",
                "display": "Error"
            }
        ]
    },
    "subject": {
        "reference": "Device/0053cfd5-a427-4691-8690-b4d956c6e698"  //link to device resource of Confidence app. this is a mandatory element in our current profile hence necessary
    },
    "effectiveDateTime": "2020-08-04T15:15:16Z", //same as the related CGM observation effectiveDateTime
    "performer":  [
        {
            "reference": "Patient/2P0tI8p-SF9-6850"
        }
    ],
    "valueCodeableConcept": {
        "coding":  [
            {
                "system": "http://roche.com/fhir/rdc/cs",
                "code": "ERROR_2",          //FHIR code for Battery Empty (32 in Confidence)
                "display": "Battery empty"
            }
        ]
    },
    "device": {
        "reference": "DeviceMetric/0053cfd5-a427-4691-8690-b4d956c6e658"  //link to deviceMetric of relevant CGM sensor deviceComponent
    },
	 "extension":  [
        {
            "url": "http://roche.com/fhir/rdc/StructureDefinition/provenance-channel",
            "valueString": "<channel-name>" //To be added by facade - fill channel data
        },
        {
            "url": "http://roche.com/fhir/rdc/StructureDefinition/provenance-source",
            "valueString": "<source-name>" //To be added by facade - fill source data
        }
    ]
}







{
    
    "resourceType": "Observation",
	"id": "1e6f0b94-1519-4f95-b50c-758fa3d4ac90",
	 "meta": {  
        "profile":  [
            "http://roche.com/fhir/rdc/StructureDefinition/observation-EWM"  
           ]
        },
    "status": "final",
    "category":  [
        {
            "coding":  [
                {
                    "system": "http://roche.com/fhir/rdc/cs",
                    "code": "EWM",
                    "display": "Error, Warning, Maintenance, Status"
                }
            ]
        }
    ],
    "code": {
        "coding":  [
            {
               "system": "http://roche.com/fhir/rdc/cs", 
                "code": "WARNING",     
                "display": "Warning"
            }
        ]
    },
    "subject": {
         "reference": "Device/0053cfd5-a427-4691-8690-b4d956c6e698"  //link to device resource of Confidence app. this is a mandatory element in our current profile hence necessary
    },
    "effectiveDateTime": "2020-08-04T15:15:16Z", //same as the related CGM observation effectiveDateTime
    "performer":  [
        {
            "reference": "Patient/2P0tI8p-SF9-6850"
        }
    ],
    "valueCodeableConcept": {
        "coding":  [
            {
                "system": "http://roche.com/fhir/rdc/cs",
                "code":"WARNING_49",          
                "display": "Calibration Required"
            }
        ]
    },
    "device": {
        "reference": "DeviceMetric/0053cfd5-a427-4691-8690-b4d956c6e658"  //link to deviceMetric of relevant CGM sensor deviceComponent
    },
	 "extension":  [
        {
            "url": "http://roche.com/fhir/rdc/StructureDefinition/provenance-channel",
            "valueString": "<channel-name>" //To be added by facade - fill channel data
        },
        {
            "url": "http://roche.com/fhir/rdc/StructureDefinition/provenance-source",
            "valueString": "<source-name>" //To be added by facade - fill source data
        }
    ]
}





CGM flags

This section describes how each flag coming from Confidence has to be handled in FHIR

In Confidence the flags are denoted by integers. There can be 0 or more flags associated with each CGM value. In order to retain the enumeration from Confidence in case they need to restore data, the flags are received and stored in the extension Observation. ext - flags (http://roche.com/fhir/rdc/StructureDefinition/flags). If there are more than one flags set for a CGM value we will get a sum of the 2 integers. Below is the enumeration for flags in Confidence.

  • LO = 1
  • HI = 2
  • TempHI = 4
  • TempLO = 8
  • DeviceFault = 16
  • BatteryEmpty = 32
  • SensorMalfunction = 64
  • CalibrationRequired = 128
  • RateOfChangeMin = 256
  • RateOfChangeMax = 512
  • InvalidValue = 1024
  • TypeIncorrectForDevice = 2048
  • DeviceSpecificAlert = 4096
  • CalibrationNotAllowed = 8192
  • CalibrationRecommended = 16384
  • SessionStopped = 32768
  • SensorRateDecreaseExceeded = 65536
  • SensorRateIncreaseExceeded = 131072

For example, if LO (1), BatteryEmpty (32) and RateOfChangeMin (256) is set then in the flags extension we will get 1 + 32 + 256 = 289.

In FHIR however, we have a different way of managing these flags. If its an error/warning from the device we have a separate EWM Observation. The facade needs to therefore create the relevant resources additionally before ingesting to FHIRSTACK. The facade needs to convert the flag value to binary and decipher the flags set based on that.

When restoring data back to Confidence, the facade needs to ignore these EWM observations and send back only the extension containing the enumerations from Confidence. Important - even the reference to the EWM observation in the CGM observation needs to be removed before sharing the reduced FHIR back with Confidence

Note : The codes used in EWM Observation created via Facade for the CGM Flags can be referenced from HERE

CGM flag from confidence Handling in FHIR
LO = 1 dataAbsentReason coding of the CGM Observation has to be made NINF in the expanded FHIR. (this is due to already existing modelling for similar use-cases in other applications). Note that the "text" remains NaN which needs to be sent back as is to Confidence in case of restore
HI = 2 dataAbsentReason of the CGM Observation has to be made PINF in the expanded FHIR. (this is due to already existing modelling for similar use-cases in other applications). Note that the "text" remains NaN which needs to be sent back as is to Confidence in case of restore
TempHI = 4 EWM observation referenced in the CGM Observation (while restoring back to confidence the link to the EWM Observation has to be removed in the reduced FHIR)
TempLO = 8 EWM observation referenced in the CGM Observation (while restoring back to confidence the link to the EWM Observation has to be removed in the reduced FHIR)
DeviceFault = 16 EWM observation referenced in the CGM Observation (while restoring back to confidence the link to the EWM Observation has to be removed in the reduced FHIR)
BatteryEmpty = 32 EWM observation referenced in the CGM Observation (while restoring back to confidence the link to the EWM Observation has to be removed in the reduced FHIR)
SensorMalfunction = 64 EWM observation referenced in the CGM Observation (while restoring back to confidence the link to the EWM Observation has to be removed in the reduced FHIR)
CalibrationRequired = 128 EWM observation referenced in the CGM Observation (while restoring back to confidence the link to the EWM Observation has to be removed in the reduced FHIR)
RateOfChangeMin = 256 EWM observation referenced in the CGM Observation (while restoring back to confidence the link to the EWM Observation has to be removed in the reduced FHIR)
RateOfChangeMax = 512 EWM observation referenced in the CGM Observation (while restoring back to confidence the link to the EWM Observation has to be removed in the reduced FHIR)
InvalidValue = 1024 We already have the dataAbsentReason as NaN in case of invalid value, so no need of any additional handling
TypeIncorrectForDevice = 2048 EWM observation referenced in the CGM Observation (while restoring back to confidence the link to the EWM Observation has to be removed in the reduced FHIR)
DeviceSpecificAlert = 4096 EWM observation referenced in the CGM Observation (while restoring back to confidence the link to the EWM Observation has to be removed in the reduced FHIR)
CalibrationNotAllowed = 8192 EWM observation referenced in the CGM Observation (while restoring back to confidence the link to the EWM Observation has to be removed in the reduced FHIR)
CalibrationRecommended = 16384 EWM observation referenced in the CGM Observation (while restoring back to confidence the link to the EWM Observation has to be removed in the reduced FHIR)
SessionStopped = 32768 EWM observation referenced in the CGM Observation (while restoring back to confidence the link to the EWM Observation has to be removed in the reduced FHIR)
SensorRateDecreaseExceeded = 65536 EWM observation referenced in the CGM Observation (while restoring back to confidence the link to the EWM Observation has to be removed in the reduced FHIR)
SensorRateIncreaseExceeded = 131072 EWM observation referenced in the CGM Observation (while restoring back to confidence the link to the EWM Observation has to be removed in the reduced FHIR)

LO = 1 (below sensor range)

Update the dataAbsentReason in CGM Observation of the expanded FHIR from NaN to NINF (note that the system and display also change).

When restoring back to confidence change back to "NaN" with teh relevant system.

"dataAbsentReason": { 
			"coding": [
				{
                    "system": "http://hl7.org/fhir/v3/NullFlavor",
                    "code": "NINF",
                    "display": "negative infinity"
				}
			],
			"text": "NaN"  
		},



HI = 2 (above sensor range)

Update the dataAbsentReason in CGM Observation of the expanded FHIR from NaN to PINF (note that the system and display also change).

When restoring back to confidence change back to "NaN" with teh relevant system.

"dataAbsentReason": { 
			"coding": [
				{
                    "system": "http://hl7.org/fhir/v3/NullFlavor",
                    "code": "PINF",
                    "display": "positive infinity"
				}
			],
			"text": "NaN"  
		},



TempHI = 4 (sensor temperature high)

Create new EWM observation and link it in the CGM Observation through Observation.related (has-member).

{
    
    "resourceType": "Observation",
	"id": "1e6f0b94-1519-4f95-b50c-758fa3d4ac89",
     "meta": {  
        "profile":  [
            "http://roche.com/fhir/rdc/StructureDefinition/observation-EWM"  
           ]
        },
    "status": "final",
    "category":  [
        {
            "coding":  [
                {
                    "system": "http://roche.com/fhir/rdc/cs",
                    "code": "EWM",
                    "display": "Error, Warning, Maintenance, Status"
                }
            ]
        }
    ],
    "code": {
        "coding":  [
            {
                "system": "http://roche.com/fhir/rdc/cs", 
                "code": "WARNING",      
                "display": "Warning"
            }
        ]
    },
    "subject": {
         "reference": "Device/0053cfd5-a427-4691-8690-b4d956c6e698"  //link to device resource of Confidence app. this is a mandatory element in our current profile hence necessary
    },
    "effectiveDateTime": "2020-08-04T15:15:16Z", //same as the related CGM observation effectiveDateTime
    "performer":  [
        {
            "reference": "Patient/2P0tI8p-SF9-6850"
        }
    ],
    "valueCodeableConcept": {
        "coding":  [
            {
                "system": "http://roche.com/fhir/rdc/cs",
                "code": "WARNING_52",              
                "display": "Sensor temperature too high"
            }
        ]
    },
    "device": {
        "reference": "DeviceMetric/0053cfd5-a427-4691-8690-b4d956c6e658"  //link to deviceMetric of relevant CGM sensor deviceComponent
    },
     "extension":  [
        {
            "url": "http://roche.com/fhir/rdc/StructureDefinition/provenance-channel",
            "valueString": "<channel-name>" //To be added by facade - fill channel data
        },
        {
            "url": "http://roche.com/fhir/rdc/StructureDefinition/provenance-source",
            "valueString": "<source-name>" //To be added by facade - fill source data
        },
        {
            "url": "http://roche.com/fhir/rdc/StructureDefinition/patient-timezone"",
            "valueString": "+02:00" //retain value from reduced FHIR
        }
    ]
}


TempLO = 8 (sensor temperature low)

Create new EWM observation and link it in the CGM Observation through Observation.related (has-member). Only the valueCodeableConcept is elaborated below. The other details of the EWM observation are same as the first sample.

{
    
    "resourceType": "Observation",
	"code": {
        "coding":  [
            {
                "system": "http://roche.com/fhir/rdc/cs", 
                "code": "WARNING",     
                "display": "Warning"
            }
        ]
    },
	....
    "valueCodeableConcept": {
        "coding":  [
            {
                "system": "http://roche.com/fhir/rdc/cs",
                "code": "WARNING_51",            
                "display": "Sensor temperature too low"
            }
        ]
    },
   ...
    ]
}


DeviceFault = 16

Create new EWM observation and link it in the CGM Observation through Observation.related (has-member). Only the valueCodeableConcept is elaborated below. The other details of the EWM observation are same as the first sample.

{
    
    "resourceType": "Observation", 
	"code": {
        "coding":  [
            {
                "system": "http://roche.com/fhir/rdc/cs", 
                "code": "ERROR",      
                "display": "Error"
            }
        ]
    },
	...
    "valueCodeableConcept": {
        "coding":  [
            {
                "system": "http://roche.com/fhir/rdc/cs",
                "code": "ERROR_30",          
                "display": "Device fault"
            }
        ]
    },
   ...
}


BatteryEmpty = 32

Create new EWM observation and link it in the CGM Observation through Observation.related (has-member). Only the valueCodeableConcept is elaborated below. The other details of the EWM observation are same as the first sample.

{
    
    "resourceType": "Observation",
	 "code": {
        "coding":  [
            {
                "system": "http://roche.com/fhir/rdc/cs", 
                "code": "ERROR",      
                "display": "Error"
            }
        ]
    },
	...
    "valueCodeableConcept": {
        "coding":  [
            {
                "system": "http://roche.com/fhir/rdc/cs",
                "code": "ERROR_2",          
                "display": "Battery empty"
            }
        ]
    },
   ....
}


SensorMalfunction = 64

Create new EWM observation and link it in the CGM Observation through Observation.related (has-member). Only the valueCodeableConcept is elaborated below. The other details of the EWM observation are same as the first sample.

{
    
    "resourceType": "Observation",
	 "code": {
        "coding":  [
            {
                "system": "http://roche.com/fhir/rdc/cs", 
                "code": "ERROR",      
                "display": "Error"
            }
        ]
    },
	...
    "valueCodeableConcept": {
        "coding":  [
            {
                "system": "http://roche.com/fhir/rdc/cs",
                "code":"ERROR_24",          
                "display": "Sensor error"
            }
        ]
    },
    ...
}


CalibrationRequired = 128

Create new EWM observation and link it in the CGM Observation through Observation.related (has-member). Only the valueCodeableConcept is elaborated below. The other details of the EWM observation are same as the first sample.

{
    
    "resourceType": "Observation",
	"code": {
        "coding":  [
            {
                "system": "http://roche.com/fhir/rdc/cs", 
                "code": "WARNING",     
                "display": "Warning"
            }
        ]
    },
	...
    "valueCodeableConcept": {
        "coding":  [
            {
                "system": "http://roche.com/fhir/rdc/cs",
                "code":"WARNING_49",          
                "display": "Calibration Required"
            }
        ]
    },
    ...
}


RateOfChangeMin = 256 (TBC - whether a warning)

Create new EWM observation and link it in the CGM Observation through Observation.related (has-member). Only the valueCodeableConcept is elaborated below. The other details of the EWM observation are same as the first sample.

{
    
    "resourceType": "Observation",
	"code": {
        "coding":  [
            {
                "system": "http://roche.com/fhir/rdc/cs", 
                "code": "WARNING",     
                "display": "Warning"
            }
        ]
    },
	....
    "valueCodeableConcept": {
        "coding":  [
            {
                "system": "http://roche.com/fhir/rdc/cs",
                "code":"WARNING_57",          
                "display": "Minimum rate of change"
            }
        ]
    },
   ...
}


RateOfChangeMax = 512 (TBC - whether a warning)

Create new EWM observation and link it in the CGM Observation through Observation.related (has-member). Only the valueCodeableConcept is elaborated below. The other details of the EWM observation are same as the first sample.

{
    
    "resourceType": "Observation",
	"code": {
        "coding":  [
            {
                "system": "http://roche.com/fhir/rdc/cs", 
                "code": "WARNING",     
                "display": "Warning"
            }
        ]
    },
	...
    "valueCodeableConcept": {
        "coding":  [
            {
                "system": "http://roche.com/fhir/rdc/cs",
                "code":"WARNING_58",          
                "display": "Maximum rate of change"
            }
        ]
    },
   ...
}


TypeIncorrectForDevice = 2048

Create new EWM observation and link it in the CGM Observation through Observation.related (has-member). Only the valueCodeableConcept is elaborated below. The other details of the EWM observation are same as the first sample.

{
    
    "resourceType": "Observation",
	"code": {
        "coding":  [
            {
                "system": "http://roche.com/fhir/rdc/cs", 
                "code": "ERROR",     
                "display": "Error"
            }
        ]
    },
	...
    "valueCodeableConcept": {
        "coding":  [
            {
                "system": "http://roche.com/fhir/rdc/cs",
                "code":"ERROR_41",          
                "display": "Type Incorrect For Device"
            }
        ]
    },
   ...
}


DeviceSpecificAlert = 4096

Create new EWM observation and link it in the CGM Observation through Observation.related (has-member). Only the valueCodeableConcept is elaborated below. The other details of the EWM observation are same as the first sample.

{
    
    "resourceType": "Observation",
	"code": {
        "coding":  [
            {
                "system": "http://roche.com/fhir/rdc/cs", 
                "code": "ERROR",     
                "display": "Error"
            }
        ]
    },
	...
    "valueCodeableConcept": {
        "coding":  [
            {
                "system": "http://roche.com/fhir/rdc/cs",
                "code":"ERROR_42",          
                "display": "Device Specific Alert"
            }
        ]
    },
   ...
}


CalibrationNotAllowed = 8192

Create new EWM observation and link it in the CGM Observation through Observation.related (has-member). Only the valueCodeableConcept is elaborated below. The other details of the EWM observation are same as the first sample.

{
    
    "resourceType": "Observation",
	"code": {
        "coding":  [
            {
                "system": "http://roche.com/fhir/rdc/cs", 
                "code": "MAINTENANCE",     
                "display": "Maintenance"
            }
        ]
    },
	...
    "valueCodeableConcept": {
        "coding":  [
            {
                "system": "http://roche.com/fhir/rdc/cs",
                "code":"MAINTENANCE_38",          
                "display": "Calibration Not Allowed"
            }
        ]
    },
   ...
}


CalibrationRecommended = 16384

Create new EWM observation and link it in the CGM Observation through Observation.related (has-member). Only the valueCodeableConcept is elaborated below. The other details of the EWM observation are same as the first sample.

{
    
    "resourceType": "Observation",
	"code": {
        "coding":  [
            {
                "system": "http://roche.com/fhir/rdc/cs", 
                "code": "MAINTENANCE",     
                "display": "Maintenance"
            }
        ]
    },
	...
    "valueCodeableConcept": {
        "coding":  [
            {
                "system": "http://roche.com/fhir/rdc/cs",
                "code":"MAINTENANCE_35",          
                "display": "Calibration recommended"
            }
        ]
    },
   ...
}


SessionStopped = 32768

Create new EWM observation and link it in the CGM Observation through Observation.related (has-member). Only the valueCodeableConcept is elaborated below. The other details of the EWM observation are same as the first sample.

{
    
    "resourceType": "Observation",
	"code": {
        "coding":  [
            {
                "system": "http://roche.com/fhir/rdc/cs", 
                "code": "MAINTENANCE",     
                "display": "Maintenance"
            }
        ]
    },
	...
    "valueCodeableConcept": {
        "coding":  [
            {
                "system": "http://roche.com/fhir/rdc/cs",
                "code":"MAINTENANCE_39",          
                "display": "Session Stopped"
            }
        ]
    },
   ...
}


SensorRateDecreaseExceeded = 65536

Create new EWM observation and link it in the CGM Observation through Observation.related (has-member). Only the valueCodeableConcept is elaborated below. The other details of the EWM observation are same as the first sample.

{
    
    "resourceType": "Observation",
	"code": {
        "coding":  [
            {
                "system": "http://roche.com/fhir/rdc/cs", 
                "code": "MAINTENANCE",     
                "display": "Maintenance"
            }
        ]
    },
	...
    "valueCodeableConcept": {
        "coding":  [
            {
                "system": "http://roche.com/fhir/rdc/cs",
                "code":"MAINTENANCE_40",          
                "display": "Sensor Rate Decrease Exceeded"
            }
        ]
    },
   ...
}


SensorRateIncreaseExceeded = 131072

Create new EWM observation and link it in the CGM Observation through Observation.related (has-member). Only the valueCodeableConcept is elaborated below. The other details of the EWM observation are same as the first sample.

{
    
    "resourceType": "Observation",
	"code": {
        "coding":  [
            {
                "system": "http://roche.com/fhir/rdc/cs", 
                "code": "MAINTENANCE",     
                "display": "Maintenance"
            }
        ]
    },
	...
    "valueCodeableConcept": {
        "coding":  [
            {
                "system": "http://roche.com/fhir/rdc/cs",
                "code":"MAINTENANCE_41",          
                "display": "Sensor Rate Increase Exceeded"
            }
        ]
    },
   ...
}