Skip to content

Commit

Permalink
Wf2 mapping fixes (#29)
Browse files Browse the repository at this point in the history
* form option mapping updates

* fixing TEI mappings
  • Loading branch information
aleksa-krolls authored Sep 19, 2024
1 parent a5bc75c commit 1151289
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 28 deletions.
2 changes: 1 addition & 1 deletion workflows/wf1/2-get-locations.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ fn(state => {
unknown: '1067AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA',
idp: 'MSF-AAAAAA000000000000001930',
internationally_displaced: '515c5abe-4172-4d0c-a991-0de2888228d7',
resident: 'bbdb287c-4ba1-4944-bd87-eb126c5f9d92',
non_displaced: 'bbdb287c-4ba1-4944-bd87-eb126c5f9d92',
returnee: 'fc49acaa-ece2-4365-9dfb-70c2105de8b1',
};
return state;
Expand Down
3 changes: 2 additions & 1 deletion workflows/wf2/2-mappings.js
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ fn(state => {
'ce1b0d8d-0a2d-4f93-a6ed-64aca2fd0f45': 'zimbabwe',
};
state.statusMap = {
'18692c24-4d33-4cdc-a92c-bf4138da5d6d': 'unknown', //Inconnu
'f921ffdd-72ca-4d58-a89b-1fa2e959d110': 'asylum_seeker',
'2bacead2-f280-457c-9d28-e80e106f7d25': 'no_status',
'MSF-AAAAAA000000000000001929': 'refugee',
Expand All @@ -273,7 +274,7 @@ fn(state => {
'1067AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA': 'unknown',
'MSF-AAAAAA000000000000001930': 'idp',
'515c5abe-4172-4d0c-a991-0de2888228d7': 'internationally_displaced',
'bbdb287c-4ba1-4944-bd87-eb126c5f9d92': 'resident',
'bbdb287c-4ba1-4944-bd87-eb126c5f9d92': 'non_displaced',
'fc49acaa-ece2-4365-9dfb-70c2105de8b1': 'returnee',
'1067AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA': 'unknown',
};
Expand Down
45 changes: 22 additions & 23 deletions workflows/wf2/2-upsert-teis.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,30 +87,29 @@ fn(state => {
)?.value?.uuid
], //input.attributeType = "24d1fa23-9778-4a8e-9f7b-93f694fc25e2"
},
// TODO: YUIQIA2ClN6 has an error, Aleksa to ask the client,
// {
// attribute: 'YUIQIA2ClN6', //current status
// value:
// statusMap[
// patient.person.attributes.find(
// a =>
// a.attributeType.uuid ===
// 'e0b6ed99-72c4-4847-a442-e9929eac4a0f'
// )?.value?.uuid
// ], //input.attributeType = "e0b6ed99-72c4-4847-a442-e9929eac4a0f"
// },
{
attribute: 'YUIQIA2ClN6', //current status
value:
statusMap[
patient.person.attributes.find(
a =>
a.attributeType.uuid ===
'e0b6ed99-72c4-4847-a442-e9929eac4a0f'
)?.value?.uuid
], //input.attributeType = "e0b6ed99-72c4-4847-a442-e9929eac4a0f"
},
// TODO: Qq6xQ2s6LO8 has an error, Aleksa to ask the client
// {
// attribute: 'Qq6xQ2s6LO8', //legal status
// value:
// statusMap[
// patient.person.attributes.find(
// a =>
// a.attributeType.uuid ===
// 'a9b2c642-097f-43f8-b96b-4d2f50ffd9b1'
// )?.value?.uuid
// ], //input.attributeType = "a9b2c642-097f-43f8-b96b-4d2f50ffd9b1"
// },
{
attribute: 'Qq6xQ2s6LO8', //legal status
value:
statusMap[
patient.person.attributes.find(
a =>
a.attributeType.uuid ===
'a9b2c642-097f-43f8-b96b-4d2f50ffd9b1'
)?.value?.uuid
], //input.attributeType = "a9b2c642-097f-43f8-b96b-4d2f50ffd9b1"
},
{
attribute: 'FpuGAOu6itZ', //marital status
value:
Expand Down
3 changes: 2 additions & 1 deletion workflows/wf2/4-get-options-map.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ fn(state => {
pN4iQH4AEzk: '722dd83a-c1cf-48ad-ac99-45ac131ccc96', //Consultation done by //TODO: Return BOOLEAN
tsFOVnlc6lz: '5f3d618e-5c89-43bd-8c79-07e4e98c2f23', //PHQ9 Score
//qptKDiv9uPl: 'ec42d68d-3e23-43de-b8c5-a03bb538e7c7', //Sex //TODO: Remove TEA?
//sGEOde9q9p9: '0a0c70d2-2ba5-4cb3-941f-b4a9a4a7ec6d', //Location of intervention - If Health Facility, specify //should be?
};

state.mhgapMap = {
Expand All @@ -77,7 +78,7 @@ fn(state => {
E7MVMTTdvPi: 'b87a93ff-a4a1-4601-b35d-1e42bfa7e194', //Total number of beneficiaries in family consultation
aCTIvKSNndK: '722dd83a-c1cf-48ad-ac99-45ac131ccc96', //Consultation done by
UlSJrSD78HS: '82978311-bef9-46f9-9a9a-cc62254b00a6', //Location of intervention
sGEOde9q9p9: '0a0c70d2-2ba5-4cb3-941f-b4a9a4a7ec6d', //Location of intervention - If Health Facility, specify
sGEOde9q9p9: '0a0c70d2-2ba5-4cb3-941f-b4a9a4a7ec6d', //Location of intervention - If Health Facility, specify //should be?
LCdm2xe86ln: '41e68dee-a2a3-4e6c-9d96-53def5caff52', //Location of intervention - If MSF Health Facility, specify
rGS6S4jyKu3: '08cd4b4a-4b0b-4391-987b-b5b3d770d30f', //Location of intervention - If Mobile Clinic, specify
L6Jj7Tppr5q: 'e08d532b-e56c-43dc-b831-af705654d2dc', //Location of intervention - If other, specify
Expand Down
4 changes: 2 additions & 2 deletions workflows/wf2/6-create-events.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ const processObjectAnswer = (
switch (true) {
case isDiagnosisByPsychologist(conceptUuid, dataElement):
return answerValue.uuid === '278401ee-3d6f-4c65-9455-f1c16d0a7a98'
? 'TRUE'
: 'FALSE';
? 'true'
: 'false';

case matchingOption && Object.keys(matchingOption).length > 0:
return matchingOption['DHIS2 Option Code'];
Expand Down

0 comments on commit 1151289

Please sign in to comment.