Skip to content

Instantly share code, notes, and snippets.

@eedrummer
Created March 22, 2019 16:38
Show Gist options
  • Save eedrummer/24d1c304b31d717314fb2e6829ba9556 to your computer and use it in GitHub Desktop.
Save eedrummer/24d1c304b31d717314fb2e6829ba9556 to your computer and use it in GitHub Desktop.
HL7 GForge Comment Processor
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