diff --git a/openfn-cd92dd57-9a3c-4318-bdcb-f57a386cf811-spec.yaml b/openfn-cd92dd57-9a3c-4318-bdcb-f57a386cf811-spec.yaml index ad0b43e..3787a6b 100644 --- a/openfn-cd92dd57-9a3c-4318-bdcb-f57a386cf811-spec.yaml +++ b/openfn-cd92dd57-9a3c-4318-bdcb-f57a386cf811-spec.yaml @@ -207,7 +207,9 @@ workflows: Upsert-TEIs->Get-Encounters: source_job: Upsert-TEIs target_job: Get-Encounters - condition_type: on_job_success + condition_type: js_expression + condition_label: has-patient-uuids + condition_expression: state.patientUuids.length > 0 && !state.errors enabled: true Get-Encounters->Get-Options-Map: source_job: Get-Encounters @@ -234,5 +236,7 @@ workflows: Get-Patients->Mappings: source_job: Get-Patients target_job: Mappings - condition_type: on_job_success + condition_type: js_expression + condition_label: has-patients + condition_expression: state.patients.length > 0 && !state.errors enabled: true diff --git a/workflows/wf2/workflow.json b/workflows/wf2/workflow.json index 458f265..4e5b867 100644 --- a/workflows/wf2/workflow.json +++ b/workflows/wf2/workflow.json @@ -6,7 +6,7 @@ "adaptor": "openmrs", "configuration": "../tmp/openmrs-creds.json", "state": { - "lastRunDateTime": "2024-09-16T00:00:00.000Z" + "lastRunDateTime": "2024-09-30T12:00:00.000Z" }, "expression": "1-get-patients.js", "next": { @@ -27,7 +27,7 @@ "configuration": "../tmp/dhis2-creds.json", "expression": "2-upsert-teis.js", "next": { - "get-encounters": "!state.errors" + "get-encounters": "!state.errors && state.patientUuids.length > 0" } }, {