FHIR Chat · HAPI FHIR 1.5 Released · hapi

Stream: hapi

Topic: HAPI FHIR 1.5 Released


view this post on Zulip James Agnew (Apr 21 2016 at 13:34):

April 20, 2016 - HAPI FHIR 1.5 Released - The next release of HAPI has now been uploaded to the Maven repos and GitHub's releases section. This release corrects a security vulnerability as described below. All users are recommended to upgrade.

This release brings a number of bugfixes and a few bigger things. As always, the changelog has the full list of changes in this version. Some changes of note include:

  • This release fixes a security vulnerability in the XML parser. See GitHub Issue #339 for information.
  • This release adds support for the current draft STU3 structure definitions, known as FHIR 1.4.0 (or the Montreal Connectathon Snapshot). See the downloads page for information on the various versions of FHIR supported by HAPI FHIR.
  • A new JAX-RS based client has been added.
  • A Server Security Interceptor has been added.
  • The JPA server has been enhanced so that search results are now paged into the database instead of simply to memory. This makes the server much more scalable to supporting larger result sets, larger volumes of queries, and operation across multiple nodes in a cluster.

view this post on Zulip Josh Mandel (Apr 21 2016 at 14:10):

Thanks @James Agnew ! Quick question about "support for the current draft STU3 structure definitions" — is this instead of the DSTU2 resources? For example with the CLI, does a user choose between them? Or get separate API endpoints for DSTU2 vs FHIR 1.4?

view this post on Zulip James Agnew (Apr 21 2016 at 17:54):

@Josh Mandel This doesn't replace the DSTU2 resources. We basically ship 3 "structure" libraries with the core library (DSTU1, DSTU2, DSTU3) and applications can use any or all of them with the app. The matrix of supported versions of FHIR by various versions of HAPI is a bit painful to look at, but it's on this page

view this post on Zulip James Agnew (Apr 21 2016 at 17:55):

Also, sadly the library is already called "DSTU3" at this point. I feel like we are going to be a source of confusion re. the "DSTU" vs "STU" thing

view this post on Zulip Grahame Grieve (Apr 21 2016 at 19:50):

we can rename the library. I haven't got around to considering whether we should or not

view this post on Zulip James Agnew (Apr 21 2016 at 19:56):

imo proably not worth it. it'll be a small source of confusion, but less confusion than renaming the library and codebase would be at this point.

view this post on Zulip Josh Mandel (Apr 21 2016 at 20:16):

Thanks -- the compatibility table helps, but I'm still not clear on which of these three structure libraries the CLI tool uses, for example (or is it all of them? Or is it configurable?) http://jamesagnew.github.io/hapi-fhir/doc_cli.html suggests just DSTU2 in the CLI.

view this post on Zulip James Agnew (Apr 21 2016 at 20:20):

Oh yeah, I need to update the CLI documentation. When we added the STU3 structures, we added a command line parameter so you can pick either STU2 or 3 (but not 1).

That's an example of an app that embeds multiple structures libraries, as it happens.

view this post on Zulip Rob Hausam (Apr 21 2016 at 21:01):

@James, is there documentation on how to update the jpaserver-example base to DSTU3 (and future versions)? We've talked about that before, including exposing multiple endpoints - but it would be good to have documentation to refer to if that's available (and the source code may be sufficient for that).

view this post on Zulip James Agnew (Apr 22 2016 at 03:04):

I should probably update the docs for that, yeah... There is an example config file in there for STU3, so if you know how to change the config file in web.xml you can do it, but new folks may not know how to do that.

view this post on Zulip Rob Hausam (Apr 22 2016 at 05:10):

I saw the config file for STU3. And I think I know how to edit web.xml - presumably change the config file reference inside the context-param/param-value tags and then update the other references as appropriate for STU3? I haven't tried it yet, though.

view this post on Zulip James Agnew (Apr 22 2016 at 10:38):

Yup, that'd be it exactly. It should be that simple to get the endpoint running STU3.

You might also need to modify FhirTesterConfig.java to get the tester UI to point to the new endpoint

view this post on Zulip Grahame Grieve (Apr 25 2016 at 19:10):

James - a question for you

view this post on Zulip Grahame Grieve (Apr 25 2016 at 19:11):

I'm tightening up on the tests in the Reference implementation

view this post on Zulip Grahame Grieve (Apr 25 2016 at 19:12):

one standing problem is that almost all the tests use some files in the build somewhere

view this post on Zulip Grahame Grieve (Apr 25 2016 at 19:12):

how should we set up the directory that they need?

view this post on Zulip Grahame Grieve (Apr 25 2016 at 19:12):

I can hard code it, or use a environment variable, but both are quite unsatisfactory

view this post on Zulip James Agnew (Apr 26 2016 at 01:01):

Is the idea that these tests live in the spec build but you want to get them into the HAPI one too so you need a way of making the path to these files a bit more abstract?

view this post on Zulip Grahame Grieve (Apr 26 2016 at 01:32):

well, it would be good if you could include the JUnit tests in the HAPI build too

view this post on Zulip Grahame Grieve (Apr 26 2016 at 01:32):

but right now, I just run them directly from in eclipse

view this post on Zulip Grahame Grieve (Apr 26 2016 at 01:32):

so where does the path to all the content come from?

view this post on Zulip James Agnew (Apr 26 2016 at 01:35):

What type of content are we talking? I guess the main problem is that HAPI's build doesn't have access to the spec directories when it's running in travis. All of the profile structures (StructureDefinition, ValueSet, CodeSystem) are on the classpath, but other stuff isn't so I'd have to do something to make it available

view this post on Zulip Grahame Grieve (Apr 26 2016 at 01:57):

well, I use two parts during testing:
build\tests
build\publish

view this post on Zulip Grahame Grieve (Apr 26 2016 at 01:58):

so yes, if you wanted to include them, that content would have to be present, or fetched from somewhere.

view this post on Zulip Grahame Grieve (Apr 26 2016 at 01:58):

but even if you don't want to include them in HAPI, how do I do it in the build alone?

view this post on Zulip Michael Lawley (May 07 2016 at 21:29):

HAPI doesn't like %-encoded operations - eg touchstone invokes /CodeSystem/%24lookup
This results in the message: Invalid request: The FHIR endpoint on this server does not know how to handle GET operation[CodeSystem/%24lookup] with parameters [[system, code]]

view this post on Zulip James Agnew (May 07 2016 at 21:30):

Ah interesting, thanks for the heads up, I'll have a look

view this post on Zulip Bryn Rhodes (May 07 2016 at 21:42):

I'm getting this error from the HAPI server through the client: ca.uhn.fhir.rest.server.exceptions.UnprocessableEntityException: HTTP 422 Unprocessable Entity: Resource requires an id, but none is present

view this post on Zulip Bryn Rhodes (May 07 2016 at 21:42):

Even though when I run that same POST through Postman it works fine.

view this post on Zulip Bryn Rhodes (May 07 2016 at 21:42):

Any thoughts?

view this post on Zulip James Agnew (May 07 2016 at 22:52):

Fascinating.... What is the method chain you're calling with the client, and does the resource object actually have an ID? I'll try and reproduce..

view this post on Zulip Bryn Rhodes (May 08 2016 at 00:49):

ca.uhn.fhir.rest.server.exceptions.UnprocessableEntityException: HTTP 422 Unprocessable Entity: Resource requires an id, but none is present

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
at ca.uhn.fhir.rest.server.exceptions.BaseServerResponseException.newInstance(BaseServerResponseException.java:272)
at ca.uhn.fhir.rest.client.BaseClient.invokeClient(BaseClient.java:290)
at ca.uhn.fhir.rest.client.GenericClient$BaseClientExecutable.invoke(GenericClient.java:680)
at ca.uhn.fhir.rest.client.GenericClient$CreateInternal.execute(GenericClient.java:794)
at ca.uhn.fhir.rest.client.GenericClient$CreateInternal.execute(GenericClient.java:738)
at org.cqframework.cql.data.fhir.FhirMeasureEvaluator.evaluate(FhirMeasureEvaluator.java:51)
at org.cqframework.cql.data.fhir.TestFhirMeasureEvaluator.TestCBP(TestFhirMeasureEvaluator.java:48)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:714)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
at org.testng.TestRunner.privateRun(TestRunner.java:767)
at org.testng.TestRunner.run(TestRunner.java:617)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:348)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:343)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:305)
at org.testng.SuiteRunner.run(SuiteRunner.java:254)

view this post on Zulip Bryn Rhodes (May 08 2016 at 00:50):

And no, the resource doesn't have an Id, but isn't that the requirement on a post? Interestingly, the same code worked when I didn't have any entities in the bundle. It started failing when I added resources to the bundle.

view this post on Zulip James Agnew (May 08 2016 at 13:02):

Yeah, that sounds right, I'm sure this is some quirk on the server that needs fixing. :)

Hmm.. Can you share the client method chain you're using to call it, just so I can have a go at reproducing in a unit test? e.g. client.create().resource(foo).execute();And details about what you're passing in would be useful too (e.g. bundle wth 2 patients, both have no id)

view this post on Zulip Bryn Rhodes (May 08 2016 at 13:30):

Here's the method chain:

view this post on Zulip Bryn Rhodes (May 08 2016 at 13:30):

fhirClient.create().resource(evaluatedResources).execute();

view this post on Zulip Bryn Rhodes (May 08 2016 at 13:32):

And here's the bundle in that evaluatedResources variable:

view this post on Zulip Bryn Rhodes (May 08 2016 at 13:32):

{
"resourceType":"Bundle",
"type":"collection",
"entry":[
{
"fullUrl":"http://fhirtest.uhn.ca/baseDstu3/Observation/res0016/_history/1",
"resource":{
"resourceType":"Observation",
"id":"res0016",
"meta":{
"versionId":"1",
"lastUpdated":"2016-05-05T03:16:52.296-04:00"
},
"status":"final",
"code":{
"coding":[
{
"system":"http://loinc.org",
"code":"8480-6",
"display":"Systolic blood pressure"
}
]
},
"subject":{
"reference":"Patient/pat004",
"display":"Fred"
},
"effectiveDateTime":"2015-06-11",
"valueQuantity":{
"value":133,
"unit":"3092008",
"system":"http://unitsofmeasure.org",
"code":"mm[Hg]"
}
}
},
{
"fullUrl":"http://fhirtest.uhn.ca/baseDstu3/Observation/res0018/_history/1",
"resource":{
"resourceType":"Observation",
"id":"res0018",
"meta":{
"versionId":"1",
"lastUpdated":"2016-05-05T03:16:52.922-04:00"
},
"status":"final",
"code":{
"coding":[
{
"system":"http://loinc.org",
"code":"8480-6",
"display":"Systolic blood pressure"
}
]
},
"subject":{
"reference":"Patient/pat004",
"display":"Fred"
},
"effectiveDateTime":"2015-11-11",
"valueQuantity":{
"value":141,
"unit":"3092008",
"system":"http://unitsofmeasure.org",
"code":"mm[Hg]"
}
}
},
{
"fullUrl":"http://fhirtest.uhn.ca/baseDstu3/Observation/res0001/_history/2",
"resource":{
"resourceType":"Observation",
"id":"res0001",
"meta":{
"versionId":"2",
"lastUpdated":"2016-05-05T03:16:47.800-04:00"
},
"status":"final",
"code":{
"coding":[
{
"system":"http://loinc.org",
"code":"8480-6",
"display":"Systolic blood pressure"
}
]
},
"subject":{
"reference":"Patient/pat001",
"display":"Jim"
},
"effectiveDateTime":"2015-09-10",
"valueQuantity":{
"value":155,
"unit":"mmHg",
"system":"http://unitsofmeasure.org",
"code":"mm[Hg]"
}
}
},
{
"fullUrl":"http://fhirtest.uhn.ca/baseDstu3/Observation/res0021/_history/1",
"resource":{
"resourceType":"Observation",
"id":"res0021",
"meta":{
"versionId":"1",
"lastUpdated":"2016-05-05T03:16:53.928-04:00"
},
"status":"final",
"code":{
"coding":[
{
"system":"http://loinc.org",
"code":"8480-6",
"display":"Systolic blood pressure"
}
]
},
"subject":{
"reference":"Patient/pat005",
"display":"Ada"
},
"effectiveDateTime":"2016-02-11",
"valueQuantity":{
"value":148,
"unit":"3092008",
"system":"http://unitsofmeasure.org",
"code":"mm[Hg]"
}
}
},
{
"fullUrl":"http://fhirtest.uhn.ca/baseDstu3/Observation/res0003/_history/1",
"resource":{
"resourceType":"Observation",
"id":"res0003",
"meta":{
"versionId":"1",
"lastUpdated":"2016-05-05T03:16:48.457-04:00"
},
"status":"final",
"code":{
"coding":[
{
"system":"http://loinc.org",
"code":"8480-6",
"display":"Systolic blood pressure"
}
]
},
"subject":{
"reference":"Patient/pat001",
"display":"Jim"
},
"effectiveDateTime":"2016-01-10",
"valueQuantity":{
"value":138,
"unit":"3092008",
"system":"http://unitsofmeasure.org",
"code":"mm[Hg]"
}
}
},
{
"fullUrl":"http://fhirtest.uhn.ca/baseDstu3/Observation/res0023/_history/1",
"resource":{
"resourceType":"Observation",
"id":"res0023",
"meta":{
"versionId":"1",
"lastUpdated":"2016-05-05T03:16:55.084-04:00"
},
"status":"final",
"code":{
"coding":[
{
"system":"http://loinc.org",
"code":"8480-6",
"display":"Systolic blood pressure"
}
]
},
"subject":{
"reference":"Patient/pat005",
"display":"Ada"
},
"effectiveDateTime":"2015-12-11",
"valueQuantity":{
"value":140,
"unit":"3092008",
"system":"http://unitsofmeasure.org",
"code":"mm[Hg]"
}
}
},
{
"fullUrl":"http://fhirtest.uhn.ca/baseDstu3/Observation/res0006/_history/1",
"resource":{
"resourceType":"Observation",
"id":"res0006",
"meta":{
"versionId":"1",
"lastUpdated":"2016-05-05T03:16:49.312-04:00"
},
"status":"final",
"code":{
"coding":[
{
"system":"http://loinc.org",
"code":"8480-6",
"display":"Systolic blood pressure"
}
]
},
"subject":{
"reference":"Patient/pat002",
"display":"Chewie"
},
"effectiveDateTime":"2016-04-10",
"valueQuantity":{
"value":141,
"unit":"3092008",
"system":"http://unitsofmeasure.org",
"code":"mm[Hg]"
}
}
},
{
"fullUrl":"http://fhirtest.uhn.ca/baseDstu3/Observation/res0008/_history/1",
"resource":{
"resourceType":"Observation",
"id":"res0008",
"meta":{
"versionId":"1",
"lastUpdated":"2016-05-05T03:16:49.886-04:00"
},
"status":"final",
"code":{
"coding":[
{
"system":"http://loinc.org",
"code":"8480-6",
"display":"Systolic blood pressure"
}
]
},
"subject":{
"reference":"Patient/pat002",
"display":"Chewie"
},
"effectiveDateTime":"2015-08-10",
"valueQuantity":{
"value":140,
"unit":"3092008",
"system":"http://unitsofmeasure.org",
"code":"mm[Hg]"
}
}
},
{
"fullUrl":"http://fhirtest.uhn.ca/baseDstu3/Observation/res0011/_history/1",
"resource":{
"resourceType":"Observation",
"id":"res0011",
"meta":{
"versionId":"1",
"lastUpdated":"2016-05-05T03:16:50.746-04:00"
},
"status":"final",
"code":{
"coding":[
{
"system":"http://loinc.org",
"code":"8480-6",
"display":"Systolic blood pressure"
}
]
},
"subject":{
"reference":"Patient/pat003",
"display":"Esther"
},
"effectiveDateTime":"2015-12-10",
"valueQuantity":{
"value":144,
"unit":"3092008",
"system":"http://unitsofmeasure.org",
"code":"mm[Hg]"
}
}
},
{
"fullUrl":"http://fhirtest.uhn.ca/baseDstu3/Observation/res0013/_history/1",
"resource":{
"resourceType":"Observation",
"id":"res0013",
"meta":{
"versionId":"1",
"lastUpdated":"2016-05-05T03:16:51.339-04:00"
},
"status":"final",
"code":{
"coding":[
{
"system":"http://loinc.org",
"code":"8480-6",
"display":"Systolic blood pressure"
}
]
},
"subject":{
"reference":"Patient/pat003",
"display":"Esther"
},
"effectiveDateTime":"2016-02-10",
"valueQuantity":{
"value":170,
"unit":"3092008",
"system":"http://unitsofmeasure.org",
"code":"mm[Hg]"
}
}
},
{
"fullUrl":"http://fhirtest.uhn.ca/baseDstu3/Observation/res0017/_history/1",
"resource":{
"res

view this post on Zulip James Agnew (May 08 2016 at 15:28):

@Bryn Rhodes Zulip helpfully cut off your resource. Could you email me the text at jamesagnew@gmail.com ?

view this post on Zulip Bryn Rhodes (May 08 2016 at 15:50):

What about a Postman collection?

view this post on Zulip Bryn Rhodes (May 08 2016 at 15:51):

https://www.getpostman.com/collections/dc41e10601d01b7b6354


Last updated: Apr 12 2022 at 19:14 UTC