fhir-mongoid-models 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 16a41240f3c38234ccc841170d5ee573b1698c6e0351cec0354db3deeacfb621
4
- data.tar.gz: 6e69cf73af1582df6cde162f894e563d6df1f090a95468fdebc8aee62b777146
3
+ metadata.gz: f2d33ae7ad96a4cf04cc323c21dd2790e082a938eb10b912ac40185380d2c34b
4
+ data.tar.gz: 4d871aeda34008cf6743418d57eeb9ee595a63e932bc191c6987ea532b73bc10
5
5
  SHA512:
6
- metadata.gz: 857ab5e0188a9fe30b46272664d4b90f7091073d00102227fa0ab9372f180053da88e2d7f2dd8a8d7b86d15b6e15929511c4dc14ae570009354990fadb27a61d
7
- data.tar.gz: 2669d8ac8b70a720188550fa50c928e0606d79a01e08e8e5433ea8a8efbe831aabcc917f87dea5ac597d80fec7a74c6d0734908846ca837601dab66e10db7294
6
+ metadata.gz: a096a579976814b53287093e680f8bc34cee8f20703ce961f5066b69f4cb3fc373e75401e03e971a1c2dc1a46d0c14eeea45dab74b55c5fea129bd5c65fad561
7
+ data.tar.gz: 017b77106e6e2f576f07758d923d1227b9ec178b71cbea453131d9ad69cf320903031961a9371c4028518a2b6db71b571755e7aa819d96f338c6532b8da60b90
@@ -0,0 +1,50 @@
1
+ name: Publish Gem
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - "*"
7
+ tags:
8
+ - v*
9
+ jobs:
10
+ build:
11
+
12
+ runs-on: ubuntu-latest
13
+
14
+ services:
15
+ mongodb:
16
+ image: mongo:3.4.23
17
+ ports:
18
+ - 27017:27017
19
+
20
+ steps:
21
+ - uses: actions/checkout@v2
22
+
23
+ - name: Set up Ruby 2.4
24
+ uses: actions/setup-ruby@v1
25
+ with:
26
+ ruby-version: 2.4
27
+
28
+ - name: Install bundler & bundle-audit
29
+ run: |
30
+ gem install bundler -v 2.1.4
31
+ gem install bundle-audit
32
+
33
+ - name: Install ruby gems
34
+ run: bundle install --jobs 4 --retry 3
35
+
36
+ - name: Build and test with Rake
37
+ env:
38
+ RAILS_ENV: test
39
+ run: |
40
+ bundle exec rubocop
41
+ bundle exec bundle-audit update && bundle exec bundle-audit check
42
+ bundle exec rake
43
+
44
+ - name: Release Gem
45
+ if: contains(github.ref, 'refs/tags/v')
46
+ uses: cadwallion/publish-rubygems-action@master
47
+ env:
48
+ GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
49
+ RUBYGEMS_API_KEY: ${{secrets.RUBYGEMS_API_KEY}}
50
+ RELEASE_COMMAND: rake release
@@ -33,9 +33,9 @@ module CQM
33
33
  class StatementReference
34
34
  include Mongoid::Document
35
35
  embedded_in :statement_dependency
36
- # embedded_in :population_set
37
- # embedded_in :population_map
38
- # embedded_in :stratification
36
+ embedded_in :population_set
37
+ embedded_in :population_map
38
+ embedded_in :stratification
39
39
 
40
40
  field :library_name, type: String
41
41
  field :statement_name, type: String
@@ -33,7 +33,6 @@ module CQM
33
33
  embeds_one :fhir_measure, class_name: 'FHIR::Measure'
34
34
  embeds_many :libraries, class_name: 'FHIR::Library'
35
35
  embeds_many :value_sets, class_name: 'FHIR::ValueSet'
36
- has_one :package, class_name: 'CQM::MeasurePackage', inverse_of: :measure, dependent: :destroy
37
36
 
38
37
  # ELM/CQL Measure-logic related data
39
38
  # Field name changed from 'cql' to 'cql_libraries' because the semantics of
@@ -45,6 +44,9 @@ module CQM
45
44
 
46
45
  embeds_many :population_sets, class_name: 'CQM::PopulationSet'
47
46
 
47
+ # TODO: Reconsider after MAT-1628
48
+ field :measure_period, type: Hash
49
+
48
50
  def as_json(*args)
49
51
  result = Hash.new
50
52
  unless self.id.nil?
@@ -89,6 +91,9 @@ module CQM
89
91
  unless self.population_sets.nil? || !self.population_sets.any?
90
92
  result['population_sets'] = self.population_sets.map{ |x| x.as_json(*args) }
91
93
  end
94
+ unless self.measure_period.nil?
95
+ result['measure_period'] = self.measure_period
96
+ end
92
97
  result['created_at'] = self.created_at unless self.created_at.nil?
93
98
  result['updated_at'] = self.updated_at unless self.updated_at.nil?
94
99
 
@@ -111,6 +116,7 @@ module CQM
111
116
  result['main_cql_library'] = json_hash['main_cql_library'] unless json_hash['main_cql_library'].nil?
112
117
  result['source_data_criteria'] = json_hash['source_data_criteria'].map { |var| CQM::DataElement.transform_json(var) } unless json_hash['source_data_criteria'].nil?
113
118
  result['population_sets'] = json_hash['population_sets'].map { |var| CQM::PopulationSet.transform_json(var) } unless json_hash['population_sets'].nil?
119
+ result['measure_period'] = json_hash['measure_period'] unless json_hash['measure_period'].nil?
114
120
  result['created_at'] = json_hash['created_at'] unless json_hash['created_at'].nil?
115
121
  result['updated_at'] = json_hash['updated_at'] unless json_hash['updated_at'].nil?
116
122
  result
@@ -58,7 +58,6 @@ module CQM
58
58
 
59
59
  field :title, type: String
60
60
  field :stratification_id, type: String
61
- field :set_id, type: String
62
61
  embeds_one :statement, class_name: 'CQM::StatementReference'
63
62
 
64
63
  def as_json(*args)
@@ -69,9 +68,6 @@ module CQM
69
68
  unless self.stratification_id.nil?
70
69
  result['stratification_id'] = self.stratification_id
71
70
  end
72
- unless self.set_id.nil?
73
- result['set_id'] = self.set_id
74
- end
75
71
  unless self.statement.nil?
76
72
  result['statement'] = self.statement.as_json(args)
77
73
  end
@@ -83,7 +79,6 @@ module CQM
83
79
  result = target
84
80
  result['title'] = json_hash['title'] unless json_hash['title'].nil?
85
81
  result['stratification_id'] = json_hash['stratification_id'] unless json_hash['stratification_id'].nil?
86
- result['set_id'] = json_hash['set_id'] unless json_hash['set_id'].nil?
87
82
  result['statement'] = CQM::StatementReference.transform_json(json_hash['statement']) unless json_hash['statement'].nil?
88
83
 
89
84
  result
@@ -96,10 +91,14 @@ module CQM
96
91
 
97
92
  embedded_in :population_set
98
93
 
94
+ # observationPopulation.criteria
99
95
  embeds_one :observation_function, class_name: 'CQM::StatementReference'
96
+
97
+ # Observation Identifier, observationPopulation.extension.[url]/cqfm-criteriaReference
100
98
  embeds_one :observation_parameter, class_name: 'CQM::StatementReference'
99
+
100
+ # Aggregate Method (aka Aggregate Type), observationPopulation.extension.[url]/cqfm-aggregateMethod
101
101
  field :aggregation_type, type: String
102
- field :set_id, type: String
103
102
 
104
103
  def as_json(*args)
105
104
  result = Hash.new
@@ -112,9 +111,6 @@ module CQM
112
111
  unless self.aggregation_type.nil?
113
112
  result['aggregation_type'] = self.aggregation_type
114
113
  end
115
- unless self.set_id.nil?
116
- result['set_id'] = self.set_id
117
- end
118
114
 
119
115
  result
120
116
  end
@@ -124,7 +120,6 @@ module CQM
124
120
  result['observation_function'] = CQM::StatementReference.transform_json(json_hash['observation_function']) unless json_hash['observation_function'].nil?
125
121
  result['observation_parameter'] = CQM::StatementReference.transform_json(json_hash['observation_parameter']) unless json_hash['observation_parameter'].nil?
126
122
  result['aggregation_type'] = json_hash['aggregation_type'] unless json_hash['aggregation_type'].nil?
127
- result['set_id'] = json_hash['set_id'] unless json_hash['set_id'].nil?
128
123
 
129
124
  result
130
125
  end
@@ -8,6 +8,11 @@ module FHIR
8
8
  embeds_one :language, class_name: 'FHIR::PrimitiveCode'
9
9
  field :resourceType, type: String
10
10
  field :fhirId, type: String
11
+
12
+ def initialize(attrs = nil)
13
+ super(attrs)
14
+ self.resourceType = self.class.name.split("::")[1].to_s
15
+ end
11
16
 
12
17
  def as_json(*args)
13
18
  result = Hash.new
@@ -3,9 +3,9 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
3
 
4
4
  Gem::Specification.new do |spec|
5
5
  spec.name = 'fhir-mongoid-models'
6
- spec.version = '0.0.1'
7
- spec.authors = %w[Andrew Bird Ashok Dongare Joseph Kotanchik Rohit Kandimalla Serhii Ilin]
8
- spec.email = %w[andrew.bird@semanticbits.com ashok.dongare@semanticbits.com joseph.kotanchik@semanticbits.com rohit.kandimalla@semanticbits.com serhii.ilin@semanticbits.com]
6
+ spec.version = '0.0.2'
7
+ spec.authors = ['Andrew Bird', 'Ashok Dongare', 'Joseph Kotanchik', 'Serhii Ilin', 'Matthew Gifford', 'Daniel Mee']
8
+ spec.email = %w[andrew.bird@semanticbits.com ashok.dongare@semanticbits.com joseph.kotanchik@semanticbits.com serhii.ilin@semanticbits.com matthew.gifford@semanticbits.com daniel.mee@semanticbits.com]
9
9
 
10
10
  spec.summary = 'Mongo models that correspond to the FHIR specification.'
11
11
  spec.description = 'This library contains auto generated Mongo (Mongoid) models that correspond to the FHIR specification.'
@@ -1,7 +1,6 @@
1
1
  require_relative '../../../app/models/models'
2
2
  require_relative '../../../app/models/cqm/patient'
3
3
  require_relative '../../../app/models/cqm/measure'
4
- require_relative '../../../app/models/cqm/measure_package'
5
4
  require_relative '../../../app/models/cqm/logic_library'
6
5
  require_relative '../../../app/models/cqm/cql_statement_dependency'
7
6
  require_relative '../../../app/models/cqm/population_set'
metadata CHANGED
@@ -1,23 +1,19 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fhir-mongoid-models
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
- - Andrew
8
- - Bird
9
- - Ashok
10
- - Dongare
11
- - Joseph
12
- - Kotanchik
13
- - Rohit
14
- - Kandimalla
15
- - Serhii
16
- - Ilin
17
- autorequire:
7
+ - Andrew Bird
8
+ - Ashok Dongare
9
+ - Joseph Kotanchik
10
+ - Serhii Ilin
11
+ - Matthew Gifford
12
+ - Daniel Mee
13
+ autorequire:
18
14
  bindir: exe
19
15
  cert_chain: []
20
- date: 2020-08-17 00:00:00.000000000 Z
16
+ date: 2020-09-08 00:00:00.000000000 Z
21
17
  dependencies:
22
18
  - !ruby/object:Gem::Dependency
23
19
  name: bundler
@@ -123,8 +119,9 @@ email:
123
119
  - andrew.bird@semanticbits.com
124
120
  - ashok.dongare@semanticbits.com
125
121
  - joseph.kotanchik@semanticbits.com
126
- - rohit.kandimalla@semanticbits.com
127
122
  - serhii.ilin@semanticbits.com
123
+ - matthew.gifford@semanticbits.com
124
+ - daniel.mee@semanticbits.com
128
125
  executables: []
129
126
  extensions: []
130
127
  extra_rdoc_files: []
@@ -132,6 +129,7 @@ files:
132
129
  - ".editorconfig"
133
130
  - ".github/CODEOWNERS"
134
131
  - ".github/workflows/build.yml"
132
+ - ".github/workflows/rubygems-publish.yml"
135
133
  - ".gitignore"
136
134
  - ".rspec"
137
135
  - ".rubocop.yml"
@@ -143,7 +141,6 @@ files:
143
141
  - app/models/cqm/data_element.rb
144
142
  - app/models/cqm/logic_library.rb
145
143
  - app/models/cqm/measure.rb
146
- - app/models/cqm/measure_package.rb
147
144
  - app/models/cqm/patient.rb
148
145
  - app/models/cqm/population_set.rb
149
146
  - app/models/fhir/account.rb
@@ -1093,7 +1090,7 @@ files:
1093
1090
  homepage: https://github.com/MeasureAuthoringTool/fhir-mongoid-models
1094
1091
  licenses: []
1095
1092
  metadata: {}
1096
- post_install_message:
1093
+ post_install_message:
1097
1094
  rdoc_options: []
1098
1095
  require_paths:
1099
1096
  - lib
@@ -1108,8 +1105,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1108
1105
  - !ruby/object:Gem::Version
1109
1106
  version: '0'
1110
1107
  requirements: []
1111
- rubygems_version: 3.0.8
1112
- signing_key:
1108
+ rubygems_version: 3.0.6
1109
+ signing_key:
1113
1110
  specification_version: 4
1114
1111
  summary: Mongo models that correspond to the FHIR specification.
1115
1112
  test_files: []
@@ -1,10 +0,0 @@
1
- module CQM
2
- # MeasurePackage stores the uploaded file for a given Measure
3
- class MeasurePackage
4
- include Mongoid::Document
5
- include Mongoid::Timestamps
6
-
7
- field :file, type: BSON::Binary
8
- belongs_to :measure, class_name: 'CQM::Measure', inverse_of: :package
9
- end
10
- end