nhs-r-community / NHSRwaitinglist

R-package to implement the waiting list management approach described in this paper by Fong et al: https://www.medrxiv.org/content/10.1101/2022.08.23.22279117v1.full-text
https://nhs-r-community.github.io/NHSRwaitinglist/
Other
15 stars 0 forks source link

average_wait() function has ambiguous name #37

Closed kaituna closed 2 months ago

kaituna commented 10 months ago

The function for 'average_wait' is actually the target mean wait required to achieve the specified waitlist performance criteria (is this correct?). Now that I am reading the documentation I think that there is some room for confusion and the code examples will make more sense if the function could be named 'mean_target_wait'.

matt-dray commented 10 months ago

Related, but in general, functions like this should also start with a verb to show intent (as per https://github.com/nhs-r-community/NHSRwaitinglist/discussions/29).

ThomUK commented 3 months ago

Picking this up, I propose the function names below.
These are core functions in the package, so I'm proposing we prefix them with the same word "calc_" for calculate. This provides the verb Matt suggests, and will also group them together in things like IDE autocomplete lists.

They do get a bit long, but it will be relatively rare to use them directly (mostly being called from inside the package).
What are your thoughts @neilwalton?

Current Function Name Proposed Function Name Purpose
queue_load() calc_queue_load() To understand the ratio between demand and capacity.
average_wait() calc_target_mean_wait() To understand the average waiting time for a queue in equilibrium Target condition).
target_queue_size() calc_target_queue_size() To understand the queue size for a queue in equilibrium.
relief_capacity() calc_relief_capacity() To calculate the relief capacity needed to bring a very large queue under control.
target_capacity() calc_target_capacity() To understand the capacity required to keep a queue in equilibrium, depending on how much variability it experiences.
waiting_list_pressure() calc_waiting_list_pressure() A pressure measure, which can be used to compare multiple waiting lists for planning purposes.