Class FHIRRegistry

    • Method Detail

      • getInstance

        public static FHIRRegistry getInstance()
        Get the singleton instance of this class

        This first time that this method is called, all registry resource providers made available through the service loader are added to the registry

        Returns:
        the singleton instance of this class
      • register

        public void register​(FHIRRegistryResourceProvider provider)
        Add a registry resource provider to the registry
        Parameters:
        provider - the registry resource provider to be added
      • hasResource

        public boolean hasResource​(String url,
                                   Class<? extends Resource> resourceType)
        Indicates whether a resource for the given canonical url and resource type exists in the registry
        Parameters:
        url - the canonical url
        resourceType - the resource type
        Returns:
        true if a resource for the given canonical url and resource type exists in the registry, false otherwise
      • getLatestVersion

        public String getLatestVersion​(String url,
                                       Class<? extends Resource> resourceType)
        Get the latest version of a resource for the given url and resource type
        Parameters:
        url - the url
        resourceType - the resource type
        Returns:
        the latest version of a resource for the given url and resource type if exists, null otherwise
      • getResource

        public <T extends Resource> T getResource​(String url,
                                                  Class<T> resourceType)
        Get the resource for the given canonical url and resource type
        Parameters:
        url - the canonical url
        resourceType - the resource type
        Returns:
        the resource for the given canonical url and resource type if exists, null otherwise
        Throws:
        ClassCastException - if the resource exists in the registry but its type does not match given resource type
        IllegalArgumentException - if the resource type is not a definitional resource type
      • getResources

        public <T extends ResourceCollection<T> getResources​(Class<T> resourceType)
        Get the resources for the given resource type
        Parameters:
        resourceType - the resource type
        Returns:
        the resources for the given resource type
        Throws:
        IllegalArgumentException - if the resource type is not a definitional resource type
      • getProfiles

        public Collection<Canonical> getProfiles​(String type)
        Get the profiles that constrain the given resource type as a collection of Canonical URLs
        Parameters:
        type - the constrained resource type
        Returns:
        the profiles that constrain the given type as a collection of Canonical URLs
      • getSearchParameters

        public Collection<SearchParameter> getSearchParameters​(String type)
        Get the search parameters with the given search parameter type (e.g. string, token, etc.)

        The method getResources(Class) can be used to get all search parameters regardless of type

        Parameters:
        type - the search parameter type
        Returns:
        the search parameters with the given search parameter type
      • getProfiles

        public Map<String,​Set<Canonical>> getProfiles()
        Given the list of providers, the method scans through the list to find all profile resource, and merge them together in order to develop a list of resource specific canonical URLs.
        Returns: