Unable to persist multiple concepts on POSTing single FHIR observation resource

Hi @surangak, @harsha89, I’m trying to POST an Observation having multiple concepts. The response is 201 but only the first concept gets stored on the db.(Note: individually all the concepts are getting persisted) I tried the same thing using the same json on HAPI FHIR Test server and it stores all the concepts. Is it a possible bug in openmrs ?? Attached below the json which I’m trying to POST.

  {"resourceType":"Observation",  
   "code":{ 
     "coding":[
        { "system":"http://openmrs.org", "code":"47f819a8-ef60-11e5-868f-3c970ed08286", "display":"MONOCYTES" },
        { "system":"http://openmrs.org", "code":"47f81a9d-ef60-11e5-868f-3c970ed08286", "display":"EOSINOPHILS" },
         { "system":"http://openmrs.org", "code":"47f81b92-ef60-11e5-868f-3c970ed08286", "display":"BASOPHILS" },
          { "system":"http://openmrs.org", "code":"47f81d7f-ef60-11e5-868f-3c970ed08286", "display":"CD8%" },
           { "system":"http://openmrs.org", "code":"47f81e78-ef60-11e5-868f-3c970ed08286", "display":"CD3 COUNT" },
            { "system":"http://openmrs.org", "code":"47f82539-ef60-11e5-868f-3c970ed08286", "display":"HERPES SIMPLEX VIRUS SEROLOGY, QUANTITATIVE" },
             { "system":"http://openmrs.org", "code":"47fa4d24-ef60-11e5-868f-3c970ed08286", "display":"SYSTOLIC BLOOD PRESSURE"
             },
                { "system":"http://openmrs.org", "code":"47f38e02-ef60-11e5-868f-3c970ed08286", "display":"BLOOD UREA NITROGEN" },
       { "system":"http://openmrs.org", "code":"47f38e02-ef60-11e5-868f-3c970ed08286", "display":"TOXICITY, DRUG" }
   ] }, 
   "valueQuantity":{ 
     "value":120.0, 
     "units":"mmHg", 
     "system":"http://unitsofmeasure.org", 
     "code":"mmHg" }, 
   "appliesDateTime":"2016-04-04T00:00:00+05:30",
   "issued":"2016-04-05T11:13:20.000+05:30", 
   "status":"final",
   "reliability":"ok", 
   "subject":{ "reference":"Patient/012", 
              "display":"John Bond(Identifier:ani123)" }, 
   "performer":[
        {
            "reference":"Practitioner/73bbb069-9781-4afc-a9d1-54b6b2270e05",
            "display":"Doc(Identifier:100-1)"
        }
    ],
   "encounter":{
        "reference":"Encounter/f2ede784-b011-40f5-9ca1-025c0b6b2f4a"
    },
   "referenceRange":
   [ 
     { "high":
      { "value":0.0, 
       "units":"mmHg",
       "system":"http://unitsofmeasure.org", 
       "code":"mmHg" }
     }
   ]
  }

Observation will contain only single concept right? What’s the usecase that you trying to achieve?

@aniruddh You may create multiple observations :slight_smile:

Hi @harsha89, Looking at the discussions on this page FHIR Encounter, Visit, & Observation resources , i think we should be able to have multiple concepts within an observation and similar examples you may find on FHIR observation page.

To give an example usecase consider a patient comes in for a visit to a hospital. Now, he/she may undergo multiple observations like blood pressure systolic, BMI, asthma, etc.Consider that patient has 160 observations. All these information I wish to send using a single request.

Does it make sense ?

@aniruddh in OpenMRS we are storing them as separate observations :). Above example that you mentioned is for same concept with different mappings I believe.

Hi @harsha89, Check out the example on HAPI FHIR google group: https://groups.google.com/forum/#!searchin/hapi-fhir/observations/hapi-fhir/kN7ESL_MeXE/qzPAfRz3HAAJ Apparently, they are using something as component [which doesn’t exist on OpenMRS] and sending multiple concepts.

{ “resourceType”: “Observation”, “id”: “50586”, “meta”: { “versionId”: “1”, “lastUpdated”: “2015-11-17T22:01:35.882+00:00” }, “status”: “final”, “code”: { “coding”: [ { “system”: “urn:std:iso:11073:10101”, “code”: “150020”, “display”: “MDC_PRESS_BLD_NONINV” } ] }, “subject”: { “reference”: “Patient/1-26” }, “effectiveDateTime”: “2015-11-17T23:01:08.846+01:00”, “device”: { “reference”: “Device/1-5c313efffe018148” }, “component”: [ { “code”: { “coding”: [ { “system”: “urn:std:iso:11073:10101”, “code”: “150021”, “display”: “MDC_PRESS_BLD_NONINV_SYS” }, { “system”: “http://hl7.org/fhir/data-types”, “code”: “Quantity”, “display”: “Value is a Numeric Data Type integer” } ] }, “valueQuantity”: { “value”: 139, “unit”: “mmHg”, “system”: “urn:std:iso:11073:10101”, “code”: “266016” } }, { “code”: { “coding”: [ { “system”: “urn:std:iso:11073:10101”, “code”: “150022”, “display”: “MDC_PRESS_BLD_NONINV_DIA” }, { “system”: “http://hl7.org/fhir/data-types”, “code”: “Quantity”, “display”: “Value is a Numeric Data Type integer” } ] }, “valueQuantity”: { “value”: 84, “unit”: “mmHg”, “system”: “urn:std:iso:11073:10101”, “code”: “266016” } }, { “code”: { “coding”: [ { “system”: “urn:std:iso:11073:10101”, “code”: “150023”, “display”: “MDC_PRESS_BLD_NONINV_MEAN” }, { “system”: “http://hl7.org/fhir/data-types”, “code”: “Quantity”, “display”: “Value is a Numeric Data Type integer” } ] }, “valueQuantity”: { “value”: 111, “unit”: “mmHg”, “system”: “urn:std:iso:11073:10101”, “code”: “266016” } } ] }

@aniruddh with OpenMRS data model you will need to create multiple observations :). We can’t store it with single observation. Also we can’t create multiple observations within one request.

@harsha89, could you suggest me a way with which I can solve this particular usecase: I’ve a UI form which has 160 observations and I would like create these observations on submit. Now, 160 individual Observation request won’t workout for me as it won’t meet our performance expectations. So is there any alternate solution for this ?? Thanks :slight_smile:

I will ask again what’s the big problem you are trying to solve

Also consider being a good open source citizen and improve the fhir documentation