-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Issue 3486 #3487
Issue 3486 #3487
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3487 +/- ##
=========================================
Coverage 83.00% 83.00%
- Complexity 21004 21007 +3
=========================================
Files 1406 1406
Lines 75568 75575 +7
Branches 11262 11266 +4
=========================================
+ Hits 62723 62730 +7
+ Misses 8524 8521 -3
- Partials 4321 4324 +3
Continue to review full report at Codecov.
|
...ain/resources/ca/uhn/hapi/fhir/changelog/6_0_0/3486-package-upload-non-active-resources.yaml
Outdated
Show resolved
Hide resolved
// Resource does not have a status field | ||
if (statusTypes.size() == 0) return true; | ||
// Resource has an empty or null status field | ||
if (statusTypes.isEmpty() || statusTypes.get(0).getValue() == null) return false; |
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.
what is the difference between statusTypes.isEmpty()
and statusTypes.size() == 0
?
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.
No diff, was a duplicated case. Fixed.
if (statusTypes.isEmpty() || statusTypes.get(0).getValue() == null) return false; | ||
// Resource has a status, and we need to check based on type | ||
return switch (theResource.fhirType()) { | ||
case "Subscription" -> (statusTypes.get(0).getValueAsString().equals("requested")); |
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.
Should this be requested
or active
? https://www.hl7.org/fhir/valueset-subscription-status.html
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.
You shouldn't be able to add a Subscription with an active status. The server sets to active after loaded the subscription and checking that it can be run.
// Resource has a status, and we need to check based on type | ||
return switch (theResource.fhirType()) { | ||
case "Subscription" -> (statusTypes.get(0).getValueAsString().equals("requested")); | ||
case "DocumentReference", "Communication" -> (!statusTypes.get(0).getValueAsString().equals("?")); |
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.
DocumentReference.status seems to use superseded
and entered-in-error
for inactive. https://www.hl7.org/fhir/valueset-document-reference-status.html
And Communication has a bunch. Maybe I don't understand what this is.
Maybe some docs, and links to the spec?
https://www.hl7.org/fhir/valueset-event-status.html
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.
Yeah, so when I talked with the support team on this, they stated that the code in the past only allowed for resources that had a value of status as empty or for this, but this was restrictive, as DocumentReferences could exist with statuses such as entered in error, or others, and still need to be loaded from the package. The same goes for Communication types. I will expand the javadoc for the method further.
...ain/resources/ca/uhn/hapi/fhir/changelog/6_0_0/3486-package-upload-non-active-resources.yaml
Outdated
Show resolved
Hide resolved
* added failing tests * tests pass * Added changelog and javadocs * fixed package tests for resources with no active field * adding jira ticket number * feedback from code review' * switching to old style switch statement'
Addresses issue #3486