fhir-fli / fhir_at_rest

Builds on basic FHIR package to allow easy creation of RESTful calls to a FHIR server or FHIR API.
MIT License
0 stars 3 forks source link

Changed `_format` and `_pretty` params to be optional. #1

Closed luis901101 closed 7 months ago

luis901101 commented 8 months ago

Hi, first of all thanks for this amazing package 👌.

This PR is only to make the general parameters _format and pretty optional, so the request doesn't include these params unless the dev states it. The idea is to keep the request as simple as possible having only what's necessary, moreover most of the FHIR backends (if not all) already uses json responses by default, so no need to specify it, it should be enough to state in the documentation that this package doesn't support XML. By the way I recently had a bad experience with Medplum API which didn't support _format nor _pretty general params and the requests were bad request error 400, check here: Medplum #3975, despite they already fixed it, I still consider letting these params as optional is better.

I leave it for your consideration.

Dokotela commented 8 months ago

I don't have any problem leaving out the _pretty. The problem is that I've certainly used FHIR servers where the default was XML (as XML was the original FHIR format, and a lot of the older FHIR developers seem to prefer it). This is especially true if you expand from FHIR into FHIR Mapping or CQL. I appreciate the input, and like I said, happy to change the _pretty, I agree that's definitely not necessary. But I'll have to think about the _format.