From 91a71643dccbbb5765aaa8893ed2897b066625e8 Mon Sep 17 00:00:00 2001 From: Katon Minhas Date: Fri, 7 Feb 2025 21:58:02 +0000 Subject: [PATCH] Merged in field/prod_prog_lob (pull request #386) Updated crosswalks * Updated crosswalks * Merged main into field/prod_prog_lob * Update CONTRACT_PRODUCT prompt Approved-by: Alex Galarce --- .../crosswalk/mappings/crosswalk_lob.json | 20 +++++++ .../crosswalk/mappings/crosswalk_product.json | 10 ++++ .../crosswalk/mappings/crosswalk_program.json | 32 ++++++++++ .../src/constants/investment_values.py | 59 ++++++++++--------- .../src/investment/aarete_derived.py | 2 + .../src/prompts/investment_prompts.json | 44 ++++++++------ 6 files changed, 121 insertions(+), 46 deletions(-) create mode 100644 fieldExtraction/crosswalk/mappings/crosswalk_lob.json create mode 100644 fieldExtraction/crosswalk/mappings/crosswalk_product.json create mode 100644 fieldExtraction/crosswalk/mappings/crosswalk_program.json diff --git a/fieldExtraction/crosswalk/mappings/crosswalk_lob.json b/fieldExtraction/crosswalk/mappings/crosswalk_lob.json new file mode 100644 index 0000000..6bb2e52 --- /dev/null +++ b/fieldExtraction/crosswalk/mappings/crosswalk_lob.json @@ -0,0 +1,20 @@ +{ + "metadata": { + "from_col": "CONTRACT_LINE_OF_BUSINESS", + "to_col": "AARETE_DERIVED_LINE_OF_BUSINESS" + }, + "mapping": { + "MEDICAID" : "Medicaid", + "MEDICARE-MEDICAID" : "Medicare-Medicaid", + "MEDICARE" : "Medicare", + "MEDICARE-ADVANTAGE" : "Medicare", + "COMMERCIAL" : "Commercial-Group", + "COMMERCIAL-EXCHANGE" : "Commercial-Group", + "GROUP" : "Commercial-Group", + "MARKETPLACE" : "Marketplace-Exchange-Individual & Family", + "CORRECTIONS" : "Corrections", + "VETERANS AFFAIRS" : "Veterans Affairs (VA)", + "CIVILIAN HEALTH AND MEDICAL PROGRAM" : "Civilian Health and Medical Program (CHAMPVA)", + "TRICARE" : "TRICARE" + } +} \ No newline at end of file diff --git a/fieldExtraction/crosswalk/mappings/crosswalk_product.json b/fieldExtraction/crosswalk/mappings/crosswalk_product.json new file mode 100644 index 0000000..270ed73 --- /dev/null +++ b/fieldExtraction/crosswalk/mappings/crosswalk_product.json @@ -0,0 +1,10 @@ +{ + "metadata": { + "from_col": "CONTRACT_PRODUCT", + "to_col": "AARETE_DERIVED_PRODUCT" + }, + "mapping": { + "EXAMPLE_PRODUCT" : "EXAMPLE_PRODUCT" + } + +} \ No newline at end of file diff --git a/fieldExtraction/crosswalk/mappings/crosswalk_program.json b/fieldExtraction/crosswalk/mappings/crosswalk_program.json new file mode 100644 index 0000000..75e095e --- /dev/null +++ b/fieldExtraction/crosswalk/mappings/crosswalk_program.json @@ -0,0 +1,32 @@ +{ + "metadata": { + "from_col": "CONTRACT_PROGRAM", + "to_col": "AARETE_DERIVED_PROGRAM" + }, + "mapping": { + "Aged, Blind, Disabled (ABD)": "Aged, Blind, Disabled (ABD)", + "Children’s Health Insurance Program (CHIP)": "Children’s Health Insurance Program (CHIP)", + "CHIP" : "Children’s Health Insurance Program (CHIP)", + "Children’s Health Insurance Program Perinate (CHIP-Perinate)": "Children’s Health Insurance Program Perinate (CHIP-Perinate)", + "CHIP-P" : "Children’s Health Insurance Program Perinate (CHIP-Perinate)", + "Foster Care": "Foster Care", + "Intellectual and Developmental Disability (IDD)": "Intellectual and Developmental Disability (IDD)", + "Temporary Assistance Needy Families (TANF)": "Temporary Assistance Needy Families (TANF)", + "Chronic Condition Special Needs Plan (C-SNP)": "Chronic Condition Special Needs Plan (C-SNP)", + "Dual Eligible Special Needs Plan (D-SNP)": "Dual Eligible Special Needs Plan (D-SNP)", + "Institutional Special Needs Plan (I-SNP)": "Institutional Special Needs Plan (I-SNP)", + "Long-Term Services and Supports (LTSS)": "Long-Term Services and Supports (LTSS)", + "Program of All-Inclusive Care for the Elderly (PACE)": "Program of All-Inclusive Care for the Elderly (PACE)", + "Special Needs Plan (SNP)": "Special Needs Plan (SNP)", + "Medicare Advantage": "Medicare Advantage", + "Supplemental": "Supplemental", + "Administrative Services Only (ASO)": "Administrative Services Only (ASO)", + "Third-Party Administrator (TPA)": "Third-Party Administrator (TPA)", + "Self-Funded": "Self-Funded", + "Employer Funded": "Employer Funded", + "Platinum": "Platinum", + "Gold": "Gold", + "Silver": "Silver", + "Bronze": "Bronze" + } +} \ No newline at end of file diff --git a/fieldExtraction/src/constants/investment_values.py b/fieldExtraction/src/constants/investment_values.py index 27d1830..87eac18 100644 --- a/fieldExtraction/src/constants/investment_values.py +++ b/fieldExtraction/src/constants/investment_values.py @@ -1,14 +1,18 @@ VALID_LOBS = [ - "MEDICARE", - "MEDICARE ADVANTAGE", "MEDICAID", - "NON-MEDICAID", - "MARKETPLACE", + "MEDICARE-MEDICAID", + "MEDICARE", + "MEDICARE-ADVANTAGE" "COMMERCIAL", "COMMERCIAL-EXCHANGE", - "MEDICAID-MEDICARE", + "GROUP", + "MARKETPLACE", + "CORRECTIONS", + "VETERANS AFFAIRS", + "CIVILIAN HEALTH AND MEDICAL PROGRAM", + "TRICARE" ] VALID_CONTRACT_NETWORKS = [ @@ -32,30 +36,31 @@ VALID_AARETE_DERIVED_NETWORKS = [ ] VALID_PROGRAMS = [ -'Aged, Blind, Disabled (ABD)', -'Children’s Health Insurance Program (CHIP)', -'Children’s Health Insurance Program Perinate (CHIP-Perinate)', -'Foster Care', -'Intellectual and Developmental Disability (IDD)', -'Temporary Assistance Needy Families (TANF)', -'Chronic Condition Special Needs Plan (C-SNP)', -'Dual Eligible Special Needs Plan (D-SNP)', -'Institutional Special Needs Plan (I-SNP)', -'Long-Term Services and Supports (LTSS)', -'Program of All-Inclusive Care for the Elderly (PACE)', -'Special Needs Plan (SNP)', -'Medicare Advantage', -'Supplemental', -'Administrative Services Only (ASO)', -'Third-Party Administrator (TPA)', -'Self-Funded', -'Employer Funded', -'Platinum', -'Gold', -'Silver', -'Bronze' + "AGED, BLIND, DISABLED (ABD)", + "CHILDREN’S HEALTH INSURANCE PROGRAM (CHIP)", + "CHILDREN’S HEALTH INSURANCE PROGRAM PERINATE (CHIP-PERINATE)", + "FOSTER CARE", + "INTELLECTUAL AND DEVELOPMENTAL DISABILITY (IDD)", + "TEMPORARY ASSISTANCE NEEDY FAMILIES (TANF)", + "CHRONIC CONDITION SPECIAL NEEDS PLAN (C-SNP)", + "DUAL ELIGIBLE SPECIAL NEEDS PLAN (D-SNP)", + "INSTITUTIONAL SPECIAL NEEDS PLAN (I-SNP)", + "LONG-TERM SERVICES AND SUPPORTS (LTSS)", + "PROGRAM OF ALL-INCLUSIVE CARE FOR THE ELDERLY (PACE)", + "SPECIAL NEEDS PLAN (SNP)", + "MEDICARE ADVANTAGE", + "SUPPLEMENTAL", + "ADMINISTRATIVE SERVICES ONLY (ASO)", + "THIRD-PARTY ADMINISTRATOR (TPA)", + "SELF-FUNDED", + "EMPLOYER FUNDED", + "PLATINUM", + "GOLD", + "SILVER", + "BRONZE" ] + VALID_AARETE_DERIVED_FEE_SCHEDULE = [ "CMS", "Medicare", "State", "Medicaid", diff --git a/fieldExtraction/src/investment/aarete_derived.py b/fieldExtraction/src/investment/aarete_derived.py index f6ca1ff..2723642 100644 --- a/fieldExtraction/src/investment/aarete_derived.py +++ b/fieldExtraction/src/investment/aarete_derived.py @@ -39,6 +39,8 @@ def get_crosswalk_answers(crosswalk_fields, aarete_derived_answers_df): aarete_derived_answers_df[from_field].map(lambda x: apply_crosswalk(str(x).upper(), crosswalk_mapping)) ) + # Right + return aarete_derived_answers_df diff --git a/fieldExtraction/src/prompts/investment_prompts.json b/fieldExtraction/src/prompts/investment_prompts.json index 4a1e06e..7072dc1 100644 --- a/fieldExtraction/src/prompts/investment_prompts.json +++ b/fieldExtraction/src/prompts/investment_prompts.json @@ -68,6 +68,14 @@ "prompt" : "What is the Line of Business? Choose ONLY from the following: {valid_values}", "valid_values" : "VALID_LOBS" }, + { + "field_name": "AARETE_DERIVED_LINE_OF_BUSINESS", + "relationship": "one_to_n", + "field_type": "crosswalk", + "prompt": "TBD", + "crosswalk" : "crosswalk_lob.json", + "base_field" : "CONTRACT_LINE_OF_BUSINESS" + }, { "field_name" : "CONTRACT_NETWORK", "relationship" : "one_to_n", @@ -87,7 +95,15 @@ "field_name" : "CONTRACT_PRODUCT", "relationship" : "one_to_n", "field_type" : "dynamic", - "prompt" : "What is the Product? Look for the brand name of a health plan or product. Do not include values that should be in other fields, even if they are labeled as a Product. This field should also not include generic healthcare terms like 'Medicare', 'Medicaid', etc." + "prompt" : "What is the Product? Look for the brand name of a health plan or product. Do not include values that should be in other fields, even if they are labeled as a Product. Do not include the name of the entire healthplan (such as 'Molina', 'Centene' etc) - rather, look for the Product that these healthplans offer. This field should also not include generic healthcare terms like 'Medicare', 'Medicaid', etc." + }, + { + "field_name": "AARETE_DERIVED_PRODUCT", + "relationship": "one_to_n", + "field_type": "TBD", + "prompt": "TBD", + "crosswalk" : "crosswalk_product.json", + "base_field" : "CONTRACT_PRODUCT" }, { "field_name" : "CONTRACT_PROGRAM", @@ -96,6 +112,14 @@ "prompt" : "What is the Program? Choose ONLY from the following: {valid_values}. Note that 'Medicare' does NOT mean 'Medicare Advantage'. If only 'Medicare' is seen, do not write 'Medicare Advantage'.", "valid_values" : "VALID_PROGRAMS" }, + { + "field_name": "AARETE_DERIVED_PROGRAM", + "relationship": "one_to_n", + "field_type": "crosswalk", + "prompt": "TBD", + "crosswalk" : "crosswalk_program.json", + "base_field" : "CONTRACT_PROGRAM" + }, { "field_name" : "CONTRACT_CLAIM_TYPE_CD", "relationship" : "one_to_one", @@ -259,24 +283,6 @@ "prompt": "Convert the claim type value to appropriate code: Return H for 'facility' or 'hospital' or 'Institutional'. Return M for 'ancillary' or 'professional'. Claim type: {CONTRACT_CLAIM_TYPE_CD}. Return only 'H' or 'M' without any additional text.", "crosswalk": "crosswalk_claim_type.json" }, - { - "field_name": "AARETE_DERIVED_PRODUCT", - "relationship": "one_to_n", - "field_type": "TBD", - "prompt": "TBD" - }, - { - "field_name": "AARETE_DERIVED_LINE_OF_BUSINESS", - "relationship": "one_to_n", - "field_type": "TBD", - "prompt": "TBD" - }, - { - "field_name": "AARETE_DERIVED_PROGRAM", - "relationship": "one_to_n", - "field_type": "TBD", - "prompt": "TBD" - }, { "field_name": "CONTRACT_SERVICE_AREA", "relationship": "one_to_one",