include

inline fun <R : Resource> Search.include(referenceParam: ReferenceClientParam, init: BaseSearch.() -> Unit = {})

Includes additional resources in the search results that reference that reference the resource on which include is being called. The developers may call include multiple times with different ResourceType to allow search api to return multiple referenced resource types.

e.g. The below example would return all the Patients with given-name as James and their associated active Practitioner and Organizations.

fhirEngine.search<Patient> {
filter(Patient.GIVEN, { value = "James" })
include<Practitioner>(Patient.GENERAL_PRACTITIONER) {
filter(Practitioner.ACTIVE, { value = of(true) })
}
include<Organization>(Patient.ORGANIZATION)
}

NOTE:

  • include doesn't support count.

  • Multiple includes of the same resource type do not guarantee the order of returned resources.


fun Search.include(resourceType: ResourceType, referenceParam: ReferenceClientParam, init: BaseSearch.() -> Unit = {})

Includes additional resources in the search results that reference the resource on which include is being called. The developers may call include multiple times with different ResourceType to allow search api to return multiple referenced resource types.

e.g. The below example would return all the Patients with given-name as James and their associated active Practitioner and Organizations.

fhirEngine.search<Patient> {
filter(Patient.GIVEN, { value = "James" })
include(ResourceType.Practitioner, Patient.GENERAL_PRACTITIONER) {
filter(Practitioner.ACTIVE, { value = of(true) })
}
include(ResourceType.Organization,Patient.ORGANIZATION)
}

NOTE:

  • include doesn't support count.

  • Multiple includes of the same resource type do not guarantee the order of returned resources.