Closed andrewrandallcaremetx closed 2 months ago
It is worth noting that HL7.Fhir.Model.Binary defines the following:
/// <summary>
/// The actual content. Note: Element is replaced by 'Binary.data' since R4. Do not use this element 'content' with R4 and newer releases.
/// </summary>
[FhirElement("content", Order=70)]
[NotMapped(Since=FhirRelease.R4)]
[Cardinality(Min=1,Max=1)]
[DataMember]
public Hl7.Fhir.Model.Base64Binary ContentElement
{
get { return _ContentElement; }
set { _ContentElement = value; OnPropertyChanged("ContentElement"); }
}
Though ContentElement
has been replaced since R4, Hl7.Fhir.Validation still appears to be validating its Cardinality attribute.
Yeah, one more side-effect caused by the fact that we use two fields instead of one. See also FirelyTeam/firely-net-sdk#2786.
Maybe add Since
to the Cardinality attribute too? Or is that a hack for the deeper problem that only one of the two properties should be considered for validation (and deserialization) at any moment?
Describe the bug Generating a Bundle, including a Binary wrapped in an Entry, does not pass Validation. The Validation believes that Content should not be null. This requirement was true in R4, but should no longer apply in R5. Deserializing the message works correctly, but
bundle.Validate(recurse: true)
throws the following exception:To Reproduce
Expected behavior
.Validate(recurse: true)
should not return any validation error.Version used:
<PackageReference Include="Hl7.Fhir.R5" Version="5.8.1" />