FHIR Chat · Observation constraints · implementers

Stream: implementers

Topic: Observation constraints


view this post on Zulip Simone Heckmann (May 13 2018 at 13:19):

We currently get two warnings when validating Observations on HAPI against core:

  "diagnostics": "All observations should have a performer",
  "diagnostics": "All observations should have an effectiveDateTime or an effectivePeriod",

but we can't trace them back to any requirement7constraint in the spec. Is there an invariant we're not seeing or is HAPI just making this up?

view this post on Zulip Simone Heckmann (May 13 2018 at 13:22):

VONK doesn't show any similar warnings. I'd like to test Grahame's server too, but it's down...

view this post on Zulip Simone Heckmann (May 13 2018 at 13:26):

Ok, we found it. It's actually hardcoded into hapi...

view this post on Zulip Anand Mohan Tumuluri (May 14 2018 at 19:49):

Its actually hardcoded in the Java RI at https://github.com/hl7-fhir/fhir-svn/blob/master/implementations/java/org.hl7.fhir.validation/src/org/hl7/fhir/r4/validation/InstanceValidator.java#L3617. It would be great if this can be fixed in Java RI.

view this post on Zulip Grahame Grieve (May 14 2018 at 21:07):

what's wrong with them?

view this post on Zulip Anand Mohan Tumuluri (May 14 2018 at 22:27):

All of Observation.subject, Observation.performer, Observation.effective[x] are optional according to the StructureDefinition and AFAIK there are no constraints that make them mandatory.

view this post on Zulip Anand Mohan Tumuluri (May 14 2018 at 22:28):

So the question is why are they made mandatory in the validator?

view this post on Zulip Anand Mohan Tumuluri (May 14 2018 at 22:47):

Moreover, Observation.performer has a cardinality of 0..*, whereas the code above expects only a single value (it calls getNamedChild from https://github.com/hl7-fhir/fhir-svn/blob/master/implementations/java/org.hl7.fhir.r4/src/org/hl7/fhir/r4/elementmodel/Element.java#L476) which fails with the error "Attempt to read a single element when there is more than one present" when you send an observation with multiple performers. @Grahame Grieve

view this post on Zulip Grahame Grieve (May 15 2018 at 03:06):

they are not made mandatory. It's a warning. And I think it's a good warning. But I definitely should fix the bug

view this post on Zulip Anand Mohan Tumuluri (May 15 2018 at 20:29):

I agree that those are good warnings, but such warnings are applicable to other resources as well and are not limited to Observations. I think its best to let profiles define such constraints and have the validator only validate based on base/profiles.

view this post on Zulip Lloyd McKenzie (May 15 2018 at 20:41):

That was dropped a couple of releases ago, but I guess James never changed his rules. Please submit a change request to get us to add the clarifying wording.

view this post on Zulip Brian Reinhold (May 15 2018 at 20:41):

ok

view this post on Zulip Lloyd McKenzie (May 15 2018 at 20:46):

@James Agnew

view this post on Zulip Grahame Grieve (May 15 2018 at 21:35):

@Lloyd McKenzie what do you think was dropped a couple of releases ago? that error looks like it comes from the validator you and I maintain, not HAPI code

view this post on Zulip Lloyd McKenzie (May 15 2018 at 21:37):

I thought we had dropped support for OIDs as temporary ids?

view this post on Zulip Grahame Grieve (May 15 2018 at 21:40):

OIDs?

view this post on Zulip Lloyd McKenzie (May 15 2018 at 21:44):

Sorry, post was made to wrong thread. Should have gone under "temporary id"

view this post on Zulip Anand Mohan Tumuluri (May 15 2018 at 23:39):

Should I submit a change request for the removal of extra Observation checks? The other not-so-great solution for me is to fork and maintain InstanceValidator which is a pain given the amount of change it goes through.

view this post on Zulip Simone Heckmann (May 16 2018 at 08:13):

I think @Patrick Werner my have already done that?

view this post on Zulip Patrick Werner (May 16 2018 at 08:35):

Hi Anand, i already reported this unexpected behavior:
GF17147

view this post on Zulip Patrick Werner (May 16 2018 at 08:39):

i also reported it to hapi:
https://github.com/jamesagnew/hapi-fhir/issues/942
Where James stated, that these are disabled by default now (which they are not as i can see in the code).
But you can disable them in the jpaserver-base config (e.g. BaseR4Config.java)

view this post on Zulip Anand Mohan Tumuluri (May 16 2018 at 14:20):

Thanks @Patrick Werner . I can disable the best practice checks using RI too but the issue around Observation having multiple performers can not be fixed without changing InstanceValidator. I am interested in a fix for that.

view this post on Zulip Patrick Werner (May 17 2018 at 08:29):

@Anand Mohan Tumuluri
i fixed it in HAPI, which works for now, until the next RI import of hapi.

@Grahame Grieve
fix: https://github.com/jamesagnew/hapi-fhir/pull/951/files
GF17221


Last updated: Apr 12 2022 at 19:14 UTC