If a user has switched patients at all before clicking my button, all previously selected patNums are passed in one at a time. I have logic checking for certain criteria that fails for some patients and not for others. When multiple patNums are passed in, if even one fails my plugin exists with a message to the user that the patient didn't meet the criteria, even if the currently selected patient fulfills that criteria.
Is there something I'm missing here? Here's the code (the criteria check happens when the CurrentPatient value is changed and OurPatient is instantiated in the constructor of FormMain)
Code: Select all
public override void LaunchToolbarButton(long patNum)
{
if (DataCheck.TableExists("rd_location"))
{
FormMain formMain = new FormMain();
if (patNum != 0 && formMain.OurPatient!= null)
{
formMain.OurPatient.CurrentPatient = Patients.GetPat(patNum);
}
}
}