Skip to content

6.7.0

Choose a tag to compare

@mmsmits mmsmits released this 15 Oct 15:33

Intro:

This release adds an opt-in PrimitiveValueConverter hook to the POCO deserializers, makes the
JSON parser reject a primitive whose value is supplied twice, keeps repeated same-url extensions in
snapshots, makes the SnapshotGenerator report differential paths with an empty segment, and fixes
FHIRPath evaluation over invalid primitive values. LocalTerminologyService now returns the full
$validate-code result shape, and the terminology services accept repeated tx-resource
parameters. There are no breaking API changes, but several changes alter behaviour or output that
callers may depend on: the new fatal parser issue JSON135, the text of
OperationOutcome.IssueComponent.ToString(), warnings on inactive codes from $validate-code, and
$expand rejecting repeated 0..1 parameters. See the behavioural notes below.

Serialization

  • New DeserializerSettings.PrimitiveValueConverter lets callers fix a wrongly typed primitive while
    parsing, such as "valueInteger": "42" or "active": "true", in both Json and Xml and in every
    mode, Ostrich included. It is called only for values that are not of the type the primitive
    stores, plus date, dateTime, instant, time and integer64, which can be the right type in
    the wrong format. If it declines (returns the input) or throws a FormatException,
    InvalidCastException or OverflowException, the usual error is reported; any other exception
    propagates. When not set, parsing is unaffected.

  • The string overloads of the Json deserializers now encode into a pooled buffer instead of
    allocating a fresh byte[] per parse, and the reader options the SDK uses are now public as
    SerializationUtil.FhirJsonReaderOptions. See issue #3598.

  • An exception thrown while reading an Xml attribute is no longer hidden behind
    "Can only exit from a resource part.".

  • The JSON parser now reports a fatal issue, JSON135 (PRIMITIVE_VALUE_SUPPLIED_TWICE), when a
    primitive gets its value from both name and _name, e.g. {"name":"John","_name":"Johnny"}.
    The second value used to be dropped silently, with only the non-fatal JSON134, so the
    NoOverflow, Recoverable and BackwardsCompatible modes accepted the data loss. This applies in
    either property order and to elements of primitive arrays. JSON134 stays a non-fatal error for
    a primitive under _name when no value was set yet. See issue #3533.

    Behavioural note: JSON that parsed before, with a non-fatal JSON134, now fails to parse in
    every mode except Ostrich when both name and _name carry a value.

FHIRPath

  • An unparseable instant, integer64, integer, positiveInt or unsignedInt value no longer
    makes almost every FHIRPath expression that reaches it throw. Its value is now the unparsed
    string, as it already was for date, dateTime and time. Before, even $this is Reference
    threw an InvalidOperationException for such a node, so a sweep like
    descendants().where($this is Reference) failed on the whole resource. The Value getter of the
    POCO still throws.

Snapshot generation

  • The SnapshotGenerator now reports a specific issue (PROFILE_ELEMENTDEF_INVALID_PATH, code
    10021) for a differential element whose path has an empty segment, such as Observation...unit,
    and skips that element. Such an element used to produce a phantom element Observation. in the
    snapshot, and any constraint on it, like a fixedString, was silently lost. The rest of the
    differential is still processed. See issue #3591.
  • When a differential has several extensions with the same url, e.g. repeated additional-binding
    extensions on a binding, and the base already has one with that url, the snapshot now keeps all of
    them. The first replaces the base extension, the rest are added next to it. They used to overwrite
    each other, so only the last one survived. See issue #3625.

Terminology

  • LocalTerminologyService's ValueSet $validate-code now returns the full result shape the HL7
    terminology ecosystem tests expect: code, system, version and display, plus an issues
    OperationOutcome with tx-issue-type codings and expressions relative to the input, for both valid
    and invalid codes. A CodeableConcept input is echoed back, and inactive or non-active concepts
    get inactive/status parameters. ValidateCodeResult has new properties to read and write
    these (CodeableConcept, NormalizedCode, CausedByUnknownSystem, UnknownSystem, Inactive,
    Status), and new Add* extension methods put an issue in its issues. See issue #3631.

    Behavioural note: an inactive, retired or deprecated code now returns result = true with a
    message (a code-comment warning). For an unknown system, message now also says the
    CodeSystem could not be found.

  • The terminology services no longer reject an operation with repeated tx-resource parameters,
    which the tx-ecosystem IG requires servers to accept. Only repeats of the operation's 0..1
    parameters are rejected; known 0..* and unknown parameters pass through. Each typed *Parameters
    class now lists its parameters in a public KnownParameters.

    Behavioural note: $expand now gets the same check, so a repeated url, filter, count
    etc. is rejected where it used to be accepted.

Other

  • PocoNode.Resolve("#id") no longer throws a NullReferenceException when the resource has a
    contained resource without an id before the one it refers to. A contained resource without an
    id does not match, and resolution continues. See issue #3613.

  • OperationOutcome.IssueComponent.ToString() now writes a space before (further diagnostics:,
    as it already did before (at. See issue #3621.

    Behavioural note: this changes the rendered text of an issue. Tests that compare against
    ToString() output need new expected strings.

Changes:

  • #3634: VONK-10389: Allow repeated tx-resource parameters
  • #3633: Return the full $validate-code result shape from LocalTerminologyService
  • #3631: Extend ValidateCodeResult with the full $validate-code output and fill it from LocalTerminologyService
  • #3627: VONK-10125: Add opt-in primitive value converter to the POCO deserializers, pool Json string parsing
  • #3598: POCO deserialization: byte/stream entry points and pooled re-encoding of JSON strings
  • #3626: Keep repeated same-url extensions in snapshots
  • #3625: Snapshot generator loses repeated extensions with the same URL (e.g. additional-binding) when the base already has one
  • #3624: Bump the runtime-dependencies-minor group with 2 updates
  • #3623: Make FHIRPath tolerate unparseable primitive values
  • #3616: Document the changes for release, bump version to 6.6.0
See More
  • #3622: Add space before "(further diagnostics:" in issue ToString
  • #3619: Add test for Base-typed inline children (#3597)
  • #3597: SnapshotGenerator: inline children of a new element typed Base are emitted one level up (segment dropped from path and id)
  • #3620: Report and skip '..' in differential paths
  • #3618: Report fatal error when name and _name both set
  • #3533: JSON deserializer silently drops a primitive value when both 'name' and '_name' supply one (non-fatal)
  • #3617: Fix Resolve NRE on contained resource w/o id
  • #3591: SnapshotGenerator: '..' in differential path produces phantom element and silently drops the constraint
  • #3576: feat: add the missing NOOVERFLOW preset to both deserializers (#3532)
  • #3613: PocoNode.Resolve throws NullReferenceException when a contained resource has no id

This list of changes was auto generated.