cqm-models 4.0.0 → 4.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.eslintrc.json +6 -0
- data/app/assets/javascripts/QDMPatient.js +24 -0
- data/app/assets/javascripts/basetypes/DataElement.js +25 -1
- data/cqm-models.gemspec +1 -1
- data/dist/browser.js +2037 -1289
- data/dist/index.js +2037 -1289
- data/package.json +5 -5
- data/templates/patient_template.js.erb +24 -0
- data/yarn.lock +699 -682
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7f8d38da5e177b43176227723a4e46b7d95a1bb244db13b08708e63e1669b274
|
4
|
+
data.tar.gz: 87558e6ac3846616a2c8b3d9d489363f5584f0248fc3168228f82980c992a834
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f498c76a3ee4feea47218ae47e2979ec5c67df1d24d5418cfc717d3e0ccdfffab3dfacfd44d4f9c9178aeeb9c9d20a5d6ff97d3b6624c516db8fe1c0507ff64e
|
7
|
+
data.tar.gz: 5148490633c94e498b13835beffd194fc3fab981aafc6546400f0da50272fe8cbf195f1f5d1dc8e28b9f19c656b206ad1c2c1b01818af0c2e4d670f16dc900bd
|
data/.eslintrc.json
CHANGED
@@ -2,8 +2,14 @@
|
|
2
2
|
"extends": "airbnb-base",
|
3
3
|
"rules": {
|
4
4
|
"max-len": ["error", {"code": 200, "ignoreComments": true}],
|
5
|
+
"no-multiple-empty-lines": "off",
|
6
|
+
"import/extensions": "off",
|
7
|
+
"max-classes-per-file": "off",
|
8
|
+
"operator-linebreak": "off",
|
9
|
+
"no-else-return": "off",
|
5
10
|
"no-unused-vars": ["error", { "varsIgnorePattern": "EntitySchema|Identifier|IdentifierSchema|DataElementSchema|ComponentSchema|FacilityLocationSchema|Code|Quantity|Interval|Integer|Array|Float|Time|Number|Date|Mixed|Any" }],
|
6
11
|
"camelcase": "off",
|
12
|
+
"arrow-parens": "off",
|
7
13
|
"comma-dangle": ["error", {
|
8
14
|
"arrays": "always-multiline",
|
9
15
|
"objects": "always-multiline",
|
@@ -56,6 +56,30 @@ QDMPatientSchema.methods.getByQrdaOid = function getByQrdaOid(qrdaOid) {
|
|
56
56
|
return this.dataElements.filter(element => element.qrdaOid === qrdaOid);
|
57
57
|
};
|
58
58
|
|
59
|
+
// cql-execution prefers getId() over id() because some data models may have an id property
|
60
|
+
QDMPatientSchema.methods.getId = function getId() {
|
61
|
+
return this._id;
|
62
|
+
};
|
63
|
+
|
64
|
+
/* eslint no-underscore-dangle: 0 */
|
65
|
+
QDMPatientSchema.methods._is = function _is(typeSpecifier) {
|
66
|
+
return this._typeHierarchy().some(
|
67
|
+
t => t.type === typeSpecifier.type && t.name === typeSpecifier.name
|
68
|
+
);
|
69
|
+
};
|
70
|
+
|
71
|
+
/* eslint no-underscore-dangle: 0 */
|
72
|
+
QDMPatientSchema.methods._typeHierarchy = function _typeHierarchy() {
|
73
|
+
const ver = this.qdmVersion.replace('.', '_');
|
74
|
+
return [
|
75
|
+
{
|
76
|
+
name: `{urn:healthit-gov:qdm:v${ver}}Patient`,
|
77
|
+
type: 'NamedTypeSpecifier',
|
78
|
+
},
|
79
|
+
{ name: '{urn:hl7-org:elm-types:r1}Any', type: 'NamedTypeSpecifier' },
|
80
|
+
];
|
81
|
+
};
|
82
|
+
|
59
83
|
// Returns an array of elements that exist on this patient. Optionally
|
60
84
|
// takes a qdmCategory, which returns all elements of that QDM qdmCategory.
|
61
85
|
// Example: patient.getDataElements({qdmCategory: 'encounters'}) will return
|
@@ -1,6 +1,6 @@
|
|
1
1
|
const mongoose = require('mongoose/browser');
|
2
|
-
const Code = require('./Code.js');
|
3
2
|
const cql = require('cql-execution');
|
3
|
+
const Code = require('./Code.js');
|
4
4
|
const Identifier = require('../attributes/Identifier');
|
5
5
|
|
6
6
|
const [Schema] = [mongoose.Schema];
|
@@ -49,6 +49,30 @@ function DataElementSchema(add, options) {
|
|
49
49
|
return null;
|
50
50
|
};
|
51
51
|
|
52
|
+
/* eslint no-underscore-dangle: 0 */
|
53
|
+
extended.methods._is = function _is(typeSpecifier) {
|
54
|
+
return this._typeHierarchy().some(
|
55
|
+
t => t.type === typeSpecifier.type && t.name === typeSpecifier.name
|
56
|
+
);
|
57
|
+
};
|
58
|
+
|
59
|
+
/* eslint no-underscore-dangle: 0 */
|
60
|
+
extended.methods._typeHierarchy = function _typeHierarchy() {
|
61
|
+
const typeName = this._type.replace(/QDM::/, '');
|
62
|
+
const prefix = this.negationRationale ? 'Negative' : 'Positive';
|
63
|
+
const ver = this.qdmVersion.replace('.', '_');
|
64
|
+
return [
|
65
|
+
{
|
66
|
+
name: `{urn:healthit-gov:qdm:v${ver}}${prefix}${typeName}`,
|
67
|
+
type: 'NamedTypeSpecifier',
|
68
|
+
},
|
69
|
+
{
|
70
|
+
name: `{urn:healthit-gov:qdm:v${ver}}${typeName}`,
|
71
|
+
type: 'NamedTypeSpecifier',
|
72
|
+
},
|
73
|
+
{ name: '{urn:hl7-org:elm-types:r1}Any', type: 'NamedTypeSpecifier' },
|
74
|
+
];
|
75
|
+
};
|
52
76
|
return extended;
|
53
77
|
}
|
54
78
|
|
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 = '4.0.
|
7
|
+
spec.version = '4.0.1'
|
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.'
|