Interface IheFhirProfile

All Known Implementing Classes:
MhdProfile, PdqmProfile, PixmProfile

public interface IheFhirProfile
Common interface for IHE FHIR profile enumerations. Provides default implementations for common profile operations.
Since:
5.2
  • Field Details

    • IHE_ITI_PREFIX

      static final String IHE_ITI_PREFIX
      Common prefix of the canonical URLs of the IHE ITI profiles. A constant expression, so that the constants built from it remain usable in annotations and in enum constant arguments.
      See Also:
  • Method Details

    • getUrl

      String getUrl()
      Gets the canonical URL of the profile
      Returns:
      the profile URL
    • getResourceClass

      Class<? extends IBaseResource> getResourceClass()
      Gets the resource class associated with this profile
      Returns:
      the resource class, or null if not applicable
    • setProfile

      default void setProfile(Resource resource)
      Set the Meta/Profile of the resource
      Parameters:
      resource - FHIR resource
    • hasProfile

      default boolean hasProfile(Resource resource)
      Checks if the resource has this profile
      Parameters:
      resource - FHIR resource
      Returns:
      true if the resource has this profile
    • registerProfiles

      static <E extends Enum<E> & IheFhirProfile> void registerProfiles(FhirContext fhirContext, Class<E> profileEnum)
      Registers all profiles from an enum in the FhirContext
      Type Parameters:
      E - the enum type
      Parameters:
      fhirContext - FhirContext
      profileEnum - the enum class containing profiles
    • registerProfiles

      @SafeVarargs static <E extends Enum<E> & IheFhirProfile> void registerProfiles(FhirContext fhirContext, Class<E> profileEnum, Class<? extends IBase>... customTypes)
      Registers all profiles from an enum in the FhirContext, with additional custom types
      Type Parameters:
      E - the enum type
      Parameters:
      fhirContext - FhirContext
      profileEnum - the enum class containing profiles
      customTypes - additional custom types to register
    • profileForResource

      static <E extends Enum<E> & IheFhirProfile> Optional<E> profileForResource(IBaseResource resource, Class<E> profileEnum)
      Finds the profile enum value for a given resource
      Type Parameters:
      E - the enum type
      Parameters:
      resource - the FHIR resource
      profileEnum - the enum class containing profiles
      Returns:
      Optional containing the matching profile, or empty if not found
    • profileForUrl

      static <E extends Enum<E> & IheFhirProfile> Optional<E> profileForUrl(String url, Class<E> profileEnum)
      Finds the profile enum value for a given URL
      Type Parameters:
      E - the enum type
      Parameters:
      url - the profile URL
      profileEnum - the enum class containing profiles
      Returns:
      Optional containing the matching profile, or empty if not found