← Về thư mục
skills/treatment-plans/scripts/_common.py
- ValidationError · class · L97-L103 — class ValidationError(ValueError)
- init · method · L100-L103 — def init(self, code: str, path: str = "$") -> None
- Issue · class · L107-L115 — class Issue
- as_dict · method · L114-L115 — def as_dict(self) -> dict[str, str]
- _text · function · L118-L135 — def _text( *, minimum: int = 0, maximum: int = MAX_TEXT_CHARS, enum: Iterable[str] | None = None, const: str | None = None, pattern: str | None = None, format_name: str | None = None, ) -> dict[str, Any]
- _boolean · function · L138-L139 — def _boolean() -> dict[str, str]
- _nullable · function · L142-L143 — def _nullable(schema: dict[str, Any]) -> dict[str, Any]
- _array · function · L146-L154 — def _array( item: dict[str, Any], *, minimum: int = 0, maximum: int = MAX_LIST_ITEMS ) -> dict[str, Any]
- _object · function · L157-L158 — def _object(properties: dict[str, dict[str, Any]]) -> dict[str, Any]
- _reject_nonlocal_path · function · L619-L626 — def _reject_nonlocal_path(raw_path: str | Path) -> Path
- safe_input_file · function · L629-L643 — def safe_input_file(raw_path: str | Path) -> Path
- safe_input_directory · function · L646-L658 — def safe_input_directory(raw_path: str | Path) -> Path
- safe_new_directory · function · L661-L675 — def safe_new_directory(raw_path: str | Path) -> Path
- safe_output_file · function · L678-L693 — def safe_output_file(raw_path: str | Path) -> Path
- _duplicate_safe_object · function · L696-L704 — def _duplicate_safe_object( pairs: list[tuple[str, Any]], ) -> dict[str, Any]
- reject_constant · function · L707-L708 — def _reject_constant(: str) -> None
- _check_bounds · function · L711-L731 — def _check_bounds(value: Any, *, depth: int = 0, counter: list[int]) -> None
- read_json · function · L734-L757 — def read_json(raw_path: str | Path) -> dict[str, Any]
- load_package · function · L760-L775 — def load_package( raw_directory: str | Path, ) -> tuple[dict[str, dict[str, Any]], dict[str, Path]]
- load_target · function · L778-L792 — def load_target( raw_path: str | Path, *, require_package: bool = False ) -> tuple[dict[str, dict[str, Any]], dict[str, Path]]
- _valid_iso_date · function · L795-L799 — def _valid_iso_date(value: str) -> bool
- parse_iso_datetime · function · L802-L809 — def parse_iso_datetime(value: str) -> datetime | None
- _validate_schema · function · L812-L872 — def _validate_schema( value: Any, schema: dict[str, Any], path: str, issues: list[Issue], ) -> None
- _duplicate_field_issues · function · L875-L892 — def _duplicate_field_issues( records: Any, field: str, path: str ) -> list[Issue]
- validate_document · function · L895-L976 — def validate_document( document: dict[str, Any], expected_type: str | None = None ) -> list[Issue]
- validate_package_structure · function · L979-L998 — def validate_package_structure( documents: dict[str, dict[str, Any]] ) -> list[Issue]
- has_errors · function · L1001-L1002 — def has_errors(issues: Iterable[Issue]) -> bool
- report_payload · function · L1005-L1033 — def report_payload( check: str, issues: Iterable[Issue], *, counts: dict[str, int] | None = None, extra: dict[str, Any] | None = None, ) -> dict[str, Any]
- error_report · function · L1036-L1037 — def error_report(check: str, error: ValidationError) -> dict[str, Any]
- print_report · function · L1040-L1041 — def print_report(report: dict[str, Any]) -> None
- atomic_write_json · function · L1044-L1079 — def atomic_write_json(destination: Path, payload: dict[str, Any]) -> Path
- copy_template_document · function · L1082-L1095 — def copy_template_document( template_path: Path, *, subject_ref: str, classification: str, ) -> dict[str, Any]
- direct_identifier_key_paths · function · L1098-L1116 — def direct_identifier_key_paths( value: Any, path: str = "$" ) -> list[str]
- all_fact_references · function · L1119-L1145 — def all_fact_references( documents: dict[str, dict[str, Any]] ) -> list[tuple[str, str]]
- collect · function · L1126-L1140 — def collect(value: Any, path: str) -> None
- record_ids · function · L1148-L1160 — def record_ids( document: dict[str, Any], list_field: str, id_field: str, ) -> set[str]