Skip to content

Latest commit

 

History

History
374 lines (260 loc) · 12.8 KB

openEHR-ProblemDiagnosis-to-FHIR-Condition-STU3-mappings.adoc

File metadata and controls

374 lines (260 loc) · 12.8 KB

openEHR ProblemDiagnosis to FHIR condition STU3 mappings

Ian McNicoll <[email protected]> v1.0.0, 12-Feb-2017

Target openEHR template

FHIR resource operation Requirements

Operation : read

  1. Expose any Problem/diagnosis records held in the underlying openEHR CDR 'Problem list' as a bundle of FHIR Condition resources, profiled to meet NHS Care-Connect Profile STU3.

  2. Deleted records, those entered in error, should not be sent.

  3. Individual Problem/diagnosis negations, handled in openEHR as Specific Exclusions such as 'No history of penicillin allergy' should not be exposed.

  4. Support the read, search and conformance FHIR resource operations.

  5. The following FHIR Condition data elements should be exposed where corresponding openEHR data is available

    • id (logical resource identifier)

    • text (This will be generated narrative from concatenated structured data below)

    • clinicalStatus

    • verificationStatus -

    • category

    • severity

    • code - Mandatory

    • bodySite - Multiple

    • subject.reference - Mandatory

    • subject.identifier- Mandatory

    • asserter

    • assertedDate - Mandatory

    • onset.onsetDateTime

    • abatement.abatementDateTime

    • note - Multiple

    • episode.valueCode (Extension)

The following Search criteria must be supported

  • assertedDate (including date ranges)

  • subject.id (via logicalID)

  • subject.identifier (via NHS Number)

  • verificationStatus (To be Confirmed after review by Care-Connect)

  • clinicalStatus (To be Confirmed after review by Care-Connect)

  • category

  • $current-problems - see Named Queries in HAPI-FHIR

Implementation will require appropriate AQL construction and or AQL resultSet filtering, for which guidance will be provided.

Operation: conformance

The AllergyIntolerance profile should emit a conformance statement on request via the /metadata resource - it is expected that the default handling provided by the HAPI-FHIR stack should be sufficient for this purpose.

Ignored FHIR Care-connect extension nodes

  • Condition.identifier

  • Condition.stage

  • Condition.encounter

Approach

  1. Retrieve candidate openEHR Problems data via a an openEHR /query POST call, using AQL.

  2. Return Scalar values for DV_TEXT/DV_CODED_TEXT elements and map to CodeableConcept, as openEHR objects are not currently supported in EtherCis AQL.

  3. Alternatively, where the openEHR data is held as DV_TEXT/DV_CODED_TEXT ELEMENT, return the whole ELEMENT value as an object.

  4. Create handlers for Excluded/Absent information items when Care-Connect guidance emerges. Assume making use of FHIR List resource for now.

SCALAR AQL (includes search parameters and dv_coded_text as scalar values)

This flattened form of the AQL avoids use of DV_CODED_TEXT objects which are not supported by EtherCis

select
    e/ehr_id/value as ehrId,
    e/ehr_status/subject/external_ref/id/value as subjectId,
    e/ehr_status/subject/external_ref/namespace as subjectNamespace,
    a/composer/name as composerName,
    a/composer/external_ref/id/value as composerId,
    a/composer/external_ref/namespace as composerNamespace,
    a/uid/value as compositionId,
    a/context/start_time/value as compositionStartTime,
    b_a/uid/value as entryId,
    b_a/data[at0001]/items[at0002]/value/value as Problem_Diagnosis_value,
    b_a/data[at0001]/items[at0002]/value/defining_code/code_string as Problem_Diagnosis_code,
    b_a/data[at0001]/items[at0002]/value/defining_code/terminology_id/value as Problem_Diagnosis_terminology,
    b_a/data[at0001]/items[at0012]/value/value as Body_site_value,
    b_a/data[at0001]/items[at0012]/value/defining_code/code_string as Body_site_code,
    b_a/data[at0001]/items[at0012]/value/defining_code/terminology_id as Body_site_terminology,
    b_a/data[at0001]/items[at0077]/value/value as Date_time_of_onset,
    b_a/data[at0001]/items[at0030]/value/value as Date_time_of_resolution,
    b_a/data[at0001]/items[at0005]/value/defining_code/code_string as Severity_code,
    b_a/data[at0001]/items[at0073]/value/defining_code/code_string as Diagnostic_certainty_code,
    b_a/data[at0001]/items[at0069]/value/value as Comment,
    b_a/protocol[at0032]/items[at0070]/value/value as AssertedDate,
    b_b/items[at0003]/value/defining_code/code_string as Active_inactive_code,
    b_b/items[at0083]/value/defining_code/code_string as Resolution_status_code,
    b_b/items[at0001]/value/defining_code/code_string as Episodicity_code,
    b_b/items[at0071]/value/value as First_occurrence
from EHR e
contains COMPOSITION a[openEHR-EHR-COMPOSITION.problem_list.v1]
contains (
    EVALUATION b_a[openEHR-EHR-EVALUATION.problem_diagnosis.v1] or
    CLUSTER b_b[openEHR-EHR-CLUSTER.problem_status.v0])
where a/name/value='Problem list'

-- Optional parameters, depending on FHIR search criteria
and e/ehr_id/value = '{{fhir.patient.id_param}}'
and e/ehr_status/subject/external_ref/id/value = '{{fhir.patient.identifier.value.param}}'
and e/ehr_status/subject/external_ref/namespace =  '{{fhir.patient.identifier.system.param}}'
and b_a/protocol[at0032]/items[at0070]/value/value >= '{{fhir_asserted_date_param_min}}'
and b_a/protocol[at0032]/items[at0070]/value/value <= '{{fhir_asserted_date_param_max}}'

Node mappings

FHIR node:: condition.id

FHIR Description

The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes.

openEHR AQL node

if entryId is not null compositionId+ '_' + entryId else compositionId

Valueset mappings

None

ℹ️
The FHIR id is constructed by a concatenation of the openEHR compositionId and entryId as above. If entryID is null, simply send the compositionID. entryID is currently not supported by Ethercis.

FHIR node:: condition.clinicalStatus

FHIR Description

The clinical status of the condition. Valueset: active | recurrence | inactive | remission | resolved

openEHR AQL node
  • Active_Inactive_codecondition.clinicalStatus

  • Resolution_status_codecondition.clinicalStatus NOTE: openEHR splits active/inactive status from resolution status, whereas FHIR combines the two concepts.

Datatype Mapping style

DV_CODED_TEXT ⇒ Code

Valueset Mappings

WARNING: Further discussion required in 5N-CDR and Care-Connect group before accurate mappings can be defined. There is a conflict here between GP-style longitudinal problems, where e.g a problem can be both active and resolved.

FHIR Valueset

active | recurrence | inactive | remission | resolved

local::at0026::Activeactive local::at0027::Inactiveinactive local::at0084::Resolvedresolved local::at0085::Resolvingactive No direct match - Add to Notes local::at0086::Not resolvingactive No direct match - Add to Notes local::at0087::IndeterminateNull

FHIR node:: condition.episodicity (CC-extension)

openEHR AQL node
  • Episodicity_codecondition.episodicity.episode.valuecode

  • First_occurencecondition.episodicity.episode.valuecode NOTE: openEHR splits out First occurrence as separate boolean attribute.

Datatype Mapping style

DV_CODED_TEXT ⇒ Code

Valueset Mappings

WARNING: Further discussion required in 5N-CDR and Care-Connect group before accurate mappings can be defined.

if (Episodicity_code == at0034) { if (First_occurence == true) condition.episodicity = First else condition.episodicity = New }

local::at0035::Ongoing episodeReview local::at0070::Indeterminatenull

FHIR node:: condition.verificationStatus

openEHR AQL node
  • DiagnosticCertaintyCodecondition.verificationStatus

Datatype Mapping style

DV_CODED_TEXT ⇒ Code

Valueset mappings

local::at0074::Suspected | local::at0075::Probableprovisional local::at0076::Confirmedconfirmed

==== FHIR node

condition.severity

openEHR AQL node
  • Severity_codecondition.verificationStatus

Datatype Mapping style

DV_CODED_TEXT ⇒ Code

Valueset mappings

local::at0047::Mildhttp://snomed.info/sct|255604002|Mild local::at0048::Moderatehttp://snomed.info/sct|6736007|Moderate local::at0049::Severehttp://snomed.info/sct|24484000|Severe

==== FHIR node

condition.category

openEHR AQL node
  • "problem-item-list" ⇒ condition.category

Datatype Mapping

DV_CODED_TEXT ⇒ Code

ℹ️
The source of conditions from openEHR are currently always 'problems so condition.category should always be set to "problem-item-list".

FHIR node: condition.code

openEHR AQL node
  • Problem_Diagnosiscondition.code

Datatype mapping

DV_TEXT ⇒ CodeableConcept
see Datatype mapping guidance

FHIR name: condition.subject

FHIR Description

Who has the condition.

openEHR AQL node

ehrIdcondition.subject.reference subjectIdcondition.subject.identifier.value subjectNamespacecondition.subject.identifier.system

Valueset mappings
  1. For subjectNamespacecondition.subject.identifier.system

    1. uk.nhs.nhs_numberhttps://fhir.nhs.uk/Id/nhs-number

ℹ️
We are using the patient’s openEHR ehrId as the id of the FHIR subject resource, and using the patient’s NHS Number, carried in the openEHR 'ehr' object as subjectId as the patient identifier. If the subjectNamespace is not uk.nhs.nhs_number, it should not be mapped to https://fhir.nhs.uk/Id/nhs-number but simply passed through unchanged.

FHIR node: condition.assertedDate

FHIR Description

- Date record was believed accurate.

openEHR AQL node

Last_updatedcondition.assertedDate

Datatype mapping

DV_DATE_TIME ⇒ dateTime

Valueset mappings

None

FHIR node: condition.note

FHIR Description

- Additional text not captured in other fields.

openEHR AQL node

Commentcondition.note.text

Datatype mapping

DV_TEXT ⇒ Annotation.

Valueset mappings

None

condition.asserter.identifier.value

FHIR Description

- The identifier of the person asserting the allergy.

openEHR AQL node

composerIdentifiercondition.asserter.identifier.value composerNamespacecondition.asserter.identifier.system

Datatype mapping

DV_TEXT ⇒ Identifier

Valueset mappings

None

Alternative OBJECT AQL (includes search parameters and dv_coded_text objects)

This flattened form of the AQL uses DV_CODED_TEXT objects which are currently not supported by EtherCis.

select
    e/ehr_id/value as ehrId,
    e/ehr_status/subject/external_ref/id/value as subjectId,
    e/ehr_status/subject/external_ref/namespace as subjectNamespace,
    a/composer/name as composerName,
    a/composer/external_ref/id/value as composerId,
    a/composer/external_ref/namespace as composerNamespace,
    a/uid/value as compositionId,
    a/context/start_time/value as compositionStartTime,
    b_a/uid/value as entryId,
    b_a/data[at0001]/items[at0002]/value as Problem_Diagnosis,
    b_a/data[at0001]/items[at0012]/value as Body_site,
    b_a/data[at0001]/items[at0077]/value/value as Date_time_of_onset,
    b_a/data[at0001]/items[at0005]/value/defining_code/code_string as Severity_code,
    b_a/data[at0001]/items[at0030]/value/value as Date_time_of_resolution,
    b_a/data[at0001]/items[at0073]/value//defining_code/code_string as Diagnostic_certainty_code,
    b_a/data[at0001]/items[at0069]/value/value as Comment,
    b_a/protocol[at0032]/items[at0070]/value/value as Date_last_updated,
    b_b/items[at0003]/value/defining_code/code_string as Active_Inactive_code,
    b_b/items[at0083]/value/defining_code/code_string as Resolution_status_code,
    b_b/items[at0001]/value//defining_code/code_string as Episodicity_code,
    b_b/items[at0071]/value/value as First_occurrence
from EHR e
contains COMPOSITION a[openEHR-EHR-COMPOSITION.problem_list.v1]
contains (
    EVALUATION b_a[openEHR-EHR-EVALUATION.problem_diagnosis.v1] or
    CLUSTER b_b[openEHR-EHR-CLUSTER.problem_status.v0])
where a/name/value='Problem list'

-- Optional parameters, depending on FHIR search criteria
and e/ehr_id/value = '{{fhir.patient.id_param}}'
and e/ehr_status/subject/external_ref/id/value = '{{fhir.patient.identifier.value.param}}'
and e/ehr_status/subject/external_ref/namespace =  '{{fhir.patient.identifier.system.param}}'
and b_a/protocol[at0032]/items[at0070]/value/value >= '{{fhir_asserted_date_param_min}}'
and b_a/protocol[at0032]/items[at0070]/value/value <= '{{fhir_asserted_date_param_max}}'

FHIR Narrative block

This is optional in Care-Connect but is good practice.

NOTE

TBD