question

Patrick Cloutier avatar image
1 Like"
Patrick Cloutier asked Matthew Gillespie answered

Any way to return "first available from a list of choices" instead of return 0 ?

Let's say I want to send items to port 1 if itemtype = 23 but to first available of ports 2,3,4 if itemtype = 35.

I know I can write a bunch of if (opavailable(current,2) and getitemtype(item)==35) return 2;

else if etc.etc.etc.

But I was wondering if there is a trick to do it simpler using some type of "return 0 from 2,3,4" ?

Thanks,

FlexSim HC 5.1.0
first available
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
0 Likes"
Matthew Gillespie answered

If you're doing this in the Patient Destination field then you should use the Based on Destination pickoption. This lets you make a list of destinations that will be chosen based on the criteria you select (First Available in this case). If none of the destinations are available it will reevaluate the choices when something upstream opens up.

5 |100000

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

Steven Hamoen avatar image
0 Likes"
Steven Hamoen answered Patrick Cloutier commented

@Patrick Cloutier Hi Patrick, in these situation I usually use a combination of push and pull. So on the send to port: "if itemtype =23 return 1 else return 0" and then use the pulls to determine the other options.

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

Patrick Cloutier avatar image Patrick Cloutier commented ·

Thanks. That works for the specific example that I gave but not for other cases where you might want to select "first available from a list of choices".

I'm using that same logic in the "Patient Destination" field based on PCI and I had to write a bunch of "if then else".

So I was just wondering if there is a function or command that I haven't found to return "first available from a list of choices".

I guess not. That's ok.

Thanks,

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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