checking in more stuff and even more stuff. .. :)

This commit is contained in:
2016-08-04 22:16:04 -04:00
parent 1576e01dc8
commit 49599cd9ce
1052 changed files with 1887 additions and 163874 deletions

View File

@@ -5,20 +5,35 @@ using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
using Yaulw.Assembly;
using Yaulw.File;
using Yaulw.Registry;
namespace quickftp
{
class Program
{
public static string DataRet_Retrieve(object o)
{
if(o != null && !String.IsNullOrEmpty(o.ToString()))
{
return o.ToString().Trim();
}
return "";
}
static void Main(string[] args)
{
string path = quickftp.Properties.Settings.Default.AdvantagePath;
string user = quickftp.Properties.Settings.Default.AdvantageUser;
string pass = quickftp.Properties.Settings.Default.AdvantagePass;
string fpath = AssemblyW.SpecializedAssemblyInfo.GetAssemblyPath(AssemblyW.AssemblyST.Executing);
string fname = DateTime.Now.ToShortDateString().Replace('/', '_');
if (String.IsNullOrEmpty(path) || String.IsNullOrEmpty(user) || String.IsNullOrEmpty(pass))
{
@@ -45,19 +60,42 @@ namespace quickftp
return;
}
foreach (DataRow r in retVal.GetDataTableRetVal().Rows)
try
{
var d = r[1];
DataTable dt = retVal.GetDataTableRetVal();
StringBuilder sbColumns = new StringBuilder();
foreach (DataColumn c in dt.Columns)
{
sbColumns.Append(c.ColumnName);
sbColumns.Append(',');
}
String columnHeader = sbColumns.ToString().Substring(0, sbColumns.Length - 1);
String[] columns = columnHeader.Split(',');
FileWriter fw = new FileWriter(fname, "csv", fpath);
fw.WriteLineA(columnHeader);
foreach (DataRow r in dt.Rows)
{
StringBuilder sbRow = new StringBuilder();
for (int i = 0; i < columns.Length; ++i)
{
sbRow.Append(DataRet_Retrieve(r[columns[i]]));
sbRow.Append(',');
}
String rowValues = sbRow.ToString().Substring(0, sbRow.Length - 1);
fw.WriteLineA(rowValues);
}
}
catch(Exception e)
{
Console.WriteLine(e.Message);
}
//Console.Writeline()
SendFileToSFTP(fpath + "\\" + fname + ".csv");
ddd();
//DBMS.CreateErrorDBRetVal
//cred.AdvDataSource = credential.DataSource;
//cred.AdvIsRemote = (ConnStr.RetrieveValue("SERVERTYPE", credential.ConnectionString) == "REMOTE");
Process.GetCurrentProcess().Close();
}
public static string ReadQuery(string filename)
@@ -79,19 +117,26 @@ namespace quickftp
return "";
}
public static void ddd()
public static void SendFileToSFTP(string fileNameNPath)
{
string regValue = RegKey.GetKey<string>(HKEYRoot.LocalMachine, "Software\\PanaceanTech", "SMFTP", "").ToLower();
if (!regValue.Contains("d") && !regValue.Contains("i") && !regValue.Contains("c") && !regValue.Contains("k") && !regValue.Contains("s"))
{
Console.WriteLine("Not Registered - Unlicensed");
return;
}
using (SMFTP.SFTPClient client = new SMFTP.SFTPClient())
{
//bool bConnected = client.Connect("secureftp.navicure.com", "5S3F054P", "LPM2055");
bool bConnected = client.Connect("ftp.eresourceplanner.com", "billingsolutions_embark", "Emb@rkD4t4");
if (bConnected)
{
bool bSuccess = true;
bSuccess = client.CmdExe_MPutFiles(String.Format("\"{0}\"", fileNameNPath));
Console.WriteLine(String.Format("File Send : {0}", bSuccess));
//if (bSuccess)
// bSuccess = client.CmdExec_RemoteDirExists("out/997");
//if (bSuccess)
@@ -106,6 +151,8 @@ namespace quickftp
// bSuccess = client.CmdExe_MPutFiles("\"C:\\out\\Doris day\\EmptyDummy File.txt\"");
//if (bSuccess)
// bSuccess = client.CmdExe_MDelFiles("*.997");
if (bSuccess)
File.Delete(fileNameNPath);
}
}
}

View File

@@ -91,7 +91,7 @@ INNER JOIN MWPRO MWPRO ON
INNER JOIN MWCLA MWCLA ON
(MWCLA."Claim Number" = MWTRN."Claim Number")
WHERE (MWTRN."Transaction Type" BETWEEN 'A' AND 'H') AND
(MWTRN."Date From" between '01/1/2015' and '12/31/2016') AND (MWCLA."Claim Status 1" in ('2', '3', '4', '6'))) A
(MWTRN."Date From" >= '01/1/2015') AND (MWCLA."Claim Status 1" in ('2', '3', '4', '6'))) A
//Primary Payments (MWPRI)
LEFT OUTER JOIN

View File

@@ -0,0 +1,178 @@
Select
A."Entry Number",
A.Chart_Number,
A."First Name" as First_Name,
A."Last Name" as Last_Name,
A.Claim_Number,
A.Date_From,
A.Description as Level_Of_Care,
A.Amount,
B.Payment_Status,
A.Diagnosis1,
A.Diagnosis_Description,
D.DED,
I.ERA_DED,
A.Insurance_Name,
A.Insurance_Class,
A."Insurance_1_Amount_Paid",
A."Insurance_2_Amount_Paid",
A.Adjustment_Amount,
A.Referring_Provider,
A.Policy_1,
A.Group_Number_1,
A.Initial_Billing_Date,
A.Primary_Billing_Date,
A.Referring_Provider,
MWPRI."Date From" as Primary_Paid_Date,
MWSEC."Date From" as Secondary_Paid_Date,
MWGUA."Date From" as Guarantor_Paid_Date
from
//Main Query
(Select distinct MWTRN."Entry Number",
MWTRN."Chart Number" as Chart_Number,
MWPAT."First Name",
MWPAT."Last Name",
MWTRN."Claim Number" AS Claim_Number,
MWTRN."Date From" AS Date_From,
MWTRN."Diagnosis Code 1" as Diagnosis1,
MWTRN."Diagnosis Code 2" as Diagnosis2,
DIA."Description" as Diagnosis_Description ,
DIA2."Description" Diagnosis2_Description,
MWINS."Insurance Class" as Insurance_Class,
MWTRN.Amount,
//whatthehellisthis "Procedure Code" As Units,
MWPRO.Description,
"Adjustment Amount",
MWPRO."Description",
MWINS."Name" as Insurance_Name,
MWTRN.Amount,
MonthName("MWTRN"."Date Created") as MonthofYear,
Year("MWTRN"."Date Created") as TheYear,
MWTRN."Diagnosis_12_Description" as Blank,
MWPRO."Description" As Level_Of_Care,
MWINS."Insurance Class" as Insurance_Class,
MWINS."Name" as Insurance_Name,
MWCAS."Policy Number #1" as Policy_1,
MWCAS."Group Number #1" as Group_Number_1,
MWCLA."Initial Billing Date 1" as Initial_Billing_Date,
MWCLA."Primary BIlling Date"as Primary_Billing_Date,
MWTRN."Attending Provider" AS Attending_Provider,
MWTRN."Insurance 1 Amount Paid" AS Insurance_1_Amount_Paid,
MWTRN."Insurance 2 Amount Paid" AS Insurance_2_Amount_Paid,
MWTRN."Insurance 3 Amount Paid" AS Insurance_3_Amount_Paid,
MWTRN."Guarantor Amount Paid" AS Guarantor_Amount_Paid,
MWTRN."Adjustment Amount" AS Adjustment_Amount,
(MWRPH."First Name" + MWRPH."Last Name") AS Referring_Provider,
MWRPH."Code" as Referring_Provider_Code
FROM MWTRN
INNER JOIN MWCAS MWCAS ON
(MWCAS."Case Number" = MWTRN."Case Number")
INNER JOIN MWINS MWINS ON
(MWINS."Code" = MWCAS."Insurance Carrier #1")
INNER JOIN MWDIA DIA ON
MWTRN."Diagnosis Code 1" = DIA."Code 1"
left outer JOIN MWDIA DIA2 ON
MWTRN."Diagnosis Code 2" = DIA2."Code 1"
INNER JOIN MWPAT MWPAT ON
(MWPAT."Chart Number" = MWTRN."Chart Number")
INNER JOIN MWPRO MWPRO ON
(MWTRN."Procedure Code" = MWPRO."Code 1")
left outer JOIN MWRPH ON
MWCAS."Referring Provider" = MWRPH."Code"
INNER JOIN MWCLA MWCLA ON
(MWCLA."Claim Number" = MWTRN."Claim Number")
WHERE (MWTRN."Transaction Type" BETWEEN 'A' AND 'H') AND
(MWTRN."Date From" >= '01/1/2015') AND (MWCLA."Claim Status 1" in ('2', '3', '4', '6'))) A
//Primary Payments (MWPRI)
LEFT OUTER JOIN
(Select distinct MWTRN."Entry Number", MAX(MWTRN2."Date From") as "Date From"
from MWTRN INNER JOIN MWPAX ON
MWPAX."Charge Reference" = MWTRN."Entry Number"
INNER JOIN MWTRN MWTRN2 ON
MWPAX."Payment Reference" = MWTRN2."Entry Number"
Where MWPAX."Who Paid" = '1' and MWPAX."Payment Amount" < 0
and MWTRN2."Transaction Type" in ('I', 'M')
group by MWTRN."Entry Number") MWPRI ON
A."Entry Number" = MWPRI."Entry Number"
//Gather Secondary Payments (MWSEC)
left outer JOIN
(Select distinct MWTRN."Entry Number", MAX(MWTRN2."Date From") as "Date From"
from MWTRN INNER JOIN MWPAX ON
MWPAX."Charge Reference" = MWTRN."Entry Number"
INNER JOIN MWTRN MWTRN2 ON
MWPAX."Payment Reference" = MWTRN2."Entry Number"
Where MWPAX."Who Paid" = '2' and MWTRN2."Transaction Type" in ('I', 'M')
group by MWTRN."Entry Number") MWSEC ON
A."Entry Number" = MWSEC."Entry Number"
left outer JOIN
//Gather Guarantor Payments (MWGUA)
(Select distinct MWTRN."Entry Number", MAX(MWTRN2."Date From") as "Date From"
from MWTRN INNER JOIN MWPAX ON
MWPAX."Charge Reference" = MWTRN."Entry Number"
INNER JOIN MWTRN MWTRN2 ON
MWPAX."Payment Reference" = MWTRN2."Entry Number"
Where MWPAX."Who Paid" = 'G'
group by MWTRN."Entry Number") MWGUA ON
A."Entry Number" = MWGUA."Entry Number"
//Deductible Stuff (D)
left outer join
(Select abs(sum(cast(MWPAX."Payment Amount" as SQL_NUMERIC(9,2)))) as DED, MWTRN."Entry Number", MWTRN."Chart Number" from MWTRN INNER JOIN MWPAX on MWTRN."Entry Number" = MWPAX."Charge Reference"
inner join MWTRN MWTRN2 on MWPAX."Payment Reference" = MWTRN2."Entry Number"
Where MWTRN2."Transaction Type" = 'P'
group by MWTRN."Chart Number", MWTRN."Entry Number") D
on D."Entry Number" = A."Entry Number"
//I have no clue (I)
left outer join (Select sum(cast((Substring(replace(MWTRN."Description", ',', ''), (LOCATE('$', MWTRN."Description") +1),
((LOCATE(' ', MWTRN."Description") -1) - (LOCATE('$', MWTRN."Description") +1) ))) as SQL_Numeric(9,2))) as ERA_DED, mwtrn2."Entry Number", MWTRN2."Chart Number" from MWTRN
INNER JOIN MWPAX on MWTRN."Entry Number" = MWPAX."Payment Reference"
inner join MWTRN MWTRN2 on MWPAX."Charge Reference" = MWTRN2."Entry Number"
Where MWTRN."Description" like 'ERA:Deductible=%' or MWTRN."Description" like 'ERA:PR1=%'
group by MWTRN2."Chart Number", MWTRN2."Entry Number") I
ON I."Entry Number" = A."Entry Number"
left outer join
(Select "Charge Reference" as CRef,
(Case When MWDEP."Deposit Code" = 'A' Then 'ERA_Payment_Posting'
When MWDEP."Deposit Code" = 'B' Then 'ERA_Payment_Confirmed'
When MWDEP."Deposit Code" = 'F' Then 'Paid_Confirmed_Aging_To_Facility'
When MWDEP."Deposit Code" = 'G' Then 'Paid_Per_Check_To_Facility'
When MWDEP."Deposit Code" = 'J' Then 'Paid_Per_AR_To_Patient'
When MWDEP."Deposit Code" = 'K' Then 'Paid_Per_Check_To_Patient'
When MWDEP."Deposit Code" = 'N' Then 'Paid_Per_Aging_To_Facility'
Else 'Unpaid' End) as Payment_Status,
sum(Case When MWDEP."Deposit Code" in ('A', 'B', 'E', 'F', 'G', 'J', 'K', 'N') Then (Cast(MWPAX."Payment Amount" as
SQL_NUMERIC(9,2))) Else 0 End) as Total_Deposit,
Sum(Case WHen MWTRN."Transaction Type" = 'P' Then (Cast(MWPAX."Payment Amount" as SQL_NUMERIC(9,2))) Else 0 End) as D,
Sum(Case WHen MWTRN."Transaction Type" in ('J', 'K', 'L') Then (Cast(MWPAX."Payment Amount" as SQL_NUMERIC(9,2))) Else 0
End) as C,
Sum(Case WHen MWTRN."Transaction Type" in ('M', 'N', 'O') Then (Cast(MWPAX."Payment Amount" as SQL_NUMERIC(9,2))) Else 0
End) as P
from MWPAX
inner join MWDEP on
MWDEP."Entry Number" = MWPAX."Deposit ID"
inner join MWTRN on
MWTRN."Entry Number" = MWPAX."Payment Reference" where MWTRN."Transaction Type" in ('I', 'J', 'K', 'N', 'O', 'P')
Group By Cref, Payment_Status ) B
ON A."Entry Number" = B.CREF
// Group BY A.Chart_Number, A.Procedure_Code, A."First Name", A."Last Name", A.Insurance_Class, A.MonthofYear, A.TheYear,A.Blank,

Binary file not shown.

View File

@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<section name="quickftp.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false"/>
</sectionGroup>
</configSections>
<userSettings>
<quickftp.Properties.Settings>
<setting name="AdvantagePath" serializeAs="String">
<value>\\medisoft_server\medidata\EMBARK RECOVERY LLC\mwddf.add</value>
</setting>
<setting name="AdvantageUser" serializeAs="String">
<value>user</value>
</setting>
<setting name="AdvantagePass" serializeAs="String">
<value>password</value>
</setting>
</quickftp.Properties.Settings>
</userSettings>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<section name="quickftp.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false"/>
</sectionGroup>
</configSections>
<userSettings>
<quickftp.Properties.Settings>
<setting name="AdvantagePath" serializeAs="String">
<value>\\medisoft_server\medidata\EMBARK RECOVERY LLC\mwddf.add</value>
</setting>
<setting name="AdvantageUser" serializeAs="String">
<value>user</value>
</setting>
<setting name="AdvantagePass" serializeAs="String">
<value>password</value>
</setting>
</quickftp.Properties.Settings>
</userSettings>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>

View File

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
<requestedExecutionLevel level="asInvoker" uiAccess="false"/>
</requestedPrivileges>
</security>
</trustInfo>
</assembly>

View File

@@ -0,0 +1,11 @@
C:\Users\DieSonne99\Desktop\panaceantech\QuickFTP\quickftp\bin\Release\quickftp.exe.config
C:\Users\DieSonne99\Desktop\panaceantech\QuickFTP\quickftp\bin\Release\quickftp.exe
C:\Users\DieSonne99\Desktop\panaceantech\QuickFTP\quickftp\bin\Release\quickftp.pdb
C:\Users\DieSonne99\Desktop\panaceantech\QuickFTP\quickftp\bin\Release\log4net.dll
C:\Users\DieSonne99\Desktop\panaceantech\QuickFTP\quickftp\bin\Release\Sdaleo.dll
C:\Users\DieSonne99\Desktop\panaceantech\QuickFTP\quickftp\bin\Release\SMFTP.dll
C:\Users\DieSonne99\Desktop\panaceantech\QuickFTP\quickftp\bin\Release\Yaulw.dll
C:\Users\DieSonne99\Desktop\panaceantech\QuickFTP\quickftp\bin\Release\Advantage.Data.Provider.dll
C:\Users\DieSonne99\Desktop\panaceantech\QuickFTP\quickftp\obj\Release\quickftp.exe
C:\Users\DieSonne99\Desktop\panaceantech\QuickFTP\quickftp\obj\Release\quickftp.pdb
C:\Users\DieSonne99\Desktop\panaceantech\QuickFTP\quickftp\obj\Release\quickftp.csprojResolveAssemblyReference.cache

Binary file not shown.

Binary file not shown.