Created
March 22, 2019 16:38
-
-
Save eedrummer/24d1c304b31d717314fb2e6829ba9556 to your computer and use it in GitHub Desktop.
HL7 GForge Comment Processor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'csv' | |
require 'erb' | |
comments = CSV.read('/Users/andrewg/Downloads/quickquery.csv', headers: true, quote_char: '|') | |
submitters = comments.map {|c| c['Real Submitter']}.uniq.sort | |
template = ERB.new <<-EOF | |
<html> | |
<head> | |
<title>Block Vote</title> | |
</head> | |
<body> | |
<h1>Comment Submitters</h1> | |
<ul> | |
<% submitters.each do |s| %> | |
<li><%= s %></li> | |
<% end %> | |
</ul> | |
<h1>Line Items</h1> | |
<ul> | |
<% comments.each do |c| %> | |
<li> | |
<a href="https://gforge.hl7.org/gf/project/fhir/tracker/?action=TrackerItemEdit&tracker_item_id=<%= c["TrackerItemID"] %>&start=0"><%= c["TrackerItemID"] %></a> | |
<%= c["Summary"] %> | |
(<%= c["Real Submitter"] %>) | |
<%= c["Ballot Resolution"] %> | |
</li> | |
<% end %> | |
</ul> | |
</body> | |
</html> | |
EOF | |
out = File.open('vote.html', 'w+') | |
out << template.result(binding) | |
out.close |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment