Limpiar los avisos de estilo
This commit is contained in:
@@ -16,8 +16,9 @@ def _patient_reads(monkeypatch, exists=True):
|
||||
monkeypatch.setattr(
|
||||
fhir.reads,
|
||||
"rows",
|
||||
lambda domain, kind, **params: ([{"person_id": params["id"]}] if exists else [])
|
||||
if kind == "person" else [],
|
||||
lambda domain, kind, **params: (
|
||||
([{"person_id": params["id"]}] if exists else []) if kind == "person" else []
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
@@ -27,19 +28,21 @@ def test_patient_eligibility_operation_returns_reasons_and_applies_filters(monke
|
||||
|
||||
def report(scenario, person_id, *, cutoff):
|
||||
calls.append((scenario, person_id, cutoff))
|
||||
return pd.DataFrame([{
|
||||
"scenario": "surveillance",
|
||||
"person_id": person_id,
|
||||
"index_date": date(2025, 2, 1),
|
||||
"index_sample_id": "sample-1",
|
||||
"criterion": "hysterectomy",
|
||||
"eligible": False,
|
||||
}])
|
||||
return pd.DataFrame(
|
||||
[
|
||||
{
|
||||
"scenario": "surveillance",
|
||||
"person_id": person_id,
|
||||
"index_date": date(2025, 2, 1),
|
||||
"index_sample_id": "sample-1",
|
||||
"criterion": "hysterectomy",
|
||||
"eligible": False,
|
||||
}
|
||||
]
|
||||
)
|
||||
|
||||
monkeypatch.setattr(fhir.gold_reads, "cacu_eligibility_report", report)
|
||||
response = fhir.cacu_eligibility(
|
||||
Domain.CACU, "patient-1", "surveillance", date(2025, 2, 15)
|
||||
)
|
||||
response = fhir.cacu_eligibility(Domain.CACU, "patient-1", "surveillance", date(2025, 2, 15))
|
||||
|
||||
assert response.status_code == 200
|
||||
assert response.media_type == fhir.FHIR_JSON
|
||||
@@ -62,9 +65,7 @@ def test_patient_eligibility_reports_stale_gold_as_fhir_conflict(monkeypatch):
|
||||
raise gold.GoldSchemaError("rebuild gold.cacu_eligibility")
|
||||
|
||||
monkeypatch.setattr(fhir.gold_reads, "cacu_eligibility_report", outdated)
|
||||
response = fhir.cacu_eligibility(
|
||||
Domain.CACU, "patient-1", None, date(2025, 2, 15)
|
||||
)
|
||||
response = fhir.cacu_eligibility(Domain.CACU, "patient-1", None, date(2025, 2, 15))
|
||||
|
||||
assert response.status_code == 409
|
||||
assert response.media_type == fhir.FHIR_JSON
|
||||
|
||||
Reference in New Issue
Block a user