public void addVisitorInfo(AbstractCredentials credentials)
{
string DUZ = credentials.LocalUid;
string arg = "$P($G(^VA(200," + DUZ + ",0)),\"^\",1)"; //NAME
arg += "_\"^\"_" + "$P($G(^VA(200," + DUZ + ",1)),\"^\",9)";
arg += "_\"^\"_" + "$P($G(^VA(200," + DUZ + ",.13)),\"^\",2)"; //OFFICE PHONE
string response = "";
try
{
response = VistaUtils.getVariableValue(cxn, arg);
}
catch (Exception e)
{
if (e.Message.Contains("M ERROR"))
{
throw new ArgumentException("No such DUZ");
}
else
{
throw e;
}
}
if (response == "")
{
return;
}
string[] flds = StringUtils.split(response, StringUtils.CARET);
credentials.FederatedUid = flds[1];
credentials.SubjectName = flds[0];
credentials.SubjectPhone = flds[2];
credentials.AuthenticationSource.SiteId.Id = cxn.DataSource.SiteId.Id;
credentials.AuthenticationSource.SiteId.Name = cxn.DataSource.SiteId.Name;
}