question

Kathrin S avatar image
0 Likes"
Kathrin S asked Eric M commented

Decision based on census

Hello.

How can I send patients at a decision point based on the census to a different path? For example, patients should always take path 1 but if the census is over 15 then choose path 2.

In addition, it would be great if the census were only used for certain patients. I have assigned patients to their medical discipline as a label. Can the census only be given for two of these disciplines? For example, for patients in trauma surgery and urology.


Thanks a lot!



FlexSim 20.2.3
flexsim 20.2.3decision pointscensus
· 1
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Eric M avatar image Eric M commented ·

Hi @Kathrin S, was Matthew Gillespie's answer helpful? If so, please click the red "Accept" button at the bottom of their answer. Or if you still have questions, add a comment and we'll continue the conversation.

If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always unaccept and comment back to reopen your question.

0 Likes 0 ·

1 Answer

Matthew Gillespie avatar image
2 Likes"
Matthew Gillespie answered

You can use the getcensus() command to get the current patient census in the whole model. You can also pass in a location group to get the census within that location group:

getcensus(Group("ExamTables"))

If you want to get the census of patients with a certain label value you'd need to query the Census History table with a query like this one that returns the census of patients with a PCI label of 2:

string query = "SELECT \
SUM([CensusHistory.StatisticsCollector].[InOut]) \
FROM[CensusHistory.StatisticsCollector]\
JOIN[PersonLabels.StatisticsCollector] ON [PersonLabels.StatisticsCollector].[PID] = [CensusHistory.StatisticsCollector].[PID]\
WHERE[PersonLabels.StatisticsCollector].[PCI] = 2";

Table result = Table.query(query);
if (result.numRows > 0)
    return result.executeCell(1,1);
else
    return 0;
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.