Class ProfileBuilder


  • public class ProfileBuilder
    extends Object
    A utility class for building profiles from a base structure definition
    • Constructor Detail

      • ProfileBuilder

        public ProfileBuilder​(Class<?> type,
                              String url,
                              String version)
    • Method Detail

      • binding

        public ProfileBuilder binding​(String id,
                                      ElementDefinition.Binding binding)
        Add value set binding to the element definition with the given id.
        Parameters:
        id - the id
        binding - the value set binding
        Returns:
        this profile builder
      • cardinality

        public ProfileBuilder cardinality​(String id,
                                          int min,
                                          String max)
        Add a cardinality constraint to the element definition with the given id.
        Parameters:
        id - the id
        min - the minimum cardinality
        max - the maximum cardinality
        Returns:
        this profile builder
      • constraint

        public ProfileBuilder constraint​(String id,
                                         ElementDefinition.Constraint... constraint)
        Add constraint objects to the element definition with the given id,
        Parameters:
        id - the id
        constraint - the constraint object
        Returns:
        this profile builder
      • fixed

        public ProfileBuilder fixed​(String id,
                                    Element fixed)
        Add a fixed value constraint to the element definition with the given id.
        Parameters:
        id - the id
        fixed - the fixed value
        Returns:
        this profile builder
      • pattern

        public ProfileBuilder pattern​(String id,
                                      Element pattern)
        Add a pattern value constraint to the element definition with the given id.
        Parameters:
        id - the id
        pattern - the pattern value
        Returns:
        this profile builder
      • slice

        public ProfileBuilder slice​(String id,
                                    String sliceName,
                                    Class<?> type,
                                    int min,
                                    String max)
        Add a slice to the element definition the given id.
        Parameters:
        id - the id
        sliceName - the slice name
        type - the type
        min - the minimum cardinality
        max - the maximum cardinality
        Returns:
        this profile builder
      • slicing

        public ProfileBuilder slicing​(String id,
                                      ElementDefinition.Slicing slicing)
        Add a slice definition to the element definition with the given id.
        Parameters:
        id - the id
        slicing - the slicing
        Returns:
        this profile builder
      • type

        public ProfileBuilder type​(String id,
                                   ElementDefinition.Type... type)
        Add a type constraint to the element definition with the given id.
        Parameters:
        id - the id
        type - the type
        Returns:
        this profile builder
      • binding

        public static ElementDefinition.Binding binding​(BindingStrength strength,
                                                        String valueSet)
        Create a value set binding from the given strength and valueSet.
        Parameters:
        strength - the strength
        valueSet - the value set
        Returns:
        a value set binding
      • binding

        public static ElementDefinition.Binding binding​(BindingStrength strength,
                                                        String valueSet,
                                                        String maxValueSet)
        Create a value set binding from the given strength, value set, and max value set.
        Parameters:
        strength - the strength
        valueSet - the value set
        maxValueSet - the max value set
        Returns:
        a value set binding
      • constraint

        public static ElementDefinition.Constraint constraint​(String key,
                                                              ConstraintSeverity severity,
                                                              String human,
                                                              String expression)
        Create a constraint from the given key, severity, human-readable description, and FHIRPath expression.
        Parameters:
        key - the key
        severity - the severity
        human - the human-readable description
        expression - the FHIRPath expression
        Returns:
        a constraint
      • profile

        public static List<String> profile​(String... profile)
        Create a list of profiles (FHIR string) from the provided Java strings.
        Parameters:
        profile - the profile
        Returns:
        a list of profiles (FHIR string)
      • targetProfile

        public static List<String> targetProfile​(String... targetProfile)
        Create a list of target profiles (FHIR string) from the provided Java strings.
        Parameters:
        targetProfile - the target profile
        Returns:
        a list of target profiles (FHIR string)
      • type

        public static ElementDefinition.Type type​(String code)
        Create a type from the given code.
        Parameters:
        code - the code
        Returns:
        a type
      • type

        public static ElementDefinition.Type type​(String code,
                                                  List<String> profile)
        Create a type from the given code and profile.
        Parameters:
        code - the code
        profile - the profile
        Returns:
        a type
      • type

        public static ElementDefinition.Type type​(String code,
                                                  List<String> profile,
                                                  List<String> targetProfile)
        Create a type from the given code, profile, and target profile.
        Parameters:
        code - the code
        profile - the profile
        targetProfile - the target profile
        Returns:
        a type