Skip to content
New issue

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

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

Already on GitHub? # to your account

Add tests for validating against different IG versions #614

Closed

Conversation

Jammjammjamm
Copy link

This branch adds unit tests which demonstrate that the validator is not correctly resolving Extensions to a particular IG version. ValueSets may also be resolving incorrectly, but with these test cases those errors are being hidden by the Extension problem.

The IGs were generated from this FSH. The IGs each contain a Profile which includes an Extension with a bound ValueSet. The Profile, Extension, and ValueSet are incompatible between the versions.

The unit tests load versions 0.1.0 and 0.2.0 of the IG into the validator and then verify that:

  • 0.2.0 resource is valid against 0.2.0 profile.
    PASSES
  • 0.1.0 resource is valid against 0.1.0 profile.
    FAILS (validator is using the 0.2.0 Extension rather than the 0.1.0 Extension):
    TestV1ResourceAgainstV1Profile: v0.1.0 resource is valid against the v0.1.0 profile
    - This element is not allowed by the profile http://hl7.org/fhir/StructureDefinition/CodeableConcept
    - This element is not allowed by the profile http://hl7.org/fhir/StructureDefinition/CodeableConcept
    - This element does not match any known slice  defined in the profile http://example.org/validator-versions-test/StructureDefinition/multi-version-test-extension and slicing is CLOSED: Patient.extension[0].value.ofType(Coding): Does not match slice 'valueCodeableConcept'
    - The Extension 'http://example.org/validator-versions-test/StructureDefinition/multi-version-test-extension' definition allows for the types [CodeableConcept] but found type Coding
    
  • 0.2.0 resource is invalid against 0.1.0 profile.
    FAILS (validator is using the 0.2.0 Extension rather than the 0.1.0 Extension, so only the error from the base profile is picked up):
    TestV2ResourceAgainstV1Profile: v0.2.0 resource is invalid against the v0.1.0 profile
    - Patient.active: max allowed = 0, but found 1 (from http://example.org/validator-versions-test/StructureDefinition/multi-version-test-patient)
    
  • 0.1.0 resource is invalid against 0.2.0 profile.
    PASSES

@stale
Copy link

stale bot commented Mar 28, 2022

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.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant