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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using "in" statement in record selection formula

Status
Not open for further replies.

luxvivens

Technical User
May 20, 2010
27
CA
I need my report to identify whether there exists a fracture ICD9 code. I need to check in 7 different diagnosis fields for this. The fracture code is 800.xx – 829.xx. For example, it could be coded as 801.0 or 816.9 or 829.4, etc.

Would someone confirm for me whether the “in” statement I am using (see below) would identify the fracture code or might I miss some this way? If it is ok as it is, is there another (more efficient way) to do this? I am using CR 10. Thanks so much for helping me with this.

Example of selection record formula (for the fracture codes)
({POA_QM_Data_Sample_2.Secondary DX 1} in ["800", "801", "802", "803", "804" , "805", "806", "807", "808", "809", "810" , "811", "812", "813", "814", "815", "816", "817", "818", "819", "820", "821", "822", "823" ,"824", "825", "826", "827", "828", "829"] or
{POA_QM_Data_Sample_2.Secondary DX 2} in ["800", "801", "802", "803", "804" , "805", "806", "807", "808", "809", "810" , "811", "812", "813", "814", "815", "816", "817", "818", "819", "820", "821", "822", "823" ,"824", "825", "826", "827", "828", "829"]
 
i had to do a similar report, by ICD9 diagnosis number and used something like this:
//{@diaginrange}
IF (floor({table.diagnum}) in [800 to 829]
OR
floor({table.diagnum2}) in [800 to 829])
then 1 else 0

then i suppressed all occurrences where my formula equaled zero. I needed to have the other data for calculations but did not need it displayed.
 
If these are always three digits, create a SQL expression using the left function or a subquery depends upon your database:

{fn left(POA_QM_Data_Sample_2.Secondary DX 1,3)}

Or:

left(POA_QM_Data_Sample_2.Secondary DX 1,3)

Or:

substr(POA_QM_Data_Sample_2.Secondary DX 1,1,3)

Or:

{fn substring(POA_QM_Data_Sample_2.Secondary DX 1,1,3)}

Add the field using the field list so that you get the correct punctuation. Repeat for DX2. Then change your selection formula to:

(
{%DX1} in "800" to "829" or
{%DX2} in "800" to "829"
)

The SQL expressions will just make the criteria process more quickly.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top