Interface ChCoreContactPointCarrier

All Known Implementing Classes:
ChCoreOrganization, ChCoreOrganizationEpr, ChCorePatient, ChCorePatientEpr, ChCoreRelatedPerson, ChEmedEprOrganization, ChEmedEprPatient, ChEmedEprRelatedPerson, ChEmedOrganization

public interface ChCoreContactPointCarrier
This interface implements common logic to entities that may contain, within their FHIR resource's telecom list, email addresses, phone numbers and/or email addresses as defined by CH Core. This allows, for instance, both ChCoreOrganization and ChCorePatient to use the same code to handle these possible slices of the telecom list.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static class 
    Comparator of contact points based on their conveyed rank.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    default org.hl7.fhir.r4.model.ContactPoint
    addEmailAddress(String emailAddress)
    Adds an email address to the list of telecom entries.
    default org.hl7.fhir.r4.model.ContactPoint
    addPhoneNumber(String phoneNumber)
    Adds a phone number to the list of telecom entries.
    List<@NonNull org.hl7.fhir.r4.model.ContactPoint>
     
    boolean
     
    default List<@NonNull org.hl7.fhir.r4.model.ContactPoint>
    Resolves the entity's email addresses.
    default List<@NonNull String>
    Fetches the list of email addresses values.
    default List<@NonNull String>
    resolveEmailAddressesAsStrings(boolean activeOnly)
    Fetches the list of email address values, optionally checking if the period is valid at the moment.
    default List<@NonNull org.hl7.fhir.r4.model.ContactPoint>
    Resolves the entity's internet addresses, i.e.
    default List<@NonNull org.hl7.fhir.r4.model.ContactPoint>
    Resolves the entity's phone numbers.
    default List<@NonNull String>
    Fetches the list of phone number values.
    default List<@NonNull String>
    resolvePhoneNumbersAsStrings(boolean activeOnly)
    Fetches the list of email address values, optionally checking if the period is valid at the moment.
    default @Nullable org.hl7.fhir.r4.model.ContactPoint
    Resolves the list of email addresses of the entity and, if it is not empty, it gets the preferred email address from teh list, i.e. the email address contact point with the lowest rank.
    default @Nullable org.hl7.fhir.r4.model.ContactPoint
    Resolves the list of internet addresses of the entity and, if it is not empty, it gets the preferred internet address from teh list, i.e. the internet address contact point with the lowest rank.
    default @Nullable org.hl7.fhir.r4.model.ContactPoint
    Resolves the list of phone numbers of the entity and, if it is not empty, it gets the preferred phone number from teh list, i.e. the phone number contact point with the lowest rank.
    default List<@NonNull org.hl7.fhir.r4.model.ContactPoint>
    resolveTelecom(org.hl7.fhir.r4.model.ContactPoint.ContactPointSystem system)
    Resolves the entity's list of telecom entries for the given system.
  • Field Details

  • Method Details

    • getTelecom

      List<@NonNull org.hl7.fhir.r4.model.ContactPoint> getTelecom()
    • hasTelecom

      boolean hasTelecom()
    • resolveEmailAddresses

      @ExpectsValidResource default List<@NonNull org.hl7.fhir.r4.model.ContactPoint> resolveEmailAddresses()
      Resolves the entity's email addresses. It can be empty if no email address was specified.
    • resolvePreferredEmailAddress

      @ExpectsValidResource default @Nullable org.hl7.fhir.r4.model.ContactPoint resolvePreferredEmailAddress()
      Resolves the list of email addresses of the entity and, if it is not empty, it gets the preferred email address from teh list, i.e. the email address contact point with the lowest rank. Should several email addresses in the list share the lowest rank, any among them might be returned by this method. See ChCoreContactPointCarrier.ContactPointRankComparator for details on how the preferred email address is determined.
      Returns:
      The preferred email address contact point of this entity, or null if the entity resource conveys no email address.
    • addEmailAddress

      default org.hl7.fhir.r4.model.ContactPoint addEmailAddress(String emailAddress)
      Adds an email address to the list of telecom entries.

      This convenience method sets the contact point system to ContactPoint.ContactPointSystem.EMAIL

      Parameters:
      emailAddress - The email address to be added.
      Returns:
      The contact point containing the email address.
    • resolvePhoneNumbers

      @ExpectsValidResource default List<@NonNull org.hl7.fhir.r4.model.ContactPoint> resolvePhoneNumbers()
      Resolves the entity's phone numbers. It can be empty if no phone number was specified.
    • resolvePreferredPhoneNumber

      @ExpectsValidResource default @Nullable org.hl7.fhir.r4.model.ContactPoint resolvePreferredPhoneNumber()
      Resolves the list of phone numbers of the entity and, if it is not empty, it gets the preferred phone number from teh list, i.e. the phone number contact point with the lowest rank. Should several phone numbers in the list share the lowest rank, any among them might be returned by this method. See ChCoreContactPointCarrier.ContactPointRankComparator for details on how the preferred phone number is determined.
      Returns:
      The preferred phone number contact point of this entity, or null if the entity resource conveys no phone number.
    • addPhoneNumber

      default org.hl7.fhir.r4.model.ContactPoint addPhoneNumber(String phoneNumber)
      Adds a phone number to the list of telecom entries.

      This convenience method fixes the contact point system to ContactPoint.ContactPointSystem.PHONE

      Parameters:
      phoneNumber - The phone number to be added.
      Returns:
      The contact point containing the phone number.
    • resolveInternetAddresses

      @ExpectsValidResource default List<@NonNull org.hl7.fhir.r4.model.ContactPoint> resolveInternetAddresses()
      Resolves the entity's internet addresses, i.e. URLs. It can be empty if no internet address was specified.
    • resolvePreferredInternetAddress

      @ExpectsValidResource default @Nullable org.hl7.fhir.r4.model.ContactPoint resolvePreferredInternetAddress()
      Resolves the list of internet addresses of the entity and, if it is not empty, it gets the preferred internet address from teh list, i.e. the internet address contact point with the lowest rank. Should several internet addresses in the list share the lowest rank, any among them might be returned by this method. See ChCoreContactPointCarrier.ContactPointRankComparator for details on how the preferred internet address is determined.
      Returns:
      The preferred internet address contact point of this entity, or null if the entity resource conveys no internet address.
    • resolveTelecom

      @ExpectsValidResource default List<@NonNull org.hl7.fhir.r4.model.ContactPoint> resolveTelecom(org.hl7.fhir.r4.model.ContactPoint.ContactPointSystem system)
      Resolves the entity's list of telecom entries for the given system. If no telecom entries exist or if there are no entries for the given system, an empty list will be returned.
      Parameters:
      system - The contact point system for which to fetch telecom entries.
      Returns:
      The list of telecom entries for the given system, empty if no telecom entries exist or if no entries for the given system were found.
    • resolveEmailAddressesAsStrings

      default List<@NonNull String> resolveEmailAddressesAsStrings()
      Fetches the list of email addresses values. It does not check their period.
      Returns:
      The list of email addresses values.
    • resolveEmailAddressesAsStrings

      default List<@NonNull String> resolveEmailAddressesAsStrings(boolean activeOnly)
      Fetches the list of email address values, optionally checking if the period is valid at the moment.
      Parameters:
      activeOnly - If true, the method will filter out email address for which the current timestamp is not within the period boundaries, if defined.
      Returns:
      The list of matching email addresses, as strings.
    • resolvePhoneNumbersAsStrings

      default List<@NonNull String> resolvePhoneNumbersAsStrings()
      Fetches the list of phone number values. It does not check their period.
      Returns:
      The list of phone number values as strings.
    • resolvePhoneNumbersAsStrings

      default List<@NonNull String> resolvePhoneNumbersAsStrings(boolean activeOnly)
      Fetches the list of email address values, optionally checking if the period is valid at the moment.
      Parameters:
      activeOnly - If true, the method will filter out phone numbers for which the current timestamp is not within the period boundaries, if defined.
      Returns:
      The list of matching email addresses, as strings.