feat: add date-based OHIP data reporting alongside XML

This commit is contained in:
Wyndham ARR committed 2026-09-18 15:29:27 +08:00
1 parent 5ecd571e3b
commit ad2c59256f
259 files changed
+37326 -126

No files matched your search

+7 -6
View File
@@ -15,6 +15,8 @@ from arr_ingestion.contracts import (
ARTIFACT_ROLES,
DELIVERY_SCHEMA_VERSION,
RESULT_SCHEMA_VERSION,
DATA_RESULT_SCHEMA_VERSION,
artifact_roles_for_schema,
ArtifactRef,
DeliveryEnvelope,
IngestionError,
@@ -242,7 +244,7 @@ class ProgrammaticUploadCoordinator:
try:
with tempfile.TemporaryDirectory(prefix="arr-review-finalize-") as temporary:
root = Path(temporary)
source_path = root / "processor-input" / "source.xml"
source_path = root / "processor-input" / ("source.json" if plan.source.role == "source_data" else "source.xml")
self.object_store.materialize(
plan.source.object_key,
source_path,
@@ -415,11 +417,10 @@ class ProgrammaticUploadCoordinator:
status: str,
business_date: object,
) -> DeliveryEnvelope:
artifacts: Dict[str, object] = {
role: None for role in ARTIFACT_ROLES
}
source_ref = source.to_artifact_ref() if isinstance(source, StoredObject) else source
artifacts["source_xml"] = source_ref.to_dict()
schema = DATA_RESULT_SCHEMA_VERSION if source_ref.role == "source_data" else RESULT_SCHEMA_VERSION
artifacts: Dict[str, object] = {role: None for role in artifact_roles_for_schema(schema)}
artifacts[source_ref.role] = source_ref.to_dict()
for role, stored in outputs.items():
artifacts[role] = stored.to_artifact_ref().to_dict()
return DeliveryEnvelope.from_dict(
@@ -431,7 +432,7 @@ class ProgrammaticUploadCoordinator:
"status": status,
"processor_version": self.processor_version,
"rule_set_sha256": self.rule_set_sha256,
"result_schema_version": RESULT_SCHEMA_VERSION,
"result_schema_version": schema,
"business_date": business_date,
"artifacts": artifacts,
}