I am attempting to write a report to show the most recent result for several different lab tests for several different patients at my clinic. The information is contained in a table which has the following fields in each record:
- the patient ID number
- the result date
- the result component ID number
- the result value
Each patient can have the same lab component resulted on several different dates, and and has can have several different lab components resulted.
I need to have the report come out like this -
PATIENT Comp. A Value Comp A Date Comp B Value Comp B Date
(each line showing the pat ID, the lastest date and value for component A, lastest date and value for component b, and so on. If the patient never had the component resulted, the date/value columns for that component should be blank).
Any suggestions?
- the patient ID number
- the result date
- the result component ID number
- the result value
Each patient can have the same lab component resulted on several different dates, and and has can have several different lab components resulted.
I need to have the report come out like this -
PATIENT Comp. A Value Comp A Date Comp B Value Comp B Date
(each line showing the pat ID, the lastest date and value for component A, lastest date and value for component b, and so on. If the patient never had the component resulted, the date/value columns for that component should be blank).
Any suggestions?