Deleted Values approach

The DELETE operation will be performed as a status change on the resource rather than a DELETE operation. This will increase system traceability because a DELETED FHIR resource is not searchable.

  • MySugr maintains a unique identifier for ALL the deletable resources NOTE: This identifier is unique for the resource. If a log entry has more than one data point resulting in more than 1 resource, each resource should be identified uniquely.
  • If any entry is deleted, mySugr shall send the deleted resource alone (no history) carrying
    • the same identifier with which it was previously ingested
    • the registeredTimestamp holding the timestamp of the delete
    • updated status indicating that it has been deleted (this depends on the resource)
  • RDCP shall maintain the history so there will be no need to send the history through ACSPIX

More details at - https://confluence.rochedc.accentureanalytics.com/x/wwb4Aw

This section contains a generalized approach for each resource type. If a particular data point is deletable in mySugr, one needs to follow the approach based on the FHIR resource type used for that data point. For instance: meal-carbohydrates, exercise-duration, blood-glucose etc are observation resources and therefore follow the approach given under "Observation resource" category.

IMPORTANT: If a data point is modelled as a separate resource then the above aporach applies (For example: BG, body-weight etc.). However, the following data points are not modelled as a separate resource but as a a part/child of another data point. So, the deleted approach in these cases are different:

mySugr data point FHIR modelling Deleted approach
exercise_description_text activity-observation (observation.category=257733005; observation.code=280147009) This observation resource is a parent to the child observations exercise-duration, steps and exercise-intensity. So, if a user deleted the exercise_description_text while 1 or more of the child entries still exist in the logentry, the parent resource should not be cancelled because it holds the references to the child observation(s). Only the valueString should be made blank in the parent resource.
meal_description_text; meal_image(s); logentry_nutritional_constituents diet-intake-observation (observation.category=364395008; observation.code=246251008) These 3 datapoints together are modelled in a single Observation resource. So if any one of the entry is deleted the entire resource should not be cancelled, but the resource should be "edited" by removing/updating the respective item.
bolus_correction_insulin_units; bolus_food_insulin_units MedicationAdministration (medicationCodeableConcept.code=411531001) These data points are modelled as a part of the MedicationAdministration resource for the pen_bolus_insulin_units. So if any one of these are deleted the entire resource should not be cancelled, but the resource should be "edited" by removing/updating the respective item.

NOTE: The approach for deleting GOAL resource is not outlined because even if the user has not mentioned a target range (for example, weight), then the default values are considered. So there never is a scenario when this setting can be deleted completely. The same applies to the CAREPLAN resource which holds the settings like therapy type and references to the GOAL resources that contain the target ranges which have a default value and cannot be deleted.

Observation resource

The "delete" approach for any Observation resource will be the same. So this approach applies for "deletion" of any data point that is modelled as an Observation resource.

  • effectiveDateTime - will have the timestamp when the observation was made
  • extension registered-timestamp - will have the timestamp of the delete action made on the entry
  • element device - will be a reference always to the device metric which basically points to the smartphone (assuming deleting is only possible on the app)
  • identifier - will have the same unique identifier with which it has been ingested already
  • status - will always be "cancelled" for the deleted resource

   

Below is a sample for deleting a BG observation with identifier "AAAAA-AAAAA-AAAAA":

   

Step Description BG Value BG Measurement TimeStamp Registered TimeStamp Type Identifier
1 A new blood glucose entry is made 88 2020-04-03T09:00:00Z 2020-04-06T12:00:00Z manual entry AAAAA-AAAAA-AAAAA
2 The entry is deleted in mySugr; In FHIR it is logically deleted by replacing it with "cancelled" status 88 2020-04-03T09:00:00Z 2020-04-06T14:00:00Z manual entry AAAAA-AAAAA-AAAAA

The following bundle is generated on Step 2.

Command 'json' could not render: File not found for 'subject=example-mysugr-deleted-values-observation'

MedicationAdministration resource

The "delete" approach for any MedicationAdministration resource will be the same. So this approach applies for "deletion" of any data point that is modelled as a MedicationAdministration resource.

  • effectiveDateTime - will have the timestamp of the medication administration
  • extension registered-timestamp - will have the timestamp of the delete action made on the entry
  • extension parent-device-metric - will be a refernce always to the device metric which basically points to the smartphone (assuming deleting is only possible on the app)
  • identifier - will have the same unique identifier with which it has been ingested already
  • status - will always be "entered-in-error" for the deleted resource

   

Below is a sample for deleting a pen_basal_injection_unit with identifier "AAAAA-AAAAA-AAAAA":

   

Step Description Insulin Units Injected TimeStamp Registered TimeStamp Type Identifier
1 A pen_basal_injection_unit is entered 2 2020-04-06T10:00:00Z manual entry AAAAA-AAAAA-AAAAA
2 The entry is deleted in mySugr; In FHIR it is logically deleted by replacing it with "entered-in-error" status 2020-04-06T12:00:00Z

The following bundle is generated on Step 2.

Command 'json' could not render: File not found for 'subject=example-mysugr-deleted-values-medicationadministration'

Condition resource

The "delete" approach for any condition resource will be the same. So this approach applies for "deletion" of any data point that is modelled as a condition resource.

  • extension registered-timestamp - will have the timestamp of the delete (inactive) action made on the entry
  • identifier - will have the same unique identifier with which it has been ingested already
  • status - will always be "inactive" for the deleted resource

   

Below is a sample for deleting(inactive) bg diabetes type with identifier "BBBBB-BBBBB-BBBBB":

   

Step Description BG diabetes type Registered TimeStamp Type Identifier
1 Bg diabetes type value is entered Diabetes mellitus type 1 2020-06-24T13:00:00Z manual entry BBBBB-BBBBB-BBBBB
2 The entry is updated as inactive to delete the diabetes type value 2020-06-24T13:16:00Z

The following bundle is generated on Step 2.

Command 'json' could not render: File not found for 'subject=example-inactive-mySugr-DG3-BG-related-settings'