FHIR Chat · FHIRValidationError · implementers

Stream: implementers

Topic: FHIRValidationError


view this post on Zulip Vasanth Thirugnanam (Mar 27 2019 at 18:56):

from fhirclient import client
settings = {
'app_id': 'first_fhir',
'api_base': 'https://syntheticmass.mitre.org/fhir/'
#https://syntheticmass.mitre.org/fhir/Patient/58b3663e3425def0f0f6a229/$everything
}
smart = client.FHIRClient(settings=settings)
import fhirclient.models.observation as o
obs = o.Observation.where(struct={'subject': 'Patient/58b3663e3425def0f0f69562','code': 'http://loinc.org|29463-7','status':'final'})

obs.perform(smart.server)

I GET THE FOLLOWING ERROR: could some one please help?
FHIRValidationError: {root}:
entry.0:
resource:
Superfluous entry "encounter" in data for <fhirclient.models.observation.Observation object at 0x0000026A163A85C0>ErrorError

view this post on Zulip Michele Mottini (Mar 27 2019 at 19:24):

Seems a FHIR version mismatch between your client and the Synthea server (that uses version 1.8)

view this post on Zulip Vasanth Thirugnanam (Mar 27 2019 at 19:25):

hmm. do you recommend a fix?

view this post on Zulip Jean Duteau (Mar 27 2019 at 19:26):

hmm. do you recommend a fix?

make sure you're using the proper version of FHIR in your client

view this post on Zulip Vasanth Thirugnanam (Mar 27 2019 at 19:27):

is version an attribute I have to set in the settings?

view this post on Zulip Michele Mottini (Mar 27 2019 at 19:30):

Don't know, not familiar to Java library - either a setting or a different version of the library
(note though that typically libraries support either DSTU2 or STU3 and Synthea is using an in-between version...)

view this post on Zulip Vasanth Thirugnanam (Mar 27 2019 at 19:40):

So, it is not a common error that one faces... let me try to google on this ... Thanks for your help.

view this post on Zulip Jean Duteau (Mar 27 2019 at 19:46):

So, it is not a common error that one faces... let me try to google on this ... Thanks for your help.

I doubt you'll find anything on google. You need to get a different version of your library that supports the proper FHIR version that Synthea is using.

view this post on Zulip Vasanth Thirugnanam (Mar 27 2019 at 19:49):

Thanks... I will look for fhir libraries from Synthea.

view this post on Zulip Vasanth Thirugnanam (Mar 27 2019 at 19:57):

I referred to documentation for the package and found this supported versions...
Version FHIR
3.0.0 3.0.0 (STU-3)
x.x 1.8.0 (STU-3 Ballot, Jan 2017)
x.x 1.6.0 (STU-3 Ballot, Sep 2016)
1.0.3 1.0.2 (DSTU 2)
1.0 1.0.1 (DSTU 2)
0.5 0.5.0.5149 (DSTU 2 Ballot, May 2015)
0.0.4 0.0.82.2943 (DSTU 1)
0.0.3 0.0.82.2943 (DSTU 1)
0.0.2 0.0.82.2943 (DSTU 1)

view this post on Zulip Vasanth Thirugnanam (Mar 28 2019 at 04:45):

Any recommendations for a Python package to use with Fhir?

view this post on Zulip Vasanth Thirugnanam (Mar 28 2019 at 18:47):

While I did not get a compatible python package, I tried to removed the encounter references from the response.json() and convert it as bundle object to access the elements, and did not throw any error. I hope it will not be an issue to use the data without <encounter>. Thanks for all your help.

view this post on Zulip Michele Mottini (Mar 28 2019 at 18:49):

If you are using the Java library you can ask for help in the #hapi stream - there must be a way to specify the expected version for the client

view this post on Zulip Vasanth Thirugnanam (Mar 28 2019 at 19:00):

If you are using the Java library you can ask for help in the #hapi stream - there must be a way to specify the expected version for the client

There as a few #hapi streams... is there a way for you to send me message with the correct stream. Thanks so much for your help.

view this post on Zulip Lloyd McKenzie (Mar 28 2019 at 19:08):

There's only one #hapi stream here. If you click on the link, it will take you there. (There are a bunch of threads in the stream though.)

view this post on Zulip Jean Duteau (Mar 28 2019 at 19:10):

That seems like a hack - you basically removed the content that is valid in one version because it isn't valid in your version. You are going to encounter this over and over again because the resources have changed between versions. You're better off spending some time finding out how you can use the proper version of your client code.

view this post on Zulip Vasanth Thirugnanam (Mar 28 2019 at 19:12):

I completely agree @Jean Duteau . I am still searching for the right version of the package, I hope #hapi has the answer. I will find out.
:slight_smile:

view this post on Zulip Vasanth Thirugnanam (Mar 28 2019 at 19:16):

There's only one #hapi stream here. If you click on the link, it will take you there. (There are a bunch of threads in the stream though.)

Thanks so much Lloyd. I was looking for streams under #implementers and found few streams with #HAPI**** (in caps). also mistook a thread as stream... learning the terminologies... Thanks for you help...

view this post on Zulip Lloyd McKenzie (Mar 28 2019 at 19:18):

No worries. There's a learning curve for everything - even Zulip :)

view this post on Zulip Pascal Pfiffner (Mar 28 2019 at 19:31):

Sounds to me like @Vasanth Thirugnanam is using the SMART Python library, not HAPI, so the hapi stream may not be that helpful. :)

view this post on Zulip Pascal Pfiffner (Mar 28 2019 at 19:32):

@Vasanth Thirugnanam , the Python library with support for FHIR 1.8.0 was not officially released, you have to checkout the commit tagged with FHIR-1.8.0 to get the right version (https://github.com/smart-on-fhir/client-py/releases/tag/FHIR-1.8.0).

view this post on Zulip Vasanth Thirugnanam (Mar 28 2019 at 19:33):

@Pascal Pfiffner Super ... this will make my life easier...


Last updated: Apr 12 2022 at 19:14 UTC