FHIR Chat · convert questionnaire response to observation · questionnaire

Stream: questionnaire

Topic: convert questionnaire response to observation


view this post on Zulip Code And Choke (Oct 09 2019 at 15:39):

Hello, while trying to convert a questionnaire response to an observation, I encounter a problem while setting the value of observation following the formular:

Observation.value[x] - set to QuestionnaireResponse.item.answer.value[x]

My approach is to get an individual QuestionnaireResponse.QuestionnaireItemComponent and map its value to the observation's value like this:

observation.setValue(responseItem.getAnswer().get(0).getValue());

However, I get the following error: java.lang.Error: Not the right type for Observation.value[x]: Coding

Does anybody have an idea?

Best regard

view this post on Zulip Lloyd McKenzie (Oct 09 2019 at 15:49):

Observation.value doesn't allow Coding - just 'code' or 'CodeableConcept'. You'll need to convert the COding into a CodeableConcept.


Last updated: Apr 12 2022 at 19:14 UTC