Skip to content
This repository was archived by the owner on Feb 12, 2021. It is now read-only.

Commit 4e45950

Browse files
committed
Added a few minor fixes to the master report generation utils.
1 parent 900cf3f commit 4e45950

2 files changed

Lines changed: 13 additions & 6 deletions

File tree

lib/util/AttachedActivePatientsReport.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ var AttachedActivePatientReport = function (data, dayOfMonth, proc) {
154154

155155
s += "\n";
156156

157+
var count = 0;
157158
for (var c in byProvider) {
158159

159160
s += "clinic_" + c + ",";
@@ -168,10 +169,12 @@ var AttachedActivePatientReport = function (data, dayOfMonth, proc) {
168169
continue;
169170
}
170171

171-
s += "provider_" + p + ",";
172+
s += "clinic_" + c + "_provider_" + count + ",";
172173
s += proc.getSubReport(byProvider[c][p]);
173174
s += "\n";
174175

176+
count++;
177+
175178
}
176179

177180
}

lib/util/ThirdNextReport.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,10 @@ var ThirdNextReport = function (data, dayOfMonth, proc) {
132132
var tmp = new Date(val.date * 1000);
133133

134134
if (tmp.getDate() === proc.dayOfMonth) {
135+
logger.info("Keeping record with date: " + tmp);
135136
return true;
136137
}
138+
logger.info("Filtering out record, had date: " + tmp + " not " + proc.dayOfMonth + " as wanted.");
137139
return false;
138140

139141
});
@@ -215,24 +217,26 @@ var ThirdNextReport = function (data, dayOfMonth, proc) {
215217

216218
var getProviderLevelReport = function (data) {
217219

220+
throw new Error("This report does not support provider level data! The reporting requirements are such that provider level data does not make sense. Please refer to the requirements in Polarian for details.");
221+
218222
};
219223

220224
/**
221-
* @param clinic {Boolean} - If this is true, will generate report based on clinic level data.
225+
* @param provider {Boolean} - If this is true, will generate report based on provider level data.
222226
* If this param is false, will generate report with anony. physicians.
223227
* @returns {String} - the report string.
224228
*/
225-
var getReport = function (clinic) {
229+
var getReport = function (provider) {
226230

227231
logger.warn(util.inspect(data, false, null));
228232

229-
if (clinic === true) {
233+
if (provider === true) {
230234

231-
return proc.getClinicLevelReport(data);
235+
return proc.getProviderLevelReport(data);
232236

233237
} else {
234238

235-
return proc.getProviderLevelReport(data);
239+
return proc.getClinicLevelReport(data);
236240

237241
}
238242

0 commit comments

Comments
 (0)