-
Notifications
You must be signed in to change notification settings - Fork 6
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
FI-2316 Label Reference target profile as MustSupport is there is only one #139
Conversation
@@ -254,17 +254,25 @@ def get_type_must_support_metadata(current_metadata, current_element) | |||
end | |||
|
|||
def handle_type_must_support_target_profiles(type, metadata) | |||
index = 0 | |||
return if profile.version == '3.1.1' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
US Core 3 also includes the base FHIR vital signs profiles, which have a different version. I'm guessing that those don't have target profiles and therefore aren't impacted by this change, though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is correct. I will also exclude FHIR R4 profiles for completeness.
target_profiles << type.targetProfile.first | ||
else | ||
index = 0 | ||
type.source_hash['_targetProfile']&.each do |hash| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ruby can handle the index for you: &.each_with_index do |hash, index|
element = FHIR::Element.new(hash) | ||
target_profiles << type.targetProfile[index] if type_must_support_extension?(element.extension) | ||
end | ||
index += 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one needs to go, too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, got it. So the index increase automatically.
end | ||
|
||
def unresolved_references_strings | ||
unresolved_reference_hash = | ||
unresolved_references.each_with_object(Hash.new { |hash, key| hash[key] = [] }) do |missing, hash| | ||
hash[missing[:path]] << missing[:target_profile] | ||
end | ||
unresolved_reference_hash.map { |path, profiles| "#{path}#{"(#{profiles.join('|')})" unless profiles.first.empty?}" } | ||
unresolved_reference_hash.map { |path, profiles| "#{path} element: Reference(#{profiles.join('|')})" unless profiles.first.empty?}" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a syntax error here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Forgot to push the last commit
2421e54
to
81497c9
Compare
Summary
This fixes https://oncprojectracking.healthit.gov/support/browse/FI-2316
This fixes GitHub Issue onc-healthit/onc-certification-g10-test-kit#470
When there is only one target profile for a MustSupport Reference, this profile shall also be treated as MustSupport. This does not affect MustSupport test but enforced reference validation test using the correct profile.
This change exculde US Core v3.1.1 which does not have any target_profile marked, and any FHIR base profiles.
Testing Guidance