Creating Blood Pressure Observation (multi component) from the mobile app (Android)

Hi,

I want to create an observation through my Android app and send it to the server; but I have a problem in creating the observation.
In fact I want to create a message like the following:

{
“resourceType”: “Observation”,
“id”: “107574”,
“meta”: {
“versionId”: “1”,
“lastUpdated”: “2016-08-20T16:47:10.080-04:00”
},
“status”: “preliminary”,
“code”: {
“coding”: [
{
“system”: “http://loinc.org”,
“code”: “55284-4”,
“display”: “Blood pressure systolic and diastolic”
},
]
},
“subject”: {
“display”: “00990098”
},
“effectiveDateTime”: “2017-01-07T22:47+01:00”,
“component”: [
{
“code”: {
“coding”: [
{
“system”: “http://loinc.org”,
“code”: “8480-6”,
“display”: “Systolic blood pressure”
}
]
},
“valueQuantity”: {
“value”: 120.0,
“system”: “http://unitsofmeasure.org”,
“code”: “mm[Hg]”
}
},
{
“code”: {
“coding”: [
{
“system”: “http://loinc.org”,
“code”: “8480-6”,
“display”: “Diastolic blood pressure”
}
]
},
“valueQuantity”: {
“value”: 80.0,
“system”: “http://unitsofmeasure.org”,
“code”: “mm[Hg]”
}
}
]
}

the code I wrote is the following (creating wrong schema):
> //create component

                Observation.Component comp=new Observation.Component();
                //create diastolic
                CodeDt code_sys=new CodeDt();
                QuantityDt sys_value = new QuantityDt();
                sys_value.setValue(syst).setSystem("http://unitsofmeasure.org").setCode("mm[Hg]");
                comp.getCode().addCoding().setCode("8480-6").setSystem("http://loinc.org").setDisplay("Systolic blood pressure");
                //created diastolic
                CodeDt code_dia=new CodeDt();
                QuantityDt dias_value = new QuantityDt();
                dias_value.setValue(dias).setSystem("http://unitsofmeasure.org").setCode("mm[Hg]");
                comp.getCode().addCoding().setCode("8462-4").setSystem("http://loinc.org").setDisplay("Diastolic blood pressure");
                //create heart rate
                CodeDt code_hr=new CodeDt();
                QuantityDt hr_value = new QuantityDt();
                hr_value.setValue(hr).setSystem("http://unitsofmeasure.org").setCode("/min");
                comp.getCode().addCoding().setCode("8867-4").setSystem("http://loinc.org").setDisplay("Heart rate");
                observation.addComponent(comp);

I want to now how can I create this schema? which part I am making mistake which I do not get my desired schema above?

Regards,
Yasaman

Hi Yasaman,

I’m having trouble reading your message because it seems like the forum is messing all the formatting up. Can you point to what specifically is wrong with the output you are getting vs. the output you want?

Cheers,
James