ID-119: Add non-must-support element check (CRD conf-10/13, PAS conf-12)#785
Open
abhinandan2012 wants to merge 1 commit into
Open
ID-119: Add non-must-support element check (CRD conf-10/13, PAS conf-12)#785abhinandan2012 wants to merge 1 commit into
abhinandan2012 wants to merge 1 commit into
Conversation
…t compliance with Da Vinci CRD and PAS requirements
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #785 +/- ##
==========================================
- Coverage 84.85% 84.84% -0.01%
==========================================
Files 297 297
Lines 14020 14018 -2
Branches 1977 1977
==========================================
- Hits 11896 11894 -2
Misses 2116 2116
Partials 8 8
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements the Da Vinci Burden Reduction client-side conformance rule that client requests SHALL NOT contain non-must-support elements (CRD conf-10, conf-13, PAS conf-12).
The change extends the inferno-core must-support DSL with a new analysis step that enumerates non-must-support elements from a profile and reports any that are populated in the resource(s) under test.
What changed
lib/inferno/dsl/must_support_metadata_extractor.rbnon_must_support_elementsenumerates non-must-support, non-required profile elements whose parent is the resource root or a must-support element. Entries are taggedmust_support: false.must_supports[:elements]now holds both must-support and non-must-support entries in a single list, matching the design decision in the ticket ("keep everything in one structure").lib/inferno/dsl/must_support_assessment.rbnon_must_support_elements_present(resources, profile_url, ...). Same signature shape asmissing_must_support_elements(validator, metadata, requirement_extension, and customization block all supported).must_support_elementsandmust_support_extensionsaccessors now filter out entries flaggedmust_support: falseso the existing "missing MS" path is unaffected.present_non_must_support_elementsreuses the existingresource_populates_element?navigation.unexpected_extensionswalks the resource (and non-extension children) for extension URLs that are not in the must-support extensions list. Sub-extensions of an MS complex extension are intentionally not recursed into, since they belong to that extension's own definition (for example,ombCategoryinsideus-core-race).spec/inferno/dsl/must_support_assessment_spec.rbmust_support: truehonored.non_must_support_elementsand merge intomust_supports[:elements].Backwards compatibility
Critical for the ticket and exercised by a dedicated spec:
must_supportflag is treated asmust_support: true. Existing metadata (which carries no flag) keeps the same behavior under the existing must-support checks.must_support: falseentries. Older metadata never carried such entries, so calling the new DSL against it returns an empty list rather than reporting spurious extension violations.Tests
UI testing steps
These steps exercise the new DSL end-to-end through the Da Vinci CRD Client v2.2.1 Test Suite. They require the companion
davinci-crd-test-kitbranchid-119-integration-non-ms-check(helper plus a new test wired into the order-sign group).Prerequisites
inferno-coreon branchid-119-non-ms-element-check.davinci-crd-test-kiton branchid-119-integration-non-ms-check, with itsGemfilepointing at the inferno-core checkout viagem 'inferno_core', path: '../inferno-core'.Start the kit
The UI is then at
http://localhost:4567.Running the CRD Client and Server Suites Against Each Other
Running Suites Against Each Other.
Run the client suite
http://localhost:4567and create a session of "Da Vinci CRD Client v2.2.1 Test Suite" (any US Core option).1.1 Registration. It should pass.Drive an order-sign hook
1.2.6 order-signuntil the "User Action Required" dialog appears.3.6 order-signto invoke the hook against Inferno's mock client.Where to see the change
After step 3, navigate to:
The new test appears as:
crd_v221_hook_request_no_non_ms1.2.6.3.04hl7.fhir.us.davinci-crd_2.2.1@conf-10,hl7.fhir.us.davinci-crd_2.2.1@conf-13Click the test row to expand the detail panel. Results are visible in three
places:
The status icon next to the test row (pass, fail, or skip).
The summary line directly under the test title in the collapsed row (for example, "Requests 1, 2, 3, 4, 5, and 6: Hook request resources contained non-must-support elements. See Messages for details.").
The Messages tab inside the expanded detail panel. Each violation is listed as a separate row of type
error, in the format:(Request N) Prefetch Template '<template_name>' - non-must-support element present: <path or extension url>Bundles add a
Bundle entry Msegment to the prefix.Soft-fallback warnings (for example, when a profile cannot be loaded for metadata extraction) appear as
warningrows in the same panel and do not fail the test on their own.Expected results