cqm-models 2.0.1 → 3.0.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/.github/workflows/gitleaks_github_actions.yml +28 -0
- data/.travis.yml +2 -2
- data/README.md +12 -9
- 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 +33 -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 +33 -0
- data/app/assets/javascripts/attributes/PatientEntity.js +32 -0
- data/app/assets/javascripts/attributes/Practitioner.js +35 -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 +17 -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/individual_result.rb +2 -6
- data/app/models/cqm/provider.rb +4 -4
- data/app/models/hqmfOid_to_datatype_map.json +5 -1
- data/app/models/model_finder.rb +1 -0
- 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/attribute.rb +1 -0
- data/app/models/qdm/attributes/care_partner.rb +10 -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 +10 -0
- data/app/models/qdm/attributes/patient_entity.rb +9 -0
- data/app/models/qdm/attributes/practitioner.rb +12 -0
- data/app/models/qdm/{result_component.rb → attributes/result_component.rb} +1 -3
- data/app/models/qdm/basetypes/code.rb +9 -10
- data/app/models/qdm/basetypes/data_element.rb +25 -18
- data/app/models/qdm/basetypes/date.rb +39 -0
- data/app/models/qdm/basetypes/interval.rb +8 -11
- data/app/models/qdm/basetypes/quantity.rb +1 -0
- data/app/models/qdm/basetypes/ratio.rb +1 -0
- 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 +5 -5
- data/data/oids_qdm_5.5.json +337 -0
- data/dist/browser.js +8819 -4882
- data/dist/index.js +8818 -4881
- data/lib/generate_entities.rb +56 -0
- data/lib/generate_models.rb +77 -39
- data/lib/generate_patients.rb +20 -14
- data/lib/generate_types.rb +54 -14
- data/lib/generator_helpers.rb +14 -0
- data/modelinfo/qdm-modelinfo-5.5.xml +982 -0
- data/package.json +4 -4
- 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 +396 -320
- metadata +40 -19
- 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
@@ -1,14 +1,17 @@
|
|
1
1
|
const mongoose = require('mongoose/browser');
|
2
2
|
|
3
|
-
const {
|
3
|
+
const { IdentifierSchema } = require('./attributes/Identifier');
|
4
4
|
const { DataElementSchema } = require('./basetypes/DataElement');
|
5
5
|
const Code = require('./basetypes/Code');
|
6
6
|
const Interval = require('./basetypes/Interval');
|
7
7
|
const Quantity = require('./basetypes/Quantity');
|
8
8
|
const DateTime = require('./basetypes/DateTime');
|
9
|
+
const QDMDate = require('./basetypes/QDMDate');
|
9
10
|
const Any = require('./basetypes/Any');
|
11
|
+
const AnyEntity = require('./basetypes/AnyEntity');
|
10
12
|
const { ComponentSchema } = require('./attributes/Component');
|
11
13
|
const { FacilityLocationSchema } = require('./attributes/FacilityLocation');
|
14
|
+
const { EntitySchema } = require('./attributes/Entity');
|
12
15
|
|
13
16
|
|
14
17
|
const [Number, String] = [
|
@@ -21,11 +24,12 @@ const PhysicalExamOrderSchema = DataElementSchema({
|
|
21
24
|
reason: Code,
|
22
25
|
anatomicalLocationSite: Code,
|
23
26
|
negationRationale: Code,
|
27
|
+
requester: AnyEntity,
|
24
28
|
qdmTitle: { type: String, default: 'Physical Exam, Order' },
|
25
29
|
hqmfOid: { type: String, default: '2.16.840.1.113883.10.20.28.4.61' },
|
26
30
|
qdmCategory: { type: String, default: 'physical_exam' },
|
27
31
|
qdmStatus: { type: String, default: 'order' },
|
28
|
-
qdmVersion: { type: String, default: '5.
|
32
|
+
qdmVersion: { type: String, default: '5.5' },
|
29
33
|
_type: { type: String, default: 'QDM::PhysicalExamOrder' },
|
30
34
|
|
31
35
|
});
|
@@ -37,4 +41,6 @@ class PhysicalExamOrder extends mongoose.Document {
|
|
37
41
|
this._type = 'QDM::PhysicalExamOrder';
|
38
42
|
}
|
39
43
|
}
|
44
|
+
|
40
45
|
module.exports.PhysicalExamOrder = PhysicalExamOrder;
|
46
|
+
|
@@ -1,14 +1,17 @@
|
|
1
1
|
const mongoose = require('mongoose/browser');
|
2
2
|
|
3
|
-
const {
|
3
|
+
const { IdentifierSchema } = require('./attributes/Identifier');
|
4
4
|
const { DataElementSchema } = require('./basetypes/DataElement');
|
5
5
|
const Code = require('./basetypes/Code');
|
6
6
|
const Interval = require('./basetypes/Interval');
|
7
7
|
const Quantity = require('./basetypes/Quantity');
|
8
8
|
const DateTime = require('./basetypes/DateTime');
|
9
|
+
const QDMDate = require('./basetypes/QDMDate');
|
9
10
|
const Any = require('./basetypes/Any');
|
11
|
+
const AnyEntity = require('./basetypes/AnyEntity');
|
10
12
|
const { ComponentSchema } = require('./attributes/Component');
|
11
13
|
const { FacilityLocationSchema } = require('./attributes/FacilityLocation');
|
14
|
+
const { EntitySchema } = require('./attributes/Entity');
|
12
15
|
|
13
16
|
|
14
17
|
const [Number, String] = [
|
@@ -18,6 +21,7 @@ const [Number, String] = [
|
|
18
21
|
|
19
22
|
const PhysicalExamPerformedSchema = DataElementSchema({
|
20
23
|
authorDatetime: DateTime,
|
24
|
+
relevantDatetime: DateTime,
|
21
25
|
relevantPeriod: Interval,
|
22
26
|
reason: Code,
|
23
27
|
method: Code,
|
@@ -25,11 +29,12 @@ const PhysicalExamPerformedSchema = DataElementSchema({
|
|
25
29
|
anatomicalLocationSite: Code,
|
26
30
|
negationRationale: Code,
|
27
31
|
components: [ComponentSchema],
|
32
|
+
performer: AnyEntity,
|
28
33
|
qdmTitle: { type: String, default: 'Physical Exam, Performed' },
|
29
34
|
hqmfOid: { type: String, default: '2.16.840.1.113883.10.20.28.4.62' },
|
30
35
|
qdmCategory: { type: String, default: 'physical_exam' },
|
31
36
|
qdmStatus: { type: String, default: 'performed' },
|
32
|
-
qdmVersion: { type: String, default: '5.
|
37
|
+
qdmVersion: { type: String, default: '5.5' },
|
33
38
|
_type: { type: String, default: 'QDM::PhysicalExamPerformed' },
|
34
39
|
|
35
40
|
});
|
@@ -41,4 +46,6 @@ class PhysicalExamPerformed extends mongoose.Document {
|
|
41
46
|
this._type = 'QDM::PhysicalExamPerformed';
|
42
47
|
}
|
43
48
|
}
|
49
|
+
|
44
50
|
module.exports.PhysicalExamPerformed = PhysicalExamPerformed;
|
51
|
+
|
@@ -1,14 +1,17 @@
|
|
1
1
|
const mongoose = require('mongoose/browser');
|
2
2
|
|
3
|
-
const {
|
3
|
+
const { IdentifierSchema } = require('./attributes/Identifier');
|
4
4
|
const { DataElementSchema } = require('./basetypes/DataElement');
|
5
5
|
const Code = require('./basetypes/Code');
|
6
6
|
const Interval = require('./basetypes/Interval');
|
7
7
|
const Quantity = require('./basetypes/Quantity');
|
8
8
|
const DateTime = require('./basetypes/DateTime');
|
9
|
+
const QDMDate = require('./basetypes/QDMDate');
|
9
10
|
const Any = require('./basetypes/Any');
|
11
|
+
const AnyEntity = require('./basetypes/AnyEntity');
|
10
12
|
const { ComponentSchema } = require('./attributes/Component');
|
11
13
|
const { FacilityLocationSchema } = require('./attributes/FacilityLocation');
|
14
|
+
const { EntitySchema } = require('./attributes/Entity');
|
12
15
|
|
13
16
|
|
14
17
|
const [Number, String] = [
|
@@ -21,11 +24,12 @@ const PhysicalExamRecommendedSchema = DataElementSchema({
|
|
21
24
|
reason: Code,
|
22
25
|
anatomicalLocationSite: Code,
|
23
26
|
negationRationale: Code,
|
27
|
+
requester: AnyEntity,
|
24
28
|
qdmTitle: { type: String, default: 'Physical Exam, Recommended' },
|
25
29
|
hqmfOid: { type: String, default: '22.16.840.1.113883.10.20.28.4.63' },
|
26
30
|
qdmCategory: { type: String, default: 'physical_exam' },
|
27
31
|
qdmStatus: { type: String, default: 'recommended' },
|
28
|
-
qdmVersion: { type: String, default: '5.
|
32
|
+
qdmVersion: { type: String, default: '5.5' },
|
29
33
|
_type: { type: String, default: 'QDM::PhysicalExamRecommended' },
|
30
34
|
|
31
35
|
});
|
@@ -37,4 +41,6 @@ class PhysicalExamRecommended extends mongoose.Document {
|
|
37
41
|
this._type = 'QDM::PhysicalExamRecommended';
|
38
42
|
}
|
39
43
|
}
|
44
|
+
|
40
45
|
module.exports.PhysicalExamRecommended = PhysicalExamRecommended;
|
46
|
+
|
@@ -1,14 +1,17 @@
|
|
1
1
|
const mongoose = require('mongoose/browser');
|
2
2
|
|
3
|
-
const {
|
3
|
+
const { IdentifierSchema } = require('./attributes/Identifier');
|
4
4
|
const { DataElementSchema } = require('./basetypes/DataElement');
|
5
5
|
const Code = require('./basetypes/Code');
|
6
6
|
const Interval = require('./basetypes/Interval');
|
7
7
|
const Quantity = require('./basetypes/Quantity');
|
8
8
|
const DateTime = require('./basetypes/DateTime');
|
9
|
+
const QDMDate = require('./basetypes/QDMDate');
|
9
10
|
const Any = require('./basetypes/Any');
|
11
|
+
const AnyEntity = require('./basetypes/AnyEntity');
|
10
12
|
const { ComponentSchema } = require('./attributes/Component');
|
11
13
|
const { FacilityLocationSchema } = require('./attributes/FacilityLocation');
|
14
|
+
const { EntitySchema } = require('./attributes/Entity');
|
12
15
|
|
13
16
|
|
14
17
|
const [Number, String] = [
|
@@ -20,13 +23,15 @@ const ProcedureOrderSchema = DataElementSchema({
|
|
20
23
|
authorDatetime: DateTime,
|
21
24
|
reason: Code,
|
22
25
|
anatomicalLocationSite: Code,
|
23
|
-
|
26
|
+
rank: Number,
|
27
|
+
priority: Code,
|
24
28
|
negationRationale: Code,
|
29
|
+
requester: AnyEntity,
|
25
30
|
qdmTitle: { type: String, default: 'Procedure, Order' },
|
26
31
|
hqmfOid: { type: String, default: '2.16.840.1.113883.10.20.28.4.66' },
|
27
32
|
qdmCategory: { type: String, default: 'procedure' },
|
28
33
|
qdmStatus: { type: String, default: 'order' },
|
29
|
-
qdmVersion: { type: String, default: '5.
|
34
|
+
qdmVersion: { type: String, default: '5.5' },
|
30
35
|
_type: { type: String, default: 'QDM::ProcedureOrder' },
|
31
36
|
|
32
37
|
});
|
@@ -38,4 +43,6 @@ class ProcedureOrder extends mongoose.Document {
|
|
38
43
|
this._type = 'QDM::ProcedureOrder';
|
39
44
|
}
|
40
45
|
}
|
46
|
+
|
41
47
|
module.exports.ProcedureOrder = ProcedureOrder;
|
48
|
+
|
@@ -1,14 +1,17 @@
|
|
1
1
|
const mongoose = require('mongoose/browser');
|
2
2
|
|
3
|
-
const {
|
3
|
+
const { IdentifierSchema } = require('./attributes/Identifier');
|
4
4
|
const { DataElementSchema } = require('./basetypes/DataElement');
|
5
5
|
const Code = require('./basetypes/Code');
|
6
6
|
const Interval = require('./basetypes/Interval');
|
7
7
|
const Quantity = require('./basetypes/Quantity');
|
8
8
|
const DateTime = require('./basetypes/DateTime');
|
9
|
+
const QDMDate = require('./basetypes/QDMDate');
|
9
10
|
const Any = require('./basetypes/Any');
|
11
|
+
const AnyEntity = require('./basetypes/AnyEntity');
|
10
12
|
const { ComponentSchema } = require('./attributes/Component');
|
11
13
|
const { FacilityLocationSchema } = require('./attributes/FacilityLocation');
|
14
|
+
const { EntitySchema } = require('./attributes/Entity');
|
12
15
|
|
13
16
|
|
14
17
|
const [Number, String] = [
|
@@ -18,21 +21,24 @@ const [Number, String] = [
|
|
18
21
|
|
19
22
|
const ProcedurePerformedSchema = DataElementSchema({
|
20
23
|
authorDatetime: DateTime,
|
24
|
+
relevantDatetime: DateTime,
|
21
25
|
relevantPeriod: Interval,
|
22
26
|
reason: Code,
|
23
27
|
method: Code,
|
24
28
|
result: Any,
|
25
29
|
status: Code,
|
26
30
|
anatomicalLocationSite: Code,
|
27
|
-
|
31
|
+
rank: Number,
|
32
|
+
priority: Code,
|
28
33
|
incisionDatetime: DateTime,
|
29
34
|
negationRationale: Code,
|
30
35
|
components: [ComponentSchema],
|
36
|
+
performer: AnyEntity,
|
31
37
|
qdmTitle: { type: String, default: 'Procedure, Performed' },
|
32
38
|
hqmfOid: { type: String, default: '2.16.840.1.113883.10.20.28.4.67' },
|
33
39
|
qdmCategory: { type: String, default: 'procedure' },
|
34
40
|
qdmStatus: { type: String, default: 'performed' },
|
35
|
-
qdmVersion: { type: String, default: '5.
|
41
|
+
qdmVersion: { type: String, default: '5.5' },
|
36
42
|
_type: { type: String, default: 'QDM::ProcedurePerformed' },
|
37
43
|
|
38
44
|
});
|
@@ -44,4 +50,6 @@ class ProcedurePerformed extends mongoose.Document {
|
|
44
50
|
this._type = 'QDM::ProcedurePerformed';
|
45
51
|
}
|
46
52
|
}
|
53
|
+
|
47
54
|
module.exports.ProcedurePerformed = ProcedurePerformed;
|
55
|
+
|
@@ -1,14 +1,17 @@
|
|
1
1
|
const mongoose = require('mongoose/browser');
|
2
2
|
|
3
|
-
const {
|
3
|
+
const { IdentifierSchema } = require('./attributes/Identifier');
|
4
4
|
const { DataElementSchema } = require('./basetypes/DataElement');
|
5
5
|
const Code = require('./basetypes/Code');
|
6
6
|
const Interval = require('./basetypes/Interval');
|
7
7
|
const Quantity = require('./basetypes/Quantity');
|
8
8
|
const DateTime = require('./basetypes/DateTime');
|
9
|
+
const QDMDate = require('./basetypes/QDMDate');
|
9
10
|
const Any = require('./basetypes/Any');
|
11
|
+
const AnyEntity = require('./basetypes/AnyEntity');
|
10
12
|
const { ComponentSchema } = require('./attributes/Component');
|
11
13
|
const { FacilityLocationSchema } = require('./attributes/FacilityLocation');
|
14
|
+
const { EntitySchema } = require('./attributes/Entity');
|
12
15
|
|
13
16
|
|
14
17
|
const [Number, String] = [
|
@@ -20,13 +23,14 @@ const ProcedureRecommendedSchema = DataElementSchema({
|
|
20
23
|
authorDatetime: DateTime,
|
21
24
|
reason: Code,
|
22
25
|
anatomicalLocationSite: Code,
|
23
|
-
|
26
|
+
rank: Number,
|
27
|
+
requester: AnyEntity,
|
24
28
|
negationRationale: Code,
|
25
29
|
qdmTitle: { type: String, default: 'Procedure, Recommended' },
|
26
30
|
hqmfOid: { type: String, default: '2.16.840.1.113883.10.20.28.4.68' },
|
27
31
|
qdmCategory: { type: String, default: 'procedure' },
|
28
32
|
qdmStatus: { type: String, default: 'recommended' },
|
29
|
-
qdmVersion: { type: String, default: '5.
|
33
|
+
qdmVersion: { type: String, default: '5.5' },
|
30
34
|
_type: { type: String, default: 'QDM::ProcedureRecommended' },
|
31
35
|
|
32
36
|
});
|
@@ -38,4 +42,6 @@ class ProcedureRecommended extends mongoose.Document {
|
|
38
42
|
this._type = 'QDM::ProcedureRecommended';
|
39
43
|
}
|
40
44
|
}
|
45
|
+
|
41
46
|
module.exports.ProcedureRecommended = ProcedureRecommended;
|
47
|
+
|
@@ -1,14 +1,17 @@
|
|
1
1
|
const mongoose = require('mongoose/browser');
|
2
2
|
|
3
|
-
const {
|
3
|
+
const { IdentifierSchema } = require('./attributes/Identifier');
|
4
4
|
const { DataElementSchema } = require('./basetypes/DataElement');
|
5
5
|
const Code = require('./basetypes/Code');
|
6
6
|
const Interval = require('./basetypes/Interval');
|
7
7
|
const Quantity = require('./basetypes/Quantity');
|
8
8
|
const DateTime = require('./basetypes/DateTime');
|
9
|
+
const QDMDate = require('./basetypes/QDMDate');
|
9
10
|
const Any = require('./basetypes/Any');
|
11
|
+
const AnyEntity = require('./basetypes/AnyEntity');
|
10
12
|
const { ComponentSchema } = require('./attributes/Component');
|
11
13
|
const { FacilityLocationSchema } = require('./attributes/FacilityLocation');
|
14
|
+
const { EntitySchema } = require('./attributes/Entity');
|
12
15
|
|
13
16
|
|
14
17
|
const [Number, String] = [
|
@@ -18,10 +21,11 @@ const [Number, String] = [
|
|
18
21
|
|
19
22
|
const ProviderCareExperienceSchema = DataElementSchema({
|
20
23
|
authorDatetime: DateTime,
|
24
|
+
recorder: AnyEntity,
|
21
25
|
qdmTitle: { type: String, default: 'Provider Care Experience' },
|
22
26
|
hqmfOid: { type: String, default: '2.16.840.1.113883.10.20.28.4.70' },
|
23
27
|
qdmCategory: { type: String, default: 'care_experience' },
|
24
|
-
qdmVersion: { type: String, default: '5.
|
28
|
+
qdmVersion: { type: String, default: '5.5' },
|
25
29
|
_type: { type: String, default: 'QDM::ProviderCareExperience' },
|
26
30
|
|
27
31
|
});
|
@@ -33,4 +37,6 @@ class ProviderCareExperience extends mongoose.Document {
|
|
33
37
|
this._type = 'QDM::ProviderCareExperience';
|
34
38
|
}
|
35
39
|
}
|
40
|
+
|
36
41
|
module.exports.ProviderCareExperience = ProviderCareExperience;
|
42
|
+
|
@@ -14,7 +14,7 @@ const [Schema, Number, String, Mixed] = [
|
|
14
14
|
|
15
15
|
const QDMPatientSchema = new Schema({
|
16
16
|
birthDatetime: DateTime,
|
17
|
-
qdmVersion: { type: String, default: '5.
|
17
|
+
qdmVersion: { type: String, default: '5.5' },
|
18
18
|
|
19
19
|
// These are the "data criteria", or QDM datatype elements that exist on a
|
20
20
|
// patient.
|
@@ -97,15 +97,27 @@ QDMPatientSchema.methods.getByProfile = function getByProfile(profile, isNegated
|
|
97
97
|
// @param {String} profile - the data criteria requested by the execution engine
|
98
98
|
// @returns {Object}
|
99
99
|
QDMPatientSchema.methods.findRecords = function findRecords(profile) {
|
100
|
+
// Clear profile cache for this patient if there is no cache or the patient has changed
|
101
|
+
if (QDMPatientSchema.dataElementCache == null
|
102
|
+
|| QDMPatientSchema.dataElementCachePatientId !== this._id) {
|
103
|
+
QDMPatientSchema.dataElementCache = {};
|
104
|
+
QDMPatientSchema.dataElementCachePatientId = this._id;
|
105
|
+
}
|
106
|
+
// If there is a cache 'hit', return it
|
107
|
+
if (Object.prototype.hasOwnProperty.call(QDMPatientSchema.dataElementCache, profile)) {
|
108
|
+
return QDMPatientSchema.dataElementCache[profile];
|
109
|
+
}
|
100
110
|
let profileStripped;
|
101
111
|
if (profile === 'Patient') {
|
102
112
|
// Requested generic patient info
|
103
113
|
const info = { birthDatetime: this.birthDatetime };
|
114
|
+
QDMPatientSchema.dataElementCache[profile] = [info];
|
104
115
|
return [info];
|
105
116
|
} else if (/PatientCharacteristic/.test(profile)) {
|
106
117
|
// Requested a patient characteristic
|
107
118
|
profileStripped = profile.replace(/ *\{[^)]*\} */g, '');
|
108
|
-
|
119
|
+
QDMPatientSchema.dataElementCache[profile] = this.getByProfile(profileStripped);
|
120
|
+
return QDMPatientSchema.dataElementCache[profile];
|
109
121
|
} else if (profile != null) {
|
110
122
|
// Requested something else (probably a QDM data type).
|
111
123
|
|
@@ -120,14 +132,17 @@ QDMPatientSchema.methods.findRecords = function findRecords(profile) {
|
|
120
132
|
if (/Positive/.test(profileStripped)) {
|
121
133
|
profileStripped = profileStripped.replace(/Positive/, '');
|
122
134
|
// Since the data criteria is 'Positive', it is not negated.
|
123
|
-
|
135
|
+
QDMPatientSchema.dataElementCache[profile] = this.getByProfile(profileStripped, false);
|
136
|
+
return QDMPatientSchema.dataElementCache[profile];
|
124
137
|
} else if (/Negative/.test(profileStripped)) {
|
125
138
|
profileStripped = profileStripped.replace(/Negative/, '');
|
126
139
|
// Since the data criteria is 'Negative', it is negated.
|
127
|
-
|
140
|
+
QDMPatientSchema.dataElementCache[profile] = this.getByProfile(profileStripped, true);
|
141
|
+
return QDMPatientSchema.dataElementCache[profile];
|
128
142
|
}
|
129
143
|
// No negation status, proceed normally
|
130
|
-
|
144
|
+
QDMPatientSchema.dataElementCache[profile] = this.getByProfile(profileStripped);
|
145
|
+
return QDMPatientSchema.dataElementCache[profile];
|
131
146
|
}
|
132
147
|
return [];
|
133
148
|
};
|
@@ -212,10 +227,6 @@ QDMPatientSchema.methods.preferences = function preferences() {
|
|
212
227
|
return this.getDataElements({ qdmCategory: 'preference' });
|
213
228
|
};
|
214
229
|
|
215
|
-
QDMPatientSchema.methods.provider_characteristics = function provider_characteristics() {
|
216
|
-
return this.getDataElements({ qdmCategory: 'provider_characteristic' });
|
217
|
-
};
|
218
|
-
|
219
230
|
QDMPatientSchema.methods.procedures = function procedures() {
|
220
231
|
return this.getDataElements({ qdmCategory: 'procedure' });
|
221
232
|
};
|
@@ -252,6 +263,11 @@ QDMPatientSchema.methods.vital_signs = function vital_signs() {
|
|
252
263
|
return this.getDataElements({ qdmCategory: 'vital_sign' });
|
253
264
|
};
|
254
265
|
|
266
|
+
QDMPatientSchema.clearDataElementCache = function clearDataElementCache() {
|
267
|
+
QDMPatientSchema.dataElementCachePatientId = null;
|
268
|
+
QDMPatientSchema.dataElementCache = null;
|
269
|
+
};
|
270
|
+
|
255
271
|
module.exports.QDMPatientSchema = QDMPatientSchema;
|
256
272
|
class QDMPatient extends mongoose.Document {
|
257
273
|
constructor(object) {
|
@@ -0,0 +1,42 @@
|
|
1
|
+
const mongoose = require('mongoose/browser');
|
2
|
+
|
3
|
+
const { IdentifierSchema } = require('./attributes/Identifier');
|
4
|
+
const { DataElementSchema } = require('./basetypes/DataElement');
|
5
|
+
const Code = require('./basetypes/Code');
|
6
|
+
const Interval = require('./basetypes/Interval');
|
7
|
+
const Quantity = require('./basetypes/Quantity');
|
8
|
+
const DateTime = require('./basetypes/DateTime');
|
9
|
+
const QDMDate = require('./basetypes/QDMDate');
|
10
|
+
const Any = require('./basetypes/Any');
|
11
|
+
const AnyEntity = require('./basetypes/AnyEntity');
|
12
|
+
const { ComponentSchema } = require('./attributes/Component');
|
13
|
+
const { FacilityLocationSchema } = require('./attributes/FacilityLocation');
|
14
|
+
const { EntitySchema } = require('./attributes/Entity');
|
15
|
+
|
16
|
+
|
17
|
+
const [Number, String] = [
|
18
|
+
mongoose.Schema.Types.Number,
|
19
|
+
mongoose.Schema.Types.String,
|
20
|
+
];
|
21
|
+
|
22
|
+
const RelatedPersonSchema = DataElementSchema({
|
23
|
+
identifier: IdentifierSchema,
|
24
|
+
linkedPatientId: String,
|
25
|
+
qdmTitle: { type: String, default: 'Related Person' },
|
26
|
+
hqmfOid: { type: String, default: '2.16.840.1.113883.10.20.28.4.141' },
|
27
|
+
qdmCategory: { type: String, default: 'related_person' },
|
28
|
+
qdmVersion: { type: String, default: '5.5' },
|
29
|
+
_type: { type: String, default: 'QDM::RelatedPerson' },
|
30
|
+
|
31
|
+
});
|
32
|
+
|
33
|
+
module.exports.RelatedPersonSchema = RelatedPersonSchema;
|
34
|
+
class RelatedPerson extends mongoose.Document {
|
35
|
+
constructor(object) {
|
36
|
+
super(object, RelatedPersonSchema);
|
37
|
+
this._type = 'QDM::RelatedPerson';
|
38
|
+
}
|
39
|
+
}
|
40
|
+
|
41
|
+
module.exports.RelatedPerson = RelatedPerson;
|
42
|
+
|
@@ -1,14 +1,17 @@
|
|
1
1
|
const mongoose = require('mongoose/browser');
|
2
2
|
|
3
|
-
const {
|
3
|
+
const { IdentifierSchema } = require('./attributes/Identifier');
|
4
4
|
const { DataElementSchema } = require('./basetypes/DataElement');
|
5
5
|
const Code = require('./basetypes/Code');
|
6
6
|
const Interval = require('./basetypes/Interval');
|
7
7
|
const Quantity = require('./basetypes/Quantity');
|
8
8
|
const DateTime = require('./basetypes/DateTime');
|
9
|
+
const QDMDate = require('./basetypes/QDMDate');
|
9
10
|
const Any = require('./basetypes/Any');
|
11
|
+
const AnyEntity = require('./basetypes/AnyEntity');
|
10
12
|
const { ComponentSchema } = require('./attributes/Component');
|
11
13
|
const { FacilityLocationSchema } = require('./attributes/FacilityLocation');
|
14
|
+
const { EntitySchema } = require('./attributes/Entity');
|
12
15
|
|
13
16
|
|
14
17
|
const [Number, String] = [
|
@@ -18,16 +21,18 @@ const [Number, String] = [
|
|
18
21
|
|
19
22
|
const SubstanceAdministeredSchema = DataElementSchema({
|
20
23
|
authorDatetime: DateTime,
|
24
|
+
relevantDatetime: DateTime,
|
21
25
|
relevantPeriod: Interval,
|
22
26
|
dosage: Quantity,
|
23
27
|
frequency: Code,
|
24
28
|
route: Code,
|
25
29
|
negationRationale: Code,
|
30
|
+
performer: AnyEntity,
|
26
31
|
qdmTitle: { type: String, default: 'Substance, Administered' },
|
27
32
|
hqmfOid: { type: String, default: '2.16.840.1.113883.10.20.28.4.73' },
|
28
33
|
qdmCategory: { type: String, default: 'substance' },
|
29
34
|
qdmStatus: { type: String, default: 'administered' },
|
30
|
-
qdmVersion: { type: String, default: '5.
|
35
|
+
qdmVersion: { type: String, default: '5.5' },
|
31
36
|
_type: { type: String, default: 'QDM::SubstanceAdministered' },
|
32
37
|
|
33
38
|
});
|
@@ -39,4 +44,6 @@ class SubstanceAdministered extends mongoose.Document {
|
|
39
44
|
this._type = 'QDM::SubstanceAdministered';
|
40
45
|
}
|
41
46
|
}
|
47
|
+
|
42
48
|
module.exports.SubstanceAdministered = SubstanceAdministered;
|
49
|
+
|