Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fhir-client] Document/support setting the fhirVersion mime-type parameter on requests #3256

Closed
lmsurpre opened this issue Jan 27, 2022 · 2 comments
Assignees
Labels
enhancement New feature or request P3 Priority 3 - Nice To Have

Comments

@lmsurpre
Copy link
Member

lmsurpre commented Jan 27, 2022

Is your feature request related to a problem? Please describe.
From https://hl7.org/fhir/http.html#version-parameter

This parameter can be used anywhere that the FHIR Mime type is used. When used in an HTTP request, the version parameter may be used on either the Content-Type header, or the Accept header, or both, and applies to the entire interaction

For R4B, via #3192 and #3242, we're gonna let this parameter drive server behavior, so we definitely need a way to set it from the client.

Describe the solution you'd like

  1. if not supported already, add a config property to set the default value across all requests
  2. document how to set it

Describe alternatives you've considered
Make it possible to set on a per-request basis

Acceptance Criteria

  1. GIVEN a client with fhirclient.default.mimetype = application/fhir+json; fhirVersion=4.0
    WHEN the request is made to the server
    THEN any applicable Accept or Content-Type header values have the fhirVersion mime type parameter set to 4.0

  2. GIVEN a client with fhirclient.default.mimetype = application/fhir+json; fhirVersion=4.3 (the default)
    WHEN the request is made to the server
    THEN any applicable Accept or Content-Type header values have the fhirVersion mime type parameter set to 4.3

Additional context

@lmsurpre lmsurpre added the enhancement New feature or request label Jan 27, 2022
@lmsurpre lmsurpre added the P3 Priority 3 - Nice To Have label Feb 7, 2022
@lmsurpre lmsurpre self-assigned this Jun 1, 2022
@lmsurpre
Copy link
Member Author

lmsurpre commented Jun 2, 2022

It turns out we already support setting the default FHIR version from fhir-client.
I'm not sure how commonly we'd need to set the fhirVersion on a per-request basis, and so I'm updating the description and acceptance criteria to remove that part of it.

If needed, that can be a separate issue.

lmsurpre added a commit that referenced this issue Jun 2, 2022
and document how to set it via the `fhirclient.default.mimetype`
configuration property (PROPNAME_DEFAULT_MIMETYPE)

Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
lmsurpre added a commit that referenced this issue Jun 2, 2022
and document how to set it via the `fhirclient.default.mimetype`
configuration property (PROPNAME_DEFAULT_MIMETYPE)

Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
lmsurpre added a commit that referenced this issue Jun 6, 2022
issue #3256 - change the default fhirclient MIME type to specify fhirVersion 4.3
punktilious added a commit that referenced this issue Aug 12, 2022
…type

Signed-off-by: Robin Arnold <robin.arnold@ibm.com>
lmsurpre added a commit that referenced this issue Aug 12, 2022
issue #3256 added unit tests to support QA of FHIRClient default mime…
@punktilious
Copy link
Collaborator

Confirmed that when setting

fhirclient.default.mimetype = application/fhir+json; fhirVersion=4.3

On the server side we see:

[25/08/2022, 11:31:33:934 UTC] 0000002a FHIRHttpServl 3   getHeaders("Content-Type") : [application/fhir+json;fhirversion=4.3]
[25/08/2022, 11:31:33:934 UTC] 0000002a FHIRHttpServl 3   getHeaders("Accept") : [application/fhir+json; fhirVersion=4.3]

and when setting

fhirclient.default.mimetype = application/fhir+json; fhirVersion=4.0
[25/08/2022, 12:06:12:611 UTC] 00000024 FHIRHttpServl 3   getHeaders("Content-Type") : [application/fhir+json;fhirversion=4.0]
[25/08/2022, 12:06:12:611 UTC] 00000024 FHIRHttpServl 3   getHeaders("Accept") : [application/fhir+json; fhirVersion=4.0]

It is noted that for Content-Type, the fhirVersion header value gets lower-cased to become fhirversion, but these parameters are case-insensitive according to the spec and the MediaType implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request P3 Priority 3 - Nice To Have
Projects
None yet
Development

No branches or pull requests

2 participants