FI-3817: MedicationRequest Multiple_Or Search Fix#236
Open
esemple998 wants to merge 4 commits intomainfrom
Open
FI-3817: MedicationRequest Multiple_Or Search Fix#236esemple998 wants to merge 4 commits intomainfrom
esemple998 wants to merge 4 commits intomainfrom
Conversation
yunwwang
reviewed
Mar 21, 2025
| expect(result.result_message).to eq("Could not find order values from intent in any of the resources returned for Patient/#{patient_id}") | ||
| end | ||
|
|
||
| it 'passes if multiple-or search test does not return all existing values if associated resources do not contain all search params' do |
Contributor
There was a problem hiding this comment.
This unit test is not working. If I commented out this line in search_test
.filter { |resource| contains_all_search_params(resource, search_params) }
This unit test still pass which should fail.
And we need another unit test for the use case when the medication_request_2 has a different encounter id.
…rent than the one currently being searched with, and add spec test
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
The MedicationRequest resource has two optional search requirements on
patient+intent+encounterandpatient+intent+authoredon. Previously, when testing it with reference server with patient 355 only, both test failed with errors:These searches are not the first search, so the tests use the result from first search to compile search values. From the first search, there is one MedicationRequest with
intent=orderandencounter=Encounter/1, and also a MedicationRequest withintent=planand no encounter reference. The multiple_or search test therefore expected that patient 355 had MedicationRequests withintent=order, planandencounter=Encounter/1, but it was not able to recognize that the only MedicationRequest withintent=orderdid not have an encounter reference.Added a fix for this problem by adding a filter to the list of existing values that the multiple_or search test compiles. This filter makes it so that a multiple_or parameter value will not be added to the list of existing values if the value comes from a resource that does not include all of the search parameters that are currently being searched by. So, in this example, it would not add
orderto the list of existing values for theintentsearch param, since the resource that containsintentwith this value does not contain all of the search parameters for thepatient+intent+encountersearch (missing encounter).Testing Guidance
Run the MedicationRequest test with patient 355 and ensure the
patient+intent+encounterandpatient+intent+authoredonsearch tests pass. Also, run the spec tests and ensure those pass.