FHIR Chat · validating Observation against STU3 heartrate profile · implementers

Stream: implementers

Topic: validating Observation against STU3 heartrate profile


view this post on Zulip Simone Heckmann (Feb 14 2019 at 18:11):

I get weird results when validating a heartrate observation against the profile http://hl7.org/fhir/StructureDefinition/heartrate

            <Observation xmlns="http://hl7.org/fhir">
                <meta>
                    <profile value="http://hl7.org/fhir/StructureDefinition/heartrate" />
                </meta>
                <identifier>
                    <system value="http://klinikum.rwth-aachen.de/fhir/NamingSystem/observation-identifier" />
                    <value value="123456789_20180807070127_0002-480a" />
                </identifier>
                <status value="final" />
                <category>
                    <coding>
                        <system value="http://hl7.org/fhir/observation-category" />
                        <code value="vital-signs" />
                    </coding>
                </category>
                <code>
                    <coding>
                        <system value="http://loinc.org" />
                        <code value="8867-4" />
                    </coding>
                </code>
                <subject>
                    <reference value="Patient/example" />
                </subject>
                <effectiveDateTime value="2018-08-07T07:01:27+01:00" />
                <valueQuantity>
                    <value value="71" />
                    <unit value="/min" />
                    <system value="http://unitsofmeasure.org" />
                    <code value="/min" />
                </valueQuantity>
            </Observation>

view this post on Zulip Simone Heckmann (Feb 14 2019 at 18:11):

http://hapi.fhir.org/baseDstu3/Observation/$validate returns

<OperationOutcome xmlns="http://hl7.org/fhir">
    <text>  ... </text>
    <issue>
        <severity value="warning"/>
        <code value="processing"/>
        <diagnostics value="All observations should have a performer"/>
        <location value="Observation"/>
    </issue>
    <issue>
        <severity value="error"/>
        <code value="processing"/>
        <diagnostics value="The Coding references a value set, not a code system (&quot;http://loinc.org&quot;)"/>
        <location value="Observation.code.coding"/>
    </issue>
    <issue>
        <severity value="error"/>
        <code value="processing"/>
        <diagnostics value="The Coding references a value set, not a code system (&quot;http://loinc.org&quot;)"/>
        <location value="Observation.code.coding"/>
    </issue>
</OperationOutcome>

view this post on Zulip Simone Heckmann (Feb 14 2019 at 18:12):

test.fhir.org returns

<OperationOutcome xmlns="http://hl7.org/fhir">
    <text>  ... </text>
<issue>
        <severity value="error"/>
        <code value="invariant"/>
        <details>
            <text value="If there is no component or related element then either a value[x] or a data absent reason must be present () (component.empty() and related.empty()) implies (dataAbsentReason or value)"/>
        </details>
        <location value="Observation"/>
        <expression value="Observation // line 2 col 4)"/>
    </issue>
    <issue>
        <severity value="information"/>
        <code value="code-invalid"/>
        <details>
            <text value="None of the codes provided are in the value set http://hl7.org/fhir/ValueSet/observation-category (http://hl7.org/fhir/ValueSet/observation-category, and a code is recommended to come from this value set"/>
        </details>
        <expression value="Observation.category // line 12 col 5)"/>
    </issue>
    <issue>
        <severity value="information"/>
        <code value="informational"/>
        <details>
            <text value="Element coding is unknown or does not match any slice  for profile http://hl7.org/fhir/StructureDefinition/heartrate"/>
        </details>
        <expression value="Observation.code.coding // line 19 col 6)"/>
    </issue>
</OperationOutcome>

EDIT: I get the same response, when I use the original heartrate example from the STU3 Spec

view this post on Zulip Simone Heckmann (Feb 14 2019 at 18:32):

POSTing and validating the Observation on my local VONK returns no errors,
however, if the Bundle is nested in a translation Bundle,
I get an error when posting the transaction to the base

<OperationOutcome xmlns="http://hl7.org/fhir">
    <id value="0a53df9e-1eb3-484e-8be9-925625286625" />
    <meta>
        <versionId value="c0fe9241-4a9a-455c-aa05-fd0033c07138" />
        <lastUpdated value="2019-02-14T18:27:21.2483008+00:00" />
    </meta>
    <issue>
        <severity value="error" />
        <code value="invalid" />
        <details>
            <coding>
                <system value="http://hl7.org/fhir/dotnet-api-operation-outcome" />
                <code value="1008" />
            </coding>
            <text value="Value is not exactly equal to fixed value 'http://loinc.org'" />
        </details>
        <location value="Observation.code[0].coding[0].system[0]" />
    </issue>
    <issue>
        <severity value="error" />
        <code value="invalid" />
        <details>
            <coding>
                <system value="http://hl7.org/fhir/dotnet-api-operation-outcome" />
                <code value="1008" />
            </coding>
            <text value="Value is not exactly equal to fixed value 'http://unitsofmeasure.org'" />
        </details>
        <location value="Observation.value[0].system[0]" />
    </issue>
    <issue>
        <severity value="error" />
        <code value="code-invalid" />
        <details>
            <coding>
                <system value="http://hl7.org/fhir/dotnet-api-operation-outcome" />
                <code value="6001" />
            </coding>
            <text value="Code '/min' from system 'http://unitsofmeasure.org/' does not exist in valueset 'http://hl7.org/fhir/ValueSet/ucum-vitals-common'" />
        </details>
        <location value="Observation.value[0]" />
    </issue>
    <issue>
        <severity value="warning" />
        <code value="not-supported" />
        <details>
            <coding>
                <system value="http://hl7.org/fhir/dotnet-api-operation-outcome" />
                <code value="5003" />
            </coding>
            <text value="Argument is not supported" />
        </details>
        <location value="/Observation" />
    </issue>
    <issue>
        <severity value="warning" />
        <code value="not-supported" />
        <details>
            <coding>
                <system value="http://hl7.org/fhir/dotnet-api-operation-outcome" />
                <code value="5003" />
            </coding>
            <text value="Argument is not supported" />
        </details>
        <location value="identifier=http://myorganization.org/fhir/NamingSystem/observation-identifier|123456789_20180807070127_0002-480a" />
    </issue>
</OperationOutcome>

However, if I POST to /Bundle or /Bundle/$validate I get no errors!!??

This is the Bundle:

<Bundle xmlns="http://hl7.org/fhir">
    <id value="fa8f61a2-5335-48f4-adb4-8662801fc49d" />
    <type value="transaction" />
    <entry>
        <fullUrl value="urn:uuid:1e6f7d63-7ca8-4b9a-8404-b079796e5988" />
        <resource>
            <Patient>

                <identifier>
                    <system value="http://myorganization.org/fhir/NamingSystem/patient-identifier" />
                    <value value="123456789" />
                </identifier>
                <name>
                    <family value="N" />
                    <given value="H" />
                </name>
            </Patient>
        </resource>
        <request>
            <method value="POST" />
            <url value="Patient" />
            <ifNoneExist value="identifier=http://myorganization.org/fhir/NamingSystem/patient-identifier|123456789" />
        </request>
    </entry>
    <entry>
        <fullUrl value="urn:uuid:98dd7653-a8f6-4e06-907e-f4c1acd36db1" />
        <resource>
            <Observation>
                <meta>
                    <profile value="http://hl7.org/fhir/StructureDefinition/heartrate" />

                </meta>
                <identifier>
                    <system value="http://myorganization.org/fhir/NamingSystem/observation-identifier" />
                    <value value="123456789_20180807070127_0002-480a" />
                </identifier>
                <status value="final" />
                <category>
                    <coding>
                        <system value="http://hl7.org/fhir/observation-category" />
                        <code value="vital-signs" />
                    </coding>
                </category>
                <code>
                    <coding>
                        <system value="http://loinc.org" />
                        <code value="8867-4" />
                    </coding>
                </code>
                <subject>
                    <reference value="urn:uuid:1e6f7d63-7ca8-4b9a-8404-b079796e5988" />
                </subject>
                <effectiveDateTime value="2018-08-07T07:01:27+01:00" />
                <valueQuantity>
                    <value value="71" />
                    <unit value="/min" />
                    <system value="http://unitsofmeasure.org" />
                    <code value="/min" />
                </valueQuantity>
            </Observation>
        </resource>
        <request>
            <method value="PUT" />
            <url value="Observation?identifier=http://myorganization.org/fhir/NamingSystem/observation-identifier|123456789_20180807070127_0002-480a" />
        </request>
    </entry>
</Bundle>

@Christiaan Knaap ...?

view this post on Zulip Simone Heckmann (Feb 14 2019 at 18:35):

BTW. I can't reproduce on the public VONK endpoint, as all I get from there is

<OperationOutcome xmlns="http://hl7.org/fhir">
    <id value="0be99ef7-2089-4f1b-a884-f2177b9cb085" />
    <meta>
        <versionId value="2a066704-9dc6-40c2-ae58-0bf8eeb12d55" />
        <lastUpdated value="2019-02-14T18:29:50.6780243+00:00" />
    </meta>
    <issue>
        <severity value="error" />
        <code value="not-supported" />
        <details>
            <coding>
                <system value="http://hl7.org/fhir/dotnet-api-operation-outcome" />
                <code value="5011" />
            </coding>
            <text value="Unable to read resource from body. Content-Type is missing." />
        </details>
    </issue>
</OperationOutcome>

(that's when validating the Bundle, the Content-Type header is set to application/fhir+xml)

POSTing to base returns <strong> Oops! Something went wrong :( </strong>
I guess the public endpoint doesn't do transactions...?
I'm locally running the default SQLite database, also Version 1.1.0.0

view this post on Zulip Simone Heckmann (Feb 14 2019 at 18:40):

I have never seen results all over the place like this O.o
Usually I find at least two servers who agree on their validation results :smirk:

view this post on Zulip Lloyd McKenzie (Feb 14 2019 at 19:09):

Can you attach your instance for people to test with?

view this post on Zulip Simone Heckmann (Feb 14 2019 at 19:27):

Both the Observation and the Bundle are contained higher up in this thread, however, I just realized, I can reproduce the OperationOutcome with the official heartrate example from the STU3 spec:
http://hl7.org/fhir/STU3/observation-example-heart-rate.xml.html

view this post on Zulip Simone Heckmann (Feb 14 2019 at 19:29):

FWIW, here's my transaction Bundle: bundle_heartrate.xml
I added in the display values for conde and category, just to rule this out as a possible cause for the errors...

view this post on Zulip Simone Heckmann (Feb 14 2019 at 19:33):

However, the issue that an validation error occurs when posting the Bundle but not when validating it is unique to VONK
With HAPI it's vice versa: The Bundle is accepted on POST, but the Validation errors (Bundle validation consistent with Observation validation), but I guess that's just because HAPI doesn't do a strict validation against conformance claims on POST

view this post on Zulip Simone Heckmann (Feb 14 2019 at 19:35):

test.fhir.org fails for both the single Observation AND the posting/validating of the Bundle, due to strict validation on POST.

view this post on Zulip Simone Heckmann (Feb 14 2019 at 19:40):

So, bottom line, I think there are two seperate issues here:
1. Grahame's server and HAPI don't validate the instance (not even the offical heartrate example) against the heartrate profile, even thought the instances seem to be correct

2. VONK does validate them, but rejects them when nested in a transaction Bundle and posted to base, even though the Bundle itself validates.

view this post on Zulip Morten Ernebjerg (Feb 14 2019 at 20:09):

Hi @Simone Heckmann, I recently had a very similar issue with the (STU3) body weight profile failing standard examples (in fact, I think I even saw some of it for the base VitalSign profile), as discussed in this thread . I had the JAR validator failing with the error you're seeing on test.fhir.org - according to Grahame, it is due to an issue with the FHIRPath for the constraint which he will fix in the upcoming technical correction to STU3 (see linked thread). I also got a different error using the online Simplifier validator (which I suppose is the same as in VONK), namely

Code 'in' from system 'http://unitsofmeasure.org' does not exist in valueset 'http://hl7.org/fhir/ValueSet/ucum-vitals-common'

Not clear yet where that came from but Michael Rutten pinged Ewout.

view this post on Zulip Mirjam Baltus (Feb 15 2019 at 08:19):

@Morten Ernebjerg: I am looking into that still, and I think it is a bug in the validator. Will let you know as soon as I find out more.
@Simone Heckmann: I'm looking into your issue with Vonk as well.


Last updated: Apr 12 2022 at 19:14 UTC