CGM data

CGM data from SINOVO is expected as follows:

  • We will not receive any sensor details from SINOVO. So the session in the Roche JSON is not linked to a sensor. The session start and end time in this case is just the start and end times of the CGM data shared in that file.
  • There may still be sequences if there is any time shift
  • CGM data interval may be fixed in some cases and in some devices like Libre there may be no fixed interval. However, since the sampling interval is mandatory in the Roche JSON schema, SINOVO will send it as 1.
  • rate of change will always be NaN for SINOVO

The following points have to be considered while mapping to FHIR:

  1. For cases where devices do not have a fixed sample interval - Approach –

    • We will still store the data as an array and keep the delta time between readings as 1 (unit depends on what is set as runtime unit for the CGM data). The missing data will be denoted as E in the array.

    • We will consider the sampling interval (deviceMetric.measurementPeriod) as sent by SINOVO. This is because we cannot know what devices do not have a fixed sampling interval and we are basically storing data as sent from source.

    • If there are 2 values for one single time (i.e. delta time = 0) then we consider only one. Ideally the value should'nt be different but for technicality we choose the latest one.

      • the first occurance will be represnted in the array (SampledData of the CGM observation)
      • The following occurances will be represented as individual Observations (with valueQuantity and not SampledData) with a 1 second increment from the previous reading. Since we do not receive the actual timestamp of these readings within the same minute, we assume the increment of 1 sec.
  2. For cases when sensor details are provided in RocheJson :

    -RocheJson2FHIR mapper needs to create sensor device component and device metric resources.

    -Mapper needs to point Transmitter devicecomponent as parent for sensor device component.

    -Sensor Devicemetric will be referenced in CGM observations.

For example:

    "sequences": [[[0,"2014-09-11T11:24:00Z"],[1,72,"NaN"],[3,72,"NaN"],[0,71,"NaN"],[0,70,"NaN"],[6,68,"NaN"]

	Observation (array) --> 2014-09-11T11:24:00Z To 2014-09-11T11:34:00Z  --> (E 72 E E 72 E E E E E 68)
	Observation (individual) --> 2014-09-11T11:28:01Z --> 71 mg/dL
	Observation (individual) --> 2014-09-11T11:28:02Z --> 70 mg/dL
  1. Since we are not getting any sensor details we will just treat session as data collected over a period in this case. There will be no session details stored as we do not get it from SINOVO.

  2. CGM data can come in one or more sequences. We will split the data in each sequence as one observation per day. If there are 2 sequences in the same day, there will be 2 observations. Basically sequences will be treated as separate observations because there may be a time gap between each sequence. Time will be stored as received from the source with the time zone details.

    Example when sampling interval is 1 min –

    Sequence 1 has data from Day 1 15:00 to Day 3 17:00
    Sequence 2 has data from Day 3 18:00 to Day 3 19:00

    We will have – 
        Observation 1 – Day 1 15:00 to Day 1 23:59
        Observation 2 – Day 2 00:00 to Day 2 23:59
        Observation 3 – Day 3 00:00 to Day 3 17:00
        Observation 4 – Day 3 18:00 to Day 3 19:00
  1. If SINOVO resends sends CGM data for a time that is already ingested, it will be ignored. Basically the mapper shall check if the time of the CGM data received is <= to the time of the last ingested CGM data for that particular patient and CGM transmitter, those data will be ignored and not ingested.

  2. CGM value as per the Roche JSON spec is a number or can be HI, LO or NaN. Please see sample below for the different mappings.

  3. Identifier for the Observation resource is built as:

		<DeviceComponent.Identifier.value>/<Obsrevation.code>/<Patient-FHIR-ID>/<Observation.effectivePeriod.start>/<Observation.effectivePeriod.end>
  1. The element data - header - unit (for type = runtime) will hold the unit of time which applies to the runtime and delta in the sequences. The mapper needs to always consider this. The schema says its only "min" but the pdf document says "s" and "min" are possible. So it is better if the mapper takes this into account.

  2. Rate of change elements

    • header-> rate of change -> Has unit attribute which is always set to (mg/dL)/min. This unit is mapped under Observation.component.valueSampledData.data.unit element.

    • sequence-> data -> rate of change -> it is calculated for each cgm measurement this element type is number and sample values are 1.2,1.3 etc.. RocheJson schema support three possible values for sequences data rate of change which are "HI","LO","NaN". these values is mapped under Observation.component.valueSampledData.data element.

Sample 1 - CGM data with a fixed interval and multiple sequences

Sample Roche JSON from SINOVO

{
    "description": {
		"id": "1",    
		"type": "cgm transmitter",    
		"manufacturer": "Dev",    
		"name": "CGM_Dev",    
		"serial number": "SCC-TkcxHsM0NTY4SB",
		......
		"sampling interval": [5  , "min"]
    },
	......
	"data": [
	{
		"type": "cgm session",    
		"number": 1,    
		"start time": "2020-08-03T23:30:00+02:00",    
		"end time": "2020-08-04T01:40:00+02:00",    
		"header": [
				{
				"type": "runtime",    "unit": "min"
				},    
				{
				"type": "timestamp"
				},    
				{
				"type": "cgm",    "unit": "mg/dL"
				},    
				{
				"type": "rate of change",    "unit": "(mg/dL)/min"
				}],
		"sequences": [[[0,"2020-08-03T23:30:00+02:00"],
						[0,87,"NaN"],
						[5,87,"NaN"],
						[5,88,"NaN"],
						[5,88,"NaN"],
						[5,89,"NaN"],
						[5,89,"NaN"],
						[5,90,"NaN"],
						[5,90,"NaN"],
						[5,91,"NaN"],
						[5,91,"NaN"],
						[5,91,"NaN"],
						[5,91,"NaN"],
						[5,92,"NaN"]],
						[[70,"2020-08-04T00:40:00+02:00"],
						[0,92,"NaN"],
						[5,92,"NaN"],
						[5,92,"NaN"],
						[5,93,"NaN"],
						[5,93,"NaN"],
						[5,93,"NaN"],
						[5,93,"NaN"],
						[5,95,"NaN"],  
						[5,95,"NaN"],
						[5,95,"NaN"],
						[5,"NaN","NaN"],
						[5,"HI","NaN"],
						[5,"LO","NaN"]]]

Expected FHIR

Command 'json' could not render: File not found for 'subject=example-udtc-sinovo-cgm-data-fixed-interval'

Sample 2 - CGM data with a single sequence and no fixed interval

Sample Roche JSON from SINOVO

{
    "description": {
		"id": "1",    
		"type": "cgm transmitter",    
		"manufacturer": "Dev",    
		"name": "CGM_Dev",    
		"serial number": "SCC-TkcxHsM0NTY4SB",
		......
		"sampling interval": [1  , "min"]
    },
	......
	"data": [
	{
		"type": "cgm session",    
		"number": 1,    
		"start time": "2020-08-04T10:30:00+02:00",    
		"end time": "2020-08-04T11:00:00+02:00",    
		"header": [
				{
				"type": "runtime",    "unit": "min"
				},    
				{
				"type": "timestamp"
				},    
				{
				"type": "cgm",    "unit": "mg/dL"
				},    
				{
				"type": "rate of change",    "unit": "(mg/dL)/min"
				}],
		"sequences": [[[0,"2020-08-04T10:30:00+02:00"],
						[5,87,"NaN"],
						[10,88,"NaN"],
						[0,89,"NaN"],
						[4,89,"NaN"],
						[6,89,"NaN"],
						[5,90,"NaN"]
						]]

Expected FHIR

Command 'json' could not render: File not found for 'subject=example-udtc-sinovo-cgm-data-random-interval'