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

Fhir engine search does not return correct data. #2260

Open
mansikalraa opened this issue Oct 11, 2023 · 4 comments
Open

Fhir engine search does not return correct data. #2260

mansikalraa opened this issue Oct 11, 2023 · 4 comments
Assignees

Comments

@mansikalraa
Copy link

mansikalraa commented Oct 11, 2023

Describe the Issue
Fhir engine search does not return correct data when using include.

when try to replicate the query

%HOST_URL%/Encounter?type=%SYSTEM_URL%|%CODE%&status=%STATUS%&_include=Encounter:patient:Patient&_elements=_id,type,status&_total=accurate

with fhir engine search method :

      fhirEngine.search(ResourceType.Encounter) {
                filter(
                    Encounter.TYPE, {
                        value = of(Coding("%SYSTEM_URL%", "%CODE%", ""))
                    }
                )
                filter(
                    Encounter.STATUS, {
                        value = of("%STATUS%")
                    }
                )
                include(ResourceType.Patient, Encounter.SUBJECT)
            }

The fhir engine does not return any Patient resouce (patient resource should be returned, checked on our server)

Tried using Encounter.Patient in resource reference as well.

I could not find any documentation on how to use include with the search in fhir engine.
Is the code incorrect, or is it not returning the correct value?

@jingtang10 @fredhersch help would be appreciated.

Would you like to work on the issue?

@aditya-07
Copy link
Collaborator

@mansikalraa Could you please provide some test data ( encounters + associated patients) for us to test on our end?

@jingtang10 jingtang10 assigned mansikalraa and williamito and unassigned aditya-07 Feb 7, 2024
@jingtang10
Copy link
Collaborator

@williamito can you please help improving documentation for include / revinclude.

@jingtang10
Copy link
Collaborator

@mansikalraa thanks for raising this issue. can you please provide some test data as @aditya-07 requested?

@mansikalraa
Copy link
Author

@jingtang10 @aditya-07 Thank you for the response. While exploring the search feature, I was able to find how to retrieve the included resouce successfully.

fhirEngine.search(ResourceType.Encounter) {
                filter(
                    Encounter.TYPE, {
                        value = of(Coding("%SYSTEM_URL%", "%CODE%", ""))
                    }
                )
                filter(
                    Encounter.STATUS, {
                        value = of("%STATUS%")
                    }
                )
                include(ResourceType.Patient, Encounter.SUBJECT)
            }.forEach { searchResult ->
                  val includedResource = searchResult.included?.get(Encounter.SUBJECT.paramName)[0] as Patient
            }
        }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Blocked
Development

No branches or pull requests

4 participants