Skip to content

Behaviour of get_filtered_treatment_ids is inconsistent when depth=None #1855

@sangeetabhatia03

Description

@sangeetabhatia03

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`.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions