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

BIN
QuickFTP/gQuery/3rdparty/ADSLOC32.dll vendored Normal file

Binary file not shown.

BIN
QuickFTP/gQuery/3rdparty/Ace32.dll vendored Normal file

Binary file not shown.

Binary file not shown.

BIN
QuickFTP/gQuery/3rdparty/SMFTP.dll vendored Normal file

Binary file not shown.

BIN
QuickFTP/gQuery/3rdparty/Sdaleo.dll vendored Normal file

Binary file not shown.

BIN
QuickFTP/gQuery/3rdparty/Yaulw.dll vendored Normal file

Binary file not shown.

BIN
QuickFTP/gQuery/3rdparty/axcws32.dll vendored Normal file

Binary file not shown.

BIN
QuickFTP/gQuery/3rdparty/log4net.dll vendored Normal file

Binary file not shown.

163
QuickFTP/gQuery/Program.cs Normal file
View File

@@ -0,0 +1,163 @@
using Sdaleo;
using Sdaleo.Systems.Advantage;
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))
{
Console.WriteLine("Advantage settings blank or null");
return;
}
AdvantageCredential cred = new AdvantageCredential(path, user, pass, AdvantageCredential.ServerType.REMOTE_LOCAL);
if(!cred.IsValid)
{
Console.WriteLine("Advantage connection invalid");
return;
}
string query1 = ReadQuery("query1.txt");
if (String.IsNullOrEmpty(query1))
return;
DB db = DB.Create(cred);
DBRetVal retVal = db.FillDataTable(query1);
if(!retVal.IsValid)
{
Console.WriteLine(retVal.ErrorMsg);
return;
}
try
{
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);
}
SendFileToSFTP(fpath + "\\" + fname + ".csv");
Process.GetCurrentProcess().Close();
}
public static string ReadQuery(string filename)
{
try
{ // Open the text file using a stream reader.
using (StreamReader sr = new StreamReader(filename))
{
// Read the stream to a string, and write the string to the console.
String line = sr.ReadToEnd();
return line;
}
}
catch (Exception e)
{
Console.WriteLine(String.Format("The file could not be read: {0}", filename));
Console.WriteLine(e.Message);
}
return "";
}
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)
// bSuccess = client.CmdExec_LocalDirSet("c:\\out", true);
//if (bSuccess)
// bSuccess = client.CmdExe_MGetDir(true, "out/997");
//if (bSuccess)
// bSuccess = client.CmdExec_RemoteDirSet("in");
//if (bSuccess)
// bSuccess = client.CmdExec_LocalDirSet("c:\\out\\997", true);
//if (bSuccess)
// 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

@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("quickftp")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("quickftp")]
[assembly: AssemblyCopyright("Copyright © 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("b162650e-fa54-4bed-b066-f2758a79eeec")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -0,0 +1,62 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace quickftp.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "12.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default {
get {
return defaultInstance;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("\\\\medisoft_server\\medidata\\EMBARK RECOVERY LLC\\mwddf.add")]
public string AdvantagePath {
get {
return ((string)(this["AdvantagePath"]));
}
set {
this["AdvantagePath"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("user")]
public string AdvantageUser {
get {
return ((string)(this["AdvantageUser"]));
}
set {
this["AdvantageUser"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("password")]
public string AdvantagePass {
get {
return ((string)(this["AdvantagePass"]));
}
set {
this["AdvantagePass"] = value;
}
}
}
}

View File

@@ -0,0 +1,15 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="quickftp.Properties" GeneratedClassName="Settings">
<Profiles />
<Settings>
<Setting Name="AdvantagePath" Type="System.String" Scope="User">
<Value Profile="(Default)">\\medisoft_server\medidata\EMBARK RECOVERY LLC\mwddf.add</Value>
</Setting>
<Setting Name="AdvantageUser" Type="System.String" Scope="User">
<Value Profile="(Default)">user</Value>
</Setting>
<Setting Name="AdvantagePass" Type="System.String" Scope="User">
<Value Profile="(Default)">password</Value>
</Setting>
</Settings>
</SettingsFile>

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.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

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>

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

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,81 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{E0B1E1C9-AF77-424A-9F00-CDD27C499350}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>quickftp</RootNamespace>
<AssemblyName>quickftp</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>x86</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>x86</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="log4net">
<HintPath>..\..\sFTPlugins\3rdParty\log4net.dll</HintPath>
</Reference>
<Reference Include="Sdaleo, Version=1.0.0.0, Culture=neutral, processorArchitecture=x86">
<SpecificVersion>False</SpecificVersion>
<HintPath>3rdparty\Sdaleo.dll</HintPath>
</Reference>
<Reference Include="SMFTP">
<HintPath>3rdparty\SMFTP.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.configuration" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="Yaulw">
<HintPath>..\..\sFTPlugins\3rdParty\Yaulw.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
<DependentUpon>Settings.settings</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

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

Binary file not shown.

Binary file not shown.

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.