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