Skip to content

FHIR-57053: compare the distinguishing properties in the report invariants - #132

Open
patrick-werner wants to merge 1 commit into
masterfrom
FHIR-57053-invariant-comparisons
Open

FHIR-57053: compare the distinguishing properties in the report invariants#132
patrick-werner wants to merge 1 commit into
masterfrom
FHIR-57053-invariant-comparisons

Conversation

@patrick-werner

Copy link
Copy Markdown
Collaborator

Resolves FHIR-57053 (Persuasive with Modification).

Changes

dr-comp-type — "change the comparison to system + code + version":

entry.resource.ofType(Composition).type.coding.select(system & '|' & version & '|' & code)
  .intersect(entry.resource.ofType(DiagnosticReport).code.coding.select(system & '|' & version & '|' & code)).exists()

dr-comp-category — removed, together with its * obeys on the Bundle profile ("Category of DR and Composition could be not the same, one is the categorization of the document, the other one about the medical discipline of the DR").

dr-comp-identifier — same comparison approach:

entry.resource.ofType(DiagnosticReport).identifier.exists() implies
  entry.resource.ofType(Composition).identifier.select(system & '|' & value)
    .intersect(entry.resource.ofType(DiagnosticReport).identifier.select(system & '|' & value)).exists()

& is used rather than + so that codings without a version still produce a comparable string instead of dropping out.

Points that needed a call

  • The resolution says "system + code + version" for dr-comp-identifier as well; Identifier has neither code nor version, so the analogous properties system and value are compared — as the issue description proposed.
  • The implication condition was narrowed to DiagnosticReport.identifier.exists(). With the previous or the invariant failed when only the Composition carried an identifier, which its description never claimed. This was raised in the issue description but not repeated in the resolution.
  • With dr-comp-category gone, the comment "DiagnosticReport.category and Composition.category shall be aligned" in ReportCategoryRule would have contradicted the resolution, so it was removed (affects Composition.category and DiagnosticReport.category).
  • Both descriptions now name the compared properties instead of saying "SHALL be equal".

All example bundles satisfy both invariants (checked type/code codings and identifiers of Composition and DiagnosticReport in the five generated bundles). SUSHI: 0 errors.

…iants

dr-comp-type now compares system, version and code, dr-comp-identifier system
and value, instead of the complete Coding and Identifier elements. The
implication of dr-comp-identifier is limited to DiagnosticReport.identifier,
matching its description. dr-comp-category was removed, as the category of the
document and the medical discipline of the report are not the same thing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant