retrieveRelatedResources

fun retrieveRelatedResources(resource: Resource, relatedResourceKey: String, referenceFhirPathExpression: String?, relatedResourcesMap: Map<String, List<Resource>>? = null): List<Resource>

This method retrieves a list of relatedResources for a given resource from the facts map It fetches a list of facts of the given relatedResourceKey then iterates through this list in order to return a list of all resources whose subject reference matches the logical Id of the resource

Parameters

resource

The parent resource for which the related resources will be retrieved

relatedResourceKey

The key representing the relatedResources in the map

referenceFhirPathExpression

A fhir path expression used to retrieve the subject reference Id from the related resources