Hello all,
I've created a database that keeps track of medications that patients are discharged on - patient information is stored in tblPatientInfo, and medications are stored in a subtable named tblMeds. tblMeds has the fields PatientID (linked to tblPatientInfo), Drug, Dose, Route, and AsNeeded (True or False). Patients may be on the same medication with two or more routes (i.e., oral, intramuscular, subcutaneous, etc...), and they may be scheduled or as needed.
I'm trying to create a query that groups patients based on whether they are discharged on two INDIVIDUAL, scheduled medications (Group A), or not (Group B). Here's an example of what I'm talking about:
PatientID Drug Dose Route AsNeeded 1 DrugA 10 mg Oral False 1 DrugB 5 mg Oral True 2 DrugA 10 mg Oral False 2 DrugA 5 mg SubQ False 2 DrugB 20 mg Oral True 3 DrugA 10 mg Oral False 3 DrugA 5 mg SubQ False 3 DrugB 20 mg Oral False 3 DrugB 5 mg Oral True
In this example, Patient 1 would be placed in Group B (on two individual drugs, but only one is scheduled), Patient 2 would be placed in Group B (on two scheduled medications, but both are DrugA with different routes), and Patient 3 would be placed in Group A (on three scheduled medications, two of which are different - DrugA, DrugA and DrugB.
I hope this makes sense. I created a query that counts scheduled and AsNeeded medications separately, and assigned anyone with a Count of scheduled meds >1 to Group A; but, that didn't account for patients being on different routes of the same scheduled medication.
Thanks in advance for any help with this!