Skip to content

Commit

Permalink
feat: Add history of head injury text (#180)
Browse files Browse the repository at this point in the history
  • Loading branch information
ReinderVosDeWael authored Jan 16, 2025
1 parent 89bce95 commit 29a9339
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
8 changes: 0 additions & 8 deletions src/ctk_functions/core/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,6 @@ class Settings(pydantic_settings.BaseSettings):
"https://redcap.healthybrainnetwork.org/redcap/api/",
)

AWS_ACCESS_KEY_ID: pydantic.SecretStr
AWS_SECRET_ACCESS_KEY: pydantic.SecretStr
AWS_REGION: str = "us-west-2"

AZURE_OPENAI_API_KEY: pydantic.SecretStr
AZURE_OPENAI_LLM_DEPLOYMENT: pydantic.SecretStr
AZURE_OPENAI_ENDPOINT: pydantic.SecretStr

LANGUAGE_TOOL_URL: str

CLOAI_SERVICE_URL: str
Expand Down
3 changes: 2 additions & 1 deletion src/ctk_functions/microservices/redcap.py
Original file line number Diff line number Diff line change
Expand Up @@ -1107,6 +1107,8 @@ class RedCapData(pydantic.BaseModel):
encephalitis_age: str | None
encephalitis_treatment: str | None
encephalitis: bool
head_injuries: bool
head_injury_yes: str | None

# Family psychiatric history

Expand Down Expand Up @@ -1476,5 +1478,4 @@ def get_intake_data(mrn: str) -> RedCapData:
records=[record_ids[0]],
),
)

return RedCapData.from_csv(patient_data)
8 changes: 8 additions & 0 deletions src/ctk_functions/routers/intake/intake_processing/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -654,6 +654,14 @@ def __init__(self, patient_data: redcap.RedCapData) -> None:
)
for disease in ("seizures", "migraines", "meningitis", "encephalitis")
]
diseases.append(
redcap.PriorDisease(
name="head injury",
was_positive=patient_data.head_injuries,
age=None,
treatment=None,
),
)
self.prior_diseases = transformers.PriorDiseases(diseases).transform()


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -415,9 +415,9 @@ def transform(self) -> str:
)}"""
else:
string = f"""
{ReplacementTags.REPORTING_GUARDIAN.value} reported a history of:
{ReplacementTags.REPORTING_GUARDIAN.value} reported a history of
{string_utils.join_with_oxford_comma(positive_diseases)} and denied
any history of:
any history of
{string_utils.join_with_oxford_comma(negative_diseases)}
"""

Expand Down

0 comments on commit 29a9339

Please sign in to comment.