Closed kaituna closed 2 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).
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. |
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'.