From 1560e7f91dc781c3e479efebb4f3855bb27a49b8 Mon Sep 17 00:00:00 2001 From: Katon Minhas Date: Wed, 30 Jul 2025 15:04:20 +0000 Subject: [PATCH] Merged in refactor/rename-procedure-cd (pull request #638) CPT4_PROC_CD --> PROCEDURE_CD * CPT4_PROC_CD --> PROCEDURE_CD Approved-by: Alex Galarce --- fieldExtraction/src/constants/investment_columns.py | 4 ++-- fieldExtraction/src/investment/code_funcs.py | 8 ++++---- fieldExtraction/src/prompts/investment_prompts.json | 4 ++-- fieldExtraction/src/prompts/investment_prompts.py | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/fieldExtraction/src/constants/investment_columns.py b/fieldExtraction/src/constants/investment_columns.py index b30d8d8..f51968b 100644 --- a/fieldExtraction/src/constants/investment_columns.py +++ b/fieldExtraction/src/constants/investment_columns.py @@ -84,8 +84,8 @@ COLUMN_ORDER = [ "FEE_SCHEDULE_VERSION", "AARETE_DERIVED_FEE_SCHEDULE_VERSION", "SERVICE_TERM", - "CPT4_PROC_CD", - "CPT4_PROC_CD_DESC", + "PROCEDURE_CD", + "PROCEDURE_CD_DESC", "CPT4_PROC_MOD", "CPT4_PROC_MOD_DESC", "REVENUE_CD", diff --git a/fieldExtraction/src/investment/code_funcs.py b/fieldExtraction/src/investment/code_funcs.py index 9a5a34e..5bd59fc 100644 --- a/fieldExtraction/src/investment/code_funcs.py +++ b/fieldExtraction/src/investment/code_funcs.py @@ -435,7 +435,7 @@ def code_description_mapping(answer_dict, all_mappings): list: Updated list of dictionaries with code descriptions added. """ - proc_code = answer_dict.get("CPT4_PROC_CD") + proc_code = answer_dict.get("PROCEDURE_CD") proc_mod = answer_dict.get("CPT4_PROC_MOD") diag_code = answer_dict.get("DIAG_CD") rev_code = answer_dict.get("REVENUE_CD") @@ -443,7 +443,7 @@ def code_description_mapping(answer_dict, all_mappings): grouper_type = answer_dict.get("GROUPER_TYPE") admit_type_code = answer_dict.get("CLAIM_ADMIT_TYPE_CD") - answer_dict["CPT4_PROC_CD_DESC"] = get_code_description(proc_code, all_mappings['proc_mapping']) + answer_dict["PROCEDURE_CD_DESC"] = get_code_description(proc_code, all_mappings['proc_mapping']) answer_dict["CPT4_PROC_MOD_DESC"] = get_code_description(proc_mod, all_mappings['proc_mapping']) answer_dict["DIAG_CD_DESC"] = get_code_description(diag_code, all_mappings['diag_mapping']) answer_dict["REVENUE_CD_DESC"] = get_code_description(rev_code, all_mappings['rev_mapping']) @@ -528,14 +528,14 @@ def get_code_breakout(answer_dicts: list[dict], filename: str, all_dataset: dict answer_dict.update(code_primary_answers) if all(string_utils.is_empty(value) for value in code_primary_answers.values()): implicit_proc_cd = code_implicit(service_term_clean, filename) - answer_dict["CPT4_PROC_CD"] = implicit_proc_cd + answer_dict["PROCEDURE_CD"] = implicit_proc_cd # Code Descriptions try: answer_dict = code_description_mapping(answer_dict, all_dataset['codes_mappings']) except Exception as e: print(f"Error in code_description_mapping: {e}") - answer_dict["CPT4_PROC_CD_DESC"] = "N/A" + answer_dict["PROCEDURE_CD_DESC"] = "N/A" answer_dict["CPT4_PROC_MOD_DESC"] = "N/A" answer_dict["DIAG_CD_DESC"] = "N/A" answer_dict["REVENUE_CD_DESC"] = "N/A" diff --git a/fieldExtraction/src/prompts/investment_prompts.json b/fieldExtraction/src/prompts/investment_prompts.json index eff6b73..160100b 100644 --- a/fieldExtraction/src/prompts/investment_prompts.json +++ b/fieldExtraction/src/prompts/investment_prompts.json @@ -468,13 +468,13 @@ "prompt": "DEFAULT_INDICATOR:\nIndicates whether this methodology serves as a default/fallback payment rate when no other payment methods apply. The default/fallback payment rate is typically a low rate and based on billed charges. This is an 'end-of-the-line' reimbursement when no other methodologies apply.\n\nOutput 'Y' ONLY if the methodology meets BOTH these criteria:\n1. Contains language indicating it applies to services not covered elsewhere, such as:\n - 'services not listed in the fee schedule'\n - 'services for which no other payment method is specified'\n - 'all other services'\n - 'services not otherwise specified'\n2. Is clearly a secondary/fallback option, NOT the primary/base reimbursement method, as indicated by:\n - Position in the contract (appears after primary methodology is defined)\n - Lower reimbursement rate than the base methodology (typically 50-60% of charges)\n - Explicit 'default' or 'fallback' terminology\n - Applies to a minor subset of services (not the majority of contract services)\n\nOutput 'N' if ANY of these are true:\n- The methodology is the primary/base reimbursement approach, even if defined by exclusion\n- The methodology applies to specific listed services/procedures\n- The methodology offers standard rates comparable to other contract methodologies\n- No default/fallback language is present\n\nExample of TRUE default (Y): 'For any services not specifically listed in Exhibits A-D, reimbursement shall be 50% of billed charges.'\nExample of base methodology defined by exclusion (N): 'Covered Services not included in the Service Categories in Table 1 shall be reimbursed at 100% of the Medicare fee schedule.'" }, { - "field_name": "CPT4_PROC_CD", + "field_name": "PROCEDURE_CD", "relationship": "one_to_n", "field_type": "code_primary_breakout", "prompt": "Identify all Procedure (CPT or HCPCS) Codes in the text: - CPT codes are exactly 5 numeric digits (00100-99999) - HCPCS codes are 1 letter followed by 4 numbers (A0000-V9999)." }, { - "field_name": "CPT4_PROC_CD_DESC", + "field_name": "PROCEDURE_CD_DESC", "relationship": "one_to_n", "field_type": "TBD", "prompt": "TBD" diff --git a/fieldExtraction/src/prompts/investment_prompts.py b/fieldExtraction/src/prompts/investment_prompts.py index 3702785..f18c61b 100644 --- a/fieldExtraction/src/prompts/investment_prompts.py +++ b/fieldExtraction/src/prompts/investment_prompts.py @@ -666,7 +666,7 @@ Use the text in the Service to populate a JSON dictionary with the following fie {questions}. For each field, return a list of all codes EXPLICITLY written for that field. The code itself must be written, not language that describes the code. -Note that codes may be present, but not explicitly labeled as codes. For example, you may simply see "J1098", which is a CPT4_PROC_CD. You may see "155" which is a REVENUE_CD, etc. +Note that codes may be present, but not explicitly labeled as codes. For example, you may simply see "J1098", which is a PROCEDURE_CD. You may see "155" which is a REVENUE_CD, etc. If the contract gives a range of codes, without listing each code in the range individually, return the range in the format 'LowestCode-HighestCode'. If any of the codes are not found, do not write a list for that field. Simply populate the field with 'N/A'.