multiple diagnoses

Reply
Contributor
Posts: 20

multiple diagnoses

Does someone already have some generic code that will pull patients with several ranges of diagnoses from a file that records up to 10 diagnoses at a time?
i.e. I want to pull any patient that had dx 345.00-345.99, or 346.0-346.9, or 296.0-296.9 from multiple years...
Super User
Posts: 5,391

Re: multiple diagnoses

I don't have any generic code, but it will help to give some hints if you could show the record lay-out, and some sample data.

/Linus
Data never sleeps
Contributor
Posts: 20

Re: multiple diagnoses

There's just generic information like name, ssn, diag1 - diag10, DOV, etc...
Trusted Advisor
Posts: 2,114

Re: multiple diagnoses

No code, but some comments. This looks like Medicare billing data since there is a limit of 10 diagnoses. The size of some of these datasets can be huge, so some approaches (like TRANSPOSE) that are effective for smaller datasets run out of computer resources with larger ones.

ICD codes are character strings, not numbers, so trying to specify a range is tricky (e.g. ICD 345.1 is different from ICD 345.10). If you are just interested in the summary at the first three digits, use the SUBSTR function or the =: operator for the comparison, e.g.
IF diag1 =: '345' | diag1=:'346'...
or
SELECT ...
WHERE substr(diag1,1,3) IN ('345', '346', '296') | ...
Contributor
Posts: 20

Re: multiple diagnoses

yes...this works quite well.
Now I am working on trying to make an array of the diagnosis codes...
N/A
Posts: 0

Re: multiple diagnoses

try the following where clause through an sql query:

where
(Diag_Code___Prin between '001' and '00999'
or Diag_Code___Prin between '033' and '03399'
or Diag_Code___Prin in ('V016','V027','V028')

or Diag_Code___Secondary_1 between '001' and '00999'
or Diag_Code___Secondary_1 between '033' and '03399'
or Diag_Code___Secondary_1 in ('V016','V027','V028')

or Diag_Code___Secondary_2 between '001' and '00999'
or Diag_Code___Secondary_2 between '033' and '03399'
or Diag_Code___Secondary_2 in ('V016','V027','V028'))
Regular Contributor
Posts: 164

Re: multiple diagnoses

Hi

Actually I have a similar type format for diagnoses (except it goes to 25) and I create the array of:

array diagcde[25] $ diagcde1-diagcde25;

Then when searching for specific codes I indicate:

do i=1 to 25 until (diagcde = ' ');
if diagcde in substr(diagcde,1,3) in ("C00","C01") then .
Ask a Question
Discussion stats
  • 6 replies
  • 582 views
  • 0 likes
  • 5 in conversation