Interface PatientIdExtractor

All Known Implementing Classes:
GenericPatientIdExtractor

public interface PatientIdExtractor
Interface used to extract patient references from FHIR resources or search parameters. This is useful for obtaining patient context for auditing and other purposes.
  • Method Details

    • patientReferenceFromResource

      Optional<? extends IBaseReference> patientReferenceFromResource(IBaseResource resource)
      Returns the patient reference from a resource or Optional.empty() if the resource has none.
      Parameters:
      resource - FHIR resource
      Returns:
      patient reference from the resource
    • patientReferenceParameterName

      Optional<String> patientReferenceParameterName(String resourceName)
      Returns the name of the search parameter that is used to restrict a search to a certain patient
      Parameters:
      resourceName - resource Name
      Returns:
      the name of the patient search parameter
    • patientIdentifierParameterName

      Optional<String> patientIdentifierParameterName(RequestDetails requestDetails)
    • patientReferenceFromSearchParameter

      Optional<String> patientReferenceFromSearchParameter(RequestDetails requestDetails)
      Returns the patient ID from a search parameter referencing a Patient resource or Optional.empty() if the search has no such parameter or if it is empty. When a Patient resource is searched, the _id parameter value will be returned.
      Parameters:
      requestDetails - HAPI FHIR request details
      Returns:
      patient ID from the search parameters
    • patientIdentifierFromSearchParameter

      Optional<String> patientIdentifierFromSearchParameter(RequestDetails requestDetails)
      Returns the patient domain identifier from a search parameter or Optional.empty() if the search has no such parameter or if it is empty. This is usually a chained token parameter (i.e. subject.identifier=system|value), where this function will return the value. When a Patient resource is searched, the identifier parameter value will be returned.
      Parameters:
      requestDetails - HAPI FHIR request details
      Returns:
      patient identifier extension from the search parameters