getname(patientlocation) is to get current patient location. May i know what is the function and variable to get patient destination in flexscipt?
getname(patientlocation) is to get current patient location. May i know what is the function and variable to get patient destination in flexscipt?
getdestination(patient)
From the documentation for that command:
Parameters
(obj traveler, [num transferactivityID])
Description
Gets the current, most recent, or pending destination of the traveler object. If the traveler is a patient, you should specify the activity ID number of the patient's transfer activity that you'd like to know the associated destination of. If the traveler is a patient and no transfer activity ID is specified, then the command will use the ID of the most recent activity started on the patient. If the traveler is a resource, rather than a patient, then the command assumes that the resource currently has an active task sequence containing a travel task, and it will use the most recent travel task (or if none have occured yet, the next pending travel task) to determine the destination.Example
getdestination(patient, 100);
The getdestination command handles a lot of different scenarios for you. I would recommend updating to the latest version (5.3.8) to take advantage of this feature and all the other bug fixes and features added in newer versions.
Otherwise you could try using these code snippets I pulled out of the body of that command.
If the activity is an escort or transport patient activity:
int activityRow = torownum(patient, activityID); treenode destination = tonode(gettablevalue(var(patient, VAR_ActivityTable), activityRow, COL_ResourceDestinationName));
If the activity is a patient travels unattended activity:
treenode activets = gettasksequence(patient, 0); // Loop through the tasks of the activets and if a travel task can be found, get its destination int nrtasks = gettotalnroftasks(activets); for (index = 1; index <= nrtasks; index++) { if (gettasktype(activets, index) == TASKTYPE_TRAVEL) { destination = gettaskinvolved(activets, index, 1); break; } }
5 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