Giter Site home page Giter Site logo

Comments (6)

grahamegrieve avatar grahamegrieve commented on May 27, 2024 1

want to contribute a test case?

from org.hl7.fhir.core.

wetret avatar wetret commented on May 27, 2024 1

@patrick-werner Thanks for the fast reply. Using Hapi version 6.10, I get still an error when validating @default slices.

Questionnaire.item[0] 1:335 - Error: Slicing cannot be evaluated: Could not match any discriminators ([linkId]) for slice Questionnaire.item:@default in profile http://dsf.dev/fhir/StructureDefinition/questionnaire|1.0.0 - None of the 1 discriminators [linkId] have fixed value, binding or existence assertions

The @default slicing specification says: Default slices must not fix the value of the discriminator elements.

I am not sure if there is an error in the profile or in the validation. Maybe you have time to take a look at it? The profile is the following:

<StructureDefinition xmlns="http://hl7.org/fhir">
    <meta>
        <tag>
            <system value="http://dsf.dev/fhir/CodeSystem/read-access-tag"/>
            <code value="ALL"/>
        </tag>
    </meta>
    <url value="http://dsf.dev/fhir/StructureDefinition/questionnaire"/>
    <version value="1.0.0"/>
    <name value="Questionnaire"/>
    <status value="active"/>
    <experimental value="false"/>
    <date value="2023-06-28"/>
    <fhirVersion value="4.0.1"/>
    <kind value="resource"/>
    <abstract value="true"/>
    <type value="Questionnaire"/>
    <baseDefinition value="http://hl7.org/fhir/StructureDefinition/Questionnaire"/>
    <derivation value="constraint"/>
    <differential>
        <element id="Questionnaire.url">
            <path value="Questionnaire.url"/>
            <min value="1"/>
        </element>
        <element id="Questionnaire.version">
            <path value="Questionnaire.version"/>
            <min value="1"/>
        </element>
        <element id="Questionnaire.date">
            <path value="Questionnaire.date"/>
            <min value="1"/>
        </element>
        <element id="Questionnaire.item">
            <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name">
                <valueString value="Parameter"/>
            </extension>
            <path value="Questionnaire.item"/>
            <slicing>
                <discriminator>
                    <type value="value"/>
                    <path value="linkId"/>
                </discriminator>
                <rules value="closed"/>
            </slicing>
            <min value="1"/>
            <constraint>
                <key value="type-code"/>
                <severity value="error"/>
                <human value="Constrains available types from ValueSet 'http://hl7.org/fhir/item-type'"/>
                <expression value="(type = 'display') or
                				(type = 'string') or
                				(type = 'text') or
                				(type = 'integer') or
                				(type = 'decimal') or
                				(type = 'boolean') or
                				(type = 'date') or
                				(type = 'time') or
                				(type = 'dateTime') or
                				(type = 'reference') or
                				(type = 'url')"/>
            </constraint>
        </element>
        <element id="Questionnaire.item:user-task-id">
            <path value="Questionnaire.item"/>
            <sliceName value="user-task-id"/>
            <min value="1"/>
            <max value="1"/>
        </element>
        <element id="Questionnaire.item:user-task-id.linkId">
            <path value="Questionnaire.item.linkId"/>
            <fixedString value="user-task-id"/>
        </element>
        <element id="Questionnaire.item:user-task-id.definition">
            <path value="Questionnaire.item.definition"/>
            <max value="0"/>
        </element>
        <element id="Questionnaire.item:user-task-id.code">
            <path value="Questionnaire.item.code"/>
            <max value="0"/>
        </element>
        <element id="Questionnaire.item:user-task-id.prefix">
            <path value="Questionnaire.item.prefix"/>
            <max value="0"/>
        </element>
        <element id="Questionnaire.item:user-task-id.text">
            <path value="Questionnaire.item.text"/>
            <min value="1"/>
            <fixedString value="The user-task-id of the process execution"/>
        </element>
        <element id="Questionnaire.item:user-task-id.type">
            <path value="Questionnaire.item.type"/>
            <fixedCode value="string"/>
        </element>
        <element id="Questionnaire.item:user-task-id.enableWhen">
            <path value="Questionnaire.item.enableWhen"/>
            <max value="0"/>
        </element>
        <element id="Questionnaire.item:user-task-id.answerOption">
            <path value="Questionnaire.item.answerOption"/>
            <max value="0"/>
        </element>
        <element id="Questionnaire.item:user-task-id.initial">
            <path value="Questionnaire.item.initial"/>
            <max value="0"/>
        </element>
        <element id="Questionnaire.item:user-task-id.item">
            <path value="Questionnaire.item.item"/>
            <max value="0"/>
        </element>
        <element id="Questionnaire.item:business-key">
            <path value="Questionnaire.item"/>
            <sliceName value="business-key"/>
            <min value="0"/>
            <max value="1"/>
        </element>
        <element id="Questionnaire.item:business-key.linkId">
            <path value="Questionnaire.item.linkId"/>
            <fixedString value="business-key"/>
        </element>
        <element id="Questionnaire.item:business-key.definition">
            <path value="Questionnaire.item.definition"/>
            <max value="0"/>
        </element>
        <element id="Questionnaire.item:business-key.code">
            <path value="Questionnaire.item.code"/>
            <max value="0"/>
        </element>
        <element id="Questionnaire.item:business-key.prefix">
            <path value="Questionnaire.item.prefix"/>
            <max value="0"/>
        </element>
        <element id="Questionnaire.item:business-key.text">
            <path value="Questionnaire.item.text"/>
            <min value="1"/>
            <fixedString value="The business-key of the process execution"/>
        </element>
        <element id="Questionnaire.item:business-key.type">
            <path value="Questionnaire.item.type"/>
            <fixedCode value="string"/>
        </element>
        <element id="Questionnaire.item:business-key.enableWhen">
            <path value="Questionnaire.item.enableWhen"/>
            <max value="0"/>
        </element>
        <element id="Questionnaire.item:business-key.answerOption">
            <path value="Questionnaire.item.answerOption"/>
            <max value="0"/>
        </element>
        <element id="Questionnaire.item:business-key.initial">
            <path value="Questionnaire.item.initial"/>
            <max value="0"/>
        </element>
        <element id="Questionnaire.item:business-key.item">
            <path value="Questionnaire.item.item"/>
            <max value="0"/>
        </element>
        <element id="Questionnaire.item:@default">
            <path value="Questionnaire.item"/>
            <sliceName value="@default"/>
            <min value="0"/>
            <max value="*"/>
        </element>
        <element id="Questionnaire.item:@default.definition">
            <path value="Questionnaire.item.definition"/>
            <max value="0"/>
        </element>
        <element id="Questionnaire.item:@default.code">
            <path value="Questionnaire.item.code"/>
            <max value="0"/>
        </element>
        <element id="Questionnaire.item:@default.prefix">
            <path value="Questionnaire.item.prefix"/>
            <max value="0"/>
        </element>
        <element id="Questionnaire.item:@default.text">
            <path value="Questionnaire.item.text"/>
            <min value="1"/>
        </element>
        <element id="Questionnaire.item:@default.type">
            <path value="Questionnaire.item.type"/>
            <min value="1"/>
        </element>
        <element id="Questionnaire.item:@default.enableWhen">
            <path value="Questionnaire.item.enableWhen"/>
            <max value="0"/>
        </element>
        <element id="Questionnaire.item:@default.answerOption">
            <path value="Questionnaire.item.answerOption"/>
            <max value="0"/>
        </element>
        <element id="Questionnaire.item:@default.initial">
            <path value="Questionnaire.item.initial"/>
            <max value="0"/>
        </element>
        <element id="Questionnaire.item:@default.item">
            <path value="Questionnaire.item.item"/>
            <max value="0"/>
        </element>
    </differential>
</StructureDefinition>

A resource I use for testing is the following:

<Questionnaire xmlns="http://hl7.org/fhir">
    <meta>
        <profile value="http://dsf.dev/fhir/StructureDefinition/questionnaire"></profile>
    </meta>
    <url value="http://dsf.dev/fhir/Questionnaire/hello-world"></url>
    <version value="0.1.0"></version>
    <status value="active"></status>
    <date value="2023-12-06T10:26:47+01:00"></date>
    <item>
        <linkId value="business-key"></linkId>
        <text value="The business-key of the process execution"></text>
        <type value="string"></type>
    </item>
    <item>
        <linkId value="user-task-id"></linkId>
        <text value="The user-task-id of the process execution"></text>
        <type value="string"></type>
    </item>
    <item>
        <linkId value="valid-type"></linkId>
        <text value="valid type"></text>
        <type value="string"></type>
    </item>
</Questionnaire>

from org.hl7.fhir.core.

stale avatar stale commented on May 27, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 5 days if no further activity occurs. Thank you for your contributions.

from org.hl7.fhir.core.

wetret avatar wetret commented on May 27, 2024

Has this issue been fixed in a version > 5.1.0?

from org.hl7.fhir.core.

wetret avatar wetret commented on May 27, 2024

@patrick-werner any updates?

from org.hl7.fhir.core.

patrick-werner avatar patrick-werner commented on May 27, 2024

@wetret according to: https://chat.fhir.org/#narrow/stream/179252-IG-creation/topic/.40default.20slice/near/399975447 it should be supported in recent versions

from org.hl7.fhir.core.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.