Merged in bugfix/claim_type_cd (pull request #749)
Bugfix/claim type cd to main * test claim type cd * Merged main into bugfix/claim_type_cd * updated claim type prompt * updated prompt * empty one to n results initiated * remove print statements * src/investment/prompt_calls.py * full context prompt update Approved-by: Katon Minhas
This commit is contained in:
committed by
Katon Minhas
parent
cc3c7a7ae2
commit
48c2d1ad51
@@ -23,6 +23,12 @@ def add_full_context_field(one_to_one_fields, field_to_add, answer_dicts):
|
||||
if len(non_empty_lobs) > 1:
|
||||
return one_to_one_fields
|
||||
|
||||
if field_to_add.field_name == "CLAIM_TYPE_CD":
|
||||
field_to_add.prompt = (
|
||||
field_to_add.prompt
|
||||
+ prompt_templates.FULL_CONTEXT_CLAIM_TYPES_ADDITIONAL_INSTRUCTION()
|
||||
)
|
||||
|
||||
field_to_add.prompt = (
|
||||
field_to_add.prompt
|
||||
+ prompt_templates.FULL_CONTEXT_ADDITIONAL_INSTRUCTIONS(field_to_add.allow_na)
|
||||
|
||||
@@ -45,6 +45,7 @@ def process_file(file_object, constants: Constants, run_timestamp):
|
||||
)
|
||||
|
||||
# ONE TO N PROCESSING
|
||||
one_to_n_results = pd.DataFrame() # Initialize empty DataFrame for one_to_n_results
|
||||
if process_one_to_n:
|
||||
exhibit_dict, all_exhibit_headers = preprocess.one_to_n_exhibit_chunking(
|
||||
text_dict, constants.EXHIBIT_HEADER_MARKERS, filename
|
||||
|
||||
@@ -490,7 +490,9 @@ def special_case_breakout(
|
||||
"""
|
||||
|
||||
final_answer_dict = {}
|
||||
|
||||
# if not dict and empty special_case_primary_answers, return empty dict
|
||||
if not isinstance(special_case_primary_answers, dict) and string_utils.is_empty(special_case_primary_answers):
|
||||
return final_answer_dict
|
||||
for term_field_name, term_answers in special_case_primary_answers.items():
|
||||
|
||||
if not term_answers:
|
||||
|
||||
@@ -161,11 +161,11 @@
|
||||
"field_name" : "CLAIM_TYPE_CD",
|
||||
"relationship" : "one_to_n",
|
||||
"field_type" : "exhibit_level",
|
||||
"prompt": "What is the Claim Type of the contract, exhibit, or services mentioned? Choose ONLY from the following: {valid_values}. Guidelines:\n- If the contract refers to services rendered by individual healthcare providers or provider groups, return 'Professional'.\n- If the document mentions services provided by hospitals, facilities or institutions, return 'Institutional'.\n- If the services include Home Health, Durable Medical Equipment (DME), Laboratory, Radiology, Dialysis, Diagnostic Imaging, Genetic Testing, Blood Testing, Sleep Lab Services, Telemedicine, Behavioral & Mental Health Services, or other services commonly performed in an ancillary setting, return 'Ancillary'.\n- If multiple claim types are mentioned for different services, return the one most closely associated with the compensation or service description in question.",
|
||||
"prompt": "What is the Claim Type of the contract, exhibit, or services mentioned in the text? Choose ONLY from the following: {valid_values}.\n\nGuidelines:\n- Return 'Professional' if the text refers to services rendered by individual healthcare providers or provider groups (e.g., physician services, office visits, outpatient procedures).\n- Return 'Institutional' if the text refers to services provided by hospitals, facilities, or institutions (e.g., inpatient, outpatient facility, or surgery centers).\n- Return 'Ancillary' if the text refers to services such as Home Health, Durable Medical Equipment (DME), Laboratory, Radiology, Dialysis, Diagnostic Imaging, Genetic Testing, Blood Testing, Sleep Lab Services, Telemedicine, Behavioral or Mental Health, or other ancillary settings.\n- If multiple claim types are mentioned, return the one most closely associated with the compensation or service description in the context.\n- If no claim type is mentioned or cannot be determined, return 'N/A'.\nDo not infer or guess.",
|
||||
"valid_values" : "VALID_CLAIM_TYPE",
|
||||
"keywords" : [],
|
||||
"smart_chunking_methodology" : "TBD",
|
||||
"allow_na" : false
|
||||
"allow_na" : true
|
||||
},
|
||||
{
|
||||
"field_name": "AARETE_DERIVED_CLAIM_TYPE_CD",
|
||||
|
||||
@@ -918,7 +918,8 @@ def GROUP_TIN_NPI_TEMPLATE(key_sections: str, provider_list: str) -> str:
|
||||
|
||||
Feel free to justify your answer, but enclose your final answer in |pipes|.
|
||||
"""
|
||||
|
||||
def FULL_CONTEXT_CLAIM_TYPES_ADDITIONAL_INSTRUCTION():
|
||||
return "Additionally Check the contract text for the provider name from the preamble or signature section to help determine the claim type."
|
||||
|
||||
def FULL_CONTEXT_ADDITIONAL_INSTRUCTIONS(allow_na):
|
||||
if allow_na:
|
||||
|
||||
Reference in New Issue
Block a user