Hi everyone, Our team at ICRC is facing an issue when trying to create an ObsGroup using the FHIR API.
Currently, the validation for Observation requires it to have a value, but in OpenMRS, ObsGroups are inherently valueless — they only group related child observations.
For context, in our offline Android app, we first create the parent observation (the group) and then the child observations that reference it using partOf.
Here’s a simplified example of what we’re sending:
Parent Observation (ObsGroup without value):
{
"resourceType": "Observation",
"id": "parent-observation",
"status": "final",
"code": { "text": "Vital Signs" }
}
Child Observation (references parent using partOf):
{
"resourceType": "Observation",
"status": "final",
"code": { "text": "Heart Rate" },
"valueQuantity": { "value": 80, "unit": "beats/minute" },
"partOf": [{ "reference": "Observation/parent-observation" }]
}
Has anyone worked around this validation issue for valueless parent Observations (ObsGroups)? Would it make sense to relax the FHIR validation or handle this mapping differently on the server side?
Thanks! — @parthfloyd & @jofrancisco (ICRC / OpenMRS Android team)