Error: The same instance id will be generated for different external instance source URIs

The pyxform issue is tracked at https://github.com/XLSForm/pyxform/issues/387.

@A.N.M_AL-IMRAN, since you don't have many procedure types, I don't think an external file for them is ideal. If you have 5 or fewer service types, you could just use an if to get the duration (if service1 was selected, duration is 3 weeks, if service2, duration is 5 weeks, etc).

Alternately, you can do the same kind of lookup @mathieubossaert suggested without using an external file but as you mentioned previously, there isn't explicit documentation around doing this. It will require writing an XPath query and I shared an example at Progress out of Poverty Index (PPI) tools - #14 by LN.

In your case, you could add a choice list called services with an additional column called duration. You would build your select_one for ${fp_method_provided} the same way you do now but without the search appearance. The part that will likely look unfamiliar is the query to look up service_duration. That will look something like instance(‘services’)/root/item[name=${fp_method_provided}]/duration. This means "go to the services choice list, find the one where the service name matches the one selected at ${fp_method_provided} and get me the duration."

See a complete form at fp_unmet_need_e-tracking_tool-hm20200506.xlsx (29.6 KB).

2 Likes