No CSVs found in <%= Dir.pwd %>/csvs/<%= @subject_loader.csv_directory %>/
CSV | Coverage | Total | Columns Defined | Columns Missed |
---|---|---|---|---|
Variables Not Found in Any CSV | <%= number_with_delimiter(@extra_variable_ids.size) %> |
|||
Domains Not Referenced by Any Variable | <%= number_with_delimiter(@extra_domain_ids.size) %> |
|||
<%= csv %> | <% if total_column_count.to_i > 0 %> <%= "%0.02f %" % (mapped_column_count * 100.0 / total_column_count) %> <% else %> --- <% end %> | <%= number_with_delimiter(total_column_count) %> |
<%= number_with_delimiter(mapped_column_count) %> |
<%= number_with_delimiter(total_column_count - mapped_column_count) %> |
Error | Domain | File | Solution |
---|---|---|---|
Not referenced by any variable | <%= domain_id %> | <%= domain_id %>.json |
Recommend to remove this domain from data dictionary as no existing variable references the domain. |
CSV | Column | JSON File | Variable ID | Variable Type | Variable Domain | Values |
---|---|---|---|---|---|---|
Coverage |
<%= total_count = @matching_results.count %> |
<% matched = @matching_results.count{|csv_files, column, scr| scr.file_name_test} %>
<% matched_percent = (total_count == 0 ? 0 : (matched * 100.0 / total_count).floor) %>
<% missing_percent = 100 - matched_percent %>
<%= number_with_delimiter(matched) %> of <%= number_with_delimiter(total_count) %>
|
<% matched = @matching_results.count{|csv_files, column, scr| scr.json_id_test} %>
<% matched_percent = (total_count == 0 ? 0 : (matched * 100.0 / total_count).floor) %>
<% missing_percent = 100 - matched_percent %>
<%= number_with_delimiter(matched) %> of <%= number_with_delimiter(total_count) %>
|
<% matched = @matching_results.count{|csv_files, column, scr| scr.variable_type_test} %>
<% matched_percent = (total_count == 0 ? 0 : (matched * 100.0 / total_count).floor) %>
<% missing_percent = 100 - matched_percent %>
<%= number_with_delimiter(matched) %> of <%= number_with_delimiter(total_count) %>
|
<% matched = @matching_results.count{|csv_files, column, scr| scr.json["type"] == "choices" and scr.domain_test} %>
<% total_count = @matching_results.count{|csv_files, column, scr| scr.json["type"] == "choices"} %>
<% matched_percent = (total_count == 0 ? 0 : (matched * 100.0 / total_count).floor) %>
<% missing_percent = 100 - matched_percent %>
<%= number_with_delimiter(matched) %> of <%= number_with_delimiter(total_count) %>
|
|
Not in any CSV file | <%= variable_id %> | <%= variable_id %>.json |
Recommend to remove this variable from data dictionary as this variable does not exist in any CSV. | |||
<% csv_files.each do |csv_file| %>
"><%= csv_file.gsub(/^csvs\/#{@subject_loader.csv_directory}\//, "") %> <% end %> |
<%= column %> |
<% if scr.file_name_test %>
<% else %>
<%= column %>.json missing
<% end %>
|
<% if scr.file_name_test %>
<% if scr.json_id_test %>
"id": "<%= column %>"
<% else %>
"id": <%= scr.json["id"].inspect %>
<% end %>
<% end %>
|
<% if scr.file_name_test %>
">"type": <%= scr.json["type"].inspect %>
<% end %>
|
<% if (scr.json["type"] == "choices" || scr.json["domain"].to_s.downcase.strip != "") && scr.file_name_test %>
<% if scr.domain_test || scr.json["domain"].to_s.strip == "" %>
">"domain": <%= scr.json["domain"].inspect %>
<% else %>
<%= scr.json["domain"] %>.json missing
<% end %>
<% end %>
|
<% if scr.json["type"] == "choices" || scr.json["domain"].to_s.downcase.strip != "" %>
<% unused_domain_values = scr.valid_values - scr.csv_values %>
<% unused_values = (scr.valid_values | scr.csv_values) - (scr.valid_values & scr.csv_values) %>
<% if scr.values_test && unused_values.empty? %>
<% else %>
<% (scr.valid_values + scr.csv_values.compact.sort).uniq.each do |value| %>
<% value_as_number = format("%g", value) rescue value_as_number = nil %>
<% next if !scr.valid_values.include?(value) && %w(numeric integer).include?(scr.json["type"]) && !value_as_number.nil? %>
<% class_type = "" %>
<% class_type = "success" if scr.valid_values.include?(value) %>
<% class_type = "default" if unused_domain_values.include?(value) %>
<%= value %>
<% end %>
<% end %>
<% end %>
|