Skip to content

Commit 4ea9be2

Browse files
committed
Refactor preprocessing logic to replace unspecified agents and update template logo size to match conf file
1 parent 44cd0c9 commit 4ea9be2

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

pipeline/orchestrator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ def run_step_2_preprocess(
236236

237237
# Build preprocessing result
238238
result = preprocess.build_preprocess_result(
239-
df, language, vaccine_reference, preprocess.IGNORE_AGENTS
239+
df, language, vaccine_reference, preprocess.REPLACE_UNSPECIFIED
240240
)
241241

242242
# Write artifact

pipeline/preprocess.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070

7171
_FORMATTER = Formatter()
7272

73-
IGNORE_AGENTS = [
73+
REPLACE_UNSPECIFIED = [
7474
"-unspecified",
7575
"unspecified",
7676
"Not Specified",
@@ -613,7 +613,7 @@ def process_vaccines_due(vaccines_due: Any, language: str) -> str:
613613

614614

615615
def process_received_agents(
616-
received_agents: Any, ignore_agents: List[str]
616+
received_agents: Any, replace_unspecified: List[str]
617617
) -> List[Dict[str, Any]]:
618618
"""Extract and normalize vaccination history from received_agents string."""
619619
if not isinstance(received_agents, str) or not received_agents.strip():
@@ -626,7 +626,7 @@ def process_received_agents(
626626
for match in matches:
627627
date_str, vaccine = match.split(" - ", maxsplit=1)
628628
vaccine = vaccine.strip()
629-
if vaccine in ignore_agents:
629+
if vaccine in replace_unspecified:
630630
continue
631631
date_iso = convert_date_iso(date_str.strip())
632632
rows.append({"date_given": date_iso, "vaccine": vaccine})
@@ -716,7 +716,7 @@ def build_preprocess_result(
716716
df: pd.DataFrame,
717717
language: str,
718718
vaccine_reference: Dict[str, Any],
719-
ignore_agents: List[str],
719+
replace_unspecified: List[str],
720720
) -> PreprocessResult:
721721
"""Process and normalize client data into structured artifact.
722722
@@ -788,7 +788,7 @@ def build_preprocess_result(
788788
vaccines_due_list = [
789789
item.strip() for item in vaccines_due.split(",") if item.strip()
790790
]
791-
received_grouped = process_received_agents(row.IMMS_GIVEN, ignore_agents) # type: ignore[attr-defined]
791+
received_grouped = process_received_agents(row.IMMS_GIVEN, replace_unspecified) # type: ignore[attr-defined]
792792
received = enrich_grouped_records(
793793
received_grouped, vaccine_reference, language, chart_diseases_header
794794
)

templates/en_template.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
5050
#v(0.2cm)
5151
52-
#conf.header_info_cim("__LOGO_PATH__", black, 16pt, "Request for Immunization Record")
52+
#conf.header_info_cim("__LOGO_PATH__", 6cm, black, 16pt, "Request for Immunization Record")
5353
5454
#v(0.2cm)
5555

0 commit comments

Comments
 (0)