cqm-models 0.8.3 → 0.8.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.eslintrc.json +1 -1
- data/app/assets/javascripts/AdverseEvent.js +1 -0
- data/app/assets/javascripts/AllergyIntolerance.js +1 -0
- data/app/assets/javascripts/AssessmentPerformed.js +2 -1
- data/app/assets/javascripts/AssessmentRecommended.js +1 -0
- data/app/assets/javascripts/CareGoal.js +2 -1
- data/app/assets/javascripts/CommunicationFromPatientToProvider.js +2 -1
- data/app/assets/javascripts/CommunicationFromProviderToPatient.js +2 -1
- data/app/assets/javascripts/CommunicationFromProviderToProvider.js +2 -1
- data/app/assets/javascripts/Component.js +1 -0
- data/app/assets/javascripts/DeviceApplied.js +1 -0
- data/app/assets/javascripts/DeviceOrder.js +1 -0
- data/app/assets/javascripts/DeviceRecommended.js +1 -0
- data/app/assets/javascripts/Diagnosis.js +1 -0
- data/app/assets/javascripts/DiagnosticStudyOrder.js +1 -0
- data/app/assets/javascripts/DiagnosticStudyPerformed.js +1 -0
- data/app/assets/javascripts/DiagnosticStudyRecommended.js +1 -0
- data/app/assets/javascripts/EncounterOrder.js +1 -0
- data/app/assets/javascripts/EncounterPerformed.js +1 -0
- data/app/assets/javascripts/EncounterRecommended.js +1 -0
- data/app/assets/javascripts/FacilityLocation.js +1 -0
- data/app/assets/javascripts/FamilyHistory.js +1 -0
- data/app/assets/javascripts/Id.js +2 -10
- data/app/assets/javascripts/ImmunizationAdministered.js +1 -0
- data/app/assets/javascripts/ImmunizationOrder.js +1 -0
- data/app/assets/javascripts/InterventionOrder.js +1 -0
- data/app/assets/javascripts/InterventionPerformed.js +1 -0
- data/app/assets/javascripts/InterventionRecommended.js +1 -0
- data/app/assets/javascripts/LaboratoryTestOrder.js +1 -0
- data/app/assets/javascripts/LaboratoryTestPerformed.js +1 -0
- data/app/assets/javascripts/LaboratoryTestRecommended.js +1 -0
- data/app/assets/javascripts/MedicationActive.js +1 -0
- data/app/assets/javascripts/MedicationAdministered.js +1 -0
- data/app/assets/javascripts/MedicationDischarge.js +1 -0
- data/app/assets/javascripts/MedicationDispensed.js +1 -0
- data/app/assets/javascripts/MedicationOrder.js +1 -0
- data/app/assets/javascripts/Participation.js +1 -0
- data/app/assets/javascripts/Patient.js +4 -8
- data/app/assets/javascripts/PatientCareExperience.js +1 -0
- data/app/assets/javascripts/PatientCharacteristic.js +1 -0
- data/app/assets/javascripts/PatientCharacteristicBirthdate.js +1 -0
- data/app/assets/javascripts/PatientCharacteristicClinicalTrialParticipant.js +1 -0
- data/app/assets/javascripts/PatientCharacteristicEthnicity.js +1 -0
- data/app/assets/javascripts/PatientCharacteristicExpired.js +1 -0
- data/app/assets/javascripts/PatientCharacteristicPayer.js +1 -0
- data/app/assets/javascripts/PatientCharacteristicRace.js +1 -0
- data/app/assets/javascripts/PatientCharacteristicSex.js +1 -0
- data/app/assets/javascripts/PhysicalExamOrder.js +1 -0
- data/app/assets/javascripts/PhysicalExamPerformed.js +1 -0
- data/app/assets/javascripts/PhysicalExamRecommended.js +1 -0
- data/app/assets/javascripts/ProcedureOrder.js +1 -0
- data/app/assets/javascripts/ProcedurePerformed.js +1 -0
- data/app/assets/javascripts/ProcedureRecommended.js +1 -0
- data/app/assets/javascripts/ProviderCareExperience.js +1 -0
- data/app/assets/javascripts/ProviderCharacteristic.js +1 -0
- data/app/assets/javascripts/Ratio.js +1 -0
- data/app/assets/javascripts/ResultComponent.js +1 -0
- data/app/assets/javascripts/SubstanceAdministered.js +1 -0
- data/app/assets/javascripts/SubstanceOrder.js +1 -0
- data/app/assets/javascripts/SubstanceRecommended.js +1 -0
- data/app/assets/javascripts/Symptom.js +1 -0
- data/app/assets/javascripts/basetypes/Any.js +1 -1
- data/app/assets/javascripts/basetypes/DataElement.js +7 -0
- data/app/models/models.rb +3 -1
- data/app/models/qdm/assessment_performed.rb +1 -1
- data/app/models/qdm/basetypes/data_element.rb +8 -5
- data/app/models/qdm/care_goal.rb +1 -1
- data/app/models/qdm/communication_from_patient_to_provider.rb +1 -1
- data/app/models/qdm/communication_from_provider_to_patient.rb +1 -1
- data/app/models/qdm/communication_from_provider_to_provider.rb +1 -1
- data/app/models/qdm/component.rb +0 -1
- data/app/models/qdm/facility_location.rb +0 -1
- data/app/models/qdm/id.rb +2 -2
- data/cqm-models.gemspec +1 -1
- data/dist/index.js +137 -84
- data/lib/generate_models.rb +27 -19
- data/package.json +1 -1
- data/templates/id_template.js.erb +15 -0
- data/templates/models_template.rb.erb +4 -0
- data/templates/mongoose_template.js.erb +1 -0
- data/templates/patient_template.js.erb +4 -8
- metadata +4 -3
@@ -6,6 +6,7 @@ const Quantity = require('./basetypes/Quantity');
|
|
6
6
|
const DateTime = require('./basetypes/DateTime');
|
7
7
|
const { ComponentSchema } = require('./Component');
|
8
8
|
const { FacilityLocationSchema } = require('./FacilityLocation');
|
9
|
+
const { IdSchema } = require('./Id');
|
9
10
|
const Any = require('./basetypes/Any');
|
10
11
|
|
11
12
|
const [Number, String] = [
|
@@ -6,6 +6,7 @@ const Quantity = require('./basetypes/Quantity');
|
|
6
6
|
const DateTime = require('./basetypes/DateTime');
|
7
7
|
const { ComponentSchema } = require('./Component');
|
8
8
|
const { FacilityLocationSchema } = require('./FacilityLocation');
|
9
|
+
const { IdSchema } = require('./Id');
|
9
10
|
const Any = require('./basetypes/Any');
|
10
11
|
|
11
12
|
const [Number, String] = [
|
@@ -6,6 +6,7 @@ const Quantity = require('./basetypes/Quantity');
|
|
6
6
|
const DateTime = require('./basetypes/DateTime');
|
7
7
|
const { ComponentSchema } = require('./Component');
|
8
8
|
const { FacilityLocationSchema } = require('./FacilityLocation');
|
9
|
+
const { IdSchema } = require('./Id');
|
9
10
|
const Any = require('./basetypes/Any');
|
10
11
|
|
11
12
|
const [Number, String] = [
|
@@ -6,6 +6,7 @@ const Quantity = require('./basetypes/Quantity');
|
|
6
6
|
const DateTime = require('./basetypes/DateTime');
|
7
7
|
const { ComponentSchema } = require('./Component');
|
8
8
|
const { FacilityLocationSchema } = require('./FacilityLocation');
|
9
|
+
const { IdSchema } = require('./Id');
|
9
10
|
const Any = require('./basetypes/Any');
|
10
11
|
|
11
12
|
const [Number, String] = [
|
@@ -1,6 +1,7 @@
|
|
1
1
|
const mongoose = require('mongoose');
|
2
2
|
const Code = require('./Code.js');
|
3
3
|
const cql = require('cql-execution');
|
4
|
+
const Id = require('../Id');
|
4
5
|
|
5
6
|
const [Schema] = [mongoose.Schema];
|
6
7
|
|
@@ -8,6 +9,12 @@ function DataElementSchema(add, options) {
|
|
8
9
|
const extended = new Schema({
|
9
10
|
dataElementCodes: { type: [] },
|
10
11
|
description: { type: String },
|
12
|
+
id: {
|
13
|
+
type: Id.IdSchema,
|
14
|
+
default() {
|
15
|
+
return new Id.Id({ value: (this._id ? this._id.toString() : mongoose.Types.ObjectId().toString()), namingSystem: null });
|
16
|
+
},
|
17
|
+
},
|
11
18
|
}, options);
|
12
19
|
|
13
20
|
if (add) {
|
data/app/models/models.rb
CHANGED
@@ -3,6 +3,9 @@ module QDM
|
|
3
3
|
end
|
4
4
|
require 'mongoid'
|
5
5
|
|
6
|
+
# Generated models that are dependencies for base types
|
7
|
+
require_relative 'qdm/id'
|
8
|
+
|
6
9
|
# base types
|
7
10
|
require_relative 'qdm/basetypes/code'
|
8
11
|
require_relative 'qdm/basetypes/interval'
|
@@ -18,7 +21,6 @@ require_relative 'qdm/tacoma/individual_result'
|
|
18
21
|
|
19
22
|
# Generated models
|
20
23
|
require_relative 'qdm/patient'
|
21
|
-
require_relative 'qdm/id'
|
22
24
|
require_relative 'qdm/ratio'
|
23
25
|
require_relative 'qdm/physical_exam_order'
|
24
26
|
require_relative 'qdm/participation'
|
@@ -9,7 +9,7 @@ module QDM
|
|
9
9
|
field :method, type: QDM::Code
|
10
10
|
field :result
|
11
11
|
field :components, type: Array
|
12
|
-
|
12
|
+
embeds_many :relatedTo, class_name: 'QDM::Id'
|
13
13
|
field :hqmfOid, type: String, default: '2.16.840.1.113883.10.20.28.3.117'
|
14
14
|
field :category, type: String, default: 'assessment'
|
15
15
|
field :qdmStatus, type: String, default: 'performed'
|
@@ -10,6 +10,14 @@ module QDM
|
|
10
10
|
# Optional description.
|
11
11
|
field :description, type: String
|
12
12
|
|
13
|
+
embeds_one :id, class_name: 'QDM::Id'
|
14
|
+
|
15
|
+
def initialize(options = {})
|
16
|
+
super(options)
|
17
|
+
# default id to the mongo ObjectId for this DataElement if it isnt already defined
|
18
|
+
self.id = QDM::Id.new(value: _id.to_s) unless id?
|
19
|
+
end
|
20
|
+
|
13
21
|
# Returns the attribute requested on the datatype.
|
14
22
|
def get(attribute)
|
15
23
|
send(attribute) if has_attribute?(attribute)
|
@@ -29,11 +37,6 @@ module QDM
|
|
29
37
|
dataElementCodes.collect { |code| QDM::Code.demongoize(code) }
|
30
38
|
end
|
31
39
|
|
32
|
-
# Return the Mongo id for this datatype.
|
33
|
-
def id
|
34
|
-
_id
|
35
|
-
end
|
36
|
-
|
37
40
|
def mongoize
|
38
41
|
json_representation = {}
|
39
42
|
attribute_names.each do |field|
|
data/app/models/qdm/care_goal.rb
CHANGED
@@ -4,7 +4,7 @@ module QDM
|
|
4
4
|
include Mongoid::Document
|
5
5
|
embedded_in :patient
|
6
6
|
field :relevantPeriod, type: QDM::Interval
|
7
|
-
|
7
|
+
embeds_many :relatedTo, class_name: 'QDM::Id'
|
8
8
|
field :targetOutcome
|
9
9
|
field :hqmfOid, type: String, default: '2.16.840.1.113883.10.20.28.3.7'
|
10
10
|
field :category, type: String, default: 'care_goal'
|
@@ -4,7 +4,7 @@ module QDM
|
|
4
4
|
include Mongoid::Document
|
5
5
|
embedded_in :patient
|
6
6
|
field :authorDatetime, type: DateTime
|
7
|
-
|
7
|
+
embeds_many :relatedTo, class_name: 'QDM::Id'
|
8
8
|
field :negationRationale, type: QDM::Code
|
9
9
|
field :hqmfOid, type: String, default: '2.16.840.1.113883.10.20.28.3.8'
|
10
10
|
field :category, type: String, default: 'communication'
|
@@ -4,7 +4,7 @@ module QDM
|
|
4
4
|
include Mongoid::Document
|
5
5
|
embedded_in :patient
|
6
6
|
field :authorDatetime, type: DateTime
|
7
|
-
|
7
|
+
embeds_many :relatedTo, class_name: 'QDM::Id'
|
8
8
|
field :negationRationale, type: QDM::Code
|
9
9
|
field :hqmfOid, type: String, default: '2.16.840.1.113883.10.20.28.3.9'
|
10
10
|
field :category, type: String, default: 'communication'
|
@@ -4,7 +4,7 @@ module QDM
|
|
4
4
|
include Mongoid::Document
|
5
5
|
embedded_in :patient
|
6
6
|
field :authorDatetime, type: DateTime
|
7
|
-
|
7
|
+
embeds_many :relatedTo, class_name: 'QDM::Id'
|
8
8
|
field :negationRationale, type: QDM::Code
|
9
9
|
field :hqmfOid, type: String, default: '2.16.840.1.113883.10.20.28.3.10'
|
10
10
|
field :category, type: String, default: 'communication'
|
data/app/models/qdm/component.rb
CHANGED
data/app/models/qdm/id.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
module QDM
|
2
2
|
# app/models/qdm/id.rb
|
3
|
-
class Id
|
3
|
+
class Id
|
4
4
|
include Mongoid::Document
|
5
|
-
embedded_in :
|
5
|
+
embedded_in :data_element
|
6
6
|
field :namingSystem, type: String
|
7
7
|
field :value, type: String
|
8
8
|
field :qdmVersion, type: String, default: '5.3'
|
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 = '0.8.
|
7
|
+
spec.version = '0.8.4'
|
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.'
|