get_filtered_treatment_ids is expected to return the list of all treatment ids upto the specified depth.
For example,
- when depth is 1, it returns the first part of the id affixed with an
_* e.g. 'Rti_*';
- when depth is 2, it returns the first 2 parts affixed with an
_* e.g. 'Rti_AcutePainManagement_*'.
When depth is None, I'd expect it return the full treatment id, but it returns the full id affixed with an _*.
This can cause an issue when two treatment ids share a prefix. e.g. Malaria_Treatment and 'Malaria_Treatment_Complicated.
When the output of get_filtered_treatment_ids is now chained to is_treatment_id_allowed, we can run into a situation where we intended to only allow Malaria_Treatment but because get_filtered_treatment_ids(depth=None) has returned 'Malaria_Treatment_*', we will allow Malaria_Treatment and 'Malaria_Treatment_Complicated`.
get_filtered_treatment_idsis expected to return the list of all treatment ids upto the specified depth.For example,
_*e.g.'Rti_*';_*e.g. 'Rti_AcutePainManagement_*'.When depth is None, I'd expect it return the full treatment id, but it returns the full id affixed with an
_*.This can cause an issue when two treatment ids share a prefix. e.g.
Malaria_Treatmentand'Malaria_Treatment_Complicated.When the output of
get_filtered_treatment_idsis now chained tois_treatment_id_allowed, we can run into a situation where we intended to only allowMalaria_Treatmentbut becauseget_filtered_treatment_ids(depth=None)has returned'Malaria_Treatment_*', we will allowMalaria_Treatmentand 'Malaria_Treatment_Complicated`.