<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><span style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: rgb(255, 255, 255);">I am trying to figure out how to work with an existing model. The data is in</span><br style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: rgb(255, 255, 255);"><span style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: rgb(255, 255, 255);">MongoDB with embedded documents. It is about patients would have</span><br style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: rgb(255, 255, 255);"><span style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: rgb(255, 255, 255);">sub-documents. For example. An individual patient may have multiple</span><br style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: rgb(255, 255, 255);"><span style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: rgb(255, 255, 255);">allergies. Also a patient has multiple medications. So it is as follows:</span><br style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: rgb(255, 255, 255);"><br style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: rgb(255, 255, 255);"><span style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: rgb(255, 255, 255);">- Patient.medications ---> multiple Medication objects</span><br style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: rgb(255, 255, 255);"><br style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: rgb(255, 255, 255);"><span style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: rgb(255, 255, 255);">So I see where you have a simple one to one. Typically perhaps you might</span><br style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: rgb(255, 255, 255);"><span style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: rgb(255, 255, 255);">have the medication record know that it is associated with the patient, but</span><br style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: rgb(255, 255, 255);"><span style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: rgb(255, 255, 255);">that is not how it is currently organized. So the question is can I write</span><br style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: rgb(255, 255, 255);"><span style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: rgb(255, 255, 255);">rules when patients.medications returns a set/ collection of medications</span><br style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: rgb(255, 255, 255);"><span style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: rgb(255, 255, 255);">associated with the patient. I want to write a rule such as "if a patient is</span><br style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: rgb(255, 255, 255);"><span style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: rgb(255, 255, 255);">taking medication=xxx...."</span><br style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: rgb(255, 255, 255);"><br style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: rgb(255, 255, 255);"><span style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: rgb(255, 255, 255);">Thanks for your help.</span><br style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: rgb(255, 255, 255);"><br style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: rgb(255, 255, 255);"><span style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.727272033691406px; background-color: rgb(255, 255, 255);">Ray Hooker</span></body></html>