fixed code implicit special and ran black for CI

This commit is contained in:
ppanchigar
2026-02-04 10:57:40 -06:00
parent 6751a5ab7a
commit 5b619b2f5f
12 changed files with 81 additions and 49 deletions
+7 -2
View File
@@ -229,8 +229,13 @@ def code_implicit_special(service, filename):
"ST": ["ST Codes TBD"],
}
code_answer_dict = {}
if llm_answer_final[0] in special_case_mapping:
code_answer_dict["PROCEDURE_CD"] = special_case_mapping[llm_answer_final]
# Check if llm_answer_final is a list and has at least one element, and if the first element is in the special_case_mapping
if (
isinstance(llm_answer_final, list)
and len(llm_answer_final) > 0
and llm_answer_final[0] in special_case_mapping
):
code_answer_dict["PROCEDURE_CD"] = special_case_mapping[llm_answer_final[0]]
code_answer_dict["PROCEDURE_CD_DESC"] = llm_answer_final
return code_answer_dict