Class FhirElement
A FHIR element.
Implements
Inherited Members
Namespace: Microsoft.Health.Fhir.CodeGenCommon.Models
Assembly: Microsoft.Health.Fhir.CodeGenCommon.dll
Syntax
public class FhirElement : FhirPropertyBase
Constructors
| Improve this Doc View SourceFhirElement(FhirComplex, String, String, String, String, Uri, Int32, String, String, String, String, String, Dictionary<String, FhirElementType>, Int32, String, Nullable<Boolean>, String, Nullable<Boolean>, Nullable<Boolean>, Boolean, String, Object, String, Object, String, Object, Boolean, Boolean, String, String, String, List<FhirElement.PropertyRepresentationCodes>, Dictionary<String, List<FhirElementDefMapping>>)
Initializes a new instance of the FhirElement class.
Declaration
public FhirElement(FhirComplex rootArtifact, string id, string path, string basePath, string explicitName, Uri url, int fieldOrder, string shortDescription, string purpose, string comment, string validationRegEx, string baseTypeName, Dictionary<string, FhirElementType> elementTypes, int cardinalityMin, string cardinalityMax, bool? isModifier, string isModifierReason, bool? isSummary, bool? isMustSupport, bool isSimple, string defaultFieldName, object defaultFieldValue, string fixedFieldName, object fixedFieldValue, string patternFieldName, object patternFieldValue, bool isInherited, bool modifiesParent, string bindingStrength, string bindingName, string valueSet, List<FhirElement.PropertyRepresentationCodes> representations, Dictionary<string, List<FhirElementDefMapping>> mappings)
Parameters
| Type | Name | Description |
|---|---|---|
| FhirComplex | rootArtifact | The root artifact that contains this definition. |
| System.String | id | Id for this element. |
| System.String | path | Dot notation path for this element. |
| System.String | basePath | The dot-notation path to the base definition of this record. |
| System.String | explicitName | Explicit name of this element, if present. |
| Uri | url | URL of this element (if present). |
| System.Int32 | fieldOrder | The field order. |
| System.String | shortDescription | Information describing the short. |
| System.String | purpose | The purpose of this element. |
| System.String | comment | The comment. |
| System.String | validationRegEx | The validation RegEx. |
| System.String | baseTypeName | Name of the base type. |
| Dictionary<System.String, FhirElementType> | elementTypes | Types and associated profiles. |
| System.Int32 | cardinalityMin | The cardinality minimum. |
| System.String | cardinalityMax | The cardinality maximum. |
| System.Nullable<System.Boolean> | isModifier | If this element modifies the meaning of its parent. |
| System.String | isModifierReason | Reason this element is a modifier. |
| System.Nullable<System.Boolean> | isSummary | If this element should be included in summaries. |
| System.Nullable<System.Boolean> | isMustSupport | If this element is marked as 'must support'. |
| System.Boolean | isSimple | If this element is a 'simple' element (no extended props). |
| System.String | defaultFieldName | Name of a default field, e.g., defaultUri, defaultCode. |
| System.Object | defaultFieldValue | Value of a default field. |
| System.String | fixedFieldName | Name of a fixed field, e.g., fixedUri, fixedCode. |
| System.Object | fixedFieldValue | Value of a fixed field. |
| System.String | patternFieldName | Name of a pattern field, e.g., fixedUri, fixedCode. |
| System.Object | patternFieldValue | Value of a pattern field. |
| System.Boolean | isInherited | If this element is inherited from somewhere else. |
| System.Boolean | modifiesParent | If this element hides a field of its parent. |
| System.String | bindingStrength | Strength of binding: required|extensible|preferred|example. |
| System.String | bindingName | |
| System.String | valueSet | URL of the value set bound to this element. |
| List<FhirElement.PropertyRepresentationCodes> | representations | Codes that define how this element is represented in instances, when the deviation varies from the normal case. |
| Dictionary<System.String, List<FhirElementDefMapping>> | mappings |
FhirElement(FhirComplex, String, String, String, String, Uri, Int32, String, String, String, String, String, Int32, Int32, Boolean, Boolean, Boolean, Boolean, String, Boolean, Boolean, Boolean, String, List<String>, String, String, Nullable<FhirElement.ElementDefinitionBindingStrength>, String, Dictionary<String, FhirElementType>, String, Object, Dictionary<String, FhirSlicing>, String, Object, String, Object, String, Boolean, Dictionary<String, List<FhirElementDefMapping>>, HashSet<String>, Dictionary<String, FhirConstraint>)
Initializes a new instance of the FhirElement class.
Declaration
public FhirElement(FhirComplex rootArtifact, string id, string path, string basePath, string explicitName, Uri url, int fieldOrder, string shortDescription, string purpose, string comment, string validationRegEx, string baseTypeName, int cardinalityMin, int cardinalityMax, bool isInherited, bool modifiesParent, bool hidesParent, bool isModifier, string isModifierReason, bool isSummary, bool isMustSupport, bool isSimple, string codesName, List<string> codes, string valueSet, string bindingStrength, FhirElement.ElementDefinitionBindingStrength? valueSetBindingStrength, string bindingName, Dictionary<string, FhirElementType> elementTypes, string defaultFieldName, object defaultFieldValue, Dictionary<string, FhirSlicing> slicing, string fixedFieldName, object fixedFieldValue, string patternFieldName, object patternFieldValue, string fiveWs, bool inDifferential, Dictionary<string, List<FhirElementDefMapping>> mappings, HashSet<string> conditions, Dictionary<string, FhirConstraint> constraints)
Parameters
| Type | Name | Description |
|---|---|---|
| FhirComplex | rootArtifact | |
| System.String | id | |
| System.String | path | |
| System.String | basePath | |
| System.String | explicitName | |
| Uri | url | |
| System.Int32 | fieldOrder | |
| System.String | shortDescription | |
| System.String | purpose | |
| System.String | comment | |
| System.String | validationRegEx | |
| System.String | baseTypeName | |
| System.Int32 | cardinalityMin | |
| System.Int32 | cardinalityMax | |
| System.Boolean | isInherited | |
| System.Boolean | modifiesParent | |
| System.Boolean | hidesParent | |
| System.Boolean | isModifier | |
| System.String | isModifierReason | |
| System.Boolean | isSummary | |
| System.Boolean | isMustSupport | |
| System.Boolean | isSimple | |
| System.String | codesName | |
| List<System.String> | codes | |
| System.String | valueSet | |
| System.String | bindingStrength | |
| System.Nullable<FhirElement.ElementDefinitionBindingStrength> | valueSetBindingStrength | |
| System.String | bindingName | |
| Dictionary<System.String, FhirElementType> | elementTypes | |
| System.String | defaultFieldName | |
| System.Object | defaultFieldValue | |
| Dictionary<System.String, FhirSlicing> | slicing | |
| System.String | fixedFieldName | |
| System.Object | fixedFieldValue | |
| System.String | patternFieldName | |
| System.Object | patternFieldValue | |
| System.String | fiveWs | |
| System.Boolean | inDifferential | |
| Dictionary<System.String, List<FhirElementDefMapping>> | mappings | |
| HashSet<System.String> | conditions | |
| Dictionary<System.String, FhirConstraint> | constraints |
Properties
| Improve this Doc View SourceBindingName
Gets the binding name for a value set binding to this element.
Declaration
public string BindingName { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
BindingStrength
Gets the binding strength for a value set binding to this element.
Declaration
public string BindingStrength { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
CardinalityMax
Gets the cardinality maximum, -1 for unbounded (e.g., *).
Declaration
public int CardinalityMax { get; }
Property Value
| Type | Description |
|---|---|
| System.Int32 | The cardinality maximum. |
CardinalityMaxString
Gets the cardinality maximum string.
Declaration
public string CardinalityMaxString { get; }
Property Value
| Type | Description |
|---|---|
| System.String | The cardinality maximum string. |
CardinalityMin
Gets the cardinality minimum.
Declaration
public int CardinalityMin { get; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
Codes
Gets the codes.
Declaration
public List<string> Codes { get; }
Property Value
| Type | Description |
|---|---|
| List<System.String> |
CodesName
Gets or sets Code Values allowed for this property.
Declaration
public string CodesName { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
Conditions
Gets the conditions.
Declaration
public HashSet<string> Conditions { get; }
Property Value
| Type | Description |
|---|---|
| HashSet<System.String> |
Constraints
Gets the constraints.
Declaration
public IEnumerable<FhirConstraint> Constraints { get; }
Property Value
| Type | Description |
|---|---|
| IEnumerable<FhirConstraint> |
ConstraintsByKey
Gets the constraints by key.
Declaration
public Dictionary<string, FhirConstraint> ConstraintsByKey { get; }
Property Value
| Type | Description |
|---|---|
| Dictionary<System.String, FhirConstraint> |
DefaultFieldName
Gets the name of the default field.
Declaration
public string DefaultFieldName { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
DefaultFieldValue
Gets the default field value.
Declaration
public object DefaultFieldValue { get; }
Property Value
| Type | Description |
|---|---|
| System.Object |
ElementTypes
Gets types and their associated profiles for this element.
Declaration
public Dictionary<string, FhirElementType> ElementTypes { get; }
Property Value
| Type | Description |
|---|---|
| Dictionary<System.String, FhirElementType> | Types and their associated profiles for this element. |
ExplicitName
Gets the explicit name of this element, if one was specified.
Declaration
public string ExplicitName { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
FhirCardinality
Gets the FHIR cardinality string: min..max.
Declaration
public string FhirCardinality { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
FieldOrder
Gets the field order.
Declaration
public int FieldOrder { get; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
FiveWs
Gets the five Ws mapping list for the current element.
Declaration
public string FiveWs { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
FixedFieldName
Gets the name of the fixed field.
Declaration
public string FixedFieldName { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
FixedFieldValue
Gets the fixed field value.
Declaration
public object FixedFieldValue { get; }
Property Value
| Type | Description |
|---|---|
| System.Object |
HidesParent
Gets a value indicating whether this field hides a parent field.
Declaration
public bool HidesParent { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
InDifferential
True if this element appears in the differential.
Declaration
public bool InDifferential { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
IsArray
Gets a value indicating whether this property is an array.
Declaration
public bool IsArray { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
IsInherited
Gets a value indicating whether this object is inherited.
Declaration
public bool IsInherited { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
IsModifier
Gets a value indicating whether this object is modifier.
Declaration
public bool IsModifier { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
IsModifierReason
Gets the is modifier reason.
Declaration
public string IsModifierReason { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
IsMustSupport
Gets a value indicating whether this object is must support.
Declaration
public bool IsMustSupport { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
IsOptional
Gets a value indicating whether this object is optional.
Declaration
public bool IsOptional { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
IsSimple
Gets a value indicating whether this object is simple (no extended properties).
Declaration
public bool IsSimple { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
IsSummary
Gets a value indicating whether this object is summary.
Declaration
public bool IsSummary { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
ModifiesParent
Gets a value indicating whether the modifies parent.
Declaration
public bool ModifiesParent { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
PatternFieldName
Gets the name of the pattern field.
Declaration
public string PatternFieldName { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
PatternFieldValue
Gets the pattern field value.
Declaration
public object PatternFieldValue { get; }
Property Value
| Type | Description |
|---|---|
| System.Object |
Representations
Gets the representation codes.
Declaration
public List<FhirElement.PropertyRepresentationCodes> Representations { get; }
Property Value
| Type | Description |
|---|---|
| List<FhirElement.PropertyRepresentationCodes> |
Slicing
Gets the slicing information.
Declaration
public Dictionary<string, FhirSlicing> Slicing { get; }
Property Value
| Type | Description |
|---|---|
| Dictionary<System.String, FhirSlicing> |
ValueSet
Gets the value set this element is bound to.
Declaration
public string ValueSet { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
ValueSetBindingStrength
Gets the element binding strength.
Declaration
public FhirElement.ElementDefinitionBindingStrength? ValueSetBindingStrength { get; }
Property Value
| Type | Description |
|---|---|
| System.Nullable<FhirElement.ElementDefinitionBindingStrength> |
Methods
| Improve this Doc View SourceAddCondition(String)
Declaration
public void AddCondition(string condition)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | condition |
AddConstraint(FhirConstraint, Boolean)
Adds a constraint.
Declaration
public void AddConstraint(FhirConstraint constraint, bool copyIfNew = false)
Parameters
| Type | Name | Description |
|---|---|---|
| FhirConstraint | constraint | The constraint. |
| System.Boolean | copyIfNew | (Optional) True to copy if new. |
AddSlice(String, String, String, String, String, FhirComplex)
Adds a component from an element.
Declaration
public bool AddSlice(string url, string sliceName, string shortDescription, string purpose, string comment, FhirComplex parent)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | url | URL of this element (if present). |
| System.String | sliceName | Name of the element. |
| System.String | shortDescription | |
| System.String | purpose | |
| System.String | comment | |
| FhirComplex | parent | The parent. |
Returns
| Type | Description |
|---|---|
| System.Boolean | True if it succeeds, false if it fails. |
AddSlicing(FhirSlicing)
Adds a slicing.
Declaration
public void AddSlicing(FhirSlicing slicing)
Parameters
| Type | Name | Description |
|---|---|---|
| FhirSlicing | slicing | Slicing information for this element, if present. |
Clone()
Makes a deep copy of this object.
Declaration
public object Clone()
Returns
| Type | Description |
|---|---|
| System.Object | A copy of this object. |
ConvertFhirRepresentations(IEnumerable<String>)
FHIR representation codes to enum.
Declaration
public static List<FhirElement.PropertyRepresentationCodes> ConvertFhirRepresentations(IEnumerable<string> codes)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<System.String> | codes | The codes. |
Returns
| Type | Description |
|---|---|
| List<FhirElement.PropertyRepresentationCodes> | A List<PropertyRepresentationCodes> |
CopyWith(FhirComplex, String, String, Nullable<Int32>, String)
Copies the with.
Declaration
public FhirElement CopyWith(FhirComplex root = null, string id = null, string path = null, int? cardinalityMin = null, string cardinalityMax = null)
Parameters
| Type | Name | Description |
|---|---|---|
| FhirComplex | root | (Optional) The root. |
| System.String | id | (Optional) Id for this element. |
| System.String | path | (Optional) Dot notation path for this element. |
| System.Nullable<System.Int32> | cardinalityMin | (Optional) The cardinality minimum. |
| System.String | cardinalityMax | (Optional) The cardinality maximum. |
Returns
| Type | Description |
|---|---|
| FhirElement | A FhirElement. |
DeepCopy(Dictionary<String, String>, Boolean, Boolean, Dictionary<String, ValueSetReferenceInfo>, FhirComplex)
Deep copy.
Declaration
public FhirElement DeepCopy(Dictionary<string, string> primitiveTypeMap, bool copySlicing, bool canHideParentFields, Dictionary<string, ValueSetReferenceInfo> valueSetReferences, FhirComplex destinationArtifact = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Dictionary<System.String, System.String> | primitiveTypeMap | The primitive type map. |
| System.Boolean | copySlicing | True to copy slicing. |
| System.Boolean | canHideParentFields | True if can hide parent fields, false if not. |
| Dictionary<System.String, ValueSetReferenceInfo> | valueSetReferences | Value Set URLs and lists of FHIR paths that reference them. |
| FhirComplex | destinationArtifact | (Optional) Destination artifact. |
Returns
| Type | Description |
|---|---|
| FhirElement | A FhirElement. |
ExpandNamesAndTypes(out String, FhirTypeBase.NamingConvention, FhirTypeBase.NamingConvention, Boolean, String, Boolean)
Names and types for export.
Declaration
public List<FhirElement.ExpandedElementRec> ExpandNamesAndTypes(out string rootExportName, FhirTypeBase.NamingConvention nameConvention, FhirTypeBase.NamingConvention typeConvention, bool concatenatePath = false, string concatenationDelimiter = "", bool isComponent = false)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | rootExportName | [out] Export name of the root element. |
| FhirTypeBase.NamingConvention | nameConvention | The name convention. |
| FhirTypeBase.NamingConvention | typeConvention | The convention. |
| System.Boolean | concatenatePath | (Optional) True to concatenate path. |
| System.String | concatenationDelimiter | (Optional) The concatenation delimiter. |
| System.Boolean | isComponent | (Optional) True if is component, false if not. |
Returns
| Type | Description |
|---|---|
| List<Microsoft.Health.Fhir.CodeGenCommon.Models.FhirElement.ExpandedElementRec> | A Dictionary of field names (e.g., ValueBoolean) and types (e.g., boolean). |
NamesAndTypesForExport(FhirTypeBase.NamingConvention, FhirTypeBase.NamingConvention, Boolean, String, Boolean)
Names and types for export.
Declaration
public Dictionary<string, string> NamesAndTypesForExport(FhirTypeBase.NamingConvention nameConvention, FhirTypeBase.NamingConvention typeConvention, bool concatenatePath = false, string concatenationDelimiter = "", bool isComponent = false)
Parameters
| Type | Name | Description |
|---|---|---|
| FhirTypeBase.NamingConvention | nameConvention | The name convention. |
| FhirTypeBase.NamingConvention | typeConvention | The convention. |
| System.Boolean | concatenatePath | (Optional) True to concatenate path. |
| System.String | concatenationDelimiter | (Optional) The concatenation delimiter. |
| System.Boolean | isComponent | (Optional) True if is component, false if not. |
Returns
| Type | Description |
|---|---|
| Dictionary<System.String, System.String> | A Dictionary of field names (e.g., ValueBoolean) and types (e.g., boolean). |
SetInDifferential()
Sets in differential.
Declaration
public void SetInDifferential()