/
LoadandMatchMetricsNames.cs
78 lines (66 loc) · 3.15 KB
/
LoadandMatchMetricsNames.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Excel = Microsoft.Office.Interop.Excel;
namespace ProviderDashboards
{
class MetricName
{
string fileName = "";//use this to keep track of the file name
int columnId; // this is the column it comes from or goes to depending on the report
string metricName = ""; //use this to display the metric name from the file if needed
public MetricName(String fileName, String metricName, int columnID)
{
this.fileName = fileName;
this.metricName = metricName;
this.columnId = columnID;
}
}
class LoadandMatchMetricsNames
{
private Excel.Application app = null;
private Excel.Workbook dashboard = null;
private Excel.Workbook metrics = null;
private Excel.Worksheet worksheet = null;
private Excel.Range workSheet_range = null;
/*
* use these to store the matches between metrics name / location on the dashboard
* to the metrics name / location on each metrics file
* string = metrics name
* Pair,int,int> = keeps the locaiton first of the dshboard metrics then the metric file location
*/
private Dictionary<MetricName, MetricName> diabetesMetrics = new Dictionary<MetricName, MetricName>();
private Dictionary<MetricName, MetricName> depressionMetrics = new Dictionary<MetricName, MetricName>();
private Dictionary<MetricName, MetricName> asthmaMetrics = new Dictionary<MetricName, MetricName>();
private Dictionary<MetricName, MetricName> cardiovascularMetrics = new Dictionary<MetricName, MetricName>();
private Dictionary<MetricName, MetricName> preventiveMetrics = new Dictionary<MetricName, MetricName>();
public LoadandMatchMetricsNames(String dashboardFile)
{
try
{
app = new Excel.Application();
app.Visible = true;
dashboard = app.Workbooks.Open(dashboardFile,
Type.Missing, Type.Missing, Type.Missing, Type.Missing,
Type.Missing, Type.Missing, Type.Missing, Type.Missing,
Type.Missing, Type.Missing, Type.Missing, Type.Missing,
Type.Missing, Type.Missing);
/* for (int i = 0; i < metricsFiles.Length; i++)
{
metrics = app.Workbooks.Open(metricsFiles[i],
Type.Missing, Type.Missing, Type.Missing, Type.Missing,
Type.Missing, Type.Missing, Type.Missing, Type.Missing,
Type.Missing, Type.Missing, Type.Missing, Type.Missing,
Type.Missing, Type.Missing);
//this is where we read all the data into some sort of array
//ExcelScanInternal(metrics);
metrics.Close(false, metricsFiles[i], null);
} */
//cleanup
//dashboard.Close(false, dashboardFile, null);
}
catch (Exception ex) { Console.WriteLine(ex.Message); }
}
}
}