Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Extract only certain procedure names from a table

Status
Not open for further replies.

JonathanNYC

IS-IT--Management
Mar 29, 2003
111
US
Is there a way to establish a group (not sure if that is the appropriate term) for only certain items that appear in a table, so that I may be able to use that group in my record selection criteria.

I have a table with 1000 different procedure names in it. Each procedure name has a corresponding 3 or 4 digit resource number associated with it. I need to report on primary hip replacement cases only. The procedure names vary and do not always contain the words “Replacement Total Hip”. I could do an “is like” on the procedure names but there is much variability among the names.

Here is an example of replacement hip names in our system:

Replacement Total Hip, Biomet 1759 (Resource Number)
Replacement Tot Hip, Osteonics 3145
Resurfacing Total Hip, Wright 1631
etc.

Again, I wish to establish a group or formula that includes the applicable resource numbers and then use the group in my record selection statement.

I am using Crystal Reports 10 and a database from Mediware that is part of an OR Operating Room Scheduling and Documentation system.
 
Jonathan,

I think that synapsevampire & lbass have advised against this before (as it can lead to items being included in any group) but I am not sure. At any rate, this is how I handle such a scenario.

Create a formula field and populate it with the following, and group on this Formula Field... (@Surgery_Type} in my examples.

Code:
[blue]IF[/blue] {table.resourcenumber} [blue]IN[/blue] [1759,3145,1631,..etc] [blue]THEN[/blue] "Hip Surgery" [blue]ELSE[/blue] "Other"
Note: You can then use this formula to identify other surgery types you may wish to differentiate.

In your record selection you can either add:
Code:
{table.resourcenumber} [blue]IN[/blue] [1759,3145,1631,..etc]
OR
Code:
{@Surgery_Type}="Hip Surgery"

Hope this helps,


Mike
______________________________________________________________
[banghead] "It Seems All My Problems Exist Between Keyboard and Chair"
 
Many thanks Mike, I incorporated your tip. Most appreciated.
 
Mike: The secondary OR part of the record selection will nt be passed to the database.

If you use the following in a record selection:

table.resourcenumber} IN [1759,3145,1631]

Then it will return only those that are hip replacements, so your formula will do nothing but the hip replacements.

If they simply want the hip replacements ganged together in a group, then your formula is fine and I doubt that anyone has complained about this:

c

But don't filter in the record selection, unless you DON'T want any otehrs, in which case the formula could have been:

if table.resourcenumber} IN [1759,3145,1631,..etc] then
"Hip"
else
"Could never happen..."

-k

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top