Issues with FHIR General parameters
# support
l
When using
_format
or
_pretty
query params on a request I get a
400 Bad Request
error: Request:
Copy code
bash
GET https://api.medplum.com/fhir/R4/CarePlan?_count=30&_offset=0&_format=json&_pretty=true
Response:
Copy code
json
{
  "resourceType": "OperationOutcome",
  "issue": [
    {
      "severity": "error",
      "code": "invalid",
      "details": {
        "text": "Unknown search parameter: _format"
      }
    }
  ],
  "extension": [
    {
      "url": "https://medplum.com/fhir/StructureDefinition/tracing",
      "extension": [
        {
          "url": "requestId",
          "valueUuid": "58966f33-c251-4e8d-b0f4-d6e72150ba40"
        },
        {
          "url": "traceId",
          "valueUuid": "8b67f061-e6fc-4fc5-865c-df8e611f66ee"
        }
      ]
    }
  ]
}
These params are valid query params according to https://build.fhir.org/http.html#parameters so it should work, anyway I think it would be better if the request doesn't fail because of unrecognized params.
r
Hi @luis901101 - we're sorry but as you noted, we don't support the _format or _pretty search parameters at this time.
Three was a lot debate in the early days on Medplum about whether to silently ignore invalid search parameters, or to error. Ultimately we opted to error to give users more feedback
l
I see, but in this case they are valid parameters according to FHIR, I understand Medplum doesn't support it yet, but the params are valid, and according to the docs Medplum is based on the FHIR API so it's confusing
So far Medplum looks great and in fact I'm moving from another FHIR based backend to Medplum and it's sad to find that all my search requests fails because of this simplicity 😢
c
Fix is under review: https://github.com/medplum/medplum/pull/3993 Sorry for the delay, thanks @luis901101 ! 🙏
This is now live on production. It will be included in release 3.0.4 later today.