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

Support for MIME-type parameter fhirVersion #896

Closed
lmsurpre opened this issue Apr 6, 2020 · 1 comment
Closed

Support for MIME-type parameter fhirVersion #896

lmsurpre opened this issue Apr 6, 2020 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@lmsurpre
Copy link
Member

lmsurpre commented Apr 6, 2020

Is your feature request related to a problem? Please describe.
Conformance.md reads:

The IBM FHIR Server supports only version 4.0.1 of the specification and presently has no support for the MIME-type parameter fhirVersion.

Currently, we just drop the parameter from all requests. However, a better behavior would be to reject requests that include the fhirVersion parameter with the wrong fhirVersion.

Describe the solution you'd like
Since the server only supports version 4.0.1, it should reject requests for other fhirVersion values other than 4.0.1 and 4.0.

406 Not Acceptable is the appropriate response when the Accept header requests a format that the server does not support, and 415 Unsupported Media Type when the client posts a format that is not supported to the server.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
A description of the parameter and its meaning: https://www.hl7.org/fhir/versioning.html#mt-version

I would be great if we can get JAX-RS to handle this for us, but given that we'd also like to support application/fhir+json and application/fhir+json with no parameter, it might not be possible.

We should use this flavor of the MediaType constructor:
https://javaee.github.io/javaee-spec/javadocs/javax/ws/rs/core/MediaType.html#MediaType-java.lang.String-java.lang.String-java.util.Map-

QA Notes
Call an IBM FHIR Server API, passing the following HTTP header values:

  1. Accept: application/fhir+json; fhirVersion=4.0 [Valid]
  2. Content-Type: application/fhir+json; fhirVersion=4.0 [Valid]
  3. Accept: application/fhir+json; fhirVersion=3.0 [406 Not Acceptable]
  4. Content-Type: application/fhir+json; fhirVersion=3.0 [415 Unsupported Media Type]
@prb112 prb112 added the enhancement New feature or request label Feb 1, 2021
@tbieste tbieste self-assigned this May 24, 2021
tbieste added a commit that referenced this issue May 26, 2021
Signed-off-by: Troy Biesterfeld <tbieste@us.ibm.com>
tbieste added a commit that referenced this issue May 26, 2021
Signed-off-by: Troy Biesterfeld <tbieste@us.ibm.com>
tbieste added a commit that referenced this issue May 26, 2021
Signed-off-by: Troy Biesterfeld <tbieste@us.ibm.com>
tbieste added a commit that referenced this issue May 26, 2021
Signed-off-by: Troy Biesterfeld <tbieste@us.ibm.com>
tbieste added a commit that referenced this issue May 27, 2021
Signed-off-by: Troy Biesterfeld <tbieste@us.ibm.com>
@tbieste tbieste added this to the Sprint 2021-07 milestone May 27, 2021
tbieste added a commit that referenced this issue Jun 2, 2021
Signed-off-by: Troy Biesterfeld <tbieste@us.ibm.com>
tbieste added a commit that referenced this issue Jun 2, 2021
Signed-off-by: Troy Biesterfeld <tbieste@us.ibm.com>
tbieste added a commit that referenced this issue Jun 2, 2021
Signed-off-by: Troy Biesterfeld <tbieste@us.ibm.com>
tbieste added a commit that referenced this issue Jun 2, 2021
Signed-off-by: Troy Biesterfeld <tbieste@us.ibm.com>
tbieste added a commit that referenced this issue Jun 2, 2021
Signed-off-by: Troy Biesterfeld <tbieste@us.ibm.com>
tbieste added a commit that referenced this issue Jun 3, 2021
Issue #896 - Add checking for MIME-type parameter fhirVersion
@lmsurpre
Copy link
Member Author

lmsurpre commented Jun 4, 2021

Confirmed that using PUT or POST with a fhirVersion other than 4.0 or 4.0.1 results in a 415 Unsuported Media Type with an error like:

{
    "resourceType": "OperationOutcome",
    "issue": [
        {
            "severity": "fatal",
            "code": "invalid",
            "details": {
                "text": "FHIRRestServletRequestException: Invalid 'fhirVersion' parameter value in 'Content-Type' header; the following FHIR versions are supported: [4.0, 4.0.1]"
            }
        }
    ]
}

Also confirmed that a GET request with an Accept header with fhirVersion other than 4.0 or 4.0.1 results in a 406 Not Acceptable with a response like:

{
    "resourceType": "OperationOutcome",
    "issue": [
        {
            "severity": "fatal",
            "code": "invalid",
            "details": {
                "text": "FHIRRestServletRequestException: Invalid 'fhirVersion' parameter value in 'Accept' header; the following FHIR versions are supported: [4.0, 4.0.1]"
            }
        }
    ]
}

@lmsurpre lmsurpre closed this as completed Jun 4, 2021
tbieste added a commit that referenced this issue Jun 9, 2021
Signed-off-by: Troy Biesterfeld <tbieste@us.ibm.com>
tbieste added a commit that referenced this issue Jun 9, 2021
Signed-off-by: Troy Biesterfeld <tbieste@us.ibm.com>
tbieste added a commit that referenced this issue Jun 9, 2021
Signed-off-by: Troy Biesterfeld <tbieste@us.ibm.com>
tbieste added a commit that referenced this issue Jun 9, 2021
Issue #896 - Add checking for MIME-type parameter fhirVersion
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants