polyguard-openenv / app /knowledge /hepatic_rules.py
TheJackBright's picture
Deploy PolyGuard OpenEnv Space
877add7 verified
"""Hepatic adjustment rules."""
from __future__ import annotations
_HEPATIC_SENSITIVE = {"benzodiazepine_like", "opioid_like"}
def is_hepatic_unsafe(drug: str, ast: float | None, alt: float | None) -> bool:
if ast is None or alt is None:
return False
return drug in _HEPATIC_SENSITIVE and (ast > 100 or alt > 100)