Closed j-frei closed 9 months ago
I think the problem is with the identifier data element. If you are using FHIR R4B, the identifier is not defined as an array for the QuestionnaireResponse resource.
Check the StructureDefinition at https://hl7.org/fhir/R4B/questionnaireresponse.html.
I tested as below and succeeded.
{
"resourceType": "QuestionnaireResponse",
"identifier": {
"system": "redcapid",
"value": "1"
},
"status": "completed",
"item": [
{
"linkId": "record_id",
"text": "Record ID",
"answer": [
{
"valueString": "1"
}
]
}
]
}
@berkant-k Indeed, you are right! I was not aware that something had changed from R4B->R5 for QR. Thank you for pointing this out!
Describe the bug The following Bundle cannot uploaded as expected. It states that the identifier should be a JSON object, but according to the FHIR cardinality on the identifier attribute, it should be a list of FHIR Identifier objects.
FHIR Bundle:
The error message is as follows:
Environment Which version of LinuxForHealth FHIR Server? 5.1.1 (based on the official Docker image)
To Reproduce Steps to reproduce the behavior:
curl -X POST -u fhiruser:change-password 'http://fhir-host/fhir-server/api/v4' -H 'Content-Type: application/fhir+json' --data @bundle.json
Expected behavior The operation should succeed.
HAPI FHIR accepts the bundle.
Additional context Replacing the list of identifiers by an identifier object is accepted by the server:
Modified files
Bundle: ```json { "resourceType": "Bundle", "type": "transaction", "entry": [ { "resource": { "resourceType": "QuestionnaireResponse", "identifier": { "system": "redcapid", "value": "1" } , "status": "completed", "item": [ { "linkId": "record_id", "text": "Record ID", "answer": [ { "valueString": "1" } ] } ] }, "request": { "method": "PUT", "url": "QuestionnaireResponse?identifier=redcapid|1" } } ] } ``` Response: ```json { "resourceType": "Bundle", "type": "transaction-response", "entry": [ { "response": { "id": "18ccf691c97-9a34a7ae-f4aa-4d96-9c5d-46fed2fd92dd", "status": "201", "location": "QuestionnaireResponse/18ccf691c97-9a34a7ae-f4aa-4d96-9c5d-46fed2fd92dd/_history/1", "etag": "W/\"1\"", "lastModified": "2024-01-03T13:00:21.529054Z", "outcome": { "resourceType": "OperationOutcome", "issue": [ { "severity": "warning", "code": "invariant", "details": { "text": "dom-6: A resource should have narrative for robust management" }, "expression": [ "QuestionnaireResponse" ] } ] } } } ] } ```