cqm-models 3.1.0 → 3.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1a0d67086fe4eae472fe08e0e069c5fc3c9bfbfb9503e1606fd958b4c553368a
4
- data.tar.gz: 10ee066a538619d8dd8850bd715f27796cc58621fa00896e30b9e7da872ba064
3
+ metadata.gz: 7a98ff5b9f4caf2158764ae9ca3370226cfaec4877b22fc45ff16584f49cfb89
4
+ data.tar.gz: f1d68db5fb968eac4b9488ac85ac195c4b5d9d56c5c8bea969e46eeb8ed78cf1
5
5
  SHA512:
6
- metadata.gz: cb89b1251f588838c3d46b9993e18fe25d152a0aca3c694660ac3a957fa10f6cf171558da8963b773879abbb807335012573a076b5dec243d7b95555e5a92b83
7
- data.tar.gz: 0215d03daaaa2e938e35dd00921885100ec98614df3ff5195003b34aa20c6cc11e720a59cb1d0200ba7cc2d056127913df3aea44776a5f80573185615a48c07d
6
+ metadata.gz: 2d769481c231d3a3902b5c9d2bd0d4c9f061381d5cba276609362d902fafddab753d9d7959c2c323a90bd56bf4d8cecdb465cbde155c6894cfdcd9239d91e304
7
+ data.tar.gz: b4af2c8d6bf9cfc71433f48e2b7bb29309bc7c8563511307fedfb096235f8aee7aa53fae01684b4455075136102b7543584c064553d0f4cbb2d4a8764657716b
data/.eslintrc.json CHANGED
@@ -1,6 +1,13 @@
1
1
  {
2
2
  "extends": "airbnb-base",
3
3
  "rules": {
4
+ "import/extensions": "off",
5
+ "import/order": "off",
6
+ "no-multiple-empty-lines": "off",
7
+ "max-classes-per-file": "off",
8
+ "arrow-parens": "off",
9
+ "operator-linebreak": "off",
10
+ "no-else-return": "off",
4
11
  "max-len": ["error", {"code": 200, "ignoreComments": true}],
5
12
  "no-unused-vars": ["error", { "varsIgnorePattern": "EntitySchema|Identifier|IdentifierSchema|DataElementSchema|ComponentSchema|FacilityLocationSchema|Code|Quantity|Interval|Integer|Array|Float|Time|Number|Date|Mixed|Any" }],
6
13
  "camelcase": "off",
@@ -3,6 +3,7 @@ on:
3
3
  pull_request:
4
4
  branches:
5
5
  - master
6
+ - cqm_models_3_x
6
7
 
7
8
  jobs:
8
9
  build:
@@ -11,7 +12,7 @@ jobs:
11
12
 
12
13
  strategy:
13
14
  matrix:
14
- ruby-version: [2.5]
15
+ ruby-version: [2.6, 2.7]
15
16
  mongodb-version: [4.0.18, 4.4]
16
17
  node-version: [12.x, 14.x]
17
18
 
@@ -7,7 +7,7 @@ function Any(key, options) {
7
7
  Any.prototype = Object.create(mongoose.SchemaType.prototype);
8
8
 
9
9
  function RecursiveCast(any) {
10
- if (any && any.value && any.unit) {
10
+ if (any && any.value !== undefined && any.unit) {
11
11
  return new cql.Quantity(any.value, any.unit);
12
12
  }
13
13
 
@@ -35,8 +35,8 @@ module CQM
35
35
  field :state, type: String, default: 'queued'
36
36
 
37
37
  # Relations to other model classes
38
- belongs_to :measure
39
- belongs_to :patient
38
+ belongs_to :measure, class_name: 'CQM::Measure', inverse_of: :calculation_result
39
+ belongs_to :patient, class_name: 'CQM::Patient', inverse_of: :calculation_result
40
40
 
41
41
  # Convert the stored array into a hash between clause and result
42
42
  def clause_results_by_clause
@@ -73,7 +73,7 @@ module CQM
73
73
  # hence the 'inverse_of: nil')
74
74
  has_and_belongs_to_many :value_sets, inverse_of: nil
75
75
 
76
- has_many :calculation_results, class_name: 'CQM::IndividualResult'
76
+ has_many :calculation_results, class_name: 'CQM::IndividualResult', inverse_of: :measure
77
77
 
78
78
  def all_stratifications
79
79
  population_sets.flat_map(&:stratifications)
@@ -11,7 +11,7 @@ module CQM
11
11
 
12
12
  has_and_belongs_to_many :providers, class_name: 'CQM::Provider'
13
13
  embeds_one :qdmPatient, class_name: 'QDM::Patient', autobuild: true
14
- has_many :calculation_results, class_name: 'CQM::IndividualResult'
14
+ has_many :calculation_results, class_name: 'CQM::IndividualResult', inverse_of: :patient
15
15
 
16
16
  # Include '_type' in any JSON output. This is necessary for deserialization.
17
17
  def to_json(options = nil)
data/cqm-models.gemspec CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = 'cqm-models'
7
- spec.version = '3.1.0'
7
+ spec.version = '3.1.2'
8
8
  spec.authors = ['aholmes@mitre.org', 'mokeefe@mitre.org', 'lades@mitre.org']
9
9
 
10
10
  spec.summary = 'Mongo models that correspond to the QDM specification.'