Skip to content

Commit

Permalink
add medication to section registry, atom feeds fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
ssayer committed Apr 2, 2012
1 parent 3e05022 commit 61f62e3
Show file tree
Hide file tree
Showing 10 changed files with 56 additions and 79 deletions.
42 changes: 21 additions & 21 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
GIT
remote: http://github.com/projectcypress/health-data-standards.git
revision: 72bb495ca6759acad843d8a0a53c7a4b7a4d1ff6
revision: 5cbf5d09c45e2cc6974336fc62cfc347efbb1487
branch: develop
specs:
health-data-standards (0.8.0)
Expand Down Expand Up @@ -96,10 +96,10 @@ GEM
eventmachine (0.12.10)
execjs (1.3.0)
multi_json (~> 1.0)
factory_girl (2.6.3)
activesupport (>= 2.3.9)
factory_girl_rails (1.7.0)
factory_girl (~> 2.6.0)
factory_girl (3.0.0)
activesupport (>= 3.0.0)
factory_girl_rails (3.0.0)
factory_girl (~> 3.0.0)
railties (>= 3.0.0)
feedzirra (0.0.31)
activesupport (>= 3.0.8)
Expand All @@ -112,11 +112,11 @@ GEM
rdoc (~> 3.8)
sax-machine (~> 0.0.20)
hashie (1.2.0)
heroku (2.21.2)
heroku (2.23.0)
launchy (>= 0.3.2)
netrc (~> 0.7.1)
rest-client (~> 1.6.1)
rubyzip
term-ansicolor (~> 1.0.5)
highline (1.6.11)
hike (1.2.1)
httpclient (2.2.4)
Expand All @@ -125,53 +125,54 @@ GEM
jquery-rails (2.0.1)
railties (>= 3.2.0, < 5.0)
thor (~> 0.14)
json (1.6.5)
json (1.6.6)
kaminari (0.13.0)
actionpack (>= 3.0.0)
activesupport (>= 3.0.0)
railties (>= 3.0.0)
launchy (2.0.5)
launchy (2.1.0)
addressable (~> 2.2.6)
libv8 (3.3.10.4)
loofah (1.0.0)
nokogiri (>= 1.3.3)
macaddr (1.5.0)
systemu (>= 2.4.0)
mail (2.4.3)
mail (2.4.4)
i18n (>= 0.4.0)
mime-types (~> 1.16)
treetop (~> 1.4.8)
method_source (0.7.1)
mime-types (1.17.2)
minitest (2.11.3)
mime-types (1.18)
minitest (2.11.4)
mongo (1.6.1)
bson (~> 1.6.1)
mongoid (2.4.6)
mongoid (2.4.7)
activemodel (~> 3.1)
mongo (~> 1.3)
tzinfo (~> 0.3.22)
multi_json (1.1.0)
multi_json (1.2.0)
net-scp (1.0.4)
net-ssh (>= 1.99.1)
net-sftp (2.0.5)
net-ssh (>= 2.0.9)
net-ssh (2.3.0)
net-ssh-gateway (1.1.0)
net-ssh (>= 1.99.1)
netrc (0.7.1)
nokogiri (1.4.7)
omniauth (1.0.3)
hashie (~> 1.2)
rack
omniauth-openid (1.0.1)
omniauth (~> 1.0)
rack-openid (~> 1.3.1)
orm_adapter (0.0.6)
orm_adapter (0.0.7)
polyglot (0.3.3)
pry (0.9.8.4)
coderay (~> 1.0.5)
method_source (~> 0.7.1)
slop (>= 2.4.4, < 3)
pry-nav (0.1.0)
pry-nav (0.2.0)
pry (~> 0.9.8.1)
rack (1.4.1)
rack-cache (1.2)
Expand Down Expand Up @@ -212,7 +213,7 @@ GEM
mime-types (>= 1.16)
rubyzip (0.9.6.1)
sass (3.1.15)
sass-rails (3.2.4)
sass-rails (3.2.5)
railties (~> 3.2.0)
sass (>= 3.1.10)
tilt (~> 1.3)
Expand All @@ -225,8 +226,7 @@ GEM
tilt (~> 1.1, != 1.3.0)
symbolize (4.2.0)
systemu (2.5.0)
term-ansicolor (1.0.7)
therubyracer (0.9.10)
therubyracer (0.10.0)
libv8 (~> 3.3.10)
thin (1.3.1)
daemons (>= 1.0.9)
Expand All @@ -237,10 +237,10 @@ GEM
treetop (1.4.10)
polyglot
polyglot (>= 0.3.1)
turn (0.9.3)
turn (0.9.4)
ansi
tzinfo (0.3.32)
uglifier (1.2.3)
uglifier (1.2.4)
execjs (>= 0.3.0)
multi_json (>= 1.0.2)
uuid (2.3.5)
Expand Down
14 changes: 0 additions & 14 deletions app/views/entries/_entry.atom.erb

This file was deleted.

11 changes: 11 additions & 0 deletions app/views/entries/index.atom.builder
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
atom_feed do |feed|

@entries.each do |entry|

feed.entry(entry, url: section_document_path(@record.medical_record_number, @section_name, entry.id), type: "application/xml") do |atom_entry|
atom_entry.link(rel: "alternate", type: Mime::XML, href: section_document_path(@record.medical_record_number, @section_name, entry))
atom_entry.link(rel: "alternate", type: Mime::Json, href: section_document_path(@record.medical_record_number, @section_name, entry))
end

end
end
12 changes: 0 additions & 12 deletions app/views/entries/index.atom.erb

This file was deleted.

9 changes: 9 additions & 0 deletions app/views/records/index.atom.builder
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
atom_feed do |feed|
@records.each do |record|
feed.entry(record, url: root_feed_url(record.medical_record_number)) do |entry|
entry.link rel: "alternate", type: Mime::Atom, href: root_feed_url(record.medical_record_number)
entry.link rel: "root", type: Mime::XML, href: root_document_url(record.medical_record_number)
entry.title record.last + ', ' + record.first
end
end
end
11 changes: 0 additions & 11 deletions app/views/records/index.atom.erb

This file was deleted.

11 changes: 11 additions & 0 deletions app/views/records/show.atom.builder
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
atom_feed do |feed|
feed.entry("c32", url: root_feed_url(@record.medical_record_number), id: "/c32") do |entry|

end
SectionRegistry.instance.extensions.each do |section|
feed.entry(section.name, url: section_feed_url(@record.medical_record_number, section.path), id: "/#{section.path}") do |atom_entry|
atom_entry.link(rel: "alternate", type: Mime::Atom, href: section_feed_url(@record.medical_record_number, section.path))
atom_entry.title(section.name)
end
end
end
15 changes: 0 additions & 15 deletions app/views/records/show.atom.erb

This file was deleted.

5 changes: 0 additions & 5 deletions app/views/shared/_section.atom.erb

This file was deleted.

5 changes: 4 additions & 1 deletion config/initializers/hdata_sections.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@
end
sr.add_section('immunizations', 'http://projecthdata.org/extension/immunization', 'Immunizations')
sr.add_section('medical_equipment', 'http://projecthdata.org/extension/medical-equipment', 'Medical Equipment')
sr.add_section('medications', 'http://projecthdata.org/extension/medication', 'Medications')
sr.add_section('medications', 'http://projecthdata.org/extension/medication', 'Medications') do |importers, exporters|
importers['application/xml'] = HealthDataStandards::Import::GreenC32::MedicationImporter.instance
exporters['application/xml'] = HealthDataStandards::Export::GreenC32::ExportGenerator.create_exporter_for(:medication)
end
sr.add_section('procedures', 'http://projecthdata.org/extension/procedure', 'Procedures') do |importers, exporters|
importers['application/xml'] = HealthDataStandards::Import::GreenC32::ProcedureImporter.instance
exporters['application/xml'] = HealthDataStandards::Export::GreenC32::ExportGenerator.create_exporter_for(:procedure)
Expand Down

0 comments on commit 61f62e3

Please sign in to comment.