google / android-fhir

The Android FHIR SDK is a set of Kotlin libraries for building offline-capable, mobile-first healthcare applications using the HL7® FHIR® standard on Android.
https://google.github.io/android-fhir/
Apache License 2.0
481 stars 259 forks source link

Support Custom Search Parameter in x-fhir-query #2555

Closed asad-zaman closed 3 months ago

asad-zaman commented 4 months ago

IMPORTANT: All PRs must be linked to an issue (except for extremely trivial and straightforward changes).

Fixes #2554

Description Add support to consider custom search parameters during x-fhir-query execution.

Alternative(s) considered Have you considered any alternatives? And if so, why have you chosen the approach in this PR?

Type Choose one: (Bug fix | Feature)

Checklist

asad-zaman commented 4 months ago

Hi @MJ1998, I have made the changes. Now use SearchParamDefinitionsProvider instead of FhirEngineConfiguration. Thanks for the suggestion.

asad-zaman commented 3 months ago

@MJ1998, Could you please check now?

asad-zaman commented 3 months ago

Hi @jingtang10, If it is ok, then could you please initiate the merge? Thanks 😊

asad-zaman commented 3 months ago

Hi @MJ1998, I didn't see any Kokoro Build details. Isn't it finished yet? Also, I didn't see any label about kokoro run like below. May be I missed something. Screenshot_20240613_174414_Chrome

asad-zaman commented 3 months ago

Hi @MJ1998, Any update?

MJ1998 commented 3 months ago

The kokoro label can only be added by core team with permissions.

Currently the kokoro seems to be running. Does it always run? Or does it fail? Can you tag me once the kokoro provides a status?

asad-zaman commented 3 months ago

Hi @jingtang10, Could you please start the Kokoro build. I didn't see any status about kokoro build. Thanks

asad-zaman commented 3 months ago

The kokoro label can only be added by core team with permissions.

Currently the kokoro seems to be running. Does it always run? Or does it fail? Can you tag me once the kokoro provides a status?

@MJ1998, I didn't see any details about kokoro build. Even I don't know whether kokoro is already run or not. I didn't get any status about success or failure. In my last ticket, I got email when kokoro failed or successed. Hence it seems to me that kokoro isn't started yet.

asad-zaman commented 3 months ago

Hi @MJ1998, Here is the Kokoro detail. In the device test, one case failed, which is unrelated to my changes. Could you please check and guide me so that I can resolve it. Thanks

MediumPhone.arm-33-en_US-portrait com.google.android.fhir.datacapture.test.QuestionnaireUiEspressoTest#clearAllAnswers_shouldClearDraftAnswer 
androidx.test.espresso.base.AssertionErrorHandler$AssertionFailedWithCauseError: expected to be empty

Here is the StackTrace:

<testcase name="clearAllAnswers_shouldClearDraftAnswer" classname="com.google.android.fhir.datacapture.test.QuestionnaireUiEspressoTest" time="1.998">
    <failure>androidx.test.espresso.base.AssertionErrorHandler$AssertionFailedWithCauseError: expected to be empty
but was: 01/05/
    at dalvik.system.VMStack.getThreadStackTrace(Native Method)
    at java.lang.Thread.getStackTrace(Thread.java:1841)
    at androidx.test.espresso.base.AssertionErrorHandler.handleSafely(AssertionErrorHandler.java:3)
    at androidx.test.espresso.base.AssertionErrorHandler.handleSafely(AssertionErrorHandler.java:1)
    at androidx.test.espresso.base.DefaultFailureHandler$TypedFailureHandler.handle(DefaultFailureHandler.java:4)
    at androidx.test.espresso.base.DefaultFailureHandler.handle(DefaultFailureHandler.java:5)
    at androidx.test.espresso.ViewInteraction.waitForAndHandleInteractionResults(ViewInteraction.java:5)
    at androidx.test.espresso.ViewInteraction.check(ViewInteraction.java:12)
    at com.google.android.fhir.datacapture.test.QuestionnaireUiEspressoTest.clearAllAnswers_shouldClearDraftAnswer(QuestionnaireUiEspressoTest.kt:548)
    ... 34 trimmed
Caused by: expected to be empty
but was: 01/05/
    at com.google.android.fhir.datacapture.test.QuestionnaireUiEspressoTest.clearAllAnswers_shouldClearDraftAnswer$lambda$42(QuestionnaireUiEspressoTest.kt:549)
    at com.google.android.fhir.datacapture.test.QuestionnaireUiEspressoTest.$r8$lambda$JAARUac_05SPY64lQllLx4zUuio(Unknown Source:0)
    at com.google.android.fhir.datacapture.test.QuestionnaireUiEspressoTest$$ExternalSyntheticLambda0.check(Unknown Source:0)
    at androidx.test.espresso.ViewInteraction$SingleExecutionViewAssertion.check(ViewInteraction.java:2)
    at androidx.test.espresso.ViewInteraction$2.call(ViewInteraction.java:14)
    at androidx.test.espresso.ViewInteraction$2.call(ViewInteraction.java:1)
    at java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at android.os.Handler.handleCallback(Handler.java:942)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loopOnce(Looper.java:201)
    at android.os.Looper.loop(Looper.java:288)
    at android.app.ActivityThread.main(ActivityThread.java:7872)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)

    </failure>
  </testcase>
MJ1998 commented 3 months ago

Hey how did you get the failed test case? These seem to pass for me locally and strangely the kokoro is never-ending @asad-zaman

asad-zaman commented 3 months ago

Hi @MJ1998, Thanks for your quick response. Here&prefix=&forceOnObjectsSortingFiltering=false) is the detail of the kokoro run. Please check.

Go to the above link and navigate to the path according below screenshot and check the file named test_result_1.xml.

tmp_25a47711-9249-40a2-9758-e359d30c5007

FYI, In my local machine, the above mentioned test case also passed.

MJ1998 commented 3 months ago

This is merged @asad-zaman. Thanks for the PR and fixing custom search parameter in x-fhir-query.