diff --git a/fieldExtraction/src/investment/one_to_n_funcs.py b/fieldExtraction/src/investment/one_to_n_funcs.py index e4883a2..6f4dc12 100644 --- a/fieldExtraction/src/investment/one_to_n_funcs.py +++ b/fieldExtraction/src/investment/one_to_n_funcs.py @@ -248,13 +248,13 @@ def get_code_breakout(answer_dicts: list[dict], filename: str): code_breakout_answers = [] already_seen = {} for answer_dict in answer_dicts: - service = answer_dict.get("CONTRACT_SERVICE_CD_OR_DESC") + service, methodology = answer_dict.get("CONTRACT_SERVICE_CD_OR_DESC"), answer_dict.get("CONTRACT_REIMBURSEMENT_METHOD") if service: code_answer_dict = already_seen.setdefault( service, string_utils.universal_json_load( llm_utils.invoke_claude( - investment_prompts.CODE_PRIMARY_BREAKOUT(service, code_primary_questions), + investment_prompts.CODE_PRIMARY_BREAKOUT(service, methodology, code_primary_questions), config.MODEL_ID_CLAUDE35_SONNET, filename ) diff --git a/fieldExtraction/src/prompts/investment_prompts.json b/fieldExtraction/src/prompts/investment_prompts.json index 5b33330..dc0e082 100644 --- a/fieldExtraction/src/prompts/investment_prompts.json +++ b/fieldExtraction/src/prompts/investment_prompts.json @@ -322,8 +322,8 @@ { "field_name": "CONTRACT_BILL_TYPE", "relationship": "one_to_n", - "field_type": "TBD", - "prompt": "TBD" + "field_type": "code_primary_breakout", + "prompt": "Identify all Bill Type codes in the text: - 4 alphanumeric characters - First character is often a leading zero, it may or may not be included - If no code is listed, but the phrase 'Bill Type' appears, write the exact text from the contract that describes the Bill Type." }, { "field_name": "AARETE_DERIVED_BILL_TYPE", diff --git a/fieldExtraction/src/prompts/investment_prompts.py b/fieldExtraction/src/prompts/investment_prompts.py index b140d49..edb234b 100644 --- a/fieldExtraction/src/prompts/investment_prompts.py +++ b/fieldExtraction/src/prompts/investment_prompts.py @@ -289,7 +289,7 @@ Return at least one json object for each combination of attributes seen. It is p Here are the attributes to be included in each dictionary, and instructions on how to correctly answer: {fields} -Ensure any relevant detail is included, including rates in tables if applicable. Include any 'Lesser of' statement that applies to the reimbursement as part of the CONTRACT_REIMBURSEMENT_METHOD. The 'Lesser of' statement might not be found in immediate proximity to the reimbursement term and may instead be found in a paragraph above. If the methodology is presented in a table, concatenate any relevant lesser of statement that applies to the table with the portion of the methodology found in the table. +Ensure any relevant detail is included, including any codes relating to the service and any rates in tables, if applicable. Include any 'Lesser of' statement that applies to the reimbursement as part of the CONTRACT_REIMBURSEMENT_METHOD. The 'Lesser of' statement might not be found in immediate proximity to the reimbursement term and may instead be found in a paragraph above. If the methodology is presented in a table, concatenate any relevant lesser of statement that applies to the table with the portion of the methodology found in the table. Here are some examples of language with additional context to be included in the CONTRACT_SERVICE_CD_OR_DESC: Text: 'Covered Services that are Medicare Covered Services and are not Medicaid Covered Services', @@ -342,7 +342,7 @@ Use the text in the methodology to populate a JSON dictionary with the following Write your JSON dictionary below: """ -def CODE_PRIMARY_BREAKOUT(context, questions): +def CODE_PRIMARY_BREAKOUT(service, methodology, questions): return f"""Analyze a given medical service, found in a Payer-Provider contract: Use the text in the Service to populate a JSON dictionary with the following fields: @@ -354,8 +354,9 @@ For the CPT4_PROC_CD and CPT4_PROC_MOD fields, ensure that each item in each lis If any of the codes are not found, do not write a list for that field. Simply populate the field with 'N/A'. -Here is the Service to analyze: -{context} +Here is the Service and Methodology to analyze: +Service: {service} +Methodology: {methodology} Write the JSON dictionary below: """