Do you want to submit a request for change, improve documentation, or ask a question?
- request for change, and ask a question
If reporting a bug, please answer the following at minimum and add any additional information you think may be helpful
What is the current behavior?
After defining resolvers and my Database connection, I tried to insert a questionnaire.
If you take for example questionnaire as shown in here:
It has answerOption
:
"answerOption": [
{
"valueCoding": {
"code": "F"
}
},
{
"valueCoding": {
"code": "M"
}
}
]
But since schema requires other values to be not here we get error saying valueInteger
, valueString
and others are required.
What is the expected behavior?
As shown in [the documentation] (http://hl7.org/fhir/questionnaire.html#resource)
If a question has only two options which are valueCoding
, we should not have to define other values?
What are the steps to reproduce?
I tried a mutation to create a questionnaire with answerOption
. However, if I remove GraphQLNonNull
from the lines: https://github.com/Asymmetrik/graphql-fhir/blob/master/src/resources/4_0_0/schemas/questionnaireitemansweroption.schema.js#L47, it works fine. So, my question would be, if we define answerOption
, do we really need to define all those [valueCoding, valueInteger, valueDecimal, valueDate, valueTime, valueReference]
.
What OS are you using and what version of node.js and @asymmetrik/graphql-fhir are you running?
PS: If GraphQLNonNull
is not required according to HL7 FHIR R4 definitions, I can create a PR if you like.
Regards,
Suresh