As a SQL statement, I would write: "SELECT HCPType FROM TreatmentFormulary WHERE TXID = 3". (note: TXID does not equal row). I will then use the result to decide what the next activity is in my treatment track. How do I get that HCPType value ???
As a SQL statement, I would write: "SELECT HCPType FROM TreatmentFormulary WHERE TXID = 3". (note: TXID does not equal row). I will then use the result to decide what the next activity is in my treatment track. How do I get that HCPType value ???
After using the query() command, you usually use the getqueryvalue() command to retrieve a specific result from that query. Since the query() command can return more than one result, you treat those results like a table. The getqueryvalue() command takes two parameters, the row and column in the results table that contains the value you want to retrieve.
It sounds like you are only expecting one value back from the query, so you can treat the results table like it only has one row and one column. Please adjust your code or let me know if that is not the case. That means to retrieve the value, you would probably want to do something like this:
double hcptypeValue = getqueryvalue(1, 1);
Then you can use the hcptypevalue variable (or whatever you name it) in the rest of your logic to determine the next activity. You'll want to change the variable to be a string if the HCPType column in the TreatmentFormulary table is actually holding string data and not number data.
You could also forgo the variable and just use a return statement to directly return the value from the results table, depending on where you are using the getqueryvalue() command. However, I would need to know more information about the model and probably see the model to know exactly.
One final note about the getqueryvalue() command. In my example, the column parameter is using a number since I am assuming we only have one column in the results table and this way is marginally more straightforward. However, it is also possible to use a string and query a specific column name in the results table. The command would look like:
double hcptypeValue = getqueryvalue(1, "HCPType");
This is helpful if the results table contains multiple columns. It's also possible to rename of column in the results table through the query() command, so you would use that new name as the second parameter if that is the case.
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