cqm-models 4.0.0 → 4.0.1

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.
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cqm-models",
3
- "version": "4.0.0",
3
+ "version": "4.0.1",
4
4
  "description": "This library contains auto generated Mongo (Mongoose.js) models that correspond to the QDM (Quality Data Model) specification.",
5
5
  "main": "app/assets/javascripts/index.js",
6
6
  "browser": {
@@ -16,13 +16,13 @@
16
16
  ],
17
17
  "license": "Apache-2.0",
18
18
  "dependencies": {
19
- "cql-execution": "~2.2.0",
20
- "mongoose": "^5.11.10"
19
+ "cql-execution": "~2.3.3",
20
+ "mongoose": "^5.13.12"
21
21
  },
22
22
  "devDependencies": {
23
23
  "browserify": "^16.1.0",
24
- "eslint": "^4.17.19",
25
- "eslint-config-airbnb-base": "^12.1.0",
24
+ "eslint": "^7.0.0",
25
+ "eslint-config-airbnb-base": "^14.2.1",
26
26
  "eslint-plugin-import": "^2.8.0",
27
27
  "istanbul": "^0.4.5",
28
28
  "jasmine": "^2.9.0"
@@ -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