revInclude

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

Includes additional resources in the search results that reference the resource on which revInclude is being called. The developers may call revInclude 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 Encounters and diabetic Conditions.

fhirEngine.search<Patient> {
filter(Patient.GIVEN, { value = "James" })
revInclude<Encounter>( Encounter.PATIENT)
revInclude<Condition>( Condition.PATIENT) {
filter(Condition.CODE, { value = of(diabetesCodeableConcept) })
}
}

NOTE:

  • revInclude doesn't support count.

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


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

Includes additional resources in the search results that reference the resource on which revInclude is being called. The developers may call revInclude 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 Encounters and Conditions.

fhirEngine.search<Patient> {
filter(Patient.GIVEN, { value = "James" })
revInclude(ResourceType.Encounter, Encounter.PATIENT)
revInclude(ResourceType.Condition, Condition.PATIENT) {
filter(Condition.CODE, { value = of(diabetesCodeableConcept) })
}
}

NOTE:

  • revInclude doesn't support count.

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