Hello Experts,
Here is the query I am using to return specific Dx codes and their associated descriptions and locations:
SELECT DISTINCT LookupDiags.Code, LookupDiags.Description, LookupDiags.Location, tblPatientData.Payer1
FROM tblPatientData
INNER JOIN LookupDiags ON
ISNULL(tblPatientData.DX1,
N'000') = LookupDiags.Code OR
tblPatientData.DX1 = LookupDiags.Code OR
tblPatientData.DX2 = LookupDiags.Code OR
tblPatientData.DX3 = LookupDiags.Code OR
tblPatientData.DX4 = LookupDiags.Code
WHERE ((tblPatientData.CaseNumbe
r)=1020800
1)
This would return something like:
Code Description Location
727.81 Contracture of Tendon Foot/Ankle
What I need returned is something like the following:
DX Code Description Location
DX1 727.81 Contracture of Tendon Foot/Ankle
Where DX represents the field name where the data was returned from. Obviously there can be up to 4 codes for each Case Number.
Thanks in advance for your help.
JackW9653
Start Free Trial