cqm-models 0.7.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.eslintignore +1 -0
- data/.eslintrc.json +26 -0
- data/.github/PULL_REQUEST_TEMPLATE.md +32 -0
- data/.gitignore +21 -0
- data/.rspec +2 -0
- data/.rubocop.yml +42 -0
- data/.travis.yml +21 -0
- data/Gemfile +5 -0
- data/LICENSE.txt +201 -0
- data/README.md +26 -0
- data/Rakefile +12 -0
- data/app/assets/javascripts/AdverseEvent.js +27 -0
- data/app/assets/javascripts/AllDataElements.js +120 -0
- data/app/assets/javascripts/AllergyIntolerance.js +27 -0
- data/app/assets/javascripts/AssessmentPerformed.js +30 -0
- data/app/assets/javascripts/AssessmentRecommended.js +27 -0
- data/app/assets/javascripts/CareGoal.js +25 -0
- data/app/assets/javascripts/CommunicationFromPatientToProvider.js +26 -0
- data/app/assets/javascripts/CommunicationFromProviderToPatient.js +26 -0
- data/app/assets/javascripts/CommunicationFromProviderToProvider.js +26 -0
- data/app/assets/javascripts/Component.js +22 -0
- data/app/assets/javascripts/Concept.js +14 -0
- data/app/assets/javascripts/DeviceApplied.js +29 -0
- data/app/assets/javascripts/DeviceOrder.js +26 -0
- data/app/assets/javascripts/DeviceRecommended.js +26 -0
- data/app/assets/javascripts/Diagnosis.js +27 -0
- data/app/assets/javascripts/DiagnosticStudyOrder.js +27 -0
- data/app/assets/javascripts/DiagnosticStudyPerformed.js +33 -0
- data/app/assets/javascripts/DiagnosticStudyRecommended.js +27 -0
- data/app/assets/javascripts/EncounterOrder.js +27 -0
- data/app/assets/javascripts/EncounterPerformed.js +32 -0
- data/app/assets/javascripts/EncounterRecommended.js +27 -0
- data/app/assets/javascripts/FacilityLocation.js +22 -0
- data/app/assets/javascripts/FamilyHistory.js +25 -0
- data/app/assets/javascripts/Id.js +22 -0
- data/app/assets/javascripts/ImmunizationAdministered.js +30 -0
- data/app/assets/javascripts/ImmunizationOrder.js +30 -0
- data/app/assets/javascripts/InterventionOrder.js +26 -0
- data/app/assets/javascripts/InterventionPerformed.js +29 -0
- data/app/assets/javascripts/InterventionRecommended.js +26 -0
- data/app/assets/javascripts/LaboratoryTestOrder.js +27 -0
- data/app/assets/javascripts/LaboratoryTestPerformed.js +33 -0
- data/app/assets/javascripts/LaboratoryTestRecommended.js +27 -0
- data/app/assets/javascripts/Measure.js +76 -0
- data/app/assets/javascripts/MeasurePackage.js +20 -0
- data/app/assets/javascripts/MedicationActive.js +28 -0
- data/app/assets/javascripts/MedicationAdministered.js +31 -0
- data/app/assets/javascripts/MedicationDischarge.js +30 -0
- data/app/assets/javascripts/MedicationDispensed.js +31 -0
- data/app/assets/javascripts/MedicationOrder.js +34 -0
- data/app/assets/javascripts/Participation.js +21 -0
- data/app/assets/javascripts/Patient.js +248 -0
- data/app/assets/javascripts/PatientCareExperience.js +23 -0
- data/app/assets/javascripts/PatientCharacteristic.js +23 -0
- data/app/assets/javascripts/PatientCharacteristicBirthdate.js +24 -0
- data/app/assets/javascripts/PatientCharacteristicClinicalTrialParticipant.js +26 -0
- data/app/assets/javascripts/PatientCharacteristicEthnicity.js +23 -0
- data/app/assets/javascripts/PatientCharacteristicExpired.js +25 -0
- data/app/assets/javascripts/PatientCharacteristicPayer.js +24 -0
- data/app/assets/javascripts/PatientCharacteristicRace.js +23 -0
- data/app/assets/javascripts/PatientCharacteristicSex.js +23 -0
- data/app/assets/javascripts/PhysicalExamOrder.js +28 -0
- data/app/assets/javascripts/PhysicalExamPerformed.js +31 -0
- data/app/assets/javascripts/PhysicalExamRecommended.js +28 -0
- data/app/assets/javascripts/ProcedureOrder.js +30 -0
- data/app/assets/javascripts/ProcedurePerformed.js +35 -0
- data/app/assets/javascripts/ProcedureRecommended.js +30 -0
- data/app/assets/javascripts/ProviderCareExperience.js +23 -0
- data/app/assets/javascripts/ProviderCharacteristic.js +23 -0
- data/app/assets/javascripts/Ratio.js +22 -0
- data/app/assets/javascripts/Result.js +28 -0
- data/app/assets/javascripts/ResultComponent.js +21 -0
- data/app/assets/javascripts/SubstanceAdministered.js +30 -0
- data/app/assets/javascripts/SubstanceOrder.js +32 -0
- data/app/assets/javascripts/SubstanceRecommended.js +32 -0
- data/app/assets/javascripts/Symptom.js +25 -0
- data/app/assets/javascripts/ValueSet.js +30 -0
- data/app/assets/javascripts/basetypes/Code.js +25 -0
- data/app/assets/javascripts/basetypes/DataElement.js +36 -0
- data/app/assets/javascripts/basetypes/DateTime.js +18 -0
- data/app/assets/javascripts/basetypes/Interval.js +35 -0
- data/app/assets/javascripts/basetypes/Quantity.js +20 -0
- data/app/assets/javascripts/index.js +12 -0
- data/app/models/models.rb +78 -0
- data/app/models/qdm/adverse_event.rb +15 -0
- data/app/models/qdm/allergy_intolerance.rb +15 -0
- data/app/models/qdm/assessment_performed.rb +18 -0
- data/app/models/qdm/assessment_recommended.rb +15 -0
- data/app/models/qdm/basetypes/code.rb +56 -0
- data/app/models/qdm/basetypes/data_element.rb +42 -0
- data/app/models/qdm/basetypes/interval.rb +54 -0
- data/app/models/qdm/basetypes/quantity.rb +52 -0
- data/app/models/qdm/care_goal.rb +13 -0
- data/app/models/qdm/communication_from_patient_to_provider.rb +14 -0
- data/app/models/qdm/communication_from_provider_to_patient.rb +14 -0
- data/app/models/qdm/communication_from_provider_to_provider.rb +14 -0
- data/app/models/qdm/component.rb +10 -0
- data/app/models/qdm/device_applied.rb +17 -0
- data/app/models/qdm/device_order.rb +14 -0
- data/app/models/qdm/device_recommended.rb +14 -0
- data/app/models/qdm/diagnosis.rb +15 -0
- data/app/models/qdm/diagnostic_study_order.rb +15 -0
- data/app/models/qdm/diagnostic_study_performed.rb +21 -0
- data/app/models/qdm/diagnostic_study_recommended.rb +15 -0
- data/app/models/qdm/encounter_order.rb +15 -0
- data/app/models/qdm/encounter_performed.rb +20 -0
- data/app/models/qdm/encounter_recommended.rb +15 -0
- data/app/models/qdm/facility_location.rb +10 -0
- data/app/models/qdm/family_history.rb +13 -0
- data/app/models/qdm/id.rb +10 -0
- data/app/models/qdm/immunization_administered.rb +18 -0
- data/app/models/qdm/immunization_order.rb +18 -0
- data/app/models/qdm/intervention_order.rb +14 -0
- data/app/models/qdm/intervention_performed.rb +17 -0
- data/app/models/qdm/intervention_recommended.rb +14 -0
- data/app/models/qdm/laboratory_test_order.rb +15 -0
- data/app/models/qdm/laboratory_test_performed.rb +21 -0
- data/app/models/qdm/laboratory_test_recommended.rb +15 -0
- data/app/models/qdm/medication_active.rb +16 -0
- data/app/models/qdm/medication_administered.rb +19 -0
- data/app/models/qdm/medication_discharge.rb +18 -0
- data/app/models/qdm/medication_dispensed.rb +19 -0
- data/app/models/qdm/medication_order.rb +22 -0
- data/app/models/qdm/participation.rb +9 -0
- data/app/models/qdm/patient.rb +201 -0
- data/app/models/qdm/patient_care_experience.rb +11 -0
- data/app/models/qdm/patient_characteristic.rb +11 -0
- data/app/models/qdm/patient_characteristic_birthdate.rb +12 -0
- data/app/models/qdm/patient_characteristic_clinical_trial_participant.rb +14 -0
- data/app/models/qdm/patient_characteristic_ethnicity.rb +11 -0
- data/app/models/qdm/patient_characteristic_expired.rb +13 -0
- data/app/models/qdm/patient_characteristic_payer.rb +12 -0
- data/app/models/qdm/patient_characteristic_race.rb +11 -0
- data/app/models/qdm/patient_characteristic_sex.rb +11 -0
- data/app/models/qdm/physical_exam_order.rb +16 -0
- data/app/models/qdm/physical_exam_performed.rb +19 -0
- data/app/models/qdm/physical_exam_recommended.rb +16 -0
- data/app/models/qdm/procedure_order.rb +18 -0
- data/app/models/qdm/procedure_performed.rb +23 -0
- data/app/models/qdm/procedure_recommended.rb +18 -0
- data/app/models/qdm/provider_care_experience.rb +11 -0
- data/app/models/qdm/provider_characteristic.rb +11 -0
- data/app/models/qdm/ratio.rb +10 -0
- data/app/models/qdm/result_component.rb +9 -0
- data/app/models/qdm/substance_administered.rb +18 -0
- data/app/models/qdm/substance_order.rb +20 -0
- data/app/models/qdm/substance_recommended.rb +20 -0
- data/app/models/qdm/symptom.rb +13 -0
- data/app/models/qdm/tacoma/concept.rb +14 -0
- data/app/models/qdm/tacoma/measure.rb +172 -0
- data/app/models/qdm/tacoma/measure_package.rb +10 -0
- data/app/models/qdm/tacoma/valueset.rb +68 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/bin/validate_dist.sh +17 -0
- data/config/mongoid.yml +6 -0
- data/cqm-models.gemspec +29 -0
- data/data/oids.json +584 -0
- data/dist/index.js +157647 -0
- data/lib/cqm/models.rb +1 -0
- data/lib/generate_models.rb +330 -0
- data/modelinfo/qdm-modelinfo-4.2.xml +515 -0
- data/modelinfo/qdm-modelinfo-4.3.xml +521 -0
- data/modelinfo/qdm-modelinfo-5.0.1.xml +436 -0
- data/modelinfo/qdm-modelinfo-5.0.2.xml +445 -0
- data/modelinfo/qdm-modelinfo-5.0.xml +429 -0
- data/modelinfo/qdm-modelinfo-5.3.xml +524 -0
- data/package.json +34 -0
- data/templates/all_data_elements_template.js.erb +4 -0
- data/templates/index_template.js.erb +12 -0
- data/templates/models_template.rb.erb +21 -0
- data/templates/mongoose_template.js.erb +20 -0
- data/templates/patient_extension.rb.erb +194 -0
- data/templates/patient_template.js.erb +247 -0
- data/tmp/.keep +0 -0
- data/yarn.lock +1901 -0
- metadata +320 -0
@@ -0,0 +1,21 @@
|
|
1
|
+
module QDM
|
2
|
+
# app/models/qdm/diagnostic_study_performed.rb
|
3
|
+
class DiagnosticStudyPerformed < DataElement
|
4
|
+
include Mongoid::Document
|
5
|
+
embedded_in :patient
|
6
|
+
field :authorDatetime, type: DateTime
|
7
|
+
field :relevantPeriod, type: QDM::Interval
|
8
|
+
field :reason, type: QDM::Code
|
9
|
+
field :result
|
10
|
+
field :resultDatetime, type: DateTime
|
11
|
+
field :status, type: QDM::Code
|
12
|
+
field :method, type: QDM::Code
|
13
|
+
field :facilityLocation, type: QDM::Code
|
14
|
+
field :negationRationale, type: QDM::Code
|
15
|
+
field :components, type: Array
|
16
|
+
field :hqmfOid, type: String, default: '2.16.840.1.113883.10.20.28.3.23'
|
17
|
+
field :category, type: String, default: 'diagnostic_study'
|
18
|
+
field :qdmStatus, type: String, default: 'performed'
|
19
|
+
field :qdmVersion, type: String, default: '5.3'
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module QDM
|
2
|
+
# app/models/qdm/diagnostic_study_recommended.rb
|
3
|
+
class DiagnosticStudyRecommended < DataElement
|
4
|
+
include Mongoid::Document
|
5
|
+
embedded_in :patient
|
6
|
+
field :authorDatetime, type: DateTime
|
7
|
+
field :method, type: QDM::Code
|
8
|
+
field :negationRationale, type: QDM::Code
|
9
|
+
field :hqmfOid, type: String, default: '2.16.840.1.113883.10.20.28.3.24'
|
10
|
+
field :qrdaOid, type: String, default: '2.16.840.1.113883.10.20.24.3.19'
|
11
|
+
field :category, type: String, default: 'diagnostic_study'
|
12
|
+
field :qdmStatus, type: String, default: 'recommended'
|
13
|
+
field :qdmVersion, type: String, default: '5.3'
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module QDM
|
2
|
+
# app/models/qdm/encounter_order.rb
|
3
|
+
class EncounterOrder < DataElement
|
4
|
+
include Mongoid::Document
|
5
|
+
embedded_in :patient
|
6
|
+
field :authorDatetime, type: DateTime
|
7
|
+
field :reason, type: QDM::Code
|
8
|
+
field :facilityLocation, type: QDM::Code
|
9
|
+
field :negationRationale, type: QDM::Code
|
10
|
+
field :hqmfOid, type: String, default: '2.16.840.1.113883.10.20.28.3.27'
|
11
|
+
field :category, type: String, default: 'encounter'
|
12
|
+
field :qdmStatus, type: String, default: 'order'
|
13
|
+
field :qdmVersion, type: String, default: '5.3'
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module QDM
|
2
|
+
# app/models/qdm/encounter_performed.rb
|
3
|
+
class EncounterPerformed < DataElement
|
4
|
+
include Mongoid::Document
|
5
|
+
embedded_in :patient
|
6
|
+
field :authorDatetime, type: DateTime
|
7
|
+
field :admissionSource, type: QDM::Code
|
8
|
+
field :relevantPeriod, type: QDM::Interval
|
9
|
+
field :dischargeDisposition, type: QDM::Code
|
10
|
+
field :facilityLocations, type: Array
|
11
|
+
field :diagnoses, type: Array
|
12
|
+
field :principalDiagnosis, type: QDM::Code
|
13
|
+
field :negationRationale, type: QDM::Code
|
14
|
+
field :lengthOfStay, type: QDM::Quantity
|
15
|
+
field :hqmfOid, type: String, default: '2.16.840.1.113883.10.20.28.3.5'
|
16
|
+
field :category, type: String, default: 'encounter'
|
17
|
+
field :qdmStatus, type: String, default: 'performed'
|
18
|
+
field :qdmVersion, type: String, default: '5.3'
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module QDM
|
2
|
+
# app/models/qdm/encounter_recommended.rb
|
3
|
+
class EncounterRecommended < DataElement
|
4
|
+
include Mongoid::Document
|
5
|
+
embedded_in :patient
|
6
|
+
field :authorDatetime, type: DateTime
|
7
|
+
field :reason, type: QDM::Code
|
8
|
+
field :facilityLocation, type: QDM::Code
|
9
|
+
field :negationRationale, type: QDM::Code
|
10
|
+
field :hqmfOid, type: String, default: '2.16.840.1.113883.10.20.28.3.28'
|
11
|
+
field :category, type: String, default: 'encounter'
|
12
|
+
field :qdmStatus, type: String, default: 'recommended'
|
13
|
+
field :qdmVersion, type: String, default: '5.3'
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
module QDM
|
2
|
+
# app/models/qdm/facility_location.rb
|
3
|
+
class FacilityLocation < DataElement
|
4
|
+
include Mongoid::Document
|
5
|
+
embedded_in :patient
|
6
|
+
field :code, type: QDM::Code
|
7
|
+
field :locationPeriod, type: QDM::Interval
|
8
|
+
field :qdmVersion, type: String, default: '5.3'
|
9
|
+
end
|
10
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
module QDM
|
2
|
+
# app/models/qdm/family_history.rb
|
3
|
+
class FamilyHistory < DataElement
|
4
|
+
include Mongoid::Document
|
5
|
+
embedded_in :patient
|
6
|
+
field :authorDatetime, type: DateTime
|
7
|
+
field :relationship, type: QDM::Code
|
8
|
+
field :hqmfOid, type: String, default: '2.16.840.1.113883.10.20.28.3.111'
|
9
|
+
field :qrdaOid, type: String, default: '2.16.840.1.113883.10.20.24.3.12'
|
10
|
+
field :category, type: String, default: 'family_history'
|
11
|
+
field :qdmVersion, type: String, default: '5.3'
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module QDM
|
2
|
+
# app/models/qdm/immunization_administered.rb
|
3
|
+
class ImmunizationAdministered < DataElement
|
4
|
+
include Mongoid::Document
|
5
|
+
embedded_in :patient
|
6
|
+
field :authorDatetime, type: DateTime
|
7
|
+
field :reason, type: QDM::Code
|
8
|
+
field :dosage, type: QDM::Quantity
|
9
|
+
field :supply, type: QDM::Quantity
|
10
|
+
field :route, type: QDM::Code
|
11
|
+
field :negationRationale, type: QDM::Code
|
12
|
+
field :hqmfOid, type: String, default: '2.16.840.1.113883.10.20.28.3.112'
|
13
|
+
field :qrdaOid, type: String, default: '2.16.840.1.113883.10.20.24.3.140'
|
14
|
+
field :category, type: String, default: 'immunization'
|
15
|
+
field :qdmStatus, type: String, default: 'administered'
|
16
|
+
field :qdmVersion, type: String, default: '5.3'
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module QDM
|
2
|
+
# app/models/qdm/immunization_order.rb
|
3
|
+
class ImmunizationOrder < DataElement
|
4
|
+
include Mongoid::Document
|
5
|
+
embedded_in :patient
|
6
|
+
field :activeDatetime, type: DateTime
|
7
|
+
field :authorDatetime, type: DateTime
|
8
|
+
field :dosage, type: QDM::Quantity
|
9
|
+
field :supply, type: QDM::Quantity
|
10
|
+
field :reason, type: QDM::Code
|
11
|
+
field :route, type: QDM::Code
|
12
|
+
field :negationRationale, type: QDM::Code
|
13
|
+
field :hqmfOid, type: String, default: '2.16.840.1.113883.10.20.28.3.113'
|
14
|
+
field :category, type: String, default: 'immunization'
|
15
|
+
field :qdmStatus, type: String, default: 'order'
|
16
|
+
field :qdmVersion, type: String, default: '5.3'
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module QDM
|
2
|
+
# app/models/qdm/intervention_order.rb
|
3
|
+
class InterventionOrder < DataElement
|
4
|
+
include Mongoid::Document
|
5
|
+
embedded_in :patient
|
6
|
+
field :authorDatetime, type: DateTime
|
7
|
+
field :reason, type: QDM::Code
|
8
|
+
field :negationRationale, type: QDM::Code
|
9
|
+
field :hqmfOid, type: String, default: '2.16.840.1.113883.10.20.28.3.35'
|
10
|
+
field :category, type: String, default: 'intervention'
|
11
|
+
field :qdmStatus, type: String, default: 'order'
|
12
|
+
field :qdmVersion, type: String, default: '5.3'
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module QDM
|
2
|
+
# app/models/qdm/intervention_performed.rb
|
3
|
+
class InterventionPerformed < DataElement
|
4
|
+
include Mongoid::Document
|
5
|
+
embedded_in :patient
|
6
|
+
field :authorDatetime, type: DateTime
|
7
|
+
field :relevantPeriod, type: QDM::Interval
|
8
|
+
field :reason, type: QDM::Code
|
9
|
+
field :result
|
10
|
+
field :status, type: QDM::Code
|
11
|
+
field :negationRationale, type: QDM::Code
|
12
|
+
field :hqmfOid, type: String, default: '2.16.840.1.113883.10.20.28.3.36'
|
13
|
+
field :category, type: String, default: 'intervention'
|
14
|
+
field :qdmStatus, type: String, default: 'performed'
|
15
|
+
field :qdmVersion, type: String, default: '5.3'
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module QDM
|
2
|
+
# app/models/qdm/intervention_recommended.rb
|
3
|
+
class InterventionRecommended < DataElement
|
4
|
+
include Mongoid::Document
|
5
|
+
embedded_in :patient
|
6
|
+
field :authorDatetime, type: DateTime
|
7
|
+
field :reason, type: QDM::Code
|
8
|
+
field :negationRationale, type: QDM::Code
|
9
|
+
field :hqmfOid, type: String, default: '2.16.840.1.113883.10.20.28.3.37'
|
10
|
+
field :category, type: String, default: 'intervention'
|
11
|
+
field :qdmStatus, type: String, default: 'recommended'
|
12
|
+
field :qdmVersion, type: String, default: '5.3'
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module QDM
|
2
|
+
# app/models/qdm/laboratory_test_order.rb
|
3
|
+
class LaboratoryTestOrder < DataElement
|
4
|
+
include Mongoid::Document
|
5
|
+
embedded_in :patient
|
6
|
+
field :authorDatetime, type: DateTime
|
7
|
+
field :reason, type: QDM::Code
|
8
|
+
field :method, type: QDM::Code
|
9
|
+
field :negationRationale, type: QDM::Code
|
10
|
+
field :hqmfOid, type: String, default: '2.16.840.1.113883.10.20.28.3.41'
|
11
|
+
field :category, type: String, default: 'laboratory_test'
|
12
|
+
field :qdmStatus, type: String, default: 'order'
|
13
|
+
field :qdmVersion, type: String, default: '5.3'
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module QDM
|
2
|
+
# app/models/qdm/laboratory_test_performed.rb
|
3
|
+
class LaboratoryTestPerformed < DataElement
|
4
|
+
include Mongoid::Document
|
5
|
+
embedded_in :patient
|
6
|
+
field :authorDatetime, type: DateTime
|
7
|
+
field :relevantPeriod, type: QDM::Interval
|
8
|
+
field :status, type: QDM::Code
|
9
|
+
field :method, type: QDM::Code
|
10
|
+
field :result
|
11
|
+
field :resultDatetime, type: DateTime
|
12
|
+
field :reason, type: QDM::Code
|
13
|
+
field :referenceRange, type: QDM::Interval
|
14
|
+
field :negationRationale, type: QDM::Code
|
15
|
+
field :components, type: Array
|
16
|
+
field :hqmfOid, type: String, default: '2.16.840.1.113883.10.20.28.3.42'
|
17
|
+
field :category, type: String, default: 'laboratory_test'
|
18
|
+
field :qdmStatus, type: String, default: 'performed'
|
19
|
+
field :qdmVersion, type: String, default: '5.3'
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module QDM
|
2
|
+
# app/models/qdm/laboratory_test_recommended.rb
|
3
|
+
class LaboratoryTestRecommended < DataElement
|
4
|
+
include Mongoid::Document
|
5
|
+
embedded_in :patient
|
6
|
+
field :authorDatetime, type: DateTime
|
7
|
+
field :method, type: QDM::Code
|
8
|
+
field :reason, type: QDM::Code
|
9
|
+
field :negationRationale, type: QDM::Code
|
10
|
+
field :hqmfOid, type: String, default: '2.16.840.1.113883.10.20.28.3.43'
|
11
|
+
field :category, type: String, default: 'laboratory_test'
|
12
|
+
field :qdmStatus, type: String, default: 'recommended'
|
13
|
+
field :qdmVersion, type: String, default: '5.3'
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module QDM
|
2
|
+
# app/models/qdm/medication_active.rb
|
3
|
+
class MedicationActive < DataElement
|
4
|
+
include Mongoid::Document
|
5
|
+
embedded_in :patient
|
6
|
+
field :relevantPeriod, type: QDM::Interval
|
7
|
+
field :dosage, type: QDM::Quantity
|
8
|
+
field :supply, type: QDM::Quantity
|
9
|
+
field :frequency, type: QDM::Code
|
10
|
+
field :route, type: QDM::Code
|
11
|
+
field :hqmfOid, type: String, default: '2.16.840.1.113883.10.20.28.3.44'
|
12
|
+
field :category, type: String, default: 'medication'
|
13
|
+
field :qdmStatus, type: String, default: 'active'
|
14
|
+
field :qdmVersion, type: String, default: '5.3'
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module QDM
|
2
|
+
# app/models/qdm/medication_administered.rb
|
3
|
+
class MedicationAdministered < DataElement
|
4
|
+
include Mongoid::Document
|
5
|
+
embedded_in :patient
|
6
|
+
field :authorDatetime, type: DateTime
|
7
|
+
field :relevantPeriod, type: QDM::Interval
|
8
|
+
field :dosage, type: QDM::Quantity
|
9
|
+
field :supply, type: QDM::Quantity
|
10
|
+
field :frequency, type: QDM::Code
|
11
|
+
field :route, type: QDM::Code
|
12
|
+
field :reason, type: QDM::Code
|
13
|
+
field :negationRationale, type: QDM::Code
|
14
|
+
field :hqmfOid, type: String, default: '2.16.840.1.113883.10.20.28.3.45'
|
15
|
+
field :category, type: String, default: 'medication'
|
16
|
+
field :qdmStatus, type: String, default: 'administered'
|
17
|
+
field :qdmVersion, type: String, default: '5.3'
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module QDM
|
2
|
+
# app/models/qdm/medication_discharge.rb
|
3
|
+
class MedicationDischarge < DataElement
|
4
|
+
include Mongoid::Document
|
5
|
+
embedded_in :patient
|
6
|
+
field :authorDatetime, type: DateTime
|
7
|
+
field :refills, type: Integer
|
8
|
+
field :dosage, type: QDM::Quantity
|
9
|
+
field :supply, type: QDM::Quantity
|
10
|
+
field :frequency, type: QDM::Code
|
11
|
+
field :route, type: QDM::Code
|
12
|
+
field :negationRationale, type: QDM::Code
|
13
|
+
field :hqmfOid, type: String, default: '2.16.840.1.113883.10.20.28.3.48'
|
14
|
+
field :category, type: String, default: 'medication'
|
15
|
+
field :qdmStatus, type: String, default: 'discharge'
|
16
|
+
field :qdmVersion, type: String, default: '5.3'
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module QDM
|
2
|
+
# app/models/qdm/medication_dispensed.rb
|
3
|
+
class MedicationDispensed < DataElement
|
4
|
+
include Mongoid::Document
|
5
|
+
embedded_in :patient
|
6
|
+
field :authorDatetime, type: DateTime
|
7
|
+
field :relevantPeriod, type: QDM::Interval
|
8
|
+
field :refills, type: Integer
|
9
|
+
field :dosage, type: QDM::Quantity
|
10
|
+
field :supply, type: QDM::Quantity
|
11
|
+
field :frequency, type: QDM::Code
|
12
|
+
field :route, type: QDM::Code
|
13
|
+
field :negationRationale, type: QDM::Code
|
14
|
+
field :hqmfOid, type: String, default: '2.16.840.1.113883.10.20.28.3.49'
|
15
|
+
field :category, type: String, default: 'medication'
|
16
|
+
field :qdmStatus, type: String, default: 'dispensed'
|
17
|
+
field :qdmVersion, type: String, default: '5.3'
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
module QDM
|
2
|
+
# app/models/qdm/medication_order.rb
|
3
|
+
class MedicationOrder < DataElement
|
4
|
+
include Mongoid::Document
|
5
|
+
embedded_in :patient
|
6
|
+
field :activeDatetime, type: DateTime
|
7
|
+
field :relevantPeriod, type: QDM::Interval
|
8
|
+
field :authorDatetime, type: DateTime
|
9
|
+
field :refills, type: Integer
|
10
|
+
field :dosage, type: QDM::Quantity
|
11
|
+
field :supply, type: QDM::Quantity
|
12
|
+
field :frequency, type: QDM::Code
|
13
|
+
field :route, type: QDM::Code
|
14
|
+
field :method, type: QDM::Code
|
15
|
+
field :reason, type: QDM::Code
|
16
|
+
field :negationRationale, type: QDM::Code
|
17
|
+
field :hqmfOid, type: String, default: '2.16.840.1.113883.10.20.28.3.51'
|
18
|
+
field :category, type: String, default: 'medication'
|
19
|
+
field :qdmStatus, type: String, default: 'order'
|
20
|
+
field :qdmVersion, type: String, default: '5.3'
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,201 @@
|
|
1
|
+
module QDM
|
2
|
+
# app/models/qdm/patient.rb
|
3
|
+
class Patient
|
4
|
+
include Mongoid::Document
|
5
|
+
field :birthDatetime, type: DateTime
|
6
|
+
field :qdmVersion, type: String, default: '5.3'
|
7
|
+
field :givenNames, type: Array
|
8
|
+
field :familyName, type: String
|
9
|
+
field :bundleId, type: String
|
10
|
+
|
11
|
+
# These are the "data criteria", or QDM datatype elements that exist on a
|
12
|
+
# patient.
|
13
|
+
embeds_many :dataElements, class_name: 'QDM::DataElement'
|
14
|
+
|
15
|
+
# This field is for application specific information only. If both Bonnie
|
16
|
+
# Cypress use a common field, it should be made a field on this model,
|
17
|
+
# and not put into extendedData.
|
18
|
+
field :extendedData, type: Hash
|
19
|
+
|
20
|
+
# Returns an array of elements that exist on this patient, that
|
21
|
+
# match the given HQMF data criteria OID.
|
22
|
+
def get_by_hqmf_oid(hqmf_oid)
|
23
|
+
dataElements.where(hqmfOid: hqmf_oid) || []
|
24
|
+
end
|
25
|
+
|
26
|
+
# Returns an array of elements that exist on this patient, that
|
27
|
+
# match the given QRDA data criteria OID.
|
28
|
+
def get_by_qrda_oid(qrda_oid)
|
29
|
+
dataElements.where(qrdaOid: qrda_oid) || []
|
30
|
+
end
|
31
|
+
|
32
|
+
# Returns an array of elements that exist on this patient. Optionally
|
33
|
+
# takes a category and/or, which returns all elements of that QDM
|
34
|
+
# category. Example: patient.get_data_elements('encounters')
|
35
|
+
# will return all Encounter QDM data types active on the patient.
|
36
|
+
def get_data_elements(category = nil, status = nil)
|
37
|
+
if category && status
|
38
|
+
dataElements.where(category: category, qdmStatus: status) || []
|
39
|
+
elsif category
|
40
|
+
dataElements.where(category: category) || []
|
41
|
+
else
|
42
|
+
dataElements || []
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
# Helper method; returns adverse_event data element types on this patient.
|
47
|
+
def adverse_events
|
48
|
+
get_data_elements('adverse_event')
|
49
|
+
end
|
50
|
+
|
51
|
+
# Helper method; returns allergy data element types on this patient.
|
52
|
+
def allergies
|
53
|
+
get_data_elements('allergy')
|
54
|
+
end
|
55
|
+
|
56
|
+
# Helper method; returns assessment data element types on this patient.
|
57
|
+
def assessments
|
58
|
+
get_data_elements('assessment')
|
59
|
+
end
|
60
|
+
|
61
|
+
# Helper method; returns care_experience data element types on this patient.
|
62
|
+
def care_experiences
|
63
|
+
get_data_elements('care_experience')
|
64
|
+
end
|
65
|
+
|
66
|
+
# Helper method; returns care_goal data element types on this patient.
|
67
|
+
def care_goals
|
68
|
+
get_data_elements('care_goal')
|
69
|
+
end
|
70
|
+
|
71
|
+
# Helper method; returns communication data element types on this patient.
|
72
|
+
def communications
|
73
|
+
get_data_elements('communication')
|
74
|
+
end
|
75
|
+
|
76
|
+
# Helper method; returns condition data element types on this patient.
|
77
|
+
def conditions
|
78
|
+
get_data_elements('condition')
|
79
|
+
end
|
80
|
+
|
81
|
+
# Helper method; returns device data element types on this patient.
|
82
|
+
def devices
|
83
|
+
get_data_elements('device')
|
84
|
+
end
|
85
|
+
|
86
|
+
# Helper method; returns diagnostic_study data element types on this patient.
|
87
|
+
def diagnostic_studies
|
88
|
+
get_data_elements('diagnostic_study')
|
89
|
+
end
|
90
|
+
|
91
|
+
# Helper method; returns encounter data element types on this patient.
|
92
|
+
def encounters
|
93
|
+
get_data_elements('encounter')
|
94
|
+
end
|
95
|
+
|
96
|
+
# Helper method; returns family_history data element types on this patient.
|
97
|
+
def family_history
|
98
|
+
get_data_elements('family_history')
|
99
|
+
end
|
100
|
+
|
101
|
+
# Helper method; returns functional_status data element types on this patient.
|
102
|
+
def functional_statuses
|
103
|
+
get_data_elements('functional_status')
|
104
|
+
end
|
105
|
+
|
106
|
+
# Helper method; returns immunization data element types on this patient.
|
107
|
+
def immunizations
|
108
|
+
get_data_elements('immunization')
|
109
|
+
end
|
110
|
+
|
111
|
+
# Helper method; returns intervention data element types on this patient.
|
112
|
+
def interventions
|
113
|
+
get_data_elements('intervention')
|
114
|
+
end
|
115
|
+
|
116
|
+
# Helper method; returns laboratory_test data element types on this patient.
|
117
|
+
def laboratory_tests
|
118
|
+
get_data_elements('laboratory_test')
|
119
|
+
end
|
120
|
+
|
121
|
+
# Helper method; returns medical_equipment data element types on this patient.
|
122
|
+
def medical_equipment
|
123
|
+
get_data_elements('medical_equipment')
|
124
|
+
end
|
125
|
+
|
126
|
+
# Helper method; returns medication data element types on this patient.
|
127
|
+
def medications
|
128
|
+
get_data_elements('medication')
|
129
|
+
end
|
130
|
+
|
131
|
+
# Helper method; returns physical_exam data element types on this patient.
|
132
|
+
def physical_exams
|
133
|
+
get_data_elements('physical_exam')
|
134
|
+
end
|
135
|
+
|
136
|
+
# Helper method; returns preference data element types on this patient.
|
137
|
+
def preferences
|
138
|
+
get_data_elements('preference')
|
139
|
+
end
|
140
|
+
|
141
|
+
# Helper method; returns provider_characteristic data element types on this patient.
|
142
|
+
def provider_characteristics
|
143
|
+
get_data_elements('provider_characteristic')
|
144
|
+
end
|
145
|
+
|
146
|
+
# Helper method; returns procedure data element types on this patient.
|
147
|
+
def procedures
|
148
|
+
get_data_elements('procedure')
|
149
|
+
end
|
150
|
+
|
151
|
+
# Helper method; returns result data element types on this patient.
|
152
|
+
def results
|
153
|
+
get_data_elements('result')
|
154
|
+
end
|
155
|
+
|
156
|
+
# Helper method; returns risk_category_assessment data element types on this patient.
|
157
|
+
def risk_category_assessments
|
158
|
+
get_data_elements('risk_category_assessment')
|
159
|
+
end
|
160
|
+
|
161
|
+
# Helper method; returns social_history data element types on this patient.
|
162
|
+
def social_history
|
163
|
+
get_data_elements('social_history')
|
164
|
+
end
|
165
|
+
|
166
|
+
# Helper method; returns substance data element types on this patient.
|
167
|
+
def substances
|
168
|
+
get_data_elements('substance')
|
169
|
+
end
|
170
|
+
|
171
|
+
# Helper method; returns symptom data element types on this patient.
|
172
|
+
def symptoms
|
173
|
+
get_data_elements('symptom')
|
174
|
+
end
|
175
|
+
|
176
|
+
# Helper method; returns system_characteristic data element types on this patient.
|
177
|
+
def system_characteristics
|
178
|
+
get_data_elements('system_characteristic')
|
179
|
+
end
|
180
|
+
|
181
|
+
# Helper method; returns transfer data element types on this patient.
|
182
|
+
def transfers
|
183
|
+
get_data_elements('transfer')
|
184
|
+
end
|
185
|
+
|
186
|
+
# Helper method; returns vital_sign data element types on this patient.
|
187
|
+
def vital_signs
|
188
|
+
get_data_elements('vital_sign')
|
189
|
+
end
|
190
|
+
|
191
|
+
# Return the Mongo id.
|
192
|
+
def id
|
193
|
+
_id
|
194
|
+
end
|
195
|
+
|
196
|
+
# Include '_type' in any JSON output. This is necessary for deserialization.
|
197
|
+
def to_json(options = nil)
|
198
|
+
serializable_hash(methods: :_type).to_json(options)
|
199
|
+
end
|
200
|
+
end
|
201
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
module QDM
|
2
|
+
# app/models/qdm/patient_care_experience.rb
|
3
|
+
class PatientCareExperience < DataElement
|
4
|
+
include Mongoid::Document
|
5
|
+
embedded_in :patient
|
6
|
+
field :authorDatetime, type: DateTime
|
7
|
+
field :hqmfOid, type: String, default: '2.16.840.1.113883.10.20.28.3.52'
|
8
|
+
field :category, type: String, default: 'care_experience'
|
9
|
+
field :qdmVersion, type: String, default: '5.3'
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
module QDM
|
2
|
+
# app/models/qdm/patient_characteristic.rb
|
3
|
+
class PatientCharacteristic < DataElement
|
4
|
+
include Mongoid::Document
|
5
|
+
embedded_in :patient
|
6
|
+
field :authorDatetime, type: DateTime
|
7
|
+
field :hqmfOid, type: String, default: '2.16.840.1.113883.10.20.28.3.53'
|
8
|
+
field :category, type: String, default: 'patient_characteristic'
|
9
|
+
field :qdmVersion, type: String, default: '5.3'
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
module QDM
|
2
|
+
# app/models/qdm/patient_characteristic_birthdate.rb
|
3
|
+
class PatientCharacteristicBirthdate < DataElement
|
4
|
+
include Mongoid::Document
|
5
|
+
embedded_in :patient
|
6
|
+
field :birthDatetime, type: DateTime
|
7
|
+
field :hqmfOid, type: String, default: '2.16.840.1.113883.10.20.28.3.54'
|
8
|
+
field :category, type: String, default: 'patient_characteristic'
|
9
|
+
field :qdmStatus, type: String, default: 'birthdate'
|
10
|
+
field :qdmVersion, type: String, default: '5.3'
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module QDM
|
2
|
+
# app/models/qdm/patient_characteristic_clinical_trial_participant.rb
|
3
|
+
class PatientCharacteristicClinicalTrialParticipant < DataElement
|
4
|
+
include Mongoid::Document
|
5
|
+
embedded_in :patient
|
6
|
+
field :reason, type: QDM::Code
|
7
|
+
field :relevantPeriod, type: QDM::Interval
|
8
|
+
field :hqmfOid, type: String, default: '2.16.840.1.113883.10.20.28.3.6'
|
9
|
+
field :qrdaOid, type: String, default: '2.16.840.1.113883.10.20.24.3.51'
|
10
|
+
field :category, type: String, default: 'patient_characteristic'
|
11
|
+
field :qdmStatus, type: String, default: 'clinical_trial_participant'
|
12
|
+
field :qdmVersion, type: String, default: '5.3'
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
module QDM
|
2
|
+
# app/models/qdm/patient_characteristic_ethnicity.rb
|
3
|
+
class PatientCharacteristicEthnicity < DataElement
|
4
|
+
include Mongoid::Document
|
5
|
+
embedded_in :patient
|
6
|
+
field :hqmfOid, type: String, default: '2.16.840.1.113883.10.20.28.3.56'
|
7
|
+
field :category, type: String, default: 'patient_characteristic'
|
8
|
+
field :qdmStatus, type: String, default: 'ethnicity'
|
9
|
+
field :qdmVersion, type: String, default: '5.3'
|
10
|
+
end
|
11
|
+
end
|