Is your feature request related to a problem? Please describe.
During connectathon, I noted that almost everyone was still using R4.
For almost all use cases, R4B should be backwards-compatible with R4.
R4 clients should be able to work with our R4B server.
However, one challenge we hit is that R4 clients are unable to parse our R4B CapabilityStatement due to a couple issues:
- https://www.hl7.org/fhir/capabilitystatement-definitions.html#CapabilityStatement.fhirVersion has a required binding to https://www.hl7.org/fhir/valueset-FHIR-version.html and 4.3.0 is not in that list
- https://www.hl7.org/fhir/capabilitystatement-definitions.html#CapabilityStatement.rest.resource.type has a required binding to https://www.hl7.org/fhir/valueset-resource-types.html and the new R4B resource types are not on that list
Describe the solution you'd like
If a client tries to retrieve our CapabilityStatement with an Accept header that indicates they are using version 4.0 (or 4.0.1), make the following changes to our generated CapabilityStatement:
- advertise 4.0.1 in the CapabilityStatement instead of 4.3.0
- omit resource types that didn’t exist in 4.0.1
Note that we cache these CapabilityStatements on a per-tenant basis, so for this to work I think we'd need to add the fhir version to the cache's key.
Describe alternatives you've considered
Always generate a 4.3.0 CapabilityStatement and suggest clients update to handle it.
Acceptance Criteria
- GIVEN a 5.0.0-SNAPSHOT server
AND a 4.x client (e.g. our fhir-client from 4.11.1)
WHEN the client invokes /metadata without specifying the fhirVersion
THEN it can successfully parse the response (i.e. only R4 resource types are present in the CapabilityStatement)
Also:
-
GIVEN a 5.0.0-SNAPSHOT server
AND /fhirserver/core/defaultFhirVersion is set to 4.0 (the default)
WHEN the client invokes /metadata without specifying the fhirVersion
THEN the CapabilityStatement says the server supports FHIR version 4.0.1
-
GIVEN a 5.0.0-SNAPSHOT server
AND /fhirserver/core/defaultFhirVersion is set to 4.0 (the default)
WHEN the client invokes /metadata with an accept header of application/fhir+json;fhirVersion=4.3
THEN the CapabilityStatement says the server supports FHIR version 4.3.0-cibuild
-
GIVEN a 5.0.0-SNAPSHOT server
AND /fhirserver/core/defaultFhirVersion is set to 4.3
WHEN the client invokes /metadata without specifying the fhirVersion
THEN the CapabilityStatement says the server supports FHIR version 4.3.0-cibuild
-
GIVEN a 5.0.0-SNAPSHOT server
AND /fhirserver/core/defaultFhirVersion is set to 4.3
WHEN the client invokes /metadata with an accept header of application/fhir+json;fhirVersion=4.0
THEN the CapabilityStatement says the server supports FHIR version 4.0.1
Additional context
some related discussion at https://chat.fhir.org/#narrow/stream/179166-implementers/topic/R4B.20technical.20corrections
Is your feature request related to a problem? Please describe.
During connectathon, I noted that almost everyone was still using R4.
For almost all use cases, R4B should be backwards-compatible with R4.
R4 clients should be able to work with our R4B server.
However, one challenge we hit is that R4 clients are unable to parse our R4B CapabilityStatement due to a couple issues:
Describe the solution you'd like
If a client tries to retrieve our CapabilityStatement with an Accept header that indicates they are using version 4.0 (or 4.0.1), make the following changes to our generated CapabilityStatement:
Note that we cache these CapabilityStatements on a per-tenant basis, so for this to work I think we'd need to add the fhir version to the cache's key.
Describe alternatives you've considered
Always generate a 4.3.0 CapabilityStatement and suggest clients update to handle it.
Acceptance Criteria
AND a 4.x client (e.g. our fhir-client from 4.11.1)
WHEN the client invokes /metadata without specifying the fhirVersion
THEN it can successfully parse the response (i.e. only R4 resource types are present in the CapabilityStatement)
Also:
GIVEN a 5.0.0-SNAPSHOT server
AND
/fhirserver/core/defaultFhirVersionis set to 4.0 (the default)WHEN the client invokes /metadata without specifying the fhirVersion
THEN the CapabilityStatement says the server supports FHIR version 4.0.1
GIVEN a 5.0.0-SNAPSHOT server
AND
/fhirserver/core/defaultFhirVersionis set to 4.0 (the default)WHEN the client invokes /metadata with an accept header of
application/fhir+json;fhirVersion=4.3THEN the CapabilityStatement says the server supports FHIR version 4.3.0-cibuild
GIVEN a 5.0.0-SNAPSHOT server
AND
/fhirserver/core/defaultFhirVersionis set to 4.3WHEN the client invokes /metadata without specifying the fhirVersion
THEN the CapabilityStatement says the server supports FHIR version 4.3.0-cibuild
GIVEN a 5.0.0-SNAPSHOT server
AND
/fhirserver/core/defaultFhirVersionis set to 4.3WHEN the client invokes /metadata with an accept header of
application/fhir+json;fhirVersion=4.0THEN the CapabilityStatement says the server supports FHIR version 4.0.1
Additional context
some related discussion at https://chat.fhir.org/#narrow/stream/179166-implementers/topic/R4B.20technical.20corrections