HELP WITH CRITERIA SELECTION

I am attaching the code that I used in this report.  I would like the following information in the procedure code field:  Only those patients who were charged for a 99213 and a 52000 or 99212 and 5200 only.  

In my report I am seeing patients that have JUST a 99212 or 99213 only and patient that have a 5200 and 99212 or 5200 and 99213.  I want someone that has the combination. See Acct # 27039.  I know that the problem is that i selected IS ONE OF for my formula but I don't know how to fix.  Some suggested doing a DO WHILE command but I don't kow how to use that.


Kate
{Archrg99.Chrg_PVID} = "DJS" and
{@DOS} in Date (2007, 01, 01) to Date (2008, 10, 18) and
{Archrg99.Proc_Code} in ["52000", "99212", "99213"]

Open in new window

kvrogersAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

peter57rCommented:
You can't use a record selection formula for this.  Record selection rules work on individual records and not on groups of records so the rules can't refer to the content of other records in the same group.
You could use a group selection rule in CR.  To do this you would have to have separate formulas which counted the number of "52000"'s, "99212"'s,  and "99213"' in the group and then base the group selection on the results of those formula fields.
You can achieve the same thing using the Add Command option to select the data for your report, where you could write a sql statement using 'groupBy' and 'Having' clauses.

If an account has all 3 values in the group is the account to be included or excluded?
0
MIKESoftware Solutions ConsultantCommented:
Try using the SELECTION FORMULAS >> GROUP

Put your logic there....
0
kvrogersAuthor Commented:
I am sorry but I am a real novice to all of the programing formula elements. Could you be a little more specific on how to achieve this.  Sorry!

This brings me to another question.  If I would like to learn how to use the formulas and understand them better, what kind of a course at a local college should I take?  Javascript??  

Kate
0
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

MIKESoftware Solutions ConsultantCommented:
for some REAL good papers on FORMULAS go to....WWW.KENHAMADY.COM

He has some of the best priced....informative formula manuals that you'll find online.

0
MIKESoftware Solutions ConsultantCommented:
INCLUDE all data then use formulas to extract ONLY data needed for display....
0
H0P5Commented:
Hi
On the right hand of the screen under the list of database fields you will find formula field.
right click and make a new one.

Your formula will be something like
If (some field) = x and (some other field) = y then "Good Record" else "Bad Record"
Then in your select expert you can use the formula you just made and filter for only "good record"

Best of luck!
0
kvrogersAuthor Commented:
Ok this is the formula I created and it's not working:

If ({Archrg99.Proc_Code} = "99213" and {Archrg99.Proc_Code}= "5200")  or
({Archrg99.Proc_Code}= "99212" and {Archrg99.Proc_Code} = "5200") then "Good Record"
Else "Bad Record"

then I set Select Record to GOOD RECORD only.  

Put when I do this I get nothing.

Remember I want patients that were bill for a 99213 and 52000 or 99212 and 52000.  

Kate
0
mlmccCommented:
You will always get nothing wuth that formula.  

The field {Archrg99.Proc_Code} cannot equal 2 values on the same record.

mlmcc
0
H0P5Commented:
Could you attach some sample data at all?

0
kvrogersAuthor Commented:
Thanks HOP5.  Wasn't sure what format so I picked XLS.

When you  look at the file noticed that Acct # 27039 shows the criteria I am looking for.  His criteria was that on 09/30 he was charged for a procedure code of 99213 and 52000.

Also see Acct #23560 that account was charged on 08/26 for a 99212 and a 52000.  

Thanks for all your help in advance.

Kate
procedure-5200-with-99212-or-992.xls
0
H0P5Commented:
This is the best I can do, but alas I am no real expert to be honest.

Group all data by Account, then by date.
This will allow you to consider what orders each account placed on each day.

Make a few formula
if account = "52000" then 1
if account = "99212 then 1
Then another one to add these two together. Call it "summary" or something
Place all of these formulas on each individual line of data. Thats 3 formula on each line.
Then in the group footer for date, the second grouping level, add a sum of "summary"
Records where this "summary" are greater than 2 are of interest.
Right click on this summary in the date footer and select "select Group Expert"
This is like the selection expert but you can exclude groups, instead of single records. Exclude groups with that summary of less than 1.

It works for what you have, although its not a glamorous solution and might fall over should you have multiple orders of the same item on the same date, but its the best i can do!

Best of luck!

0
mlmccCommented:
Can a person have multiple for either type?

Will they always be on the same date?

mlmcc
0
kvrogersAuthor Commented:
mlmcc:  Yes you can have individual codes for each person based on DOS(date of service - see below) but I only want the combination of 52000 & 99212 OR 52000 & 99213 and what my report is showing me is all the individual codes and then the combination I am looking for.  All by Date of Service which is what I want. So reports looks like this:

Date of Service      Acct #      Procedure Code
3/25/2008                           27039      52000

6/3/2008                          27039      99213
            
9/30/2008                          27039      99213
                          27039      52000
      
All I really want to show on my report is the one for DOS:  09/30/2008 where the patient was billed for the codes 99213 and 52000.  I need my report to show this combination
or  the combination of  99212 and 52000 like this one:

8/26/2008      23560      99212
      23560      52000

Thanks,
Kate


0
mlmccCommented:
That is what I thought you wanted.

mlmcc
0
kvrogersAuthor Commented:
Hop5: I created the formulat for 52000 = 1 and 9213 = 1 and the summary for adding both and added to the footer but when you say:
Right click on this summary in the date footer and select "select Group Expert"
This is like the selection expert but you can exclude groups, instead of single records. Exclude groups with that summary of less than 1.
When I right mouse click I do not get the option of "select Group Expert" but I selected from the toolbar but I don't understand how to type in the exclusion part.
 
Kate
0
H0P5Commented:
If you right click on the actual formula field you placed in the actual footer you can get into this group select expert.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
kvrogersAuthor Commented:
Well I finally got it.  I left my formula as before see snippet below but in the Date group footer I added a summary of distinct count of ARCHRG.PROC_CODE and then I used select expert and select "is equal to" 2.00 and suppressed that footer.  
 
That gave me what I wanted.  Thanks  to every one.  Especially Hop5 your answer was what I concentrated on the most.
Kate

{@DOS} in Date (2007, 01, 01) to Date (2008, 10, 18) and
{Archrg99.Chrg_PVID} = "DJS" and
{Archrg99.Proc_Code} in ["52000", "99212", "99213"]

Open in new window

0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Crystal Reports

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.