OpenFn / apollo

GNU Lesser General Public License v2.1
0 stars 2 forks source link

Build a simple input structure from commcare mappings #113

Open josephjclark opened 1 week ago

josephjclark commented 1 week ago

As part of the snomed mapping problem #110 we need to find a good way to formalize the commcare inputs.

Basically commcare defines forms which capture a bunch of values. We need to capture all the potential values as an input, so that we can provide a mapping to them.

I think the input structure should look like this, so that it can be sent straight to #111

zero how many units do you drink per week?
one-to-three how many units do you drink per week?

the model would return a fhir mapping like

{ 
    'zero': { system, value, display }
}

Where each line is an input to be mapped, and the first word is the mapping key, and the rest is a dump of context to help the AI make decisions. We can formalise the context later, as we learn more.

This gist contains the commcare form definitions, which should contain the full range of values: https://gist.github.com/AishaHassen/1c0fc03a850b28232b2dbbaf1bb29859

Try searching for how_many_alcoholic_drinks_per_week - around line 842 you can see the form definition with the value specified.

I think we need some sort of script which reads in this XML and extracts all the possible inputs.

josephjclark commented 1 week ago

Hunter will be available to help with this from the week of the 25th. I'll have a chat with her about it late next week