forked from OpenFn/openfn-lime
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathopenfn-69066751-5f2c-459c-b42e-feba1c802383-spec.yaml
226 lines (207 loc) · 6.78 KB
/
openfn-69066751-5f2c-459c-b42e-feba1c802383-spec.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
name: msf-lime-mosul
description: |
OpenFn cloud project for workflow testing between MSF and OpenFn teams
collections: null
credentials:
name: MSF OMRS Demo Nov 2024
owner: [email protected]
"[email protected](raw)":
name: 'MSF OMRS Demo Nov 2024 (raw)'
owner: [email protected]
name: AK Sharepoint
owner: [email protected]
name: MSF OMRS Demo - Raw with baseUrl
owner: [email protected]
name: OpenMRS Demo Azure
owner: [email protected]
name: dhis2
owner: [email protected]
name: openmrs
owner: [email protected]
"[email protected][Mtuchi]":
name: 'Collections Config[Mtuchi]'
owner: [email protected]
name: MSF DHIS2 UAT
owner: [email protected]
name: OpenFnSharepoint
owner: [email protected]
name: OpenMRS Demo
owner: [email protected]
name: mtuchi-github-token
owner: [email protected]
workflows:
wf1-dhis2-omrs-migration:
name: wf1-dhis2-omrs-migration
jobs:
Fetch-Metadata:
name: Fetch Metadata
adaptor: '@openfn/[email protected]'
credential: null
body:
path: workflows/wf1/1-fetch-metadata.js
Get-Teis-and-Locations:
name: Get Teis and Locations
adaptor: '@openfn/[email protected]'
credential: [email protected]
body:
path: workflows/wf1/2-get-teis-and-locations.js
Create-Patients:
name: Create Patients
adaptor: '@openfn/[email protected]'
credential: [email protected]
body:
path: workflows/wf1/3-create-patients.js
Update-Teis:
name: Update Teis
adaptor: '@openfn/[email protected]'
credential: [email protected]
body:
path: workflows/wf1/4-update-teis.js
triggers:
cron:
type: cron
cron_expression: '0 0 * * *'
enabled: false
edges:
cron->Fetch-Metadata:
source_trigger: cron
target_job: Fetch-Metadata
condition_type: always
enabled: true
Fetch-Metadata->Get-Teis-and-Locations:
source_job: Fetch-Metadata
target_job: Get-Teis-and-Locations
condition_type: on_job_success
enabled: true
Get-Teis-and-Locations->Create-Patients:
source_job: Get-Teis-and-Locations
target_job: Create-Patients
condition_type: js_expression
condition_label: has-teis
condition_expression: |
state.teis.length > 0 && !state.errors
enabled: true
Create-Patients->Update-Teis:
source_job: Create-Patients
target_job: Update-Teis
condition_type: on_job_success
enabled: true
wf2-omrs-dhis2:
name: wf2-omrs-dhis2
jobs:
Get-Patients:
name: Get Patients
adaptor: '@openfn/[email protected]'
credential: [email protected]
body:
path: workflows/wf2/1-get-patients.js
Upsert-TEIs:
name: Upsert TEIs
adaptor: '@openfn/[email protected]'
credential: [email protected]
body:
path: workflows/wf2/2-upsert-teis.js
Get-Encounters:
name: Get Encounters
adaptor: '@openfn/[email protected]'
credential: [email protected]
body:
path: workflows/wf2/3-get-encounters.js
Get-TEIs-and-Map-Answers:
name: Get TEIs and Map Answers
adaptor: '@openfn/[email protected]'
credential: [email protected]
body:
path: workflows/wf2/5-get-teis.js
Create-Events:
name: Create Events
adaptor: '@openfn/[email protected]'
credential: [email protected]
body:
path: workflows/wf2/6-create-events.js
Mappings:
name: Mappings
adaptor: '@openfn/[email protected]'
credential: null
body:
path: workflows/wf2/2-mappings.js
Update-TEIs:
name: Update TEIs
adaptor: '@openfn/[email protected]'
credential: [email protected]
body:
path: workflows/wf2/7-update-teis.js
triggers:
cron:
type: cron
cron_expression: '0 0 * * *'
enabled: false
edges:
cron->Get-Patients:
source_trigger: cron
target_job: Get-Patients
condition_type: always
enabled: true
Upsert-TEIs->Get-Encounters:
source_job: Upsert-TEIs
target_job: Get-Encounters
condition_type: js_expression
condition_label: has-patient-uuids
condition_expression: |
state.patientUuids.length > 0 && !state.errors
enabled: true
Get-TEIs-and-Map-Answers->Create-Events:
source_job: Get-TEIs-and-Map-Answers
target_job: Create-Events
condition_type: js_expression
condition_label: has-teis
condition_expression: |
state.TEIs && !state.errors
enabled: true
Create-Events->Update-TEIs:
source_job: Create-Events
target_job: Update-TEIs
condition_type: js_expression
condition_label: has-gender-updated
condition_expression: |
state?.genderUpdated?.length > 0 && !state.errors
enabled: true
Mappings->Upsert-TEIs:
source_job: Mappings
target_job: Upsert-TEIs
condition_type: js_expression
condition_label: has-patients
condition_expression: |
state.patients.length > 0 && !state.errors
enabled: true
Get-Patients->Mappings:
source_job: Get-Patients
target_job: Mappings
condition_type: on_job_success
enabled: true
Get-Encounters->Get-TEIs-and-Map-Answers:
source_job: Get-Encounters
target_job: Get-TEIs-and-Map-Answers
condition_type: js_expression
condition_label: has-encounters
condition_expression: |
!state.errors && state.encounters
enabled: true
Mappings->Get-Encounters:
source_job: Mappings
target_job: Get-Encounters
condition_type: js_expression
condition_label: has-no-patients
condition_expression: |
!state.errors && state.patients.length === 0
enabled: true