Mapping Entities with Corresponding CPT Codes - Pipeline

Description

This pipeline maps clinical entities (procedures, tests, treatments) to their corresponding CPT (Current Procedural Terminology) codes. It provides fast and accurate procedural code mapping without requiring embeddings.

How to use


from sparknlp.pretrained import PretrainedPipeline

pipeline = PretrainedPipeline("cpt_mapper_pipeline", "en", "clinical/models")

sample_text = """ A 28-year-old female underwent episiotomy during vaginal delivery. Pulse oximetry was monitored continuously throughout the procedure. Due to postpartum hemorrhage, blood transfusion was administered. The patient was transferred to the inpatient hospital for overnight observation."""

result = pipeline.transform(spark.createDataFrame([[sample_text]]).toDF("text"))


from johnsnowlabs import nlp, medical

pipeline = nlp.PretrainedPipeline("cpt_mapper_pipeline", "en", "clinical/models")

sample_text = """ A 28-year-old female underwent episiotomy during vaginal delivery. Pulse oximetry was monitored continuously throughout the procedure. Due to postpartum hemorrhage, blood transfusion was administered. The patient was transferred to the inpatient hospital for overnight observation."""

result = pipeline.transform(spark.createDataFrame([[sample_text]]).toDF("text"))


import com.johnsnowlabs.nlp.pretrained.PretrainedPipeline

val pipeline = PretrainedPipeline("cpt_mapper_pipeline", "en", "clinical/models")

val sample_text = """ A 28-year-old female underwent episiotomy during vaginal delivery. Pulse oximetry was monitored continuously throughout the procedure. Due to postpartum hemorrhage, blood transfusion was administered. The patient was transferred to the inpatient hospital for overnight observation."""

val result = pipeline.transform(spark.createDataFrame([[sample_text]]).toDF("text"))

Results


|ner_chunk         |mapping_result|
|------------------|--------------|
|episiotomy        |59300         |
|Pulse oximetry    |94760         |
|blood transfusion |36430         |
|inpatient hospital|1021881       |

Model Information

Model Name: cpt_mapper_pipeline
Type: pipeline
Compatibility: Healthcare NLP 6.3.0+
License: Licensed
Edition: Official
Language: en
Size: 1.7 GB

Included Models

  • DocumentAssembler
  • SentenceDetector
  • TokenizerModel
  • WordEmbeddingsModel
  • MedicalNerModel
  • NerConverterInternalModel
  • ChunkMapperModel

References

CPT resolver models are removed from the Models Hub due to license restrictions and can only be shared with the users who already have a valid CPT license. If you possess one and wish to use this model, kindly contact us at support@johnsnowlabs.com.