How to describe a new custom data type

The CoffeeCounter is a fictive application to visualize custom feautures of the platform and the sdk. For an example we want to create a new data structure to model a subject’s coffee consume. The coffee consume can be used for clinical diagnoses, or a simple self management application.

Description

Consuming too much caffeine can have negative influence to health in general. Due to this possible harm, records about the consumption in regards to frequency and strength can be helpful. On the one hand, subjects can log and review their own consume to control theirselves. During a therapy on the other hand physicians or nutritionists can monitor the consume. Additionally the types of the consumed drinks can be recorded, to match the different ingredients.

Use

  • Use only for coffee and coffee-like Drinks.

Not use

  • Do not use for other drinks like energy drinks or caffeine containing longdrinks/Cocktails.

Data Model

Name Type M Description Example
code CodedEntry See parameter codes /
time DateTime Time and Date, a portion coffee is consumed “2014-10-13T11:24:57.143”
size UnitValue X Size of consumed coffee. Usually unit is ml. “unitValue”:{
“value”:320,
“unit”:”ml”,
“valueText”:”320 ml”
}
strength String X See corresponding enumeration
type String See corresponding enumeration
milk Boolean Consumed with milk? false
sugar Boolean Consumed with sugar? false

Rules

  • The mandatory fields should be combined with the type to derive common ingredients and statistic information about strength and containing caffeine.

Parameter Codes

loinc_num component system property time_aspct scale_typ method_typ
18204-8 Caffeine renal clearance Urine+Ser/Plas VRat 24H Qn
25361-7 Caffeine Ser/Plas SCnc Pt Qn
29211-0 Caffeine Body fld MCnc Pt Qn
3422-3 Caffeine Ser/Plas MCnc Pt Qn
3423-1 Caffeine Urine Threshold Pt Ord
3424-9 Caffeine Urine MCnc Pt Qn
40416-0 Caffeine Gast fld Threshold Pt Ord
4150-9 Caffeine Dose Mass Pt Qn
43829-1 Caffeine XXX Threshold Pt Ord
59810-2 Caffeine^trough Ser SCnc Pt Qn
59811-0 Caffeine^peak Ser SCnc Pt Qn
60290-4 Caffeine XXX SCnc Pt Qn
61477-6 PhenX measure – caffeine intake ^Patient Pt PhenX
61488-3 How often did you drink diet colas and diet root beer (caffeine free) ^Patient Find Pt Ord PhenX
61489-1 What is your serving size for diet colas and diet root beer (caffeine free) ^Patient Find Pt Ord PhenX
61490-9 How often did you drink diet colas and diet root beer (with caffeine) ^Patient Find Pt Ord PhenX
61491-7 What is your serving size for diet colas and diet root beer (with caffeine) ^Patient Find Pt Ord PhenX
61500-5 How often did you drink regular colas and root beer (caffeine free, not diet) ^Patient Find Pt Ord PhenX
61501-3 What is your serving size for regular colas and root beer (caffeine free, not diet) ^Patient Find Pt Ord PhenX
61502-1 How often did you drink regular colas and root beer (with caffeine, not diet) ^Patient Find Pt Ord PhenX
61503-9 What is your serving size for regular colas and root beer (with caffeine, not diet) ^Patient Find Pt Ord PhenX
62280-3 PhenX – caffeine protocol ^Patient Pt PhenX
73492-1 Butalbital+Acetylsalicylate+Caffeine induced platelet Ab.IgM Ser/Plas Pr Pt Ord Flow cytometry
73493-9 Butalbital+Acetylsalicylate+Caffeine induced platelet Ab.IgG Ser/Plas Pr Pt Ord Flow cytometry
74919-2 Caffeine^trough Ser/Plas MCnc Pt Qn

Enums

 strength

Very_Strong
Strong
Normal
Weak
Very_Weak
Decaf

  type

Coffee
Coffee_Crema
Espresso
Latte_Macchiato
Cappucino

Update Rhythm

Daily, multiple objects are expected to be stored.

Schema

{
 "id": "/CoffeeCounter/Consume",
 "$schema": "http://json-schema.org/draft-04/schema#",
 "type": "object",
 "properties": {
  "code": {
   "$ref": "/core/CodedValue"
  },
  "time": {
   "$ref": "/core/DateTime"
  },
  "size": {
   "$ref": "/core/UnitValue"
  },
  "strength": {
   "type": "string",
   "enum": ["VERY_STRONG", "STRONG", "NORMAL", "WEAK", "VERY_WEAK", "DECAF"]
  },
  "type": {
   "type": "string",
   "enum": ["COFFE", "COFFEE_CREMA", "ESPRESSO", "LATTE_MACCHIATO", "CAPPUCINO"]
  },
  "milk": {
   "type": "boolean"
  },
  "sugar": {
   "type": "boolean"
  }
 },
 "required": ["size", "strength"],
 "additionalProperties": false
}

The following example shows the description and implementation of a new data type for coffee consum. This also describes the composition of a core data type.

Example object

{
 "consume":{
  "parameterCode":{
   "catalogName":"LOINC",
   "catalogVersion":"2.48",
   "code":"8308-9",
   "codeText":"LOINC 8308-9",
   "description":"Body height"
  },
  "time":"2014-10-13T11:24:57.143",
  "size":{
   "unitValue":{
    "value":320,
    "unit":"ml",
    "valueText":"320 ml"
   }
  },
  "strength":"STRONG",
  "type":"COFFEE_CREMA",
  "milk":false,
  "sugar":false
 }
}