How do I write a command to determine if a patient is accompanied by one or more caregivers?
Thanks,
Tee
How do I write a command to determine if a patient is accompanied by one or more caregivers?
Thanks,
Tee
Tell me what your "real life" definition of "accompanied" is, because I'm still struggling to determine if your definition of "accompanied" fits with any standard definitions within the software. In the software, a staff member can be "allocated" to one specific activity on one specific patient at a time, and a staff member can be "kept" by one specific patient over a period of time that may span two or more activities on the same or diferent patients. These states of "allocated" or "kept' can be queried with commands. If your definition of "accompanied" doesn't fit within these two software specific situations, then you will need to continue to use a user-defined label as you've been doing.
I'm curious why you want to know whether a staff member is "accompanied" or not. Is it to make a processing decision,a bed placement decision, or are you maybe interested in capturing some kind of custom statistic?
if(objectexists(getcompanion(patient,1)) { // do this if patient has at least one companion }
I wasn't sure what you mean by "accompanied by one or more caregivers", so my answer above assumed you were refering to "companions".
If, instead, you want to get a reference to a staff member who was used on a particular activity of the patient, then you can use the getrequiredresource() command. To use this command, you need to specify a particular activity. For instance, the following command
getrequiredresource(patient,torownum(patient,40),STAFF,1)
will return a reference to the staff member who was allocated to the first requirement of activity ID 40 of "patient". Timing is everything here, because if no staff member has been allocated yet to that activity, then the command will return a reference to the group member associated with the staff requirement! So in other words, this command will always return a valid reference to an object: either a group object or a specific resource member of the group who was allocated. Therefore, you could not simply say
if(objectexists(getrequiredresource(patient,torownum(patient,40),STAFF,1))) { // do this }
but instead would need to maybe say something like this
if(getobjecttype(getrequiredresource(patient,torownum(patient,40),STAFF,1)) == OBJECT_Staff) { // do this if a staff member was allocated to activity 40 }
Because I'm not sure of your actual use case, I'm not able to give much more than this. If I totally missed the mark, please give me more background on what you're trying to do, and I'll do my best to help!
Right now, in one of my models I have a patient label named "Accompanied" which has a default value of zero. When a staff member is assigned to a patient accept the value of that label to 1. When the staff member is released, as set the value of that label to 0. This process works but it means I have to carefully assign the values to the label "Accompanied." Since a staff member may accompany a patient through several activities, keeping up with whether or not the patient is accompanied by a staff members can be time-consuming. I just thought that there is an easier way to examine a patient at any activity and see if there is a staff member associated with that patient.
Thanks for your help with this.
Tee
8 People are following this question.
FlexSim can help you understand and improve any system or process. Transform your existing data into accurate predictions.
FlexSim is a fully 3D simulation software environment. FlexSim can be used to simulate any process in any industry.
FlexSim®, FlexSim Healthcare™, Problem Solved.®, the FlexSim logo, the FlexSim X-mark, and the FlexSim Healthcare logo with stylized Caduceus mark are trademarks of FlexSim Software Products, Inc. All rights reserved.
Privacy | Do not sell or share my personal information | Cookie preferences | Report noncompliance | Terms of use | Legal | © Autodesk Inc. All rights reserved