Package org.linuxforhealth.fhir.profile
Class ProfileSupport
- java.lang.Object
-
- org.linuxforhealth.fhir.profile.ProfileSupport
-
public final class ProfileSupport extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static CacheManager.Configuration
BINDING_CACHE_CONFIG
static java.lang.String
BINDING_CACHE_NAME
static CacheManager.Configuration
CONSTRAINT_CACHE_CONFIG
static java.lang.String
CONSTRAINT_CACHE_NAME
static CacheManager.Configuration
ELEMENT_DEF_CACHE_CONFIG
static java.lang.String
ELEMENT_DEF_CACHE_NAME
static java.lang.String
HL7_STRUCTURE_DEFINITION_URL_PREFIX
static java.lang.String
HL7_VALUE_SET_URL_PREFIX
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ElementDefinition.Binding
getBinding(java.lang.String path)
static java.util.Map<java.lang.String,ElementDefinition.Binding>
getBindingMap(java.lang.String url)
static java.util.List<ElementDefinition.Constraint>
getConstraintDifferential(ElementDefinition elementDefinition)
static java.util.Set<java.lang.String>
getConstraintKeys(StructureDefinition structureDefinition)
static java.util.Set<java.lang.String>
getConstraintKeys(StructureDefinition.Differential differential)
static java.util.Set<java.lang.String>
getConstraintKeys(ElementDefinition elementDefinition)
static java.util.List<Constraint>
getConstraints(java.lang.String url, java.lang.Class<?> type)
static java.util.List<Constraint>
getConstraints(java.util.List<java.lang.String> urls, java.lang.Class<?> type)
static java.util.List<Constraint>
getConstraints(Resource resource)
Get constraints for all the resource-asserted profiles of the passed resource.static ElementDefinition
getElementDefinition(java.lang.String path)
static java.util.Map<java.lang.String,ElementDefinition>
getElementDefinitionMap(java.lang.Class<?> type)
static java.util.Map<java.lang.String,ElementDefinition>
getElementDefinitionMap(java.lang.String url)
static StructureDefinition
getProfile(java.lang.String url)
static StructureDefinition
getProfile(java.lang.String url, java.lang.Class<?> type)
static java.util.Set<java.lang.String>
getReferencedProfileConstraintKeys(ElementDefinition elementDefinition)
static java.util.List<java.lang.String>
getResourceAssertedProfiles(Resource resource)
static StructureDefinition
getStructureDefinition(java.lang.Class<?> modelClass)
static StructureDefinition
getStructureDefinition(java.lang.String url)
static java.lang.String
getUrl(StructureDefinition profile)
static java.lang.String
getVersion(StructureDefinition profile)
static boolean
hasConstraintDifferential(ElementDefinition elementDefinition)
static boolean
hasResourceAssertedProfile(Resource resource, StructureDefinition profile)
static boolean
isApplicable(StructureDefinition profile, java.lang.Class<?> type)
Is the StructureDefinition applicable to the resource or element type?static boolean
isProfile(StructureDefinition structureDefinition)
static boolean
isSlice(ElementDefinition elementDefinition)
static boolean
isSliceDefinition(ElementDefinition elementDefinition)
-
-
-
Field Detail
-
HL7_STRUCTURE_DEFINITION_URL_PREFIX
public static final java.lang.String HL7_STRUCTURE_DEFINITION_URL_PREFIX
- See Also:
- Constant Field Values
-
HL7_VALUE_SET_URL_PREFIX
public static final java.lang.String HL7_VALUE_SET_URL_PREFIX
- See Also:
- Constant Field Values
-
CONSTRAINT_CACHE_NAME
public static final java.lang.String CONSTRAINT_CACHE_NAME
- See Also:
- Constant Field Values
-
ELEMENT_DEF_CACHE_NAME
public static final java.lang.String ELEMENT_DEF_CACHE_NAME
- See Also:
- Constant Field Values
-
BINDING_CACHE_NAME
public static final java.lang.String BINDING_CACHE_NAME
- See Also:
- Constant Field Values
-
CONSTRAINT_CACHE_CONFIG
public static final CacheManager.Configuration CONSTRAINT_CACHE_CONFIG
-
ELEMENT_DEF_CACHE_CONFIG
public static final CacheManager.Configuration ELEMENT_DEF_CACHE_CONFIG
-
BINDING_CACHE_CONFIG
public static final CacheManager.Configuration BINDING_CACHE_CONFIG
-
-
Method Detail
-
getUrl
public static java.lang.String getUrl(StructureDefinition profile)
-
getVersion
public static java.lang.String getVersion(StructureDefinition profile)
-
isSlice
public static boolean isSlice(ElementDefinition elementDefinition)
-
isSliceDefinition
public static boolean isSliceDefinition(ElementDefinition elementDefinition)
-
getReferencedProfileConstraintKeys
public static java.util.Set<java.lang.String> getReferencedProfileConstraintKeys(ElementDefinition elementDefinition)
-
hasConstraintDifferential
public static boolean hasConstraintDifferential(ElementDefinition elementDefinition)
-
getConstraintDifferential
public static java.util.List<ElementDefinition.Constraint> getConstraintDifferential(ElementDefinition elementDefinition)
-
getBinding
public static ElementDefinition.Binding getBinding(java.lang.String path)
-
getBindingMap
public static java.util.Map<java.lang.String,ElementDefinition.Binding> getBindingMap(java.lang.String url)
-
getConstraints
public static java.util.List<Constraint> getConstraints(java.util.List<java.lang.String> urls, java.lang.Class<?> type)
-
getConstraints
public static java.util.List<Constraint> getConstraints(Resource resource)
Get constraints for all the resource-asserted profiles of the passed resource.- Parameters:
resource
-- Returns:
-
getResourceAssertedProfiles
public static java.util.List<java.lang.String> getResourceAssertedProfiles(Resource resource)
-
hasResourceAssertedProfile
public static boolean hasResourceAssertedProfile(Resource resource, StructureDefinition profile)
-
getConstraints
public static java.util.List<Constraint> getConstraints(java.lang.String url, java.lang.Class<?> type)
- Parameters:
url
- the canonical url (with optional version postfix and optional fragment id for contained resources) for a profile in the registrytype
- the target resource or element type for the profile- Returns:
-
getElementDefinition
public static ElementDefinition getElementDefinition(java.lang.String path)
-
getElementDefinitionMap
public static java.util.Map<java.lang.String,ElementDefinition> getElementDefinitionMap(java.lang.Class<?> type)
-
getElementDefinitionMap
public static java.util.Map<java.lang.String,ElementDefinition> getElementDefinitionMap(java.lang.String url)
-
getConstraintKeys
public static java.util.Set<java.lang.String> getConstraintKeys(StructureDefinition structureDefinition)
-
getConstraintKeys
public static java.util.Set<java.lang.String> getConstraintKeys(StructureDefinition.Differential differential)
-
getConstraintKeys
public static java.util.Set<java.lang.String> getConstraintKeys(ElementDefinition elementDefinition)
-
getProfile
public static StructureDefinition getProfile(java.lang.String url)
-
getProfile
public static StructureDefinition getProfile(java.lang.String url, java.lang.Class<?> type)
- Parameters:
url
- the canonical url (with optional version postfix and optional fragment id for contained resources) for a profile in the registrytype
- the resource or element type- Returns:
-
getStructureDefinition
public static StructureDefinition getStructureDefinition(java.lang.Class<?> modelClass)
-
getStructureDefinition
public static StructureDefinition getStructureDefinition(java.lang.String url)
- Parameters:
url
- the canonical url (with optional version postfix and optional fragment id for contained resources) for a profile in the registry- Returns:
- the StructureDefinition for the given canonical url if it exists, null otherwise
- Throws:
java.lang.ClassCastException
- if the resource exists in the registry but is not a StructureDefinition
-
isApplicable
public static boolean isApplicable(StructureDefinition profile, java.lang.Class<?> type)
Is the StructureDefinition applicable to the resource or element type?- Parameters:
profile
-type
- the resource or element type to check- Returns:
-
isProfile
public static boolean isProfile(StructureDefinition structureDefinition)
-
-