cqm-models 4.0.0 → 4.1.0
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/.github/workflows/ci.yml +1 -1
- data/.gitignore +1 -0
- data/app/assets/javascripts/QDMPatient.js +25 -0
- data/app/assets/javascripts/basetypes/DataElement.js +26 -1
- data/app/models/qdm/basetypes/data_element.rb +1 -0
- data/cqm-models.gemspec +1 -1
- data/dist/browser.js +11540 -15319
- data/dist/index.js +11540 -15319
- data/package.json +9 -8
- data/templates/patient_template.js.erb +25 -0
- data/yarn.lock +1504 -938
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 824c04168aff91f769c20c2ebdb0eebc5b5b63f457ca424002e71c833260b6fc
|
4
|
+
data.tar.gz: ec4fad1105bef87c9e4acde4ec0639db03b6b96d77146ebb62a7e1a64068d2df
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d4c6e1020981220cb7227caef2dc7423d3bc3374e1b9ff5b1a85ffabe226e2fb8428fbe63abce00cbfda68f21ede488fc9d6122d5fd8ccf8a641cd7903d0baa4
|
7
|
+
data.tar.gz: b8cf4f3ede2e516a194f3879ce5a96980782b9227bffdc6d3a3c1a2779945b9d0d7455a9b33c84b59ed3ac89c4756eedfda6a8cb230285e8c620396fd8a0b723
|
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",
|
data/.github/workflows/ci.yml
CHANGED
data/.gitignore
CHANGED
@@ -56,6 +56,31 @@ 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}Tuple', type: 'NamedTypeSpecifier' },
|
80
|
+
{ name: '{urn:hl7-org:elm-types:r1}Any', type: 'NamedTypeSpecifier' },
|
81
|
+
];
|
82
|
+
};
|
83
|
+
|
59
84
|
// Returns an array of elements that exist on this patient. Optionally
|
60
85
|
// takes a qdmCategory, which returns all elements of that QDM qdmCategory.
|
61
86
|
// 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,31 @@ 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}Tuple', type: 'NamedTypeSpecifier' },
|
74
|
+
{ name: '{urn:hl7-org:elm-types:r1}Any', type: 'NamedTypeSpecifier' },
|
75
|
+
];
|
76
|
+
};
|
52
77
|
return extended;
|
53
78
|
}
|
54
79
|
|
@@ -65,6 +65,7 @@ module QDM
|
|
65
65
|
def shift_dates(seconds)
|
66
66
|
fields.keys.each do |field|
|
67
67
|
send(field + '=', (send(field).to_time + seconds.seconds).to_datetime) if send(field).is_a? DateTime
|
68
|
+
send(field + '=', (send(field).to_time + seconds.seconds).to_datetime) if send(field).is_a? Time
|
68
69
|
send(field + '=', send(field).shift_dates(seconds)) if (send(field).is_a? Interval) || (send(field).is_a? DataElement)
|
69
70
|
|
70
71
|
# Special case for facility locations
|
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.
|
7
|
+
spec.version = '4.1.0'
|
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.'
|