Module Relationship Query

I’m trying to create a relationship like so. I have a Patient Module; Surgery Module, and Insurance Module. A patient may have 1 to 3 insurances. A Surgery can only have 1 or 2 insurances. I have a 1 to Many for Patient to Surgery relationship as well. So all of these are basically 1 to Many relationships.

I’d like to be able to create 2 insurance fields on the Surgery module. You will select the insurance 1 and optionally select an insurance 2. Then in my Surgery PDF template I can use whatever was selected as 1 as primary and whatever selected as 2 as secondary.

I have created relate fields for insurance in the Surgery module however when I go to pick the appropriate insurance I get a list of all insurances for all patients not just the insurances for the patient that the surgery is for. You can filter down the options in the select popup to get the correct patient, but I’m curious if you can create the relationship so that only those insurances applicable to that patient are possible choices.

I hope this makes sense, my apologies if not.

Check the field billing_contact at following path.
modules/AOS_Invoices/metadata/editviewdefs.php

initial_filter is what i think you are talking about.

1 Like

That is exactly what I was looking for.

Thank you.

did you get this to work? if so, would you mind sharing your solution?

I have the same issue and tried the initial_filter displayParms but information from the editView does not seem to pass to the popup search.

did you get this to work? if so, would you mind sharing your solution?

I have the same issue and tried the initial_filter displayParms but information from the editView does not seem to pass to the popup search.