Skip to content

6.9.0

Latest

Choose a tag to compare

@mmsmits mmsmits released this 18 Nov 16:44

Intro:

This release adds flat and not-for-UI value set expansions, the lenient-display-validation parameter for
$validate-code, and more ways to build a DateTimeRange. It also makes IsValidValue stricter about FHIR
date/time and primitive literals, and fixes several parsing and base64Binary issues. There are no breaking API
changes.

Date and time ranges

  • DateTimeRange can be built from two instants and a precision with a public constructor, and
    TryBetween(start, end, out range) reports a reversed pair, or two null arguments, instead of throwing. StartOrMinValue
    and EndOrMaxValue give the bounds with DateTimeOffset.MinValue/MaxValue for an unbounded side,
    for code that compares instants, and LastInstant is the last instant the range covers, one tick
    before End. See issue #3657.

Terminology

  • ValueSetExpander.ExpandAsync(ValueSet, ExpandParameters) and a public SupportedParameters. excludeNested=true
    (or the new ValueSetExpanderSettings.AlwaysExpandFlat) returns a flat, depth-first expansion, and excludeNotForUI=true
    leaves out not-selectable and abstract codes. Unsupported parameters are rejected; applied ones are echoed in
    expansion.parameter. The size cap now counts nested codes, intersections keep nested codes, and Total is recomputed
    after excludes. The ExpandParameters builders for system-version, check-system-version and force-system-version now
    use the OperationDefinition names. See issue #3632.

  • $validate-code supports the lenient-display-validation parameter of the
    ValueSet/$validate-code OperationDefinition.
    ValidateCodeParameters and CodeSystemValidateCodeParameters have a LenientDisplayValidation property and a
    WithLenientDisplayValidation() builder method. When it is false, LocalTerminologyService (ValueSet $validate-code)
    reports a display that does not match the code as an invalid-display error and the code is not valid. Terminology services
    that call a terminology server send the parameter along. When it is true or absent, a wrong display stays
    a warning and the code stays valid, as before.

  • ValidateCodeResult.AddInvalidDisplay(details, lenient, expression) adds the invalid-display issue as a warning or an error.
    The overload without lenient is obsolete. See issue #3640.

    Upcoming change: in the next major version, a missing lenient-display-validation parameter will mean strict
    validation, so a wrong display will be an error by default. The OperationDefinition says: "If the
    'lenient-display-validation' parameter is false or absent, then an invalid display will cause the 'result' output
    parameter to be 'false', i.e. the validation will fail." Pass true to keep it a warning.

Blazor WebAssembly

  • TaskHelper.Await now runs the delegate inline on the browser and WASI platforms instead of wrapping it in Task.Run, which cannot be blocked on in single-threaded WebAssembly ("Cannot wait on monitors on this runtime"). Resolvers that return an already completed task now work there; a task that is not complete throws a PlatformNotSupportedException. Other platforms are unchanged.

Performance

  • Reading annotations from a POCO or an AnnotationList (HasAnnotation, TryGetAnnotation, Annotations(type), RemoveAnnotations) no longer creates an empty annotation list, so DeepCopy()/CopyTo() no longer propagate one from elements that were only inspected. The list (and its dictionary) is now created on the first write only, and the dictionary is sized for a few annotation types. This removes a ConcurrentDictionary allocation per element that was only inspected, which speeds up work like snapshot generation. The public API is unchanged. See issue #3665.
  • FHIRPath as/is and ResourceIdentity do less work per call.

Fixes

  • FhirDateTime.IsValidValue and Time.IsValidValue now require seconds, as the FHIR dateTime and time formats do.
    Parsing and deserialization still accept a time without seconds. See issue #3650.
  • IsValidValue and the element-model parsers for date/time, id, code, oid, uuid and Quantity no longer accept a
    trailing line break. See issue #3659.
  • Validating a Base64Binary no longer rewrites a literal that contains whitespace. See issue #3648.
  • The JSON deserializer merges x and _x when only one of them is an array, instead of throwing or dropping elements, and
    reports the new non-fatal JSON136. Property-level validation errors are now reported at the element itself. See issue
    #3655.
  • Building a POCO from an ISourceNode (ToPoco()) stored a base64Binary value as a decoded byte[] in JsonValue instead of keeping the base64 text, so validation reported an incorrect literal type (e.g. on Binary.data), and an invalid base64 literal threw a FormatException instead of being reported by validation. The literal is now kept as-is. This was broken since 6.2.1.

Changes:

  • #3671: Keep accepting times without seconds when parsing
  • #3650: FhirDateTime.IsValidValue: doc comment says "correctly formatted" but a time without seconds passes
  • #3651: Require seconds in FhirDateTime and Time values
  • #3682: Bump MSTest.TestFramework and Verify.MSTest
  • #3679: Keep base64Binary literal when building POCOs from source nodes
  • #3681: Bump the test-dependencies group with 1 update
  • #3678: AI review loop: review-only mode when the author fixes
  • #3676: ValueSetExpander: take ExpandParameters, support excludeNested and excludeNotForUI
  • #3677: AI review loop: fix /ai-review more (round input type on dispatch)
  • #3632: ValueSetExpander: take ExpandParameters, support excludeNested (flat) and excludeNotForUI, fix system-version parameter names
See More
  • #3663: Add AI PR review loop (pilot)
  • #3675: Bump Microsoft.SourceLink.GitHub from 10.0.403 to 11.0.100
  • #3673: Bump the test-dependencies-major group with 2 updates
  • #3666: Don't create or copy empty annotation lists on read (#3665)
  • #3665: Optimize annotations: reading or copying an empty AnnotationList creates a locked Lazy and a ConcurrentDictionary
  • #3667: Add rule that generated model classes are never edited by hand
  • #3664: Bump the runtime-dependencies-minor group with 1 update
  • #3661: Reject trailing line break in IsValidValue
  • #3659: IsValidValue and the element-model parsers accept a trailing line break
  • #3660: Bump the runtime-dependencies-minor group with 1 update
  • #3653: Speed up FhirPath as/is and ResourceIdentity
  • #3656: Merge 'x' and '_x' when only one is an array
  • #3658: DateTimeRange: TryBetween, constructor, clamped bounds, LastInstant
  • #3657: DateTimeRange: TryBetween, a public constructor, clamped bounds and the last instant
  • #3655: JSON deserializer throws or drops values when 'x' and '_x' disagree on being an array
  • #3652: FhirPath: duplicate binary.as entry forces dynamic dispatch, TypeOperators.Is walks base classes per call, ResourceIdentity uses culture-sensitive StartsWith
  • #3649: Keep Base64Binary literal when validating
  • #3648: Base64Binary validation drops whitespace from JsonValue
  • #3647: Revert Microsoft.Extensions.Caching.Memory bump and exclude it from dependabot
  • #3645: Run TaskHelper.Await inline on browser/WASI
  • #3646: Bump the runtime-dependencies-minor group with 2 updates
  • #3641: Support lenient-display-validation
  • #3644: Release 6.8.0
  • #3640: Support lenient-display-validation in $validate-code

This list of changes was auto generated.