• Ready for review
  • SNOMED to ICD-10 Mapping

    Introduction

    Bahmni Line Reports offer flexible configuration options to seamlessly integrate with a series of extensions, enhancing functionalities like custom report generation. Among these extensions is the ICD-10 extension, a module designed for mapping SNOMED codes to ICD-10 codes within Bahmni Reports. This extension supports ICD-10 mapping in both Snowstorm and Snowstorm Lite environments. Snowstorm Lite is a compact FHIR terminology server tailored for low-resource settings.

    SNOMED to ICD-10 Line Report Screenshot

    Given below is an example of a SNOMED Diagnosis Line Report with SNOMED to ICD-10 mapping

    Configuring Extensions

    The provided configuration example illustrates how to set up a SNOMED Diagnosis Line Report to utilise the ICD-10 extension

    "diagnosisICDLineReportClinicalFindings": { "name": "SNOMED Diagnosis Line Report(ICD) for Clinical Findings", "type": "fhirTSLookupDiagnosisLine", "requiredPrivilege": "app:reports", "config": { "tsConceptSource": "SCT", "conceptNameDisplayFormat": "shortNamePreferred", "terminologyParentCode": "404684003", "displayTerminologyCode": "true", "terminologyColumnName": "SNOMED Code", "patientAttributes": [ ], "patientAddresses": [ ], "extensions": ["org.bahmni.reports.extensions.icd10.Icd10ResultSetExtension"] } },

    The extensions attribute specifies the fully qualified extension class names that should be in the class path and used to extend the report's functionality.

    Without extensions: The raw result set, which is a collection of rows of data, is passed directly to the Jasper Report Builder for rendering.
    With extensions: The result set is transformed into a map collection, which is a more efficient way to enrich data. Each extension class uses reflection to access and enrich the data in the map collection. The extension class can then pass the enriched data to the next extension class in the chain. The processed result set is passed subsequently to the Jasper Report Builder for rendering.

    The extension JAR file is mounted in the Bahmni Reports container using a Docker volume in the docker-compose file. This ensures that the extension class is available to the image. The following line needs to be uncommented in the reports service for the extension to get activated.

    reports: image: bahmni/reports:${REPORTS_IMAGE_TAG:?} ... volumes: - "../snomed-resources/icd10-extensions-1.0.0-SNAPSHOT.jar:/var/run/bahmni-reports/bahmni-reports/WEB-INF/lib/icd10-extensions-1.0.0-SNAPSHOT.jar:ro"

    After uncommenting, update reports container by running docker compose up -d reports

    ICD-10 Extension Repository

    Source Code Repository for ICD-10 reports extension is as follows:

    https://github.com/Bahmni/bahmni-reports-extension-icd10

    Typically all the report extensions should implement the enrich method from the interface org.bahmni.reports.extensions.ResultSetExtension

    Mapping ICD-10 in a Snowstorm Environment

    ICD-10 Reports extension for Snowstorm borrows the same mechanism of the ICD-10 mappings Demonstrator found here: https://ihtsdo.github.io/iid-icd-maps/

    The screenshot shows that the SNOMED CT code 421671002 matches the ICD-10 codes B20.8 and J17.8 (see green check mark) for a given age and gender.

    Native API

    SNOMED codes are mapped to ICD-10 codes by filtering a reference rule set based on the SNOMED code, patient age, and gender

    • For example, 447562003 is the SNOMED code for SNOMED CT to ICD-10 extended map is a map reference set for mapping SNOMED Code to ICD-10 code(s)

    • To use the reference set, you pass the SNOMED code as a parameter to the reference set in the form of an ECL query. ECL is a language used to query SNOMED CT concepts.

    ^[*] 447562003 |ICD-10 complex map reference set| {{ M referencedComponentId = "[SNOMED CODE]" }}

    For example

    ^[*] 447562003 |ICD-10 complex map reference set| {{ M referencedComponentId = 421671002 }}MED CT to ICD-10 extended mapSNOMED CT to ICD-10 extended map

    The response comprise of a list of rules for mapping the given SNOMED code to ICD codes.

    The following attributes from each rule are used to determine the target ICD-10 code(s):

    MapGroup – This contains a set of rules that are grouped together. These rules determine which ICD-10 code will be chosen

    MapPriority – Each rule in MapGroup is given a priority. This indicates the priority of the sequence of the rules to be executed in a MapGroup. Eg, if MapPriority is 1, then this rule will be executed first, followed by 2, 3 and so on

    MapRule – This is the actual rule to determine which target map (ICD-10 code) will be chosen for the corresponding SNOMED Code

    MapTarget – the target ICD-10 code which will be mapped to SNOMED Code

    Algorithm to extract ICD-10 code(s)

    The algorithm for mapping SNOMED codes to ICD-10 codes using Snowstorm is as follows:

    1. For each row of data, identify the SNOMED code i.e. Excessive growth rate(440311000124109)

    2. Use the following API to get the unordered ICD-10 mapping rules for the given SNOMED code:

    This API uses the following configuration from the application.properties file:

    1. Order the mapping rules by mapGroup and then by mapPriority.

    2. For each mapGroup, iterate over the rules in ascending order of priority and evaluate them until a matching mapTarget is found.

    3. To evaluate each rule, the system uses the javax.script.ScriptEngine evaluator to convert the rule into a JavaScript expression and then evaluates the expression. The evaluator can optionally take into account the patient's age and gender.

    4. If the JavaScript expression evaluates to true, then the corresponding mapTarget has the matching ICD-10 code for the given mapGroup. The system collects these codes into an ArrayList of matching ICD-10 codes.

    5. The ICD-10 codes that are generated by the mapping process will be displayed in the enriched column of the report.

     

    Mapping ICD-10 in a Snowstorm Lite Environment

    FHIR API

    This API uses the following URL template configuration from the application.properties file:

    The response comprise of a list of rules for mapping the given SNOMED code to ICD codes.

    Algorithm to extract ICD-10 code(s)

    The algorithm for mapping SNOMED codes to ICD-10 codes is as follows:

    1. Categorise the parameters from the response list into two separate lists, namely, message parameters and match parameters, based on their names.

    2. Create a list of mapping rules for each pair of message and match parameters. The MapGroup, MapPriority, MapRule attributes are extracted from message parameter using the regex below. Also the MapTarget is extracted from match parameter

    1. Order the mapping rules by mapGroup and then by mapPriority.

    2. For each mapGroup, iterate over the rules in ascending order of priority and evaluate them until a matching mapTarget is found.

    3. To evaluate each rule, the system uses the javax.script.ScriptEngine evaluator to convert the rule into a JavaScript expression and then evaluates the expression. The evaluator can optionally take into account the patient's age and gender.

    4. If the JavaScript expression evaluates to true, then the corresponding mapTarget has the matching ICD-10 code for the given mapGroup. The system collects these codes into an ArrayList of matching ICD-10 codes.

    5. The ICD-10 codes that are generated by the mapping process will be displayed in the enriched column of the report.

    The Bahmni documentation is licensed under Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)