microsoft / fhir-server

A service that implements the FHIR standard
MIT License
1.21k stars 518 forks source link

Unhelpful error message when trying to post a Research Study #1446

Closed camila8 closed 4 years ago

camila8 commented 4 years ago

Describe the bug The error description below is not helpful.

{ "resourceType": "OperationOutcome", "id": "7b21177a664b724b85edc254066d5b9a", "issue": [ { "severity": "error", "code": "invalid", "diagnostics": "Error occurred when parsing model." } ] }

FHIR Version? R4

Data provider? Post in postman to our FHIR API

To Reproduce Steps to reproduce the behavior:

  1. Post Research Study with an invalid body: { "resourceType": "ResearchStudy", "id": "grouptest1", "title": "researchstudy1", "status": "active", "description": "this is testing a research study resource", "enrollment": "Group/069ca6e2-d0ea-4b32-a7f6-259f2cde38d8" }

Expected behavior For the error to tell me that enrollment is a list and the format is incorrect

Actual behavior useless error description

brendankowitz commented 4 years ago

Should be be improved with a recent checkin: #1417

camila8 commented 4 years ago

We are using the FHIR API in Azure. Did this change make it there yet? If not where should I place this issue so it gets updated in the Azure FHIR API.

brendankowitz commented 4 years ago

I'm inclined to close the issue here since this is fixed in our main branch.

I've verified the new diagnostics would be:

{
  "resourceType": "OperationOutcome",
  "id": "04f34399-8477-40cc-b529-08c3eac92fd7",
  "issue": [
    {
      "severity": "error",
      "code": "invalid",
      "diagnostics": "Error occurred when parsing model: 'Type checking the data: Since type Reference is not a primitive, it cannot have a value (at Resource.enrollment[0])'."
    }
  ]
}

This should be available in the managed service in 1-2 weeks

camila8 commented 4 years ago

great thanks!