internal TaggedPatientArray matchByNameCityState(AbstractConnection cxn, string name, string city, string stateAbbr)
{
TaggedPatientArray result = new TaggedPatientArray();
if (name == "")
{
result.fault = new FaultTO("Missing name");
}
else if (city == "")
{
result.fault = new FaultTO("Missing city");
}
else if (stateAbbr == "")
{
result.fault = new FaultTO("Missing stateAbbr");
}
else if (!State.isValidAbbr(stateAbbr))
{
result.fault = new FaultTO("Invalid stateAbbr");
}
if (result.fault != null)
{
return result;
}
try
{
PatientApi api = new PatientApi();
Patient[] matches = api.matchByNameCityState(cxn, name, city, stateAbbr);
result = new TaggedPatientArray(cxn.DataSource.SiteId.Id, matches);
}
catch (Exception e)
{
result.fault = new FaultTO(e.Message);
}
return result;
}