0
Answer

Show only result within 90 days from present date after API

I have my code pasted below. Now I'm totally lost on where and what code to insert let's say I want to show only data which has a startdate within (date today - 90 days). Kindly help me please. Been stuck for weeks on this one.
By the way this code will run after it grabs the data from another program through API.
public DataTable FGetHasData(int iMode)
{
DataTable dtHASDataReturn = new DataTable();
DataTable dtHASData = new DataTable();
string sSorter = String.Empty;
if (iMode.Equals(0))
{
try
{
dtHASData = this.oHASData.RetrievePayments();
dtHASData.Columns[0].ColumnName = "Agency Code";
dtHASData.Columns[1].ColumnName = "Agency Name";
dtHASData.Columns[2].ColumnName = "Patient Code";
dtHASData.Columns[3].ColumnName = "Claim Code";
dtHASData.Columns[5].ColumnName = "Insurance Company Name";
dtHASData.Columns[6].ColumnName = "Amount";
dtHASData.Columns[7].ColumnName = "Document Number";
dtHASData.Columns[8].ColumnName = "To Print";
dtHASData.Columns[9].ColumnName = "Payment Type";
dtHASData.Columns[10].ColumnName = "Memo";
dtHASData.Columns[11].ColumnName = "Balance Type";
dtHASData.Columns[12].ColumnName = "RAP";
dtHASData.Columns[13].ColumnName = "Outlier";
sSorter = "periodstart";
}
catch (Exception e)
{
this.FLogTrans(e.Message.ToString());
return dtHASDataReturn;
}
}
else if (iMode.Equals(1))
{
try
{
dtHASData = this.oHASData.RetrieveRemittanceAdvices();
dtHASData.Columns[0].ColumnName = "Agency Code";
dtHASData.Columns[1].ColumnName = "Agency Name";
dtHASData.Columns[3].ColumnName = "Check Amount";
dtHASData.Columns[4].ColumnName = "Remittance Advice Memo";
dtHASData.Columns[5].ColumnName = "Insurance Company Name";
dtHASData.Columns[6].ColumnName = "Amount Paid";
dtHASData.Columns[7].ColumnName = "Net Reimbursement";
dtHASData.Columns[8].ColumnName = "Withheld";
dtHASData.Columns[9].ColumnName = "Document Number";
dtHASData.Columns[10].ColumnName = "To Print";
dtHASData.Columns[11].ColumnName = "Payment Type";
dtHASData.Columns[12].ColumnName = "Memo";
sSorter = "RADate";
}
catch (Exception e)
{
this.FLogTrans(e.Message.ToString());
return dtHASDataReturn;
}
}
DataView dvSorter = new DataView(dtHASData);
if (this.FConfigVarRetriever(4).Equals("1"))
{
int iRowsMany = int.Parse(this.FConfigVarRetriever(5));
dvSorter.Sort = sSorter + " desc";
dtHASData = dvSorter.ToTable();
if (iMode.Equals(0))
{
dtHASData.Columns[4].ColumnName = "Period Start";
}
else if (iMode.Equals(1))
{
dtHASData.Columns[2].ColumnName = "Remittance Advice Date";
}
dtHASDataReturn = dtHASData.AsEnumerable().Take(iRowsMany).CopyToDataTable();
}
else if (this.FConfigVarRetriever(4).Equals("2"))
{
dvSorter.RowFilter = sSorter + " >= '" + this.FConfigVarRetriever(6) + "'";
dvSorter.Sort = sSorter + " desc";
dtHASData = dvSorter.ToTable();
if (iMode.Equals(0))
{
dtHASData.Columns[4].ColumnName = "Period Start";
}
else if (iMode.Equals(1))
{
dtHASData.Columns[2].ColumnName = "Remittance Advice Date";
}
dtHASDataReturn = dtHASData;
}
return dtHASDataReturn;
}