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

Validate contains change #3209

Merged
merged 7 commits into from
Dec 6, 2021
Merged

Validate contains change #3209

merged 7 commits into from
Dec 6, 2021

Conversation

markiantorno
Copy link
Collaborator

Give me a moment to review this myself first, then I will provide details and tag people.

@codecov
Copy link

codecov bot commented Dec 2, 2021

Codecov Report

Merging #3209 (f30f763) into master (3e7eec4) will decrease coverage by 0.01%.
The diff coverage is 57.81%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #3209      +/-   ##
============================================
- Coverage     82.80%   82.78%   -0.02%     
- Complexity    20258    20273      +15     
============================================
  Files          1362     1365       +3     
  Lines         72799    72858      +59     
  Branches      10975    10978       +3     
============================================
+ Hits          60281    60318      +37     
- Misses         8306     8331      +25     
+ Partials       4212     4209       -3     
Impacted Files Coverage Δ
.../src/main/java/ca/uhn/fhir/rest/api/Constants.java 100.00% <ø> (ø)
...org/hl7/fhir/dstu3/hapi/ctx/HapiWorkerContext.java 23.52% <ø> (ø)
...va/org/hl7/fhir/r4/hapi/ctx/HapiWorkerContext.java 27.10% <ø> (ø)
...va/org/hl7/fhir/r5/hapi/ctx/HapiWorkerContext.java 13.53% <0.00%> (-0.87%) ⬇️
...validation/validator/FhirDefaultPolicyAdvisor.java 0.00% <0.00%> (ø)
...validator/VersionSpecificWorkerContextWrapper.java 58.75% <12.50%> (-1.65%) ⬇️
...pi/validation/validator/FhirInstanceValidator.java 87.95% <80.00%> (-0.51%) ⬇️
...hn/fhir/jpa/validation/ValidatorPolicyAdvisor.java 87.50% <87.50%> (ø)
...ain/java/ca/uhn/fhir/validation/FhirValidator.java 80.68% <100.00%> (ø)
...va/ca/uhn/fhir/jpa/config/BaseConfigDstu3Plus.java 100.00% <100.00%> (ø)
... and 17 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 20f3420...f30f763. Read the comment docs.

@markiantorno
Copy link
Collaborator Author

Alright so, these changes are related to bumping the dependency on org.hl7.fhir.core to version 5.3.0.

The main updates that resulted in the majority of the changes in this PR were the addition of the interface IValidationPolicyAdvisor, and the refactoring of some of the main validation classes (for cleaning purposes). Also, many of the error messages were updated, so the resulting tests in HAPI had to be modified to reflect these message changes.

In regard to the new interface IValidationPolicyAdvisor, by implementing this interface and passing it through the validation context in HAPI to the [InstanceValidator] (https://github.com/hapifhir/org.hl7.fhir.core/blob/master/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/InstanceValidator.java) in the core libraries, users can now control the behavior of the validator when validating references, contained resources, and coded content. Previously, only references were controlled in this way, and users controlled this by overriding the validation fetcher.

Test cases were added in the validation test cases repository to demonstrate it's functionality. In particular, the two test cases contained-resource-bad-id, and contained-resource-bad-id-ignore. The definitions and expected outcomes of these test cases are in the manifest.json in that repository.

Please let me know if you have any questions.

Copy link
Collaborator

@tadgh tadgh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good, just a couple minor questions for my own clarity, and some minor style stuff.

  1. This requires a changelog
  2. Does this change break Smile CDR? If so, bumping the HAPI version makes sense here, otherwise you can leave it at PRE3.

Otherwise, lgtm.

@markiantorno
Copy link
Collaborator Author

Overall looks good, just a couple minor questions for my own clarity, and some minor style stuff.

1. This requires a changelog

2. Does this change _break_ Smile CDR? If so, bumping the HAPI version makes sense here, otherwise you can leave it at PRE3.

Chagelog added, and this will break things in CDR, so I bumped to PRE-4

@tadgh tadgh self-requested a review December 6, 2021 16:24

Test cases were added in the validation test cases repository to demonstrate it's functionality. In particular, the two
test cases contained-resource-bad-id, and contained-resource-bad-id-ignore. The definitions and expected outcomes of
these test cases are in the manifest.json in that repository."
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While i do appreciate the verbosity from a developer perspective, we try to keep public changelogs at a high level indicating what specific things might impact users without getting too deep into technical details.. In this case i would write something like (obviously adjust it for the actual changes you made):

An upgrade to the core libraries has added the ability to control whether contained resources get validated. You can read more about it [in the documentation](link to documentation here).

@tadgh tadgh merged commit d60d07b into master Dec 6, 2021
@tadgh tadgh deleted the validate_contains_change branch December 6, 2021 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants