question

Jaidit J avatar image
0 Likes"
Jaidit J asked Jaidit J commented

How to get ONLY Female patients go to Mammo Screening in a Healthcare Facility

Hello,

I'm building a HC model, and we have a Mammo Screening machine as one of the services. How can I tell FlexSim to only send Female patients to this machine? We will be having an arrival distribution for the machine. Every time a patient gets there to a get a mammogram, it will have to be a female. How can we do this? Thanks so much!

FlexSim 21.2.4
healthcareconditional decidegender
5 |100000

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

1 Answer

Regan Blackett avatar image
0 Likes"
Regan Blackett answered Jaidit J commented

The trick to this is first knowing the difference between Male/Female-shaped patients in such a way that we can use activities like a Decide to chose different logic for the differently shaped patients. This difference isn't baked in so we need to do a little work.

What I would do first is set up a Person Label in the People Settings section of the toolbox called "Gender" (or whatever you would like to name it).

Then in your patient flow right after the Source activity, put in a Assign Labels activity and configure it like this:

labels.png

Then you can use a Decide activity using the conditional decide option like this:

decide.png

If the Gender label has the text "Male" in it then you can send the patient to a connector off the Decide activity named "Male", otherwise use "Female". There are some more streamlined ways of doing this but thought it might be usefule to see it done this way in case this is a newer idea for anyone reading this.

Then you can just have your "Male" patients go to activity set that acquires one location resource, and your "Females" another. I'm also including an example model to see how this all comes together.

Hope this helps!

getgenderexample_1.fsm


decide.png (21.9 KiB)
labels.png (21.5 KiB)
· 7
5 |100000

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

Matthew Gillespie avatar image Matthew Gillespie ♦♦ commented ·

@Regan Blackett @Jaidit J I don't think the shapeindex number is very reliable and probably depends on the number/order of other loaded shapes. I've usually done this by looking at the name of the shape to see if it has the word Male or Female in it:

shape(patient).value.includes("Male") 
1 Like 1 ·
Regan Blackett avatar image Regan Blackett ♦ Matthew Gillespie ♦♦ commented ·
Cool, I didn't know about the includes() method, updated my answer to use that instead.
0 Likes 0 ·
Jaidit J avatar image Jaidit J commented ·

This helps. I think to keep it easier we are going to have males and females go to MAMMO with males dressing blue, and females dressing pink. However, I can't get my females to dress pink. everyone is dressing blue. I spent all morning and cant get this to work. Can someone review my code? Thanks so much!Tampa_Satellite_2nd_floor_JJ2.fsm

0 Likes 0 ·
Matthew Gillespie avatar image Matthew Gillespie ♦♦ Jaidit J commented ·

@Jaidit J You added two change shirt options. So all the mammo patients are putting on a pink shirt and then changing to a blue shirt. You just want to change the shirt once, but have the color be dependent on the gender label. So the color field should say:

patient.Gender == "M" ? Color.blue : Color.pink

1645561629850.png

If you've never used the the ternary operator (condition ? true_value : false_value) it's just a way of putting an if/else statement on a single line. It's the same as saying:

if (patient.Gender == "M")
    color = Color.blue;
else
    color = Color.pink;


0 Likes 0 ·
1645561629850.png (17.6 KiB)
Jaidit J avatar image Jaidit J commented ·

thank you so much! That worked! I was able to finish the Mammo Process, but now I get a series or errors that I believe have to do with my latest changes. It is referencing the Elevator, but I don't understand what they mean. Thank you soo much for your help so far. Can you take a look? Tampa_Satellite_2nd_floor_JJ2.fsm

0 Likes 0 ·
Matthew Gillespie avatar image Matthew Gillespie ♦♦ Jaidit J commented ·

@Jaidit J You added ElevatorBank1 as a member of the Locations group, but the elevator isn't a "Location" object.

tampa-satellite-2nd-floor-jj2_fixed.fsm

If you have further questions please ask it on a new, separate question as explained in our Best Practices page.

0 Likes 0 ·
Jaidit J avatar image Jaidit J commented ·

I will! thnak you sooo much!!!!!

0 Likes 0 ·