Skip to content

Commit

Permalink
Max-Ratings API: Updates to digestive systems. (#3135)
Browse files Browse the repository at this point in the history
Updates to digestive systems.
  • Loading branch information
dfitchett authored Jul 1, 2024
1 parent fd873f9 commit 23dea21
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 13 deletions.
13 changes: 13 additions & 0 deletions domain-ee/ee-max-cfi-app/scripts/dc_lookup_table_updater.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import csv
import re
import sys
from typing import Any

Expand Down Expand Up @@ -45,11 +46,23 @@ def import_file(filename: str) -> dict[int, tuple[Any, Any, Any, Any, Any, Any]]
except ValueError:
raise ValueError(f'Invalid diagnostic code at index {index}: \n{csv_line}')

rated_issue_name = remove_diagnostic_code_prefix(clean_string(rated_issue_name), diagnostic_code_str)
diagnostic_code_to_data[diagnostic_code] = (rated_issue_name, max_rating_str, body_system, category, subcategory, cfr_ref)

return diagnostic_code_to_data


def clean_string(input_string):
# Remove non-alphanumeric characters, excluding some special characters, from the end of the string
return re.sub(r'[^\w(){}\[\]°]*$', '', input_string)


def remove_diagnostic_code_prefix(rated_issue_name: str, diagnostic_code_str: str) -> str:
if rated_issue_name.startswith(diagnostic_code_str):
return rated_issue_name[len(diagnostic_code_str) :].strip()
return rated_issue_name


def export_data(data: dict[int, tuple[Any, int, Any, Any, Any, Any]]):
with open(DATA_FILE, 'w') as file:
csv_writer = csv.writer(file)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ Diagnostic Code,Rated Issue Name,Max Rating,Body System,Category,Subcategory,CFR
6845,Chronic pleural effusion or fibrosis,100,The respiratory system,DISEASES OF THE LUNGS AND PLEURA—TUBERCULOSIS,,38 CFR 4.97
6846,Sarcoidosis,100,The respiratory system,DISEASES OF THE LUNGS AND PLEURA—TUBERCULOSIS,,38 CFR 4.97
6847,"Sleep Apnea Syndromes (Obstructive, Central, Mixed)",100,The respiratory system,DISEASES OF THE LUNGS AND PLEURA—TUBERCULOSIS,,38 CFR 4.97
7000,"Valvular heart disease (including rheumatic heart disease),",100,The Cardiovascular System,,,38 CFR 4.104
7000,Valvular heart disease (including rheumatic heart disease),100,The Cardiovascular System,,,38 CFR 4.104
7001,"Endocarditis, or",100,The Cardiovascular System,,,38 CFR 4.104
7002,Pericarditis,100,The Cardiovascular System,,,38 CFR 4.104
7003,Pericardial adhesions,100,The Cardiovascular System,,,38 CFR 4.104
Expand Down Expand Up @@ -382,7 +382,7 @@ Diagnostic Code,Rated Issue Name,Max Rating,Body System,Category,Subcategory,CFR
7204,Esophageal motility disorder,80,The Digestive System,,,38 CFR 4.114
7205,"Esophagus, diverticulum of, acquired",80,The Digestive System,,,38 CFR 4.114
7206,Gastroesophageal reflux disease,80,The Digestive System,,,38 CFR 4.114
7207,Barrett’s esophagus,80,The Digestive System,,,38 CFR 4.114
7207,Barrett’s esophagus,100,The Digestive System,,,38 CFR 4.114
7301,"Peritoneum, adhesions of, due to surgery, trauma, disease, or infection",80,The Digestive System,,,38 CFR 4.114
7303,Chronic complications of upper gastrointestinal surgery,80,The Digestive System,,,38 CFR 4.114
7304,Peptic ulcer disease,100,The Digestive System,,,38 CFR 4.114
Expand Down Expand Up @@ -410,7 +410,7 @@ Diagnostic Code,Rated Issue Name,Max Rating,Body System,Category,Subcategory,CFR
7328,"Intestine, small, resection of",100,The Digestive System,,,38 CFR 4.114
7329,"Intestine, large, resection of",100,The Digestive System,,,38 CFR 4.114
7330,"Intestinal fistulous disease, external",100,The Digestive System,,,38 CFR 4.114
7331,[Removed],,The Digestive System,,,38 CFR 4.114
7331,"Peritonitis, tuberculous, active or inactive",100,The Digestive System,,,38 CFR 4.114
7332,"Rectum and anus, impairment of sphincter control",100,The Digestive System,,,38 CFR 4.114
7333,"Rectum and anus, stricture of",100,The Digestive System,,,38 CFR 4.114
7334,"Rectum, prolapse of",100,The Digestive System,,,38 CFR 4.114
Expand All @@ -420,18 +420,18 @@ Diagnostic Code,Rated Issue Name,Max Rating,Body System,Category,Subcategory,CFR
7338,"Hernia, including femoral, inguinal, umbilical, ventral, incisional, and other (but not including hiatal)",100,The Digestive System,,,38 CFR 4.114
7339,[Removed],,The Digestive System,,,38 CFR 4.114
7340,[Removed],,The Digestive System,,,38 CFR 4.114
7342,[Removed],,The Digestive System,,,38 CFR 4.114
7343,[Removed],,The Digestive System,,,38 CFR 4.114
7342,"Visceroptosis, symptomatic, marked",10,The Digestive System,,,38 CFR 4.114
7343,"Malignant neoplasms of the digestive system, exclusive of skin growths",100,The Digestive System,,,38 CFR 4.114
7344,"Benign neoplasms, exclusive of skin growths",,The Digestive System,,,38 CFR 4.114
7345,"Chronic liver disease without cirrhosis (including hepatitis B, chronic active hepatitis, autoimmune hepatitis, hemochromatosis, drug-induced hepatitis, etc., but excluding bile duct disorders and hepatitis C)",100,The Digestive System,,,38 CFR 4.114
7345,Chronic liver disease without cirrhosis,100,The Digestive System,,,38 CFR 4.114
7346,Hiatal hernia and paraesophageal hernia,80,The Digestive System,,,38 CFR 4.114
7347,"Pancreatitis, chronic",100,The Digestive System,,,38 CFR 4.114
7348,Vagotomy with pyloroplasty or gastroenterostomy,40,The Digestive System,,,38 CFR 4.114
7348,Vagotomy with pyloroplasty or gastroenterostomy,100,The Digestive System,,,38 CFR 4.114
7350,Liver abscess,100,The Digestive System,,,38 CFR 4.114
7351,Liver transplant,100,The Digestive System,,,38 CFR 4.114
7352,Pancreas transplant,100,The Digestive System,,,38 CFR 4.114
7354,"Hepatitis C (or non-A, non-B hepatitis)",100,The Digestive System,,,38 CFR 4.114
7355,Celiac disease,100,The Digestive System,,,38 CFR 4.114
7355,Celiac disease,80,The Digestive System,,,38 CFR 4.114
7356,Gastrointestinal dysmotility syndrome,80,The Digestive System,,,38 CFR 4.114
7357,Post pancreatectomy syndrome,100,The Digestive System,,,38 CFR 4.114
7500,"Kidney, removal of one",100,The Genitourinary System,,,38 CFR 4.115b
Expand Down Expand Up @@ -542,7 +542,7 @@ Diagnostic Code,Rated Issue Name,Max Rating,Body System,Category,Subcategory,CFR
7828,Acne,30,The Skin,,,38 CFR 4.118
7829,Chloracne,30,The Skin,,,38 CFR 4.118
7830,Scarring alopecia,20,The Skin,,,38 CFR 4.118
7831,Alopecia areata:,10,The Skin,,,38 CFR 4.118
7831,Alopecia areata,10,The Skin,,,38 CFR 4.118
7832,Hyperhidrosis,30,The Skin,,,38 CFR 4.118
7833,Malignant melanoma,100,The Skin,,,38 CFR 4.118
7900,"Hyperthyroidism, including, but not limited to, Graves' disease",30,The Endocrine System,,,38 CFR 4.119
Expand Down Expand Up @@ -601,19 +601,19 @@ Diagnostic Code,Rated Issue Name,Max Rating,Body System,Category,Subcategory,CFR
8209,Paralysis of,30,Neurological Conditions and Convulsive Disorders,Diseases of the Cranial Nerves,Ninth (glossopharyngeal) cranial nerve,38 CFR 4.124a
8210,Paralysis of,50,Neurological Conditions and Convulsive Disorders,Diseases of the Cranial Nerves,"Tenth (pneumogastric, vagus) cranial nerve",38 CFR 4.124a
8211,Paralysis of,30,Neurological Conditions and Convulsive Disorders,Diseases of the Cranial Nerves,"Eleventh (spinal accessory, external branch) cranial nerve.",38 CFR 4.124a
8212,Paralysis of,50,Neurological Conditions and Convulsive Disorders,Diseases of the Cranial Nerves,Twelfth (hypoglossal) cranial nerve,38 CFR 4.124a
8212,Paralysis of,50,Neurological Conditions and Convulsive Disorders,Diseases of the Cranial Nerves,Twelfth (hypoglossal) cranial nerve.,38 CFR 4.124a
8305,Neuritis,30,Neurological Conditions and Convulsive Disorders,Diseases of the Cranial Nerves,Fifth (trigeminal) cranial nerve,38 CFR 4.124a
8307,Neuritis,20,Neurological Conditions and Convulsive Disorders,Diseases of the Cranial Nerves,Seventh (facial) cranial nerve,38 CFR 4.124a
8309,Neuritis,20,Neurological Conditions and Convulsive Disorders,Diseases of the Cranial Nerves,Ninth (glossopharyngeal) cranial nerve,38 CFR 4.124a
8310,Neuritis,30,Neurological Conditions and Convulsive Disorders,Diseases of the Cranial Nerves,"Tenth (pneumogastric, vagus) cranial nerve",38 CFR 4.124a
8311,Neuritis,20,Neurological Conditions and Convulsive Disorders,Diseases of the Cranial Nerves,"Eleventh (spinal accessory, external branch) cranial nerve.",38 CFR 4.124a
8312,Neuritis,30,Neurological Conditions and Convulsive Disorders,Diseases of the Cranial Nerves,Twelfth (hypoglossal) cranial nerve,38 CFR 4.124a
8312,Neuritis,30,Neurological Conditions and Convulsive Disorders,Diseases of the Cranial Nerves,Twelfth (hypoglossal) cranial nerve.,38 CFR 4.124a
8405,Neuralgia,10,Neurological Conditions and Convulsive Disorders,Diseases of the Cranial Nerves,Fifth (trigeminal) cranial nerve,38 CFR 4.124a
8407,Neuralgia,10,Neurological Conditions and Convulsive Disorders,Diseases of the Cranial Nerves,Seventh (facial) cranial nerve,38 CFR 4.124a
8409,Neuralgia,10,Neurological Conditions and Convulsive Disorders,Diseases of the Cranial Nerves,Ninth (glossopharyngeal) cranial nerve,38 CFR 4.124a
8410,Neuralgia,10,Neurological Conditions and Convulsive Disorders,Diseases of the Cranial Nerves,"Tenth (pneumogastric, vagus) cranial nerve",38 CFR 4.124a
8411,Neuralgia,10,Neurological Conditions and Convulsive Disorders,Diseases of the Cranial Nerves,"Eleventh (spinal accessory, external branch) cranial nerve.",38 CFR 4.124a
8412,Neuralgia,10,Neurological Conditions and Convulsive Disorders,Diseases of the Cranial Nerves,Twelfth (hypoglossal) cranial nerve,38 CFR 4.124a
8412,Neuralgia,10,Neurological Conditions and Convulsive Disorders,Diseases of the Cranial Nerves,Twelfth (hypoglossal) cranial nerve.,38 CFR 4.124a
8510,Paralysis of,70,Neurological Conditions and Convulsive Disorders,Diseases of the Peripheral Nerves,Upper radicular group (fifth and sixth cervicals),38 CFR 4.124a
8511,Paralysis of,70,Neurological Conditions and Convulsive Disorders,Diseases of the Peripheral Nerves,Middle radicular group,38 CFR 4.124a
8512,Paralysis of,70,Neurological Conditions and Convulsive Disorders,Diseases of the Peripheral Nerves,Lower radicular group,38 CFR 4.124a
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
TABLE_VERSION = 2
TABLE_VERSION = 3
# auto-generated by dc_lookup_table_updater.py

0 comments on commit 23dea21

Please sign in to comment.