cqm-models 2.0.1 → 3.0.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 +1 -1
- data/README.md +9 -6
- data/app/assets/javascripts/AdverseEvent.js +9 -3
- data/app/assets/javascripts/AllDataElements.js +18 -6
- data/app/assets/javascripts/AllergyIntolerance.js +8 -2
- data/app/assets/javascripts/AssessmentOrder.js +8 -2
- data/app/assets/javascripts/AssessmentPerformed.js +11 -3
- data/app/assets/javascripts/AssessmentRecommended.js +8 -2
- data/app/assets/javascripts/CareGoal.js +10 -3
- data/app/assets/javascripts/CommunicationPerformed.js +12 -6
- data/app/assets/javascripts/DeviceApplied.js +9 -2
- data/app/assets/javascripts/DeviceOrder.js +8 -2
- data/app/assets/javascripts/DeviceRecommended.js +8 -2
- data/app/assets/javascripts/Diagnosis.js +8 -2
- data/app/assets/javascripts/DiagnosticStudyOrder.js +8 -2
- data/app/assets/javascripts/DiagnosticStudyPerformed.js +9 -2
- data/app/assets/javascripts/DiagnosticStudyRecommended.js +8 -2
- data/app/assets/javascripts/EncounterOrder.js +9 -2
- data/app/assets/javascripts/EncounterPerformed.js +11 -5
- data/app/assets/javascripts/EncounterRecommended.js +8 -2
- data/app/assets/javascripts/FamilyHistory.js +8 -2
- data/app/assets/javascripts/ImmunizationAdministered.js +9 -2
- data/app/assets/javascripts/ImmunizationOrder.js +8 -2
- data/app/assets/javascripts/InterventionOrder.js +8 -2
- data/app/assets/javascripts/InterventionPerformed.js +9 -2
- data/app/assets/javascripts/InterventionRecommended.js +8 -2
- data/app/assets/javascripts/LaboratoryTestOrder.js +8 -2
- data/app/assets/javascripts/LaboratoryTestPerformed.js +9 -2
- data/app/assets/javascripts/LaboratoryTestRecommended.js +8 -2
- data/app/assets/javascripts/MedicationActive.js +9 -2
- data/app/assets/javascripts/MedicationAdministered.js +9 -2
- data/app/assets/javascripts/MedicationDischarge.js +9 -2
- data/app/assets/javascripts/MedicationDispensed.js +10 -4
- data/app/assets/javascripts/MedicationOrder.js +9 -4
- data/app/assets/javascripts/Participation.js +8 -2
- data/app/assets/javascripts/PatientCareExperience.js +8 -2
- data/app/assets/javascripts/PatientCharacteristic.js +7 -2
- data/app/assets/javascripts/PatientCharacteristicBirthdate.js +7 -2
- data/app/assets/javascripts/PatientCharacteristicClinicalTrialParticipant.js +7 -2
- data/app/assets/javascripts/PatientCharacteristicEthnicity.js +7 -2
- data/app/assets/javascripts/PatientCharacteristicExpired.js +7 -2
- data/app/assets/javascripts/PatientCharacteristicPayer.js +7 -2
- data/app/assets/javascripts/PatientCharacteristicRace.js +7 -2
- data/app/assets/javascripts/PatientCharacteristicSex.js +7 -2
- data/app/assets/javascripts/PhysicalExamOrder.js +8 -2
- data/app/assets/javascripts/PhysicalExamPerformed.js +9 -2
- data/app/assets/javascripts/PhysicalExamRecommended.js +8 -2
- data/app/assets/javascripts/ProcedureOrder.js +10 -3
- data/app/assets/javascripts/ProcedurePerformed.js +11 -3
- data/app/assets/javascripts/ProcedureRecommended.js +9 -3
- data/app/assets/javascripts/ProviderCareExperience.js +8 -2
- data/app/assets/javascripts/QDMPatient.js +25 -9
- data/app/assets/javascripts/RelatedPerson.js +42 -0
- data/app/assets/javascripts/SubstanceAdministered.js +9 -2
- data/app/assets/javascripts/SubstanceOrder.js +9 -2
- data/app/assets/javascripts/SubstanceRecommended.js +8 -2
- data/app/assets/javascripts/Symptom.js +8 -2
- data/app/assets/javascripts/attributes/CarePartner.js +31 -0
- data/app/assets/javascripts/attributes/Component.js +22 -1
- data/app/assets/javascripts/attributes/DiagnosisComponent.js +34 -0
- data/app/assets/javascripts/attributes/Entity.js +58 -0
- data/app/assets/javascripts/attributes/FacilityLocation.js +4 -1
- data/app/assets/javascripts/attributes/Identifier.js +23 -0
- data/app/assets/javascripts/attributes/Organization.js +31 -0
- data/app/assets/javascripts/attributes/PatientEntity.js +30 -0
- data/app/assets/javascripts/attributes/Practitioner.js +33 -0
- data/app/assets/javascripts/attributes/ResultComponent.js +31 -0
- data/app/assets/javascripts/basetypes/Any.js +24 -14
- data/app/assets/javascripts/basetypes/AnyEntity.js +44 -0
- data/app/assets/javascripts/basetypes/Code.js +8 -11
- data/app/assets/javascripts/basetypes/DataElement.js +14 -6
- data/app/assets/javascripts/basetypes/Interval.js +2 -2
- data/app/assets/javascripts/basetypes/QDMDate.js +36 -0
- data/app/assets/javascripts/basetypes/Quantity.js +1 -1
- data/app/assets/javascripts/basetypes/Ratio.js +1 -1
- data/app/assets/javascripts/cqm/Provider.js +0 -2
- data/app/models/cqm/provider.rb +4 -4
- data/app/models/hqmfOid_to_datatype_map.json +1 -1
- data/app/models/models.rb +12 -5
- data/app/models/qdm/adverse_event.rb +3 -2
- data/app/models/qdm/allergy_intolerance.rb +2 -1
- data/app/models/qdm/assessment_order.rb +2 -1
- data/app/models/qdm/assessment_performed.rb +5 -2
- data/app/models/qdm/assessment_recommended.rb +2 -1
- data/app/models/qdm/attributes/care_partner.rb +8 -0
- data/app/models/qdm/attributes/component.rb +1 -1
- data/app/models/qdm/attributes/diagnosis_component.rb +10 -0
- data/app/models/qdm/attributes/entity.rb +15 -0
- data/app/models/qdm/attributes/facility_location.rb +1 -1
- data/app/models/qdm/{id.rb → attributes/identifier.rb} +3 -4
- data/app/models/qdm/attributes/organization.rb +8 -0
- data/app/models/qdm/attributes/patient_entity.rb +7 -0
- data/app/models/qdm/attributes/practitioner.rb +10 -0
- data/app/models/qdm/{result_component.rb → attributes/result_component.rb} +1 -3
- data/app/models/qdm/basetypes/code.rb +8 -10
- data/app/models/qdm/basetypes/data_element.rb +19 -6
- data/app/models/qdm/basetypes/date.rb +38 -0
- data/app/models/qdm/basetypes/interval.rb +2 -2
- data/app/models/qdm/care_goal.rb +4 -2
- data/app/models/qdm/communication_performed.rb +6 -5
- data/app/models/qdm/device_applied.rb +3 -1
- data/app/models/qdm/device_order.rb +2 -1
- data/app/models/qdm/device_recommended.rb +2 -1
- data/app/models/qdm/diagnosis.rb +2 -1
- data/app/models/qdm/diagnostic_study_order.rb +2 -1
- data/app/models/qdm/diagnostic_study_performed.rb +3 -1
- data/app/models/qdm/diagnostic_study_recommended.rb +2 -1
- data/app/models/qdm/encounter_order.rb +3 -1
- data/app/models/qdm/encounter_performed.rb +3 -2
- data/app/models/qdm/encounter_recommended.rb +2 -1
- data/app/models/qdm/family_history.rb +2 -1
- data/app/models/qdm/immunization_administered.rb +3 -1
- data/app/models/qdm/immunization_order.rb +2 -1
- data/app/models/qdm/intervention_order.rb +2 -1
- data/app/models/qdm/intervention_performed.rb +3 -1
- data/app/models/qdm/intervention_recommended.rb +2 -1
- data/app/models/qdm/laboratory_test_order.rb +2 -1
- data/app/models/qdm/laboratory_test_performed.rb +3 -1
- data/app/models/qdm/laboratory_test_recommended.rb +2 -1
- data/app/models/qdm/medication_active.rb +3 -1
- data/app/models/qdm/medication_administered.rb +3 -1
- data/app/models/qdm/medication_discharge.rb +3 -1
- data/app/models/qdm/medication_dispensed.rb +4 -3
- data/app/models/qdm/medication_order.rb +3 -3
- data/app/models/qdm/participation.rb +2 -1
- data/app/models/qdm/patient.rb +1 -1
- data/app/models/qdm/patient_care_experience.rb +2 -1
- data/app/models/qdm/patient_characteristic.rb +1 -1
- data/app/models/qdm/patient_characteristic_birthdate.rb +1 -1
- data/app/models/qdm/patient_characteristic_clinical_trial_participant.rb +1 -1
- data/app/models/qdm/patient_characteristic_ethnicity.rb +1 -1
- data/app/models/qdm/patient_characteristic_expired.rb +1 -1
- data/app/models/qdm/patient_characteristic_payer.rb +1 -1
- data/app/models/qdm/patient_characteristic_race.rb +1 -1
- data/app/models/qdm/patient_characteristic_sex.rb +1 -1
- data/app/models/qdm/physical_exam_order.rb +2 -1
- data/app/models/qdm/physical_exam_performed.rb +3 -1
- data/app/models/qdm/physical_exam_recommended.rb +2 -1
- data/app/models/qdm/procedure_order.rb +4 -2
- data/app/models/qdm/procedure_performed.rb +5 -2
- data/app/models/qdm/procedure_recommended.rb +3 -2
- data/app/models/qdm/provider_care_experience.rb +2 -1
- data/app/models/qdm/related_person.rb +13 -0
- data/app/models/qdm/substance_administered.rb +3 -1
- data/app/models/qdm/substance_order.rb +3 -1
- data/app/models/qdm/substance_recommended.rb +2 -1
- data/app/models/qdm/symptom.rb +2 -1
- data/bin/validate_generator.sh +1 -1
- data/cqm-models.gemspec +2 -2
- data/data/oids_qdm_5.5.json +321 -0
- data/dist/browser.js +3434 -3356
- data/dist/index.js +3433 -3355
- data/lib/generate_models.rb +78 -39
- data/lib/generate_patients.rb +3 -3
- data/lib/generate_types.rb +1 -1
- data/lib/generator_helpers.rb +14 -0
- data/modelinfo/qdm-modelinfo-5.5.xml +982 -0
- data/package.json +2 -2
- data/templates/entity_extension.rb.erb +6 -0
- data/templates/identifier_extension.rb.erb +58 -0
- data/templates/{id_template.js.erb → identifier_template.js.erb} +6 -5
- data/templates/models_template.rb.erb +19 -4
- data/templates/mongoose_template.js.erb +86 -12
- data/templates/patient_template.js.erb +0 -4
- data/yarn.lock +245 -201
- metadata +31 -11
- data/app/assets/javascripts/Id.js +0 -21
- data/app/assets/javascripts/ProviderCharacteristic.js +0 -36
- data/app/assets/javascripts/ResultComponent.js +0 -33
- data/app/models/qdm/provider_characteristic.rb +0 -12
@@ -8,20 +8,17 @@ Code.prototype = Object.create(mongoose.SchemaType.prototype);
|
|
8
8
|
|
9
9
|
Code.prototype.cast = (code) => {
|
10
10
|
if (code != null) {
|
11
|
+
// return code if it doesn't even need casting
|
12
|
+
if (code.isCode) {
|
13
|
+
return code;
|
14
|
+
}
|
11
15
|
// handles codes that have not yet been cast to a code and those that have already been cast to a code
|
12
|
-
if (code.code &&
|
13
|
-
|
14
|
-
|
15
|
-
} else if (typeof code.codeSystemOid === 'undefined' && typeof code.system === 'undefined') {
|
16
|
-
throw new Error(`Code: ${code} does not have a system oid`);
|
17
|
-
}
|
18
|
-
|
19
|
-
const val = { code: code.code, codeSystemOid: code.codeSystemOid || code.system };
|
20
|
-
|
21
|
-
val.descriptor = (typeof code.descriptor !== 'undefined') ? code.descriptor : null;
|
16
|
+
if (code.code && code.system) {
|
17
|
+
const val = { code: code.code, system: code.system };
|
18
|
+
val.display = (typeof code.display !== 'undefined') ? code.display : null;
|
22
19
|
val.version = (typeof code.version !== 'undefined') ? code.version : null;
|
23
20
|
|
24
|
-
return new cql.Code(val.code, val.
|
21
|
+
return new cql.Code(val.code, val.system, val.version, val.display);
|
25
22
|
}
|
26
23
|
throw new Error(`Expected a code. Received ${code}.`);
|
27
24
|
} else {
|
@@ -1,19 +1,19 @@
|
|
1
1
|
const mongoose = require('mongoose/browser');
|
2
2
|
const Code = require('./Code.js');
|
3
3
|
const cql = require('cql-execution');
|
4
|
-
const
|
4
|
+
const Identifier = require('../attributes/Identifier');
|
5
5
|
|
6
6
|
const [Schema] = [mongoose.Schema];
|
7
7
|
|
8
8
|
function DataElementSchema(add, options) {
|
9
9
|
const extended = new Schema({
|
10
|
-
dataElementCodes: { type: [] },
|
10
|
+
dataElementCodes: { type: [Code] },
|
11
11
|
description: { type: String },
|
12
12
|
codeListId: { type: String },
|
13
13
|
id: {
|
14
|
-
type:
|
14
|
+
type: String,
|
15
15
|
default() {
|
16
|
-
return
|
16
|
+
return this._id ? this._id.toString() : mongoose.Types.ObjectId().toString();
|
17
17
|
},
|
18
18
|
},
|
19
19
|
}, options);
|
@@ -25,7 +25,12 @@ function DataElementSchema(add, options) {
|
|
25
25
|
// Returns all of the codes on this data element in a format usable by
|
26
26
|
// the cql-execution framework.
|
27
27
|
extended.methods.getCode = function getCode() {
|
28
|
-
return this.dataElementCodes.map(code =>
|
28
|
+
return this.dataElementCodes.map((code) => {
|
29
|
+
if (code.isCode) {
|
30
|
+
return code;
|
31
|
+
}
|
32
|
+
return new cql.Code(code.code, code.system, code.version, code.display);
|
33
|
+
});
|
29
34
|
};
|
30
35
|
|
31
36
|
// Return the first code on this data element in a format usable by
|
@@ -33,7 +38,10 @@ function DataElementSchema(add, options) {
|
|
33
38
|
extended.methods.code = function code() {
|
34
39
|
if (this.dataElementCodes && this.dataElementCodes[0]) {
|
35
40
|
const qdmCode = this.dataElementCodes[0];
|
36
|
-
|
41
|
+
if (qdmCode.isCode) {
|
42
|
+
return qdmCode;
|
43
|
+
}
|
44
|
+
return new cql.Code(qdmCode.code, qdmCode.system, qdmCode.version, qdmCode.display);
|
37
45
|
}
|
38
46
|
return null;
|
39
47
|
};
|
@@ -15,9 +15,9 @@ Interval.prototype.cast = (interval) => {
|
|
15
15
|
|
16
16
|
// Cast Low and High values to Quantities if it is a quantity
|
17
17
|
if (casted.low && casted.low.unit && casted.low.value) {
|
18
|
-
casted.low = new cql.Quantity(casted.low);
|
18
|
+
casted.low = new cql.Quantity(casted.low.value, casted.low.unit);
|
19
19
|
if (casted.high && casted.high.unit && casted.high.value) {
|
20
|
-
casted.high = new cql.Quantity(casted.high);
|
20
|
+
casted.high = new cql.Quantity(casted.high.value, casted.high.unit);
|
21
21
|
}
|
22
22
|
return casted;
|
23
23
|
}
|
@@ -0,0 +1,36 @@
|
|
1
|
+
const mongoose = require('mongoose/browser');
|
2
|
+
const cql = require('cql-execution');
|
3
|
+
|
4
|
+
function QDMDate(key, options) {
|
5
|
+
mongoose.SchemaType.call(this, key, options, 'Date');
|
6
|
+
}
|
7
|
+
QDMDate.prototype = Object.create(mongoose.SchemaType.prototype);
|
8
|
+
|
9
|
+
QDMDate.prototype.cast = (date) => {
|
10
|
+
if (date == null) {
|
11
|
+
return date;
|
12
|
+
}
|
13
|
+
|
14
|
+
// Already a CQL Date
|
15
|
+
if (date.isDate) {
|
16
|
+
return date;
|
17
|
+
}
|
18
|
+
|
19
|
+
// Object
|
20
|
+
if (typeof date === 'object') {
|
21
|
+
const keys = Object.keys(date);
|
22
|
+
if (keys.includes('year') && keys.includes('month') && keys.includes('day')) {
|
23
|
+
return new cql.Date(date.year, date.month, date.day);
|
24
|
+
}
|
25
|
+
}
|
26
|
+
|
27
|
+
// Date String
|
28
|
+
if (!cql.Date.parse(date)) {
|
29
|
+
throw new Error(`Date: ${date} is not a valid Date`);
|
30
|
+
} else {
|
31
|
+
return cql.Date.parse(date);
|
32
|
+
}
|
33
|
+
};
|
34
|
+
|
35
|
+
mongoose.Schema.Types.QDMDate = QDMDate;
|
36
|
+
module.exports = QDMDate;
|
@@ -13,7 +13,7 @@ Quantity.prototype.cast = (quantity) => {
|
|
13
13
|
throw new Error(`Quantity: ${quantity} does not have a unit`);
|
14
14
|
}
|
15
15
|
|
16
|
-
return new cql.Quantity(quantity);
|
16
|
+
return new cql.Quantity(quantity.value, quantity.unit);
|
17
17
|
};
|
18
18
|
|
19
19
|
mongoose.Schema.Types.Quantity = Quantity;
|
@@ -1,5 +1,4 @@
|
|
1
1
|
const mongoose = require('mongoose/browser');
|
2
|
-
const Id = require('../Id');
|
3
2
|
|
4
3
|
const [Schema, String, Boolean] = [
|
5
4
|
mongoose.Schema,
|
@@ -31,7 +30,6 @@ const ProviderSchema = new Schema({
|
|
31
30
|
title: String,
|
32
31
|
addresses: [AddressSchema],
|
33
32
|
telecoms: [TelecomSchema],
|
34
|
-
ids: [Id.IdSchema],
|
35
33
|
|
36
34
|
}, { id: false });
|
37
35
|
|
data/app/models/cqm/provider.rb
CHANGED
@@ -16,7 +16,7 @@ module CQM
|
|
16
16
|
|
17
17
|
embeds_many :addresses
|
18
18
|
embeds_many :telecoms
|
19
|
-
embeds_many :ids, class_name: 'QDM::
|
19
|
+
embeds_many :ids, class_name: 'QDM::Identifier'
|
20
20
|
|
21
21
|
def npi=(an_npi)
|
22
22
|
cda_id_npi = ids.where(namingSystem: NPI_OID).first
|
@@ -24,7 +24,7 @@ module CQM
|
|
24
24
|
cda_id_npi.value = an_npi
|
25
25
|
cda_id_npi.save!
|
26
26
|
else
|
27
|
-
ids << QDM::
|
27
|
+
ids << QDM::Identifier.new(namingSystem: NPI_OID, value: an_npi)
|
28
28
|
end
|
29
29
|
end
|
30
30
|
|
@@ -34,7 +34,7 @@ module CQM
|
|
34
34
|
end
|
35
35
|
|
36
36
|
def tin=(a_tin)
|
37
|
-
ids << QDM::
|
37
|
+
ids << QDM::Identifier.new(namingSystem: TAX_ID_OID, value: a_tin)
|
38
38
|
end
|
39
39
|
|
40
40
|
def tin
|
@@ -48,7 +48,7 @@ module CQM
|
|
48
48
|
cda_id_ccn.value = a_ccn
|
49
49
|
cda_id_ccn.save!
|
50
50
|
else
|
51
|
-
ids << QDM::
|
51
|
+
ids << QDM::Identifier.new(namingSystem: CCN_OID, value: a_ccn)
|
52
52
|
end
|
53
53
|
end
|
54
54
|
|
@@ -1,4 +1,5 @@
|
|
1
1
|
{
|
2
|
+
"2.16.840.1.113883.10.20.28.4.141": "RelatedPerson",
|
2
3
|
"2.16.840.1.113883.10.20.28.4.61": "PhysicalExamOrder",
|
3
4
|
"2.16.840.1.113883.10.20.28.4.130": "Participation",
|
4
5
|
"2.16.840.1.113883.10.20.28.4.55": "PatientCharacteristicSex",
|
@@ -33,7 +34,6 @@
|
|
33
34
|
"2.16.840.1.113883.10.20.28.4.28": "EncounterRecommended",
|
34
35
|
"2.16.840.1.113883.10.20.28.4.67": "ProcedurePerformed",
|
35
36
|
"2.16.840.1.113883.10.20.28.4.119": "AllergyIntolerance",
|
36
|
-
"2.16.840.1.113883.10.20.28.4.71": "ProviderCharacteristic",
|
37
37
|
"22.16.840.1.113883.10.20.28.4.63": "PhysicalExamRecommended",
|
38
38
|
"2.16.840.1.113883.10.20.28.4.54": "PatientCharacteristicBirthdate",
|
39
39
|
"2.16.840.1.113883.10.20.28.4.120": "AdverseEvent",
|
data/app/models/models.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Base QDM module (generated from lib/generate_models.rb) for QDM 5.
|
1
|
+
# Base QDM module (generated from lib/generate_models.rb) for QDM 5.5
|
2
2
|
module QDM
|
3
3
|
end
|
4
4
|
require 'mongoid'
|
@@ -7,17 +7,25 @@ require 'mongoid'
|
|
7
7
|
require_relative 'model_finder'
|
8
8
|
|
9
9
|
# Generated models that are dependencies for base types
|
10
|
-
require_relative 'qdm/
|
10
|
+
require_relative 'qdm/attributes/attribute'
|
11
|
+
require_relative 'qdm/attributes/identifier'
|
11
12
|
|
12
13
|
# base types
|
13
14
|
require_relative 'qdm/basetypes/code'
|
14
15
|
require_relative 'qdm/basetypes/data_element'
|
16
|
+
require_relative 'qdm/basetypes/date'
|
15
17
|
require_relative 'qdm/basetypes/interval'
|
16
18
|
require_relative 'qdm/basetypes/quantity'
|
17
19
|
require_relative 'qdm/basetypes/ratio'
|
18
|
-
require_relative 'qdm/attributes/attribute'
|
19
20
|
require_relative 'qdm/attributes/facility_location'
|
20
21
|
require_relative 'qdm/attributes/component'
|
22
|
+
require_relative 'qdm/attributes/entity'
|
23
|
+
require_relative 'qdm/attributes/care_partner'
|
24
|
+
require_relative 'qdm/attributes/diagnosis_component'
|
25
|
+
require_relative 'qdm/attributes/organization'
|
26
|
+
require_relative 'qdm/attributes/patient_entity'
|
27
|
+
require_relative 'qdm/attributes/practitioner'
|
28
|
+
require_relative 'qdm/attributes/result_component'
|
21
29
|
|
22
30
|
# Tacoma-specific models
|
23
31
|
require_relative 'cqm/measure'
|
@@ -38,6 +46,7 @@ require_relative '../../lib/generate_patients'
|
|
38
46
|
|
39
47
|
# Generated models
|
40
48
|
require_relative 'qdm/patient'
|
49
|
+
require_relative 'qdm/related_person'
|
41
50
|
require_relative 'qdm/physical_exam_order'
|
42
51
|
require_relative 'qdm/participation'
|
43
52
|
require_relative 'qdm/patient_characteristic_sex'
|
@@ -58,7 +67,6 @@ require_relative 'qdm/device_order'
|
|
58
67
|
require_relative 'qdm/diagnostic_study_performed'
|
59
68
|
require_relative 'qdm/intervention_order'
|
60
69
|
require_relative 'qdm/family_history'
|
61
|
-
require_relative 'qdm/result_component'
|
62
70
|
require_relative 'qdm/medication_active'
|
63
71
|
require_relative 'qdm/laboratory_test_order'
|
64
72
|
require_relative 'qdm/diagnostic_study_order'
|
@@ -73,7 +81,6 @@ require_relative 'qdm/encounter_order'
|
|
73
81
|
require_relative 'qdm/encounter_recommended'
|
74
82
|
require_relative 'qdm/procedure_performed'
|
75
83
|
require_relative 'qdm/allergy_intolerance'
|
76
|
-
require_relative 'qdm/provider_characteristic'
|
77
84
|
require_relative 'qdm/physical_exam_recommended'
|
78
85
|
require_relative 'qdm/patient_characteristic_birthdate'
|
79
86
|
require_relative 'qdm/adverse_event'
|
@@ -4,13 +4,14 @@ module QDM
|
|
4
4
|
include Mongoid::Document
|
5
5
|
embedded_in :patient
|
6
6
|
field :authorDatetime, type: DateTime
|
7
|
-
field :
|
7
|
+
field :relevantDatetime, type: DateTime
|
8
8
|
field :severity, type: QDM::Code
|
9
9
|
field :facilityLocation, type: QDM::FacilityLocation
|
10
10
|
field :type, type: QDM::Code
|
11
|
+
embeds_one :recorder, class_name: 'QDM::Entity'
|
11
12
|
field :qdmTitle, type: String, default: 'Adverse Event'
|
12
13
|
field :hqmfOid, type: String, default: '2.16.840.1.113883.10.20.28.4.120'
|
13
14
|
field :qdmCategory, type: String, default: 'adverse_event'
|
14
|
-
field :qdmVersion, type: String, default: '5.
|
15
|
+
field :qdmVersion, type: String, default: '5.5'
|
15
16
|
end
|
16
17
|
end
|
@@ -7,10 +7,11 @@ module QDM
|
|
7
7
|
field :prevalencePeriod, type: QDM::Interval
|
8
8
|
field :type, type: QDM::Code
|
9
9
|
field :severity, type: QDM::Code
|
10
|
+
embeds_one :recorder, class_name: 'QDM::Entity'
|
10
11
|
field :qdmTitle, type: String, default: 'Allergy/Intolerance'
|
11
12
|
field :hqmfOid, type: String, default: '2.16.840.1.113883.10.20.28.4.119'
|
12
13
|
field :qdmCategory, type: String, default: 'allergy'
|
13
14
|
field :qdmStatus, type: String, default: 'intolerance'
|
14
|
-
field :qdmVersion, type: String, default: '5.
|
15
|
+
field :qdmVersion, type: String, default: '5.5'
|
15
16
|
end
|
16
17
|
end
|
@@ -6,10 +6,11 @@ module QDM
|
|
6
6
|
field :authorDatetime, type: DateTime
|
7
7
|
field :negationRationale, type: QDM::Code
|
8
8
|
field :reason, type: QDM::Code
|
9
|
+
embeds_one :requester, class_name: 'QDM::Entity'
|
9
10
|
field :qdmTitle, type: String, default: 'Assessment, Order'
|
10
11
|
field :hqmfOid, type: String, default: '2.16.840.1.113883.10.20.28.4.131'
|
11
12
|
field :qdmCategory, type: String, default: 'assessment'
|
12
13
|
field :qdmStatus, type: String, default: 'order'
|
13
|
-
field :qdmVersion, type: String, default: '5.
|
14
|
+
field :qdmVersion, type: String, default: '5.5'
|
14
15
|
end
|
15
16
|
end
|
@@ -4,16 +4,19 @@ module QDM
|
|
4
4
|
include Mongoid::Document
|
5
5
|
embedded_in :patient
|
6
6
|
field :authorDatetime, type: DateTime
|
7
|
+
field :relevantDatetime, type: DateTime
|
8
|
+
field :relevantPeriod, type: QDM::Interval
|
7
9
|
field :negationRationale, type: QDM::Code
|
8
10
|
field :reason, type: QDM::Code
|
9
11
|
field :method, type: QDM::Code
|
10
12
|
field :result
|
11
13
|
field :components, type: Array
|
12
|
-
|
14
|
+
field :relatedTo, type: Array
|
15
|
+
embeds_one :performer, class_name: 'QDM::Entity'
|
13
16
|
field :qdmTitle, type: String, default: 'Assessment, Performed'
|
14
17
|
field :hqmfOid, type: String, default: '2.16.840.1.113883.10.20.28.4.117'
|
15
18
|
field :qdmCategory, type: String, default: 'assessment'
|
16
19
|
field :qdmStatus, type: String, default: 'performed'
|
17
|
-
field :qdmVersion, type: String, default: '5.
|
20
|
+
field :qdmVersion, type: String, default: '5.5'
|
18
21
|
end
|
19
22
|
end
|
@@ -6,10 +6,11 @@ module QDM
|
|
6
6
|
field :authorDatetime, type: DateTime
|
7
7
|
field :negationRationale, type: QDM::Code
|
8
8
|
field :reason, type: QDM::Code
|
9
|
+
embeds_one :requester, class_name: 'QDM::Entity'
|
9
10
|
field :qdmTitle, type: String, default: 'Assessment, Recommended'
|
10
11
|
field :hqmfOid, type: String, default: '2.16.840.1.113883.10.20.28.4.118'
|
11
12
|
field :qdmCategory, type: String, default: 'assessment'
|
12
13
|
field :qdmStatus, type: String, default: 'recommended'
|
13
|
-
field :qdmVersion, type: String, default: '5.
|
14
|
+
field :qdmVersion, type: String, default: '5.5'
|
14
15
|
end
|
15
16
|
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
module QDM
|
2
|
+
# app/models/qdm/diagnosis_component.rb
|
3
|
+
class DiagnosisComponent < Attribute
|
4
|
+
include Mongoid::Document
|
5
|
+
field :code, type: QDM::Code
|
6
|
+
field :presentOnAdmissionIndicator, type: QDM::Code
|
7
|
+
field :rank, type: Integer
|
8
|
+
field :qdmVersion, type: String, default: '5.5'
|
9
|
+
end
|
10
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module QDM
|
2
|
+
# app/models/qdm/entity.rb
|
3
|
+
class Entity < Attribute
|
4
|
+
include Mongoid::Document
|
5
|
+
embedded_in :data_element
|
6
|
+
field :id, type: String
|
7
|
+
embeds_one :identifier, class_name: 'QDM::Identifier'
|
8
|
+
field :qdmVersion, type: String, default: '5.5'
|
9
|
+
def initialize(options = {})
|
10
|
+
super(options)
|
11
|
+
# default id to the mongo ObjectId for this DataElement if it isnt already defined
|
12
|
+
self.id = _id.to_s unless id?
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -1,10 +1,9 @@
|
|
1
1
|
module QDM
|
2
|
-
# app/models/qdm/
|
3
|
-
class
|
2
|
+
# app/models/qdm/identifier.rb
|
3
|
+
class Identifier < Attribute
|
4
4
|
include Mongoid::Document
|
5
|
-
embedded_in :data_element
|
6
5
|
field :namingSystem, type: String
|
7
6
|
field :value, type: String
|
8
|
-
field :qdmVersion, type: String, default: '5.
|
7
|
+
field :qdmVersion, type: String, default: '5.5'
|
9
8
|
end
|
10
9
|
end
|