Closed almostchristian closed 1 week ago
This needs to be solved in the ElementSchemaCompilar of the MinMaxValidator, not in the Long comparison itself.
Yeah, changing it in the MinMaxValidator would be the minimal change with the least impact to existing code,
How about using EqualityOperators. Compare
? I notice that this method has the tryCoerce
function which will convert the int to long.
When validating an Attachment element with the size field in R4B (size is mapped to
unsignedInt
in R4/R4B andinteger64
in R5), TheMinMaxValueValidator
fails with an ArgumentException with message:Reproduction code:
I believe the fix should be in
Hl7.Fhir.ElementModel.Types.Long
to allow comparisons toInteger
which should to be in line with the csharp comparison semantics where int values are automatically converted to long.