-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wf2 - map latest answer to sex
from encounter to TEI
#38
Comments
@mtuchi this is a tricky one... I suggest we pair on it later today |
hey @mtuchi for this one...
|
I need fresh eyes on this one, I think get-encounters step need to start before |
@mtuchi as discussed...
|
Hiya @aleksa-krolls i have added the // TEI: Wn43LPkTyjv
"conflicts": [
{
"object": "G0hLyxqgcO7",
"value": "value_not_true_only"
}
], |
Hiya @aleksa-krolls i have tested locally the whole workflow for |
* update gist url * add gender updated mappings and update TEIs to address #38 * update lastRunDateTime * add update-teis step * commented out G0hLyxqgcO7 * add log when creating an event * update optionsMap gist link latest optionSets --------- Co-authored-by: Aleksa Krolls <[email protected]>
hey @mtuchi this is generally looking pretty good, but per the logs I'm wondering if we're mapping more encounters than we need to. Can you please check out my comments (yellow post-its) in this "sex" diagram and lmk if we need to make any other changes? Also fyi there is a known issue with some of the OMRS |
@aleksa-krolls i have found the issue and worked on a fix, See my PR #46. You can merge and test again |
Background, context, and business value
Sometimes
sex
is specified on an OMRS form/encounter in a later consultation. If answered, we will need to map this answer for sex from the encounter to the trackedEntityInstance record.The specific request, in as few words as possible
If either the
mhpss baseline
form (encounter id:6a3e1e0e-dd13-3465-b8f5-ee2d42691fe5
) ormhgap baseline
form (encounter id:82db23a1-4eb1-3f3c-bb65-b7ebfe95b19b
) havesex
specified, then map this value to the dhis2TEI
record.mhpss baseline
encounter first --> and map answer if thesex
concept is found.mhgap baseline
encounter --> and map answer if thesex
concept is found.sex
is found in neither encounter, then no action required.See example code snippet below. If either encounter contains an
obs[x]
whereconcept.uuid = 'ec42d68d-3e23-43de-b8c5-a03bb538e7c7'
, then map theobs[x].uuid
answer using the optionsMap --> to dhis2attribute: qptKDiv9uPl
Workflow
wf2 --> I think you'll need to update step
6-create-events
to add a step to update the parentTEI
again if an answer forsex
is found in either of the 2 encounters.Your mapping will look something like this...
openfn-lime-pilot/workflows/wf2/2-upsert-teis.js
Lines 64 to 65 in 90efe52
Output
qptKDiv9uPl
is the only attribute you'll need to update for this TEI, so your final payload will probably look like this...Testing guidance
Try running wf2 with this cursor to get patient
{"lastRunDateTime": "2024-09-30T07:00:00.000Z"}
to test this with.Toggl
MSF 2024
The text was updated successfully, but these errors were encountered: