diff --git a/fieldExtraction/src/prompts/investment_prompts.py b/fieldExtraction/src/prompts/investment_prompts.py index b53ba8e..45f4595 100644 --- a/fieldExtraction/src/prompts/investment_prompts.py +++ b/fieldExtraction/src/prompts/investment_prompts.py @@ -127,6 +127,33 @@ Only return the dictionary, with no other commentary or explanation. Ensure you ##################################################################################### +def EXHIBIT_NAME(page_start): + return f"""Analyze the following contract excerpt and extract the full header found. + +You must capture the complete hierarchy of document identifiers present in the text. Include all of the following when present: +* Full Attachment names and numbers (e.g., "Attachment C: Commercial-Exchange") +* Complete Exhibit numbers/letters with full titles (e.g., "Exhibit 1 - Medicare") +* Any other relevant subtitles and section identifiers, including but not limited to 'Article', 'Amendment', 'Schedule', 'Addendum', or similar. +* Provider/Entity names when listed with exhibit information + +- Rules for inclusion: + * Do NOT abbreviate or summarize any part of the exhibit names + * Do NOT include page numbers + * Do NOT cherry-pick only certain parts - capture the complete exhibit hierarchy + * Include ALL text that appears to be part of the exhibit/attachment header + * Keep exact capitalization and formatting as shown in document +- Write 'N/A' only if NO exhibit, attachment, amendment, or other identifiers are found + +Here is the text to analyze: +{page_start} + +Before returning any output, ensure that all instructions for inclusion were followed. + +Enclose your final answer in |pipes|. +""" + + + def TOP_DOWN_PRIMARY(page): return f"""### PAGE START ### {page} ### PAGE END @@ -211,142 +238,6 @@ TD_PRIMARY_FIELDS = [ ] -def TOP_DOWN_EXCLUSIONS(page): - return f"""### PAGE START ### {page} ### PAGE END - -The above text contains a page with at least one term related to exclusions or inclusions - -If it is indicated that any type of service or other situation should be EXCLUDED (or NOT INCLUDED), write just the exclusion clause here. - -Include language that specifically has words like 'exclusion', 'excluded', 'not to include'. -If there is no exclusion clause, write 'N/A'. -The exclusion clause may be a single sentence, an entire paragraph, or multiple paragraphs. - -Only write the EXACT text from the page, with no other commentary or explanation. Do not write ANY words in your response that are not found on the page. -""" - - -def TOP_DOWN_MEDICALLY_NECESSARY(page): - return f"""### PAGE START ### {page} ### PAGE END - -The above text contains a page with at least one Medical Necessity term. - -Extract the Medical Necessity paragraph from the page. - -Only write the EXACT text from the page, with no other commentary or explanation. Do not write ANY words in your response that are not found on the page. -""" - - -##################################################################################### -#################################### CONDITIONAL #################################### -##################################################################################### - - -def CONDITIONAL_IP_OP_SMALL(s, m): - return f"""Service: {s} -Methodology: {m} - -Is the term above related to Inpatient or Outpatient services? - -Write only 'IP' for Inpatient, 'OP' for Outpatient, or 'N/A' if the answer is unclear. - -Only write IP or OP if 'Inpatient' or 'Outpatient' is clearly and explicitly written in the Service or Methodology. Otherwise, write 'N/A'. Do not attempt to deduce the answer based on your prior knowledge. - -Return only the answer, without using complete sentences. -""" - - -def CONDITIONAL_IP_OP_BIG(d, page): - return f"""### PAGE START ### {page} ### PAGE END - -The above text contains a number of reimbursement terms. For the rest of this request, focus only on the specific term listed below: -Service: {d['FULL_SERVICE']} -Methodology: {d['FULL_METHODOLOGY']} - -Based on the context given, is the term above related to Inpatient or Outpatient services. - -Write only 'IP' for Inpatient, 'OP' for Outpatient. Only write IP or OP if it is EXPLICITLY written on the page and applies to the Service and Methodology. - -If neither, simply write 'N/A'. - -Return only the answer, without using complete sentences. -""" - - -def CONDITIONAL_PROV_2(d, page): - if "PROFESSIONAL" in d["PROV_TYPE"].upper(): - valid_list = valid.VALID_PROF - elif "ANCILLARY" in d["PROV_TYPE"].upper(): - valid_list = valid.VALID_ANC - elif "FACILITY" in d["PROV_TYPE"].upper(): - valid_list = valid.VALID_FAC - else: - - valid_list = valid.VALID_PROF + valid.VALID_ANC + valid.VALID_FAC - return f"""### PAGE START ### {page} ### PAGE END - -The above text contains a number of reimbursement terms. For the rest of this request, focus only on the specific term listed below: -Service: {d['FULL_SERVICE']} -Methodology: {d['FULL_METHODOLOGY']} -Exhibit Name: {d['EXHIBIT']} - -Based on the context given, what is the Provider Type applicable to the term above? - -Choose ONLY from the following: -{valid_list} -Do not attempt to deduce the Provider Type from context clues. It will be clearly and explicitly written in the text itself. If there is not clear Provider Type from the list, write 'N/A'. - -Return only the answer, without using complete sentences. -""" - - -def CONDITIONAL_DSH_IME_UC(page): - return f"""### PAGE START ### {page} ### PAGE END - -Is there language on the page saying that DSH, GME, IME, or UC is included? Write 'Y' or 'N'. - -Return only the answer, without using complete sentences. -""" - - -def CONDITIONAL_RBRVS(page): - return f"""### PAGE START ### {page} ### PAGE END - -Is RBRVS language found anywhere on the page? Write 'Y' or 'N'. - -Return only the answer 'Y' or 'N', without using complete sentences. -""" - - -def CONDITIONAL_STOP_LOSS(page): - return f"""### PAGE START ### {page} ### PAGE END - -Does the page include a sentence describing stop-loss thresholds? If yes, write the threshold dollar value only. If not, write 'N/A'. - -Return only the answer, without using complete sentences. -""" - - -def CONDITIONAL_LOB_CHECK(d, page): - return f"""### PAGE START ### {page} ### PAGE END - -Above is a page of a contract, with several Services listed. For the rest of this task, focus only on the Service and methodology listed below: -Service: {d['FULL_SERVICE']} -Methodology: {d['FULL_METHODOLOGY']} - -Below are the Line of Business values previously identified as being present on this page. -CONTRACT_LOB : {d['CONTRACT_LOB']} - -First, identify the section of the page that the Service and Methodology belong to. This may be a specific subsection or paragraph. Do not write this answer out, only use it to inform your search for the LOB value. - -Next, identify which single value of CONTRACT_LOB the given Service falls under. It can ONLY be ONE of values in the list. Do NOT return the original list. -The correct answer will likely be found in the same subsection or paragraph that the Service and Methodology are in. It might be listed somewhere close above the Service and Methodology text. - -Again, there is only ONE correct answer in the list. Choose carefully. - -Return only the Line of Business answer, without using complete sentences. -""" - ##################################################################################### ###################################### AC Fields ####################################