diff --git a/src/Hl7.Fhir.Conformance/Model/Generated/ElementDefinition.cs b/src/Hl7.Fhir.Conformance/Model/Generated/ElementDefinition.cs
index b6ea5165a4..cc1843ebed 100644
--- a/src/Hl7.Fhir.Conformance/Model/Generated/ElementDefinition.cs
+++ b/src/Hl7.Fhir.Conformance/Model/Generated/ElementDefinition.cs
@@ -1401,6 +1401,8 @@ public string Key
/// Why this constraint is necessary or appropriate
///
[FhirElement("requirements", InSummary=true, Order=40)]
+ [DeclaredType(Type = typeof(FhirString))]
+ [DeclaredType(Type = typeof(Markdown), Since = FhirRelease.R5)]
[DataMember]
public Hl7.Fhir.Model.Markdown Requirements
{
@@ -2113,6 +2115,8 @@ public Hl7.Fhir.Model.BindingStrength? Strength
/// Intended use of codes in the bound value set
///
[FhirElement("description", InSummary=true, Order=40)]
+ [DeclaredType(Type = typeof(FhirString))]
+ [DeclaredType(Type = typeof(Markdown), Since = FhirRelease.R5)]
[DataMember]
public Hl7.Fhir.Model.Markdown Description
{
@@ -2684,6 +2688,8 @@ public string Map
/// Comments about the mapping or its use
///
[FhirElement("comment", InSummary=true, Order=60)]
+ [DeclaredType(Type = typeof(FhirString))]
+ [DeclaredType(Type = typeof(Markdown), Since = FhirRelease.R5)]
[DataMember]
public Hl7.Fhir.Model.Markdown Comment
{
diff --git a/src/Hl7.Fhir.R5.Tests/Hl7.Fhir.R5.Tests.csproj b/src/Hl7.Fhir.R5.Tests/Hl7.Fhir.R5.Tests.csproj
index 6460da7b5b..7444d7d7f1 100644
--- a/src/Hl7.Fhir.R5.Tests/Hl7.Fhir.R5.Tests.csproj
+++ b/src/Hl7.Fhir.R5.Tests/Hl7.Fhir.R5.Tests.csproj
@@ -4,6 +4,10 @@
+
+ R5
+
+
Hl7.Fhir.R5.Tests
diff --git a/src/Hl7.Fhir.STU3/Model/Generated/ElementDefinition.cs b/src/Hl7.Fhir.STU3/Model/Generated/ElementDefinition.cs
index 20cdc0a6d7..a442624643 100644
--- a/src/Hl7.Fhir.STU3/Model/Generated/ElementDefinition.cs
+++ b/src/Hl7.Fhir.STU3/Model/Generated/ElementDefinition.cs
@@ -1346,6 +1346,8 @@ public string Key
/// Why this constraint is necessary or appropriate
///
[FhirElement("requirements", InSummary=true, Order=40)]
+ [DeclaredType(Type = typeof(FhirString))]
+ [DeclaredType(Type = typeof(Markdown), Since = FhirRelease.R5)]
[DataMember]
public Hl7.Fhir.Model.FhirString RequirementsElement
{
@@ -1720,6 +1722,8 @@ public Hl7.Fhir.Model.BindingStrength? Strength
/// Human explanation of the value set
///
[FhirElement("description", InSummary=true, Order=40)]
+ [DeclaredType(Type = typeof(FhirString))]
+ [DeclaredType(Type = typeof(Markdown), Since = FhirRelease.R5)]
[DataMember]
public Hl7.Fhir.Model.FhirString DescriptionElement
{
@@ -1976,6 +1980,8 @@ public string Map
/// Comments about the mapping or its use
///
[FhirElement("comment", InSummary=true, Order=60)]
+ [DeclaredType(Type = typeof(FhirString))]
+ [DeclaredType(Type = typeof(Markdown), Since = FhirRelease.R5)]
[DataMember]
public Hl7.Fhir.Model.FhirString CommentElement
{
diff --git a/src/Hl7.Fhir.Shared.Tests/ElementModel/PocoTypedElementTests.cs b/src/Hl7.Fhir.Shared.Tests/ElementModel/PocoTypedElementTests.cs
index 8ff6be4031..1db0e1aaab 100644
--- a/src/Hl7.Fhir.Shared.Tests/ElementModel/PocoTypedElementTests.cs
+++ b/src/Hl7.Fhir.Shared.Tests/ElementModel/PocoTypedElementTests.cs
@@ -1,4 +1,5 @@
-using Hl7.Fhir.ElementModel;
+using FluentAssertions;
+using Hl7.Fhir.ElementModel;
using Hl7.Fhir.FhirPath;
using Hl7.Fhir.Model;
using Hl7.Fhir.Serialization;
@@ -191,5 +192,41 @@ public async Tasks.Task ValidateFiveWs()
Assert.AreEqual(poco.Subject, subjectProp);
}
+
+
+ [TestMethod]
+ public void CheckTypeOfElementDefinitionMembers()
+ {
+#if !R5
+ var resultType = "string";
+#else
+ var resultType = "markdown";
+#endif
+ var ed = new ElementDefinition()
+ {
+ Mapping = new System.Collections.Generic.List() {
+ new ElementDefinition.MappingComponent() {
+ Comment = "comment"
+ }
+ },
+ Binding = new ElementDefinition.ElementDefinitionBindingComponent()
+ {
+ Description = "description",
+
+ },
+ Constraint = new System.Collections.Generic.List()
+ {
+ new ElementDefinition.ConstraintComponent()
+ {
+ Requirements = "requirements"
+ }
+ }
+ };
+ var element = ed.ToTypedElement();
+ element.Select("mapping.comment").First().InstanceType.Should().Be(resultType);
+ element.Select("binding.description").First().InstanceType.Should().Be(resultType);
+ element.Select("constraint.requirements").First().InstanceType.Should().Be(resultType);
+ }
+
}
}