porsche2k7
Programmer
Hi All,
I have a sql code which extracts the hospital patient data. The records are grouped by SSN and ordered by timestamp. Here is the source data
SSN HospClass Activity
123 Inpatient Admission
123 Outpatient Discharge
234 Inpatient Admission
234 Outpatient Transfer
234 Outpatient Transfer
234 Inpatient Discharge
345 Inpatient Admission
345 Ambulatory Transfer
345 Outpatient Discharge
456 Inpatient Admission
456 Emergency Transfer
456 Outpatient Discharge
However from this data I need to be able to generate a error report based on the rule, that a patient with Inpatient Admission cannot be transferred to Ambulatory or Emergency. Hence for this data the report would look like below.
SSN HospClass Activity
345 Inpatient Admission
345 Ambulatory Transfer
345 Outpatient Discharge
456 Inpatient Admission
456 Emergency Transfer
456 Outpatient Discharge
If the first record has a HospClass of Inpatient then next records for the same SSN having Ambulatory or Emergency as the HospClass should be shown on the report.
Is there anyway to acheive this using Crystal report formulas. I am using CR XI. Thanks for your feedback in advance.
I have a sql code which extracts the hospital patient data. The records are grouped by SSN and ordered by timestamp. Here is the source data
SSN HospClass Activity
123 Inpatient Admission
123 Outpatient Discharge
234 Inpatient Admission
234 Outpatient Transfer
234 Outpatient Transfer
234 Inpatient Discharge
345 Inpatient Admission
345 Ambulatory Transfer
345 Outpatient Discharge
456 Inpatient Admission
456 Emergency Transfer
456 Outpatient Discharge
However from this data I need to be able to generate a error report based on the rule, that a patient with Inpatient Admission cannot be transferred to Ambulatory or Emergency. Hence for this data the report would look like below.
SSN HospClass Activity
345 Inpatient Admission
345 Ambulatory Transfer
345 Outpatient Discharge
456 Inpatient Admission
456 Emergency Transfer
456 Outpatient Discharge
If the first record has a HospClass of Inpatient then next records for the same SSN having Ambulatory or Emergency as the HospClass should be shown on the report.
Is there anyway to acheive this using Crystal report formulas. I am using CR XI. Thanks for your feedback in advance.