EMIS published data transformation and mapping: Difference between revisions

From Endeavour Knowledge Base
No edit summary
No edit summary
Line 2: Line 2:
This article describes the mapping of EMIS published data into the intermediate FHIR store
This article describes the mapping of EMIS published data into the intermediate FHIR store


== Admin location ==
= Care record observations =
 
Care record observations are a high level entity type. CareRecord_Observation contains data which is mapped to multiple FHIR resource types. Target FHIR profiles depend on content
 
== Content dependent rules ==
 
The target resource type is decided by the following rules, using the code and 'CodeType' from the Coding_ClinicalCode file (looked up using the CodeId from CareRecord_Observation) and the Value field from CareRecord_Observation.
 
{| border="1" cellpadding="1" cellspacing="1" style="width: 800pt;"
|-
! scope="col" style="text-align: left; background-color: rgb(239, 239, 239); width: 181px;" | Code type Rule
! scope="col" style="width: 150px; background-color: rgb(239, 239, 239);" | Target profile
|-
| If the Value is empty, and the CodeType is one of (Biochemistry, Cyology_Histology,Haematology,Immunology,Microbiology,Radiology, Health_Management)
| DiagnosticReport
|-
|
If the Value is not empty OR the CodeType is one of
 
(Biochemistry,Biological_Values,Cytology_Histology, Haematology, Health_Management, Immunology,Microbiology,Radiology,Symptoms_Findings, Procedure (note, the codes is this category aren't actually "procedures"), Administration_Documents_Attachments, Body_Structure //dental structures,Care_Episode_Outcome, Dental_Finding,Diagnostics, Discharged_From_Service,EMIS_Qualifier,Ethnicity,HMP,Intervention_Category, Intervention_Target, KC60,;Marital_Status, Nationality,Nursing_Problem, Nursing_Problem_Domain, Obsteterics_Birth,Person_Health_Social, Planned_Dental, Problem_Rating_Scale, Reason_For_Care, Referral_Activity, Referral_Rejected, Referral_Withdrawn, Regiment, Religion, Trade_Branch, Unset)
 
|
Observation
 
 
 
 
 
|-
| If the CodeType is Conditions_Operations_Procedures and the Code is in (Preventive procedures, Operations, procedures, sites, Other therapeutic procedures)
| Procedure
|-
| If the CodeType is Conditions_Operations_Procedures and the Code is in (Infectious and parasitic diseases, Neoplasms,Endocrine, nutritional, metabolic and immunity disorders, Diseases of blood and blood-forming organs, Mental disorders, Nervous system and sense organ diseases, Circulatory system diseases, Respiratory system diseases, Digestive system diseases, Genitourinary system diseases, Skin and subcutaneous tissue diseases, Musculoskeletal and connective tissue diseases)
|
Condition
 
 
 
|-
| Else&nbsp;<span style="line-height:normal">If the CodeType is Conditions_Operations_Procedures</span>
| Observation
|-
| If the CodeType is any of (Allergy_Adverse_Drug_Reations, Allergy_Adverse_Reations)
| AllergyIntolerance
|-
| If the CodeType is any of (Dental_Disorder, Dental_Procedure)
| Condition
|-
| If the CodeType is (Family_History)
| FamilyMemberHistory<br/> &nbsp;
|-
| f the CodeType is (Immunisations)
| Immunization
|-
| If code type is (Investigation_Requests)
| DiagnosticOrder
|-
| If code type is Pathology_Specimen
| Specimen
|-
| If code type is Referral
| Referral request
|}
 
There is a mismatch between EMIS observations and FHIR resource profiles
 
{| border="1" cellpadding="1" cellspacing="1" style="width: 800pt;"
|-
! scope="col" style="text-align: left; background-color: rgb(239, 239, 239); width: 181px;" | Structural Rule
! scope="col" style="width: 150px; background-color: rgb(239, 239, 239);" | Target profile
|-
|
IF target profile IS Condition
 
&nbsp; &nbsp;IF CSV Care Record observation ID is in CSV Care Record Problem ID
 
| Combine problem and Condition into problem onset profile
|-
|
In addition to the above mappings
 
R1: IF&nbsp; the target resource select from above&nbsp;''is not'' condition
 
&nbsp; &nbsp; &nbsp; &nbsp;R2: IF the CSV CareRecord_Observation ID&nbsp; is in CSV CareRecord_Problem record ID
 
| Combine problem and other into Condition with "problem" profile
|-
| &nbsp; &nbsp; &nbsp; &nbsp;R2: ELSE
| Observation
|-
| R1: Else&nbsp; &nbsp;&nbsp;: See R3
| &nbsp;
|-
|
R3: If the CSV Care Record Observation has PROBLEM ID
 
&nbsp; &nbsp; &nbsp; &nbsp; R4: IF the CSV care record Observation ID is NOT the PROBLEM ID
 
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;R5: IF the CSV care record CODE = the linked problem ID CODE
 
| Condition with episode indicator = review
|-
| (R3,R4,R5&nbsp;: Else
| No change&nbsp;
|}
 
&nbsp;
 
= Admin location =


{| class="MsoTableGrid" style="border-collapse:collapse; border:solid windowtext 1.0pt"
{| class="MsoTableGrid" style="border-collapse:collapse; border:solid windowtext 1.0pt"
|-
|-
! style="width:162.8pt; background-color: rgb(239, 239, 239); border:solid windowtext 1.0pt" width="217" | Source
! style="width:162.8pt; background-color:#efefef; border:solid windowtext 1.0pt" width="217" | Source
! style="width:318.6pt; background-color: rgb(239, 239, 239); border:solid windowtext 1.0pt; border-left:none" width="425" | Target
! style="width:318.6pt; background-color:#efefef; border:solid windowtext 1.0pt; border-left:none" width="425" | Target
|-
|-
| style="width:162.8pt; border:solid windowtext 1.0pt" width="217" |  
| style="width:162.8pt; border:solid windowtext 1.0pt" width="217" |  
Line 13: Line 121:


| style="width:318.6pt; border:solid windowtext 1.0pt; border-left:none" width="425" |  
| style="width:318.6pt; border:solid windowtext 1.0pt; border-left:none" width="425" |  
Location&nbsp; { .....
Location { .....


|-
|-
Line 139: Line 247:


| style="width:318.6pt; border-top:none; border-left:none; border-bottom:solid windowtext 1.0pt; border-right:solid windowtext 1.0pt" width="425" |  
| style="width:318.6pt; border-top:none; border-left:none; border-bottom:solid windowtext 1.0pt; border-right:solid windowtext 1.0pt" width="425" |  
<span style="line-height:normal">**</span>
<span style="line-height:normal">*</span>


|}
|}


&nbsp;
= Admin organisation =


&nbsp;
Each record maps to a FHIR Organization resource.


= Care record observations =
{| class="MsoTableGrid" style="border-collapse:collapse; border:solid windowtext 1.0pt"
|-
! style="width:162.8pt; background-color:#efefef; border:solid windowtext 1.0pt" width="217" | Source
! style="width:318.6pt; background-color:#efefef; border:solid windowtext 1.0pt; border-left:none" width="425" | Target
|-
| style="width:162.8pt; border:solid windowtext 1.0pt; border-top:none" width="217" |
<span style="line-height:normal">OrganisationGuid</span>


Care record observations are a high level entity type. CareRecord_Observation contains data which is mapped to multiple FHIR resource types. Target FHIR profiles depend on content
| style="width:318.6pt; border-top:none; border-left:none; border-bottom:solid windowtext 1.0pt; border-right:solid windowtext 1.0pt" width="425" |
<span style="line-height:normal">Id*</span>


== Content dependent rules ==
|-
| style="width:162.8pt; border:solid windowtext 1.0pt; border-top:none" width="217" |
<span style="line-height:normal">CDB</span>


The target resource type is decided by the following rules, using the code and 'CodeType' from the Coding_ClinicalCode file (looked up using the CodeId from CareRecord_Observation) and the Value field from CareRecord_Observation.
| style="width:318.6pt; border-top:none; border-left:none; border-bottom:solid windowtext 1.0pt; border-right:solid windowtext 1.0pt" width="425" |
<span style="line-height:normal">Identifier::Value (use=secondary, system=cdb-number)</span>


{| border="1" cellpadding="1" cellspacing="1" style="width: 800pt;"
|-
|-
! scope="col" style="text-align: left; background-color: rgb(239, 239, 239); width: 181px;" | Code type Rule
| style="width:162.8pt; border:solid windowtext 1.0pt; border-top:none" width="217" |  
! scope="col" style="width: 150px; background-color: rgb(239, 239, 239);" | Target profile
<span style="line-height:normal">OrganisationName</span>
 
| style="width:318.6pt; border-top:none; border-left:none; border-bottom:solid windowtext 1.0pt; border-right:solid windowtext 1.0pt" width="425" |  
<span style="line-height:normal">Name</span>
 
|-
|-
| If the Value is empty, and the CodeType is one of (Biochemistry, Cyology_Histology,Haematology,Immunology,Microbiology,Radiology, Health_Management)
| style="width:162.8pt; border:solid windowtext 1.0pt; border-top:none" width="217" |
| DiagnosticReport
<span style="line-height:normal">ODSCode</span>
 
| style="width:318.6pt; border-top:none; border-left:none; border-bottom:solid windowtext 1.0pt; border-right:solid windowtext 1.0pt" width="425" |
<span style="line-height:normal">Identifier::Value (use=officail, system=ods-organization-code)</span>
 
|-
|-
|  
| style="width:162.8pt; border:solid windowtext 1.0pt; border-top:none" width="217" |  
If the Value is not empty OR the CodeType is one of
<span style="line-height:normal">ParentOrganisationGuid</span>
 
| style="width:318.6pt; border-top:none; border-left:none; border-bottom:solid windowtext 1.0pt; border-right:solid windowtext 1.0pt" width="425" |
<span style="line-height:normal">PartOf::Reference *</span>


(Biochemistry,Biological_Values,Cytology_Histology, Haematology, Health_Management, Immunology,Microbiology,Radiology,Symptoms_Findings, Procedure (note, the codes is this category aren't actually "procedures"), Administration_Documents_Attachments, Body_Structure //dental structures,Care_Episode_Outcome, Dental_Finding,Diagnostics, Discharged_From_Service,EMIS_Qualifier,Ethnicity,HMP,Intervention_Category, Intervention_Target, KC60,;Marital_Status, Nationality,Nursing_Problem, Nursing_Problem_Domain, Obsteterics_Birth,Person_Health_Social, Planned_Dental, Problem_Rating_Scale, Reason_For_Care, Referral_Activity, Referral_Rejected, Referral_Withdrawn, Regiment, Religion, Trade_Branch, Unset)
|-
| style="width:162.8pt; border:solid windowtext 1.0pt; border-top:none" width="217" |
<span style="line-height:normal">CCGOrganisationGuid</span>


|  
| style="width:318.6pt; border-top:none; border-left:none; border-bottom:solid windowtext 1.0pt; border-right:solid windowtext 1.0pt" width="425" |  
Observation
<span style="line-height:normal">PartOf::Reference *</span>


&nbsp;
|-
| style="width:162.8pt; border:solid windowtext 1.0pt; border-top:none" width="217" |
<span style="line-height:normal">OrganisationType</span>


&nbsp;
| style="width:318.6pt; border-top:none; border-left:none; border-bottom:solid windowtext 1.0pt; border-right:solid windowtext 1.0pt" width="425" |
<span style="line-height:normal">Type***</span>


|-
|-
| If the CodeType is Conditions_Operations_Procedures and the Code is in (Preventive procedures, Operations, procedures, sites, Other therapeutic procedures)
| style="width:162.8pt; border:solid windowtext 1.0pt; border-top:none" width="217" |  
| Procedure
<span style="line-height:normal">OpenDate</span>
|-
| If the CodeType is Conditions_Operations_Procedures and the Code is in (Infectious and parasitic diseases, Neoplasms,Endocrine, nutritional, metabolic and immunity disorders, Diseases of blood and blood-forming organs, Mental disorders, Nervous system and sense organ diseases, Circulatory system diseases, Respiratory system diseases, Digestive system diseases, Genitourinary system diseases, Skin and subcutaneous tissue diseases, Musculoskeletal and connective tissue diseases)
|
Condition


&nbsp;
| style="width:318.6pt; border-top:none; border-left:none; border-bottom:solid windowtext 1.0pt; border-right:solid windowtext 1.0pt" width="425" |
<span style="line-height:normal">primarycare-activeperiod-extension::ValuePeriod::Start</span>


|-
|-
| Else&nbsp;<span style="line-height:normal">If the CodeType is Conditions_Operations_Procedures</span>
| style="width:162.8pt; border:solid windowtext 1.0pt; border-top:none" width="217" |
| Observation
<span style="line-height:normal">CloseDate</span>
|-
| If the CodeType is any of (Allergy_Adverse_Drug_Reations, Allergy_Adverse_Reations)
| AllergyIntolerance
|-
| If the CodeType is any of (Dental_Disorder, Dental_Procedure)
| Condition
|-
| If the CodeType is (Family_History)
| FamilyMemberHistory<br/> &nbsp;
|-
| f the CodeType is (Immunisations)
| Immunization
|-
| If code type is (Investigation_Requests)
| DiagnosticOrder
|-
| If code type is Pathology_Specimen
| Specimen
|-
| If code type is Referral
| Referral request
|}


There is a mismatch between EMIS observations and FHIR resource profiles
| style="width:318.6pt; border-top:none; border-left:none; border-bottom:solid windowtext 1.0pt; border-right:solid windowtext 1.0pt" width="425" |
<span style="line-height:normal">primarycare-activeperiod-extension::ValuePeriod::End</span>


{| border="1" cellpadding="1" cellspacing="1" style="width: 800pt;"
|-
|-
! scope="col" style="text-align: left; background-color: rgb(239, 239, 239); width: 181px;" | Structural Rule
| style="width:162.8pt; border:solid windowtext 1.0pt; border-top:none" width="217" |
! scope="col" style="width: 150px; background-color: rgb(239, 239, 239);" | Target profile
<span style="line-height:normal">MainLocationGuid</span>
|-
|
IF target profile IS Condition


&nbsp; &nbsp;IF CSV Care Record observation ID is in CSV Care Record Problem ID
| style="width:318.6pt; border-top:none; border-left:none; border-bottom:solid windowtext 1.0pt; border-right:solid windowtext 1.0pt" width="425" |
<span style="line-height:normal">primarycare-mainlocation-extension::ValueReference*</span>


| Combine problem and Condition into problem onset profile
|-
|-
|  
| style="width:162.8pt; border:solid windowtext 1.0pt; border-top:none" width="217" |  
In addition to the above mappings
<span style="line-height:normal">ProcessingId</span>


R1: IF&nbsp; the target resource select from above&nbsp;''is not'' condition
| style="width:318.6pt; border-top:none; border-left:none; border-bottom:solid windowtext 1.0pt; border-right:solid windowtext 1.0pt" width="425" |
<span style="line-height:normal">**</span>


&nbsp; &nbsp; &nbsp; &nbsp;R2: IF the CSV CareRecord_Observation ID&nbsp; is in CSV CareRecord_Problem record ID
|}


| Combine problem and other into Condition with "problem" profile
&nbsp;
|-
| &nbsp; &nbsp; &nbsp; &nbsp;R2: ELSE
| Observation
|-
| R1: Else&nbsp; &nbsp;&nbsp;: See R3
| &nbsp;
|-
|
R3: If the CSV Care Record Observation has PROBLEM ID


&nbsp; &nbsp; &nbsp; &nbsp; R4: IF the CSV care record Observation ID is NOT the PROBLEM ID
&nbsp;


&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;R5: IF the CSV care record CODE = the linked problem ID CODE
&nbsp;
 
| Condition with episode indicator = review
|-
| (R3,R4,R5&nbsp;: Else
| No change&nbsp;
|}


&nbsp;
&nbsp;

Revision as of 17:06, 5 May 2020

This article describes the mapping of EMIS published data into the intermediate FHIR store

Care record observations

Care record observations are a high level entity type. CareRecord_Observation contains data which is mapped to multiple FHIR resource types. Target FHIR profiles depend on content

Content dependent rules

The target resource type is decided by the following rules, using the code and 'CodeType' from the Coding_ClinicalCode file (looked up using the CodeId from CareRecord_Observation) and the Value field from CareRecord_Observation.

Code type Rule Target profile
If the Value is empty, and the CodeType is one of (Biochemistry, Cyology_Histology,Haematology,Immunology,Microbiology,Radiology, Health_Management) DiagnosticReport

If the Value is not empty OR the CodeType is one of

(Biochemistry,Biological_Values,Cytology_Histology, Haematology, Health_Management, Immunology,Microbiology,Radiology,Symptoms_Findings, Procedure (note, the codes is this category aren't actually "procedures"), Administration_Documents_Attachments, Body_Structure //dental structures,Care_Episode_Outcome, Dental_Finding,Diagnostics, Discharged_From_Service,EMIS_Qualifier,Ethnicity,HMP,Intervention_Category, Intervention_Target, KC60,;Marital_Status, Nationality,Nursing_Problem, Nursing_Problem_Domain, Obsteterics_Birth,Person_Health_Social, Planned_Dental, Problem_Rating_Scale, Reason_For_Care, Referral_Activity, Referral_Rejected, Referral_Withdrawn, Regiment, Religion, Trade_Branch, Unset)

Observation

 

 

If the CodeType is Conditions_Operations_Procedures and the Code is in (Preventive procedures, Operations, procedures, sites, Other therapeutic procedures) Procedure
If the CodeType is Conditions_Operations_Procedures and the Code is in (Infectious and parasitic diseases, Neoplasms,Endocrine, nutritional, metabolic and immunity disorders, Diseases of blood and blood-forming organs, Mental disorders, Nervous system and sense organ diseases, Circulatory system diseases, Respiratory system diseases, Digestive system diseases, Genitourinary system diseases, Skin and subcutaneous tissue diseases, Musculoskeletal and connective tissue diseases)

Condition

 

Else If the CodeType is Conditions_Operations_Procedures Observation
If the CodeType is any of (Allergy_Adverse_Drug_Reations, Allergy_Adverse_Reations) AllergyIntolerance
If the CodeType is any of (Dental_Disorder, Dental_Procedure) Condition
If the CodeType is (Family_History) FamilyMemberHistory
 
f the CodeType is (Immunisations) Immunization
If code type is (Investigation_Requests) DiagnosticOrder
If code type is Pathology_Specimen Specimen
If code type is Referral Referral request

There is a mismatch between EMIS observations and FHIR resource profiles

Structural Rule Target profile

IF target profile IS Condition

   IF CSV Care Record observation ID is in CSV Care Record Problem ID

Combine problem and Condition into problem onset profile

In addition to the above mappings

R1: IF  the target resource select from above is not condition

       R2: IF the CSV CareRecord_Observation ID  is in CSV CareRecord_Problem record ID

Combine problem and other into Condition with "problem" profile
       R2: ELSE Observation
R1: Else    : See R3  

R3: If the CSV Care Record Observation has PROBLEM ID

        R4: IF the CSV care record Observation ID is NOT the PROBLEM ID

           R5: IF the CSV care record CODE = the linked problem ID CODE

Condition with episode indicator = review
(R3,R4,R5 : Else No change 

 

Admin location

Source Target

Admin Location

Location { .....

LocationGuid

Id*

LocationName

Name

LocationTypeDescription

Type::Text

ParentLocationGuid

PartOf::Reference *

OpenDate

primarycare-activeperiod-extension::ValuePeriod::Start

CloseDate

primarycare-activeperiod-extension::ValuePeriod::End

MainContactName

primarycare-location-main-contact-extension::String

FaxNumber

Telecom (use=work, system=fax)

EmailAddress

Telecom (use=work, system=email)

PhoneNumber

Telecom (use=work, system=phone)

HouseNameFlatNumber

Address::Line

NumberAndStreet

Address::Line

Village

Address::Line

Town

Address::City

County

Address::District

Postcode

Address::PostalCode

Deleted

<If true, FHIR resource is deleted>

ProcessingId

*

Admin organisation

Each record maps to a FHIR Organization resource.

Source Target

OrganisationGuid

Id*

CDB

Identifier::Value (use=secondary, system=cdb-number)

OrganisationName

Name

ODSCode

Identifier::Value (use=officail, system=ods-organization-code)

ParentOrganisationGuid

PartOf::Reference *

CCGOrganisationGuid

PartOf::Reference *

OrganisationType

Type***

OpenDate

primarycare-activeperiod-extension::ValuePeriod::Start

CloseDate

primarycare-activeperiod-extension::ValuePeriod::End

MainLocationGuid

primarycare-mainlocation-extension::ValueReference*

ProcessingId

**

 

 

 

 

Prescribing_DrugRecord End Dates

The Prescribing_DrugRecord file contains both a Boolean active indicator (IsActive) and the medication end date (CancellationDate). Within Emis Web, it’s the IsActive indicator that is used to determine whether medication is active or not, the CancellationDate just providing additional information for ended medication. Analysing the received data has highlighted that there are a number of cases where the CancellationDate doesn’t match what the IsActive flag states:

  1. IsActive = true but a CancellationDate is present;
  2. IsActive = false but a CancellationDate is absent.

From the dates of affected data, these appear to be related to either a service moving to Emis Web from another GP system, and are an artefact of that transfer.

To ensure consistency in the FHIR MedicationStatements created from this file, the Cancellation date will only be carried over if the DrugRecord is non-active. If no cancellation date is present, it will be derived from the medication start and course length (found from the associated Prescribing_IssueRecord file).