FHIR Chat · extension on one choice of polymorphic element · conformance

Stream: conformance

Topic: extension on one choice of polymorphic element


view this post on Zulip Brett Esler (Oct 25 2017 at 03:07):

Hi all - query on extending one of the datatype choices in an element for example; Patient.deceased[x] - would like to extend Patient.deceasedDateTime whilst still allowing Patient.deaceasedBoolean (with no extension). I could not work out how to explicitly do this... do I need to extend deceased[x] then add constraint or is there a direct way to do this with a profile?

view this post on Zulip Lloyd McKenzie (Oct 25 2017 at 03:15):

In R4 draft and forward, if your profile references Patient.deceasedDateTime, whatever you say will be presumed to be about that particular type slice and will in no way prevent Patient.deceasedBoolean from being present. (That wasn't the inference of all systems in R3 and prior.)

view this post on Zulip Brett Esler (Oct 25 2017 at 03:42):

Thanks @Lloyd McKenzie can I extend deceased[x] in general for now in R3?

view this post on Zulip Grahame Grieve (Oct 25 2017 at 03:50):

well, pretty much, the same way, since it's the R4 logic that applies in the validator :-(

view this post on Zulip Brett Esler (Oct 25 2017 at 03:51):

I can't seem to slice on deceased[x] and build in IG publisher

java.lang.Exception: Exception loading http://hl7.org.au/fhir/StructureDefinitio
n/au-patient: Attempt to a slice an element that does not repeat: Patient.deceas
ed[x]/null from http://hl7.org/fhir/StructureDefinition/date in http://hl7.org.a
u/fhir/StructureDefinition/au-patient
at org.hl7.fhir.igtools.publisher.Publisher.load(Publisher.java:1950)
at org.hl7.fhir.igtools.publisher.Publisher.loadConformance(Publisher.ja
va:1640)
at org.hl7.fhir.igtools.publisher.Publisher.createIg(Publisher.java:366)

     at org.hl7.fhir.igtools.publisher.Publisher.execute(Publisher.java:336)
     at org.hl7.fhir.igtools.publisher.Publisher.main(Publisher.java:3907)

Caused by: org.hl7.fhir.exceptions.DefinitionException: Attempt to a slice an el
ement that does not repeat: Patient.deceased[x]/null from http://hl7.org/fhir/St
ructureDefinition/date in http://hl7.org.au/fhir/StructureDefinition/au-patient
at org.hl7.fhir.r4.conformance.ProfileUtilities.processPaths(ProfileUtil
ities.java:609)
at org.hl7.fhir.r4.conformance.ProfileUtilities.generateSnapshot(Profile
Utilities.java:363)
at org.hl7.fhir.r4.context.SimpleWorkerContext.seeMetadataResource(Simpl
eWorkerContext.java:568)
at org.hl7.fhir.r4.context.BaseWorkerContext.cacheResource(BaseWorkerCon
text.java:158)
at org.hl7.fhir.igtools.publisher.Publisher.load(Publisher.java:1948)
... 4 more
Exception in thread "main" java.lang.NullPointerException
at org.hl7.fhir.igtools.publisher.Publisher.main(Publisher.java:3917)
Press any key to continue . . .

view this post on Zulip Grahame Grieve (Oct 25 2017 at 03:53):

I'm going to run on the validation stuff early next week

view this post on Zulip Grahame Grieve (Oct 25 2017 at 03:53):

(R unconference tmorrow/friday)

view this post on Zulip Lloyd McKenzie (Oct 25 2017 at 04:02):

I've hit that before. If you declare the cardinality, the problem goes away.

view this post on Zulip Brett Esler (Oct 25 2017 at 04:22):

Thanks @Lloyd McKenzie think that has got me past that one for the IG build... much appreciated

view this post on Zulip Michel Rutten (Oct 25 2017 at 09:50):

Hi @Brett Esler, in Forge you can specify this by explicitly slicing the Patient.deceased[x] element. If you slice a choice type element, Forge automatically initializes the slicinng discriminator for a type slice. Now you can add specific slices for individual type choices and define type-specific constraints.


Last updated: Apr 12 2022 at 19:14 UTC