Ensure that older DSTU3 versions use the legacy mime types #520

Merged
merged 1 commit into from Dec 10, 2016

Conversation

Projects
None yet
3 participants
@lawley
Contributor

lawley commented Nov 30, 2016

For dstu3 structures corresponding to FHIR version 1.4.0 (eg the Baltimore / May2016 snapshot), ensure that the legacy mime types are used instead of the newer ones.

@coveralls

This comment has been minimized.

Show comment
Hide comment
@coveralls

coveralls Nov 30, 2016

Coverage Status

Coverage increased (+0.008%) to 87.68% when pulling 8846477 on aehrc:feature/legacyContentTypeFHIR140 into a9d7b8d on jamesagnew:master.

Coverage Status

Coverage increased (+0.008%) to 87.68% when pulling 8846477 on aehrc:feature/legacyContentTypeFHIR140 into a9d7b8d on jamesagnew:master.

@jamesagnew jamesagnew merged commit 47ea6c3 into jamesagnew:master Dec 10, 2016

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage increased (+0.008%) to 87.68%
Details
@jamesagnew

This comment has been minimized.

Show comment
Hide comment
@jamesagnew

jamesagnew Dec 10, 2016

Owner

Thanks for the PR. I've merged it!

I'm going to check in a little modification to this, basically moving the version string that's pulled from the model out of RestulServerUtils and pulling it right up into the FhirDstu3 class. That should preserve your fix, and have the additional benefit that clients and servers will correctly report "1.4.0" if you're using that structures JAR.

Please feel free to re-open this if the fix doesn't work for you.

Owner

jamesagnew commented Dec 10, 2016

Thanks for the PR. I've merged it!

I'm going to check in a little modification to this, basically moving the version string that's pulled from the model out of RestulServerUtils and pulling it right up into the FhirDstu3 class. That should preserve your fix, and have the additional benefit that clients and servers will correctly report "1.4.0" if you're using that structures JAR.

Please feel free to re-open this if the fix doesn't work for you.

jamesagnew added a commit that referenced this pull request Dec 11, 2016

@lawley

This comment has been minimized.

Show comment
Hide comment
@lawley

lawley Dec 11, 2016

Contributor

Hi James, sadly the introduction of a new method in the structures library won't work for our case because we are tied to an old version of the structures library (b8f1f39) and thus we need a patch that doesn't change hapi-fhir-structures-dstu3 but only hapi-fhir-base.

Otherwise we get:

java.lang.AbstractMethodError: org.hl7.fhir.dstu3.hapi.ctx.FhirDstu3.getVersionString()Ljava/lang/String;
	at ca.uhn.fhir.rest.client.api.HttpClientUtil.createUserAgentString(HttpClientUtil.java:33)
	at ca.uhn.fhir.rest.client.apache.ApacheHttpClient.addHeadersToRequest(ApacheHttpClient.java:143)
	at ca.uhn.fhir.rest.client.apache.ApacheHttpClient.createGetRequest(ApacheHttpClient.java:132)
	at ca.uhn.fhir.rest.client.BaseHttpClientInvocation.createHttpRequest(BaseHttpClientInvocation.java:77)
	at ca.uhn.fhir.rest.method.HttpGetClientInvocation.asHttpRequest(HttpGetClientInvocation.java:112)
	at ca.uhn.fhir.rest.client.BaseClient.invokeClient(BaseClient.java:226)
	at ca.uhn.fhir.rest.client.GenericClient$BaseClientExecutable.invoke(GenericClient.java:637)
	at ca.uhn.fhir.rest.client.GenericClient$FetchConformanceInternal.execute(GenericClient.java:929)
	at ca.uhn.fhir.rest.client.RestfulClientFactory.validateServerBase(RestfulClientFactory.java:302)
	at ca.uhn.fhir.rest.client.RestfulClientFactory.validateServerBaseIfConfiguredToDoSo(RestfulClientFactory.java:203)
	at ca.uhn.fhir.rest.client.BaseClient.invokeClient(BaseClient.java:189)
	at ca.uhn.fhir.rest.client.BaseClient.fetchResourceFromUrl(BaseClient.java:121)
Contributor

lawley commented Dec 11, 2016

Hi James, sadly the introduction of a new method in the structures library won't work for our case because we are tied to an old version of the structures library (b8f1f39) and thus we need a patch that doesn't change hapi-fhir-structures-dstu3 but only hapi-fhir-base.

Otherwise we get:

java.lang.AbstractMethodError: org.hl7.fhir.dstu3.hapi.ctx.FhirDstu3.getVersionString()Ljava/lang/String;
	at ca.uhn.fhir.rest.client.api.HttpClientUtil.createUserAgentString(HttpClientUtil.java:33)
	at ca.uhn.fhir.rest.client.apache.ApacheHttpClient.addHeadersToRequest(ApacheHttpClient.java:143)
	at ca.uhn.fhir.rest.client.apache.ApacheHttpClient.createGetRequest(ApacheHttpClient.java:132)
	at ca.uhn.fhir.rest.client.BaseHttpClientInvocation.createHttpRequest(BaseHttpClientInvocation.java:77)
	at ca.uhn.fhir.rest.method.HttpGetClientInvocation.asHttpRequest(HttpGetClientInvocation.java:112)
	at ca.uhn.fhir.rest.client.BaseClient.invokeClient(BaseClient.java:226)
	at ca.uhn.fhir.rest.client.GenericClient$BaseClientExecutable.invoke(GenericClient.java:637)
	at ca.uhn.fhir.rest.client.GenericClient$FetchConformanceInternal.execute(GenericClient.java:929)
	at ca.uhn.fhir.rest.client.RestfulClientFactory.validateServerBase(RestfulClientFactory.java:302)
	at ca.uhn.fhir.rest.client.RestfulClientFactory.validateServerBaseIfConfiguredToDoSo(RestfulClientFactory.java:203)
	at ca.uhn.fhir.rest.client.BaseClient.invokeClient(BaseClient.java:189)
	at ca.uhn.fhir.rest.client.BaseClient.fetchResourceFromUrl(BaseClient.java:121)
@jamesagnew

This comment has been minimized.

Show comment
Hide comment
@jamesagnew

jamesagnew Dec 11, 2016

Owner

Aw nuts.

I'm assuming you're looking for support for FHIR 1.4.0 (Montreal snapshot)?

I've actually just added a new hapi-fhir-structures-dstu2.1 module which should bring stable support for that version. Would this be an option for you?

Either way, I'm sure we can find a way to get this working without changing the signature of IFhirVersion then

Owner

jamesagnew commented Dec 11, 2016

Aw nuts.

I'm assuming you're looking for support for FHIR 1.4.0 (Montreal snapshot)?

I've actually just added a new hapi-fhir-structures-dstu2.1 module which should bring stable support for that version. Would this be an option for you?

Either way, I'm sure we can find a way to get this working without changing the signature of IFhirVersion then

jamesagnew added a commit that referenced this pull request Dec 12, 2016

@jamesagnew

This comment has been minimized.

Show comment
Hide comment
@jamesagnew

jamesagnew Dec 12, 2016

Owner

...and now the current method should work too.

Owner

jamesagnew commented Dec 12, 2016

...and now the current method should work too.

@lawley

This comment has been minimized.

Show comment
Hide comment
@lawley

lawley Dec 12, 2016

Contributor

Yes, FHIR 1.4.0 May 2016 (Montreal) is the one.

I've just updated our code to use the new dstu2.1 structures and it looks good!

Contributor

lawley commented Dec 12, 2016

Yes, FHIR 1.4.0 May 2016 (Montreal) is the one.

I've just updated our code to use the new dstu2.1 structures and it looks good!

@lawley lawley deleted the aehrc:feature/legacyContentTypeFHIR140 branch Dec 12, 2016

@lawley lawley restored the aehrc:feature/legacyContentTypeFHIR140 branch Apr 12, 2017

@lawley lawley deleted the aehrc:feature/legacyContentTypeFHIR140 branch Apr 12, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment