diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..64b274f Binary files /dev/null and b/.DS_Store differ diff --git a/Gemfile.lock b/Gemfile.lock index c939219..f71e5e5 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -4,13 +4,13 @@ PATH ruby-cda (0.3.0) activesupport (>= 5.0) i18n (>= 1) - nokogiri (>= 1.6) + nokogiri (>= 1.13.4) virtus (>= 1.0) GEM remote: https://rubygems.org/ specs: - activesupport (7.0.2.3) + activesupport (7.0.4) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 1.6, < 2) minitest (>= 5.1) @@ -25,35 +25,35 @@ GEM concurrent-ruby (1.1.10) descendants_tracker (0.0.4) thread_safe (~> 0.3, >= 0.3.1) - diff-lcs (1.4.4) - i18n (1.10.0) + diff-lcs (1.5.0) + i18n (1.12.0) concurrent-ruby (~> 1.0) ice_nine (0.11.2) mini_portile2 (2.8.0) - minitest (5.15.0) - nokogiri (1.13.3) + minitest (5.16.3) + nokogiri (1.13.8) mini_portile2 (~> 2.8.0) racc (~> 1.4) racc (1.6.0) - rspec (3.10.0) - rspec-core (~> 3.10.0) - rspec-expectations (~> 3.10.0) - rspec-mocks (~> 3.10.0) + rspec (3.11.0) + rspec-core (~> 3.11.0) + rspec-expectations (~> 3.11.0) + rspec-mocks (~> 3.11.0) rspec-collection_matchers (1.2.0) rspec-expectations (>= 2.99.0.beta1) - rspec-core (3.10.1) - rspec-support (~> 3.10.0) - rspec-expectations (3.10.1) + rspec-core (3.11.0) + rspec-support (~> 3.11.0) + rspec-expectations (3.11.1) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.10.0) - rspec-mocks (3.10.2) + rspec-support (~> 3.11.0) + rspec-mocks (3.11.1) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.10.0) - rspec-support (3.10.2) - rspec_junit_formatter (0.4.1) + rspec-support (~> 3.11.0) + rspec-support (3.11.1) + rspec_junit_formatter (0.6.0) rspec-core (>= 2, < 4, != 2.12.0) thread_safe (0.3.6) - tzinfo (2.0.4) + tzinfo (2.0.5) concurrent-ruby (~> 1.0) virtus (2.0.0) axiom-types (~> 0.1) diff --git a/lib/ccd/autoloads.rb b/lib/ccd/autoloads.rb index 677b0e0..015d2d3 100644 --- a/lib/ccd/autoloads.rb +++ b/lib/ccd/autoloads.rb @@ -276,7 +276,9 @@ module Ccd autoload :ProductInstance, 'ccd/models/product_instance.rb' autoload :ProductInstanceTemplate, 'ccd/templates/product_instance_template.rb' autoload :ProgressNote, 'ccd/models/progress_note.rb' + autoload :ProgressNoteAct, 'ccd/models/progress_note_act.rb' autoload :ProgressNoteTemplate, 'ccd/templates/progress_note_template.rb' + autoload :ProgressNoteActTemplate, 'ccd/templates/progress_note_act_template.rb' autoload :PurposeOfReferenceObservation, 'ccd/models/purpose_of_reference_observation.rb' autoload :PurposeOfReferenceObservationTemplate, 'ccd/templates/purpose_of_reference_observation_template.rb' autoload :QuantityMeasurementObservation, 'ccd/models/quantity_measurement_observation.rb' diff --git a/lib/ccd/models/progress_note_act.rb b/lib/ccd/models/progress_note_act.rb new file mode 100644 index 0000000..1895fdc --- /dev/null +++ b/lib/ccd/models/progress_note_act.rb @@ -0,0 +1,11 @@ +module Ccd + class ProgressNoteAct < Cda::Act + include Ccd::ProgressNoteActTemplate + + def self.template_type + "act" + end + + Ccd.load_extension('progress_note_act.rb') + end +end diff --git a/lib/ccd/templates/progress_note_act_template.rb b/lib/ccd/templates/progress_note_act_template.rb new file mode 100644 index 0000000..824097e --- /dev/null +++ b/lib/ccd/templates/progress_note_act_template.rb @@ -0,0 +1,30 @@ +module Ccd::ProgressNoteActTemplate + def self.include(base) + base.class_eval do + extend ::Ccd::Dsl + + # SHALL contain exactly one [1..1] @classCode="ACT" (CodeSystem: HL7ActClass 2.16.840.1.113883.5.6 STATIC) (CONF:7469). + constraint 'class_code', {:cardinality=>"1..1", :value=>"ACT"} + + # SHALL contain exactly one [1..1] @moodCode="EVN" Event (CodeSystem: ActMood 2.16.840.1.113883.5.1001 STATIC) (CONF:7470). + constraint 'mood_code', {:cardinality=>"1..1", :value=>"EVN"} + + # SHALL contain exactly one [1..1] @root="2.16.840.1.113883.10.20.22.4.202" (CONF:10489). + constraint 'template_id', {:cardinality=>"1..1", :value=>{:root=>"2.16.840.1.113883.10.20.22.4.202", :extension=>"2016-11-01"}} + + # SHALL contain exactly one [1..1] code (CONF:7477). + constraint 'code', {:cardinality=>"1..1", :value=>{:code=>"34109-9", :display_name=>"Note", :code_system=>"2.16.840.1.113883.6.1", :codeSystemName=>"LOINC"}} + + constraint 'code.translation', {:cardinality=>"1..1", :value=>{:code=>"11506-3", :display_name=>"ProgressNote", :code_system=>"2.16.840.1.113883.6.1", :codeSystemName=>"LOINC"}} + + # SHALL contain exactly one [1..1] text (CONF:7270). + constraint 'text', {:cardinality=>"1..1"} + + # This statusCode SHALL contain exactly one [1..1] @code, which SHALL be selected from ValueSet ProblemAct statusCode 2.16.840.1.113883.11.20.9.19 STATIC 2011-09-09 (CONF:19086). + constraint 'status_code.code', {:cardinality=>"1..1"} + + # SHALL contain exactly one [1..1] effectiveTime (CONF:7498). + constraint 'effective_time', {:cardinality=>"1..1"} + end + end +end \ No newline at end of file diff --git a/ruby-cda.gemspec b/ruby-cda.gemspec index 6fcfb93..7a7015d 100644 --- a/ruby-cda.gemspec +++ b/ruby-cda.gemspec @@ -15,7 +15,7 @@ Gem::Specification.new do |s| s.homepage = 'https://github.com/niquola/ruby-cda' s.add_dependency 'activesupport', '>= 5.0' - s.add_dependency 'nokogiri', '>= 1.6' + s.add_dependency 'nokogiri', '>= 1.13.4' s.add_dependency 'virtus', '>= 1.0' s.add_dependency 'i18n', '>= 1'