Marcia G Akins
|
|
Group: StrataFrame Users
Posts: 322,
Visits: 529
|
Hi All.
I am working on an application where there is an application level filter in effect by user. I would like to use the BrowseDialog to allow the users to search for records but only within a subset that satisfies the filter condition.
Is it possible to do this?
TIA
Marcia
|
|
|
Marcia G Akins
|
|
Group: StrataFrame Users
Posts: 322,
Visits: 529
|
Aaron Young (3/14/2011) Hi,
I wonder if your intention is to filter the results of the search query? If so, you can add a where clause in the BrowseDialog_Searching event. The following example adds a where condition that only returns records which have two fields equal to 0:-
This is exactly what I want to do! Thanks a million before taxes! Marcia
|
|
|
Aaron Young
|
|
Group: StrataFrame Users
Posts: 277,
Visits: 1.1K
|
Please don't mention taxes.....
|
|
|
Marcia G Akins
|
|
Group: StrataFrame Users
Posts: 322,
Visits: 529
|
Hi Aaron.
Here is the code that I have in brwPatients_searching method and it does not filter the what is returned - it gives me all the records.
What am I doing that is stupid?
// Add a "Where" clause to only include records where the provider id
// is in the current filter condition
System.Collections.ArrayList value = new System.Collections.ArrayList();
value.Add(AppMain.Current_Filter);
MicroFour.StrataFrame.Data.WhereStatement WhereClause = new MicroFour.StrataFrame.Data.WhereStatement(new String[] { "ProvID" }, value, MicroFour.StrataFrame.Data.WhereStatementTypeOptions.In);
|
|
|
Marcia G Akins
|
|
Group: StrataFrame Users
Posts: 322,
Visits: 529
|
Hi Aaron. Never mind. I must have taken my stupid pills this morning.  I was missing this line of code: e.RawWhereStatementsCollection.Add(where2);
|
|
|
Trent Taylor
|
|
Group: StrataFrame Developers
Posts: 6.6K,
Visits: 7K
|
Please don't mention taxes.....
Amen!
|
|
|
Trent Taylor
|
|
Group: StrataFrame Developers
Posts: 6.6K,
Visits: 7K
|
One other thought on this would be to create a View. The Browse dialog has the ability to change the query table. This include the support of a view. You can also change this at run-time allowing you to have multiple views if necessary. Just another thought
|
|
|
Marcia G Akins
|
|
Group: StrataFrame Users
Posts: 322,
Visits: 529
|
Trent L. Taylor (3/15/2011)
One other thought on this would be to create a View. The Browse dialog has the ability to change the query table. This include the support of a view. You can also change this at run-time allowing you to have multiple views if necessary. Just another thought  Can you share some sample code with me? I do not think that the multiple views would work because the user can select one or more providers so the data that the browse dialog runs over would have to change with a dynamic WHERE clause at run time. TIA Marcia
|
|
|
Edhy Rijo
|
|
Group: StrataFrame Users
Posts: 2.4K,
Visits: 23K
|
Probably this thread can help you out: http://forum.strataframe.net/FindPost23458.aspx
Edhy Rijo
|
|
|
Marcia G Akins
|
|
Group: StrataFrame Users
Posts: 322,
Visits: 529
|
[quote] Edhy Rijo (3/15/2011)
Probably this thread can help you out: http://forum.strataframe.net/FindPost23458.aspx[/quote] Hi Edhy. Thanks for trying to help. I don't think that this is going to do what I want. What I really need is for the code that Aaron gave me to put in the BrowseDialog_searching method to work as advertised. I followed his instructions exactly, but the result set was not filtered by the current provider(s).
|
|
|
Edhy Rijo
|
|
Group: StrataFrame Users
Posts: 2.4K,
Visits: 23K
|
Marcia G Akins (3/15/2011) ...What I really need is for the code that Aaron gave me to put in the BrowseDialog_searching method to work as advertised. I followed his instructions exactly, but the result set was not filtered by the current provider(s). I see. Sorry, I have not used that functionality of the Dialog Browser yet.
Edhy Rijo
|
|
|
Aaron Young
|
|
Group: StrataFrame Users
Posts: 277,
Visits: 1.1K
|
Hi Marcia,
Sorry for the late reply. Is this still your code?
System.Collections.ArrayList value = new System.Collections.ArrayList(); value.Add(AppMain.Current_Filter); MicroFour.StrataFrame.Data.WhereStatement WhereClause = new MicroFour.StrataFrame.Data.WhereStatement(new String[] { "ProvID" }, value, MicroFour.StrataFrame.Data.WhereStatementTypeOptions.In);
Assuming you are still using the code above, I think AppMain.Current_Filter is the problem. I suspect it is a list of provider ID numbers but they are being added to the value array as a single element. They should be split and added as individual array elements. For example, take a look at this code:-
// This code adds a WHERE clause of "ID IN (10000145, 10000146, 10000149) System.Collections.ArrayList value = new System.Collections.ArrayList(); value.Add(10000145); value.Add(10000146); value.Add(10000149); MicroFour.StrataFrame.Data.WhereStatement where1 = new MicroFour.StrataFrame.Data.WhereStatement(new String[] { "ID" }, value, MicroFour.StrataFrame.Data.WhereStatementTypeOptions.In); e.RawWhereStatementsCollection.Add(where1);
The above code definitely 100% works so if you can split AppMain.Current_Filter into separate IDs and add them to the array then you could be in luck. If it still doesn't work, can you give me an example for AppMain.Current_Filter?
Aaron
|
|
|
Marcia G Akins
|
|
Group: StrataFrame Users
Posts: 322,
Visits: 529
|
Aaron Young (3/15/2011) Hi Marcia,
Sorry for the late reply. Is this still your code?
System.Collections.ArrayList value = new System.Collections.ArrayList(); value.Add(AppMain.Current_Filter); MicroFour.StrataFrame.Data.WhereStatement WhereClause = new MicroFour.StrataFrame.Data.WhereStatement(new String[] { "ProvID" }, value, MicroFour.StrataFrame.Data.WhereStatementTypeOptions.In);
Assuming you are still using the code above, I think AppMain.Current_Filter is the problem. I suspect it is a list of provider ID numbers but they are being added to the value array as a single element. They should be split and added as individual array elements. For example, take a look at this code:-
// This code adds a WHERE clause of "ID IN (10000145, 10000146, 10000149) System.Collections.ArrayList value = new System.Collections.ArrayList(); value.Add(10000145); value.Add(10000146); value.Add(10000149); MicroFour.StrataFrame.Data.WhereStatement where1 = new MicroFour.StrataFrame.Data.WhereStatement(new String[] { "ID" }, value, MicroFour.StrataFrame.Data.WhereStatementTypeOptions.In); e.RawWhereStatementsCollection.Add(where1);
AaronHi Aaron. Thanks so much for all the help you have given me. Everything is working now. The problem was not Current_Filter. I am embarrassed to say that it was the loose nut behind the keyboard
|
|
|
Marcia G Akins
|
|
Group: StrataFrame Users
Posts: 322,
Visits: 529
|
This code is not filtering the result set. Here is what I am trying to do. I am searching for patients but I only want the browse dialog to search patients for one or more specific providers that have been set as an application level filter.
Even with the code in the Searching method, I am still getting all the patients back.
What am I doing wrong?
|
|
|
Marcia G Akins
|
|
Group: StrataFrame Users
Posts: 322,
Visits: 529
|
This code is still not working to filter the result set. This is what I am trying to do. I have an application level filter set up to displat information from one or more selected providers. When I go to select a patient, I want the result set to include only patients for the provider(s) that have been set up as the application level filter.
When I search, all patient records are being returned.
What am I doing wrong?
|
|
|