Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error Index -1 out of bounds for length 0 in derived profiles where base profile has sliced value[x] element on type #1630

Open
LilianMinne opened this issue May 21, 2024 · 1 comment

Comments

@LilianMinne
Copy link

LilianMinne commented May 21, 2024

We have defined a couple of "generic" (STU3) profiles that capture multiple Observations (e.g. bc-FetusObservation, bc-ChildObservation). To add mapping information for each data element, we type sliced the value[x] element and added a list of mappings for each type. The "generic" profiles seem correct and the validation results of these profiles contain no errors. The following profiles derived from these "generic" profiles result in an Index -1 out of bounds for length 0 error:

The problem seems to be in the definition of the value[x] element, for example this code fragment from bc-FetalHeartRate:

        <element id="Observation.value[x]:valueQuantity">
            <path value="Observation.value[x]" />
            <sliceName value="valueQuantity" />
            <mapping>
                <identity value="gebz-peri-v3.2" />
                <map value="peri32-dataelement-1777" />
                <comment value="HartfrequentieWaarde" />
            </mapping>
        </element>

When this code is commented out OR when the base profile is changed (in this case from bc-FetusObservation to nl-core-observation), the validation result is success. For reference, see the definition of the original parent profile: https://simplifier.net/geboortezorg-stu3/bc-fetusobservation

There seems to be a problem with first adding a type slice definition in the parent profile and then adding additional constraints on these slices in the derived profile. As far as we know the code should be correct. Is this a problem in the validator or do we miss something here?

@grahamegrieve
Copy link
Collaborator

is this still a problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants