FHIR Chat · Conflicting data types in bundle json schema · implementers

Stream: implementers

Topic: Conflicting data types in bundle json schema


view this post on Zulip Simone Heckmann (Jan 04 2018 at 12:43):

I have the following problem: When trying to populate the active element in a Patient resource, which is an entry in a Bundle, my tool (integration engine operating on the JSON schema for Bundle) errors due to a data type mismatch.

After some debugging, I found the cause of the problem:
All resources that have an active attribute use data type boolean, except for one: Account.
Account uses active with data type Period. Apparently the schema can't differentiate between these attributes, since Bundle.entry.resource is just an enumeration of all attributes of all resources. So the tool just picks the first active element it can find, which happens to be the one in Account.

Is that an issue that needs to be handled by the tool, or do we need to pay attention when building the spec to avoid such conflicts?

view this post on Zulip Simone Heckmann (Jan 04 2018 at 13:32):

I suppose the problem occurs when using generic JSON path language, because Bundle.entry.resource.active can't differentiate by resource type...

view this post on Zulip Lloyd McKenzie (Jan 04 2018 at 15:33):

Sounds like a limitation of the tooling/path language. It's certainly not something we would consider changing the models for - the same name in different contexts can mean very different things and can certainly have different data types.

view this post on Zulip Grahame Grieve (Jan 04 2018 at 20:51):

I'm not sure. I'll talk to the JSON schema tooling guys when I meet with them in a couple of months

view this post on Zulip Brian Postlethwaite (Jan 05 2018 at 23:11):

you should be able to cast to the type that you're interested in though

view this post on Zulip Brian Postlethwaite (Jan 05 2018 at 23:11):

(assuming FHIRPATH)


Last updated: Apr 12 2022 at 19:14 UTC