Mapping ICD-10-CM Codes with Their Corresponding ICD-9-CM Codes

Description

This pretrained model maps ICD-10-CM codes to corresponding ICD-9-CM codes.

Predicted Entities

icd9_code

Open in Colab Copy S3 URI

How to use

documentAssembler = DocumentAssembler()\
    .setInputCol("text")\
    .setOutputCol("ner_chunk")

sbert_embedder = BertSentenceEmbeddings.pretrained("sbiobert_base_cased_mli", "en", "clinical/models")\
    .setInputCols(["ner_chunk"])\
    .setOutputCol("sbert_embeddings")

icd_resolver = SentenceEntityResolverModel.pretrained("sbiobertresolve_icd10cm_augmented_billable_hcc", "en", "clinical/models") \
    .setInputCols(["sbert_embeddings"]) \
    .setOutputCol("icd10cm_code")\
    .setDistanceFunction("EUCLIDEAN")

chunkerMapper = ChunkMapperModel.pretrained("icd10_icd9_mapper", "en", "clinical/models")\
    .setInputCols(["icd10cm_code"])\
    .setOutputCol("mappings")\
    .setRels(["icd9_code"])


pipeline = Pipeline(stages = [
    documentAssembler,
    sbert_embedder,
    icd_resolver,
    chunkerMapper])

model = pipeline.fit(spark.createDataFrame([[""]]).toDF("text"))

light_pipeline= LightPipeline(model)

result = light_pipeline.fullAnnotate("Diabetes Mellitus")


val documentAssembler = new DocumentAssembler()
    .setInputCol("text")
    .setOutputCol("ner_chunk")

val sbert_embedder = BertSentenceEmbeddings.pretrained("sbiobert_base_cased_mli", "en", "clinical/models")
    .setInputCols(Array("ner_chunk"))
    .setOutputCol("sbert_embeddings")

val icd_resolver = SentenceEntityResolverModel.pretrained("sbiobertresolve_icd10cm_augmented_billable_hcc", "en", "clinical/models") 
    .setInputCols(Array("sbert_embeddings")) 
    .setOutputCol("icd10cm_code")
    .setDistanceFunction("EUCLIDEAN")

val chunkerMapper = ChunkMapperModel.pretrained("icd10_icd9_mapper", "en", "clinical/models")
    .setInputCols(Array("icd10cm_code"))
    .setOutputCol("mappings")
    .setRels(Array("icd9_code"))


val pipeline = new Pipeline(stages = Array(
    documentAssembler,
    sbert_embedder,
    icd_resolver,
    chunkerMapper
    ))

val data = Seq("Diabetes Mellitus").toDS.toDF("text")

val result= pipeline.fit(data).transform(data)


import nlu
nlu.load("en.map_entity.icd10_ic9").predict("""Diabetes Mellitus""")

Results

|    | chunk             | icd10cm_code   | icd9_mapping   |
|---:|:------------------|:---------------|:---------------|
|  0 | Diabetes Mellitus | Z833           | V180           |

Model Information

Model Name: icd10_icd9_mapper
Compatibility: Healthcare NLP 4.1.0+
License: Licensed
Edition: Official
Input Labels: [ner_chunk]
Output Labels: [mappings]
Language: en
Size: 580.0 KB