health-data-standards 0.5.0 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/health-data-standards/export/ccr.rb +66 -53
- data/lib/health-data-standards/import/c32/patient_importer.rb +13 -1
- data/lib/health-data-standards/models/encounter.rb +7 -2
- data/lib/health-data-standards/models/entry.rb +17 -0
- data/lib/health-data-standards/models/fulfillment_history.rb +19 -6
- data/lib/health-data-standards/models/immunization.rb +7 -2
- data/lib/health-data-standards/models/lab_result.rb +4 -1
- data/lib/health-data-standards/models/medication.rb +30 -10
- data/lib/health-data-standards/models/order_information.rb +13 -4
- data/lib/health-data-standards/models/record.rb +9 -5
- data/templates/_allergies_no_current.c32.erb +39 -0
- data/templates/_care_goals.c32.erb +1 -0
- data/templates/_conditions_no_current.c32.erb +2 -0
- data/templates/_medications_no_current.c32.erb +32 -0
- data/templates/_procedures.c32.erb +1 -0
- data/templates/show.c32.erb +6 -0
- metadata +19 -15
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.7.0
|
@@ -27,15 +27,16 @@ module HealthDataStandards
|
|
27
27
|
end
|
28
28
|
end
|
29
29
|
to_ccr_purpose(xml)
|
30
|
-
xml.
|
30
|
+
xml.Body do
|
31
31
|
to_ccr_problems(xml, patient)
|
32
|
-
|
33
|
-
to_ccr_results(xml, patient)
|
34
|
-
to_ccr_encounters(xml, patient)
|
32
|
+
to_ccr_allergies(xml, patient)
|
35
33
|
to_ccr_medications(xml, patient)
|
36
34
|
to_ccr_immunizations(xml, patient)
|
35
|
+
to_ccr_vitals(xml, patient)
|
36
|
+
to_ccr_results(xml, patient)
|
37
37
|
to_ccr_procedures(xml, patient)
|
38
|
-
|
38
|
+
to_ccr_encounters(xml, patient)
|
39
|
+
|
39
40
|
end
|
40
41
|
to_ccr_actors(xml, patient)
|
41
42
|
end
|
@@ -46,10 +47,10 @@ module HealthDataStandards
|
|
46
47
|
private
|
47
48
|
|
48
49
|
def code_section(xml, codes)
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
50
|
+
if codes.present?
|
51
|
+
codes.each_pair do |code_set, coded_values|
|
52
|
+
coded_values.each do |coded_value|
|
53
|
+
xml.Code do
|
53
54
|
xml.Value(coded_value)
|
54
55
|
xml.CodingSystem(code_set)
|
55
56
|
#TODO: Need to fix this and not be a hard-coded value
|
@@ -71,6 +72,7 @@ module HealthDataStandards
|
|
71
72
|
end
|
72
73
|
end
|
73
74
|
|
75
|
+
|
74
76
|
# Builds the XML snippet for the problems section inside the CCR standard
|
75
77
|
#
|
76
78
|
# @return [Builder::XmlMarkup] CCR XML representation of patient data
|
@@ -136,25 +138,57 @@ module HealthDataStandards
|
|
136
138
|
if patient.vital_signs.present?
|
137
139
|
xml.VitalSigns do
|
138
140
|
patient.vital_signs.each_with_index do |vital_sign, index|
|
139
|
-
xml
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
141
|
+
to_result(xml,vital_sign,"VT000#{index + 1}")
|
142
|
+
end
|
143
|
+
end
|
144
|
+
end
|
145
|
+
end
|
146
|
+
|
147
|
+
|
148
|
+
# Builds the XML snippet for the lab section inside the CCR standard
|
149
|
+
#
|
150
|
+
# @return [Builder::XmlMarkup] CCR XML representation of patient data
|
151
|
+
def to_ccr_results(xml, patient)
|
152
|
+
if patient.results.present?
|
153
|
+
xml.Results do
|
154
|
+
patient.results.each_with_index do |lab_result, index|
|
155
|
+
to_result(xml,lab_result,"LB000#{index + 1}")
|
153
156
|
end
|
154
157
|
end
|
155
158
|
end
|
156
159
|
end
|
160
|
+
|
157
161
|
|
162
|
+
def to_result(xml, res, ccr_id )
|
163
|
+
xml.Result do
|
164
|
+
xml.CCRDataObjectID(ccr_id)
|
165
|
+
xml.DateTime do
|
166
|
+
xml.Type do
|
167
|
+
xml.Text("Start date")
|
168
|
+
end
|
169
|
+
#time
|
170
|
+
xml.ExactDateTime(convert_to_ccr_time_string(res.time))
|
171
|
+
end
|
172
|
+
xml.Description do
|
173
|
+
xml.Text(res.description)
|
174
|
+
code_section(xml, res.codes)
|
175
|
+
end
|
176
|
+
|
177
|
+
xml.Source
|
178
|
+
xml.Test do
|
179
|
+
xml.CCRDataObjectID("#{ccr_id}TestResult")
|
180
|
+
xml.Source
|
181
|
+
xml.TestResult do
|
182
|
+
xml.Value(res.value["scalar"])
|
183
|
+
xml.Units do
|
184
|
+
xml.Unit(res.value["units"])
|
185
|
+
end
|
186
|
+
end
|
187
|
+
end
|
188
|
+
end
|
189
|
+
|
190
|
+
end
|
191
|
+
|
158
192
|
# Builds the XML snippet for the medications section inside the CCR standard
|
159
193
|
#
|
160
194
|
# @return [Builder::XmlMarkup] CCR XML representation of patient data
|
@@ -225,31 +259,7 @@ module HealthDataStandards
|
|
225
259
|
end
|
226
260
|
end
|
227
261
|
|
228
|
-
|
229
|
-
#
|
230
|
-
# @return [Builder::XmlMarkup] CCR XML representation of patient data
|
231
|
-
def to_ccr_results(xml, patient)
|
232
|
-
if patient.results.present?
|
233
|
-
xml.Results do
|
234
|
-
patient.results.each_with_index do |lab_result, index|
|
235
|
-
xml.Result do
|
236
|
-
xml.CCRDataObjectID("LB000#{index + 1}")
|
237
|
-
xml.DateTime do
|
238
|
-
xml.Type do
|
239
|
-
xml.Text("Start date")
|
240
|
-
end
|
241
|
-
#time
|
242
|
-
xml.ExactDateTime(convert_to_ccr_time_string(lab_result.time))
|
243
|
-
end
|
244
|
-
xml.Description do
|
245
|
-
xml.Text(lab_result.description)
|
246
|
-
code_section(xml, lab_result.codes)
|
247
|
-
end
|
248
|
-
end
|
249
|
-
end
|
250
|
-
end
|
251
|
-
end
|
252
|
-
end
|
262
|
+
|
253
263
|
|
254
264
|
# Builds the XML snippet for the procedures section inside the CCR standard
|
255
265
|
#
|
@@ -274,6 +284,7 @@ module HealthDataStandards
|
|
274
284
|
xml.Status do
|
275
285
|
xml.Text("Active")
|
276
286
|
end
|
287
|
+
xml.Source
|
277
288
|
end
|
278
289
|
end
|
279
290
|
end
|
@@ -303,6 +314,7 @@ module HealthDataStandards
|
|
303
314
|
xml.Status do
|
304
315
|
xml.Text("Current")
|
305
316
|
end
|
317
|
+
xml.Source
|
306
318
|
end
|
307
319
|
end
|
308
320
|
end
|
@@ -315,7 +327,7 @@ module HealthDataStandards
|
|
315
327
|
def to_ccr_actors(xml, patient)
|
316
328
|
xml.Actors do
|
317
329
|
xml.Actor do
|
318
|
-
xml.ActorObjectID(
|
330
|
+
xml.ActorObjectID(patient.id)
|
319
331
|
xml.Person do
|
320
332
|
xml.Name do
|
321
333
|
xml.CurrentName do
|
@@ -323,10 +335,10 @@ module HealthDataStandards
|
|
323
335
|
xml.Family(patient.last)
|
324
336
|
end
|
325
337
|
end
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
338
|
+
xml.DateOfBirth do
|
339
|
+
xml.ExactDateTime(convert_to_ccr_time_string(patient.birthdate))
|
340
|
+
end
|
341
|
+
if (patient.gender)
|
330
342
|
xml.Gender do
|
331
343
|
if (patient.gender.upcase == "M")
|
332
344
|
xml.Text("Male")
|
@@ -338,6 +350,7 @@ module HealthDataStandards
|
|
338
350
|
end
|
339
351
|
end
|
340
352
|
end
|
353
|
+
xml.Source
|
341
354
|
end
|
342
355
|
end
|
343
356
|
end
|
@@ -117,11 +117,13 @@ module HealthDataStandards
|
|
117
117
|
end
|
118
118
|
|
119
119
|
# Inspects a C32 document and populates the patient Hash with first name, last name
|
120
|
-
# birth date and
|
120
|
+
# birth date, gender and the effectiveTime.
|
121
121
|
#
|
122
122
|
# @param [Hash] patient A hash that is used to represent the patient
|
123
123
|
# @param [Nokogiri::XML::Node] doc The C32 document parsed by Nokogiri
|
124
124
|
def get_demographics(patient, doc)
|
125
|
+
effective_date = doc.at_xpath('/cda:ClinicalDocument/cda:effectiveTime')['value']
|
126
|
+
patient.effective_time = HL7Helper.timestamp_to_integer(effective_date)
|
125
127
|
patient_element = doc.at_xpath('/cda:ClinicalDocument/cda:recordTarget/cda:patientRole/cda:patient')
|
126
128
|
patient.first = patient_element.at_xpath('cda:name/cda:given').text
|
127
129
|
patient.last = patient_element.at_xpath('cda:name/cda:family').text
|
@@ -132,6 +134,16 @@ module HealthDataStandards
|
|
132
134
|
patient.gender = gender_node['code']
|
133
135
|
id_node = doc.at_xpath('/cda:ClinicalDocument/cda:recordTarget/cda:patientRole/cda:id')
|
134
136
|
patient.medical_record_number = id_node['extension']
|
137
|
+
|
138
|
+
# parse race, ethnicity, and spoken language
|
139
|
+
race_node = patient_element.at_xpath('cda:raceCode')
|
140
|
+
patient.race = { code: race_node['code'], code_set: 'CDC-RE' } if race_node
|
141
|
+
ethnicity_node = patient_element.at_xpath('cda:ethnicGroupCode')
|
142
|
+
patient.ethnicity = {code: ethnicity_node['code'], code_set: 'CDC-RE'} if ethnicity_node
|
143
|
+
|
144
|
+
languages = patient_element.search('languageCommunication').map {|lc| lc.at_xpath('cda:languageCode')['code'] }
|
145
|
+
patient.languages = languages unless languages.empty?
|
146
|
+
|
135
147
|
end
|
136
148
|
end
|
137
149
|
end
|
@@ -1,7 +1,12 @@
|
|
1
1
|
class Encounter < Entry
|
2
2
|
field :performer, type: Hash
|
3
3
|
field :facility, type: Hash
|
4
|
-
field :admitType, type: Hash
|
5
|
-
field :dischargeDisp, type: Hash
|
4
|
+
field :admitType, type: Hash
|
5
|
+
field :dischargeDisp, type: Hash
|
6
6
|
embeds_one :reason, class_name: "Entry"
|
7
|
+
|
8
|
+
alias :admit_type :admitType
|
9
|
+
alias :admit_type= :admitType=
|
10
|
+
alias :discharge_disp :dischargeDisp
|
11
|
+
alias :discharge_disp= :dischargeDisp=
|
7
12
|
end
|
@@ -150,6 +150,23 @@ class Entry
|
|
150
150
|
codes.present? && (start_time.present? || end_time.present? || time.present?)
|
151
151
|
end
|
152
152
|
|
153
|
+
# Compares hash values to determine equality
|
154
|
+
def ==(other)
|
155
|
+
self.class==other.class && self.hash==other.hash
|
156
|
+
end
|
157
|
+
|
158
|
+
# Returns the hash value, calculating it if not already done
|
159
|
+
def hash
|
160
|
+
@hash || calculate_hash!
|
161
|
+
end
|
162
|
+
|
163
|
+
# Calculates a hash value for this entry
|
164
|
+
def calculate_hash!
|
165
|
+
entry_hash = to_hash
|
166
|
+
entry_hash['description']=nil
|
167
|
+
@hash = entry_hash.hash
|
168
|
+
end
|
169
|
+
|
153
170
|
# Creates a Hash for this Entry
|
154
171
|
# @return [Hash] a Hash representing the Entry
|
155
172
|
def to_hash
|
@@ -1,11 +1,24 @@
|
|
1
1
|
class FulfillmentHistory
|
2
2
|
include Mongoid::Document
|
3
3
|
|
4
|
-
field :prescriptionNumber, type: String
|
4
|
+
field :prescriptionNumber, type: String
|
5
5
|
field :provider, type: Hash
|
6
|
-
field :dispensingPharmacyLocation, type: Hash
|
7
|
-
field :dispenseDate, type: Integer
|
8
|
-
field :quantityDispensed, type: Hash
|
9
|
-
field :fillNumber, type: Integer
|
10
|
-
field :fillStatus, type: Hash
|
6
|
+
field :dispensingPharmacyLocation, type: Hash
|
7
|
+
field :dispenseDate, type: Integer
|
8
|
+
field :quantityDispensed, type: Hash
|
9
|
+
field :fillNumber, type: Integer
|
10
|
+
field :fillStatus, type: Hash
|
11
|
+
|
12
|
+
alias :dispensing_pharmacy_location :dispensingPharmacyLocation
|
13
|
+
alias :dispensing_pharmacy_location= :dispensingPharmacyLocation=
|
14
|
+
alias :dispense_date :dispenseDate
|
15
|
+
alias :dispense_date= :dispenseDate=
|
16
|
+
alias :quantity_dispensed :quantityDispensed
|
17
|
+
alias :quantity_dispensed= :quantityDispensed=
|
18
|
+
alias :fill_number :fillNumber
|
19
|
+
alias :fill_number= :fillNumber=
|
20
|
+
alias :fill_status :fillStatus
|
21
|
+
alias :fill_status= :fillStatus=
|
22
|
+
alias :prescription_number :prescriptionNumber
|
23
|
+
alias :prescription_number= :prescriptionNumber=
|
11
24
|
end
|
@@ -1,5 +1,10 @@
|
|
1
1
|
class Immunization < Entry
|
2
|
-
field :refusalInd, type: Boolean
|
2
|
+
field :refusalInd, type: Boolean
|
3
3
|
field :performer, type: Hash
|
4
|
-
field :refusalReason, type: Hash
|
4
|
+
field :refusalReason, type: Hash
|
5
|
+
|
6
|
+
alias :refusal_ind :refusalInd
|
7
|
+
alias :refusal_ind= :refusalInd=
|
8
|
+
alias :refusal_reason :refusalReason
|
9
|
+
alias :refusal_reason= :refusalReason=
|
5
10
|
end
|
@@ -1,25 +1,45 @@
|
|
1
1
|
class Medication < Entry
|
2
|
-
field :administrationTiming, type: Hash
|
3
|
-
field :freeTextSig, type: String
|
2
|
+
field :administrationTiming, type: Hash
|
3
|
+
field :freeTextSig, type: String
|
4
4
|
field :dose, type: Hash
|
5
|
-
field :brandName, type: String
|
6
|
-
field :typeOfMedication, type: Hash
|
7
|
-
field :statusOfMedication, type: Hash
|
5
|
+
field :brandName, type: String
|
6
|
+
field :typeOfMedication, type: Hash
|
7
|
+
field :statusOfMedication, type: Hash
|
8
8
|
embeds_many :fulfillmentHistory, class_name: 'FulfillmentHistory'
|
9
9
|
embeds_many :orderInformation, class_name: 'OrderInformation'
|
10
10
|
field :route, type: Hash
|
11
11
|
field :site, type: Hash
|
12
|
-
field :doseRestriction, type: Hash
|
13
|
-
field :fulfillmentInstructions, type: String
|
12
|
+
field :doseRestriction, type: Hash
|
13
|
+
field :fulfillmentInstructions, type: String
|
14
14
|
field :indication, type: Hash
|
15
|
-
field :productForm, type: Hash
|
15
|
+
field :productForm, type: Hash
|
16
16
|
field :vehicle, type: Hash
|
17
17
|
field :reaction, type: Hash
|
18
|
-
field :deliveryMethod, type: Hash
|
19
|
-
field :patientInstructions, type: String
|
18
|
+
field :deliveryMethod, type: Hash
|
19
|
+
field :patientInstructions, type: String
|
20
20
|
|
21
|
+
alias :administration_timing :administrationTiming
|
22
|
+
alias :administration_timing= :administrationTiming=
|
23
|
+
alias :free_text_sig :freeTextSig
|
24
|
+
alias :free_text_sig= :freeTextSig=
|
25
|
+
alias :brand_name :brandName
|
26
|
+
alias :brand_name= :brandName=
|
27
|
+
alias :type_of_medication :typeOfMedication
|
28
|
+
alias :type_of_medication= :typeOfMedication=
|
29
|
+
alias :status_of_medication :statusOfMedication
|
30
|
+
alias :status_of_medication= :statusOfMedication=
|
21
31
|
alias :fulfillment_history :fulfillmentHistory
|
22
32
|
alias :fulfillment_history= :fulfillmentHistory=
|
23
33
|
alias :order_information :orderInformation
|
24
34
|
alias :order_information= :orderInformation=
|
35
|
+
alias :dose_restriction :doseRestriction
|
36
|
+
alias :dose_restriction= :doseRestriction=
|
37
|
+
alias :fulfillment_instructions :fulfillmentInstructions
|
38
|
+
alias :fulfillment_instructions= :fulfillmentInstructions=
|
39
|
+
alias :product_form :productForm
|
40
|
+
alias :product_form= :productForm=
|
41
|
+
alias :delivery_method :deliveryMethod
|
42
|
+
alias :delivery_method= :deliveryMethod=
|
43
|
+
alias :patient_instructions :patientInstructions
|
44
|
+
alias :patient_instructions= :patientInstructions=
|
25
45
|
end
|
@@ -1,9 +1,18 @@
|
|
1
1
|
class OrderInformation
|
2
2
|
include Mongoid::Document
|
3
3
|
|
4
|
-
field :orderNumber, type: String
|
4
|
+
field :orderNumber, type: String
|
5
5
|
field :fills, type: Integer
|
6
|
-
field :quantityOrdered, type: Hash
|
7
|
-
field :orderExpirationDateTime, type: Integer
|
8
|
-
field :orderDateTime, type: Integer
|
6
|
+
field :quantityOrdered, type: Hash
|
7
|
+
field :orderExpirationDateTime, type: Integer
|
8
|
+
field :orderDateTime, type: Integer
|
9
|
+
|
10
|
+
alias :order_number :orderNumber
|
11
|
+
alias :order_number= :orderNumber=
|
12
|
+
alias :quantity_ordered :quantityOrdered
|
13
|
+
alias :quantity_ordered= :quantityOrdered=
|
14
|
+
alias :order_expiration_date_time :orderExpirationDateTime
|
15
|
+
alias :order_expiration_date_time= :orderExpirationDateTime=
|
16
|
+
alias :order_date_time :orderDateTime
|
17
|
+
alias :order_date_time= :orderDateTime=
|
9
18
|
end
|
@@ -1,18 +1,22 @@
|
|
1
1
|
class Record
|
2
2
|
|
3
3
|
include Mongoid::Document
|
4
|
-
|
4
|
+
|
5
5
|
field :first, type: String
|
6
6
|
field :last, type: String
|
7
7
|
field :gender, type: String
|
8
8
|
field :birthdate, type: Integer
|
9
|
-
field :
|
10
|
-
field :
|
9
|
+
field :effective_time, type: Integer
|
10
|
+
field :race, type: Hash
|
11
|
+
field :ethnicity, type: Hash
|
12
|
+
field :languages, type: Array
|
11
13
|
field :test_id, type: BSON::ObjectId
|
12
14
|
field :medical_record_number, type: String
|
13
15
|
|
14
|
-
[:allergies, :care_goals, :conditions, :encounters, :immunizations, :medical_equipment,
|
15
|
-
:medications, :procedures, :results, :social_history, :vital_signs]
|
16
|
+
Sections = [:allergies, :care_goals, :conditions, :encounters, :immunizations, :medical_equipment,
|
17
|
+
:medications, :procedures, :results, :social_history, :vital_signs]
|
18
|
+
|
19
|
+
Sections.each do |section|
|
16
20
|
embeds_many section, as: :entry_list, class_name: "Entry"
|
17
21
|
end
|
18
22
|
|
@@ -0,0 +1,39 @@
|
|
1
|
+
<component>
|
2
|
<!-- Allergies: patient has no allergies -->
|
1
3
|
<section>
|
2
4
|
<templateId root="2.16.840.1.113883.3.88.11.83.102" assigningAuthorityName="HITSP/C83"/>
|
5
|
+
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.3.13" assigningAuthorityName="IHE PCC"/>
|
6
|
+
<templateId root="2.16.840.1.113883.10.20.1.2" assigningAuthorityName="HL7 CCD"/>
|
7
|
+
<code code="11450-4" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Problem List"/>
|
3
8
|
<title>Allergies and Adverse Reactions</title>
|
4
9
|
<text>
|
5
10
|
<table border="1" width="100%">
|
6
11
|
<thead>
|
7
12
|
<tr>
|
8
13
|
<th>Description</th>
|
9
14
|
<th>Code</th>
|
10
15
|
<th>Time</th>
|
11
16
|
</tr>
|
12
17
|
</thead>
|
13
18
|
<tbody>
|
14
19
|
<tr ID="noallergies_summary">
|
15
20
|
<td ID="noallergies">No Known allergies</td>
|
21
|
+
<td>160244002</td>
|
16
22
|
<td><%= Time.now.utc.to_formatted_s(:number) %></td>
|
17
23
|
</tr>
|
18
24
|
</tbody>
|
19
25
|
</table>
|
20
26
|
</text>
|
21
27
|
<entry typeCode="DRIV">
|
28
|
+
<act classCode="ACT" moodCode="EVN">
|
29
|
+
<templateId root="2.16.840.1.113883.10.20.1.27"/>
|
30
|
+
<templateId root="2.16.840.1.113883.3.88.11.83.6"/>
|
31
|
+
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.5.1"/>
|
32
|
+
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.5.3"/>
|
33
|
+
<id root="f6fd6f86-4265-4dcb-95cf-7799100b54ad"/>
|
34
|
+
<code nullFlavor="NA"/>
|
35
|
+
<statusCode code="active"/>
|
36
|
+
<effectiveTime>
|
37
|
+
<low nullFlavor="NA"/>
|
38
|
+
</effectiveTime>
|
39
|
+
<entryRelationship typeCode="SUBJ" inversionInd="false">
|
40
|
+
<observation classCode="OBS" moodCode="EVN">
|
41
|
+
<templateId root="2.16.840.1.113883.10.20.1.18"/>
|
42
|
+
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.6"/>
|
43
|
+
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.5"/>
|
44
|
+
<templateId root="2.16.840.1.113883.10.20.1.28"/>
|
45
|
+
<id root="2b37be6b-9b1c-4069-bbca-1caf5fe1937d"/>
|
46
|
+
<code code="420134006" codeSystem="2.16.840.1.113883.6.96" displayName="Propensity to adverse reactions (disorder)" codeSystemName="SNOMED CT"/>
|
47
|
+
<statusCode code="completed"/>
|
48
|
+
<effectiveTime>
|
49
|
+
<low nullFlavor="UNK"/>
|
50
|
+
</effectiveTime>
|
51
|
+
<value xsi:type="CD" code="160244002" codeSystem="2.16.840.1.113883.6.96" displayName="No Known allergies" codeSystemName="SNOMED CT">
|
52
|
+
<originalText>
|
53
|
+
<reference value="#noallergies"/>
|
54
|
+
</originalText>
|
55
|
+
</value>
|
56
|
+
</observation>
|
57
|
+
</entryRelationship>
|
58
|
+
</act>
|
59
|
+
</entry>
|
60
|
+
</section>
|
61
|
+
</component>
|
@@ -7,6 +7,7 @@
|
|
7
7
|
<templateId root="2.16.840.1.113883.10.20.1.10" assigningAuthorityName="HL7 CCD"/>
|
8
8
|
<!--Plan of Care section template-->
|
9
9
|
<code code="18776-5" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Treatment plan"/>
|
10
|
+
<title>Plan of Care</title>
|
10
11
|
<%== render :partial => 'narrative_block', :locals => {:entries => entries, :section => 'plan_of_care'} %>
|
11
12
|
<% entries.each do |entry| -%>
|
12
13
|
<entry typeCode="DRIV">
|
@@ -0,0 +1,2 @@
|
|
1
|
+
<component>
|
2
|
<!-- Problems: patient has no problems -->
|
1
3
|
<section>
|
2
4
|
<templateId root="2.16.840.1.113883.3.88.11.83.103" assigningAuthorityName="HITSP/C83"/>
|
3
5
|
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.3.6" assigningAuthorityName="IHE PCC"/>
|
4
6
|
<templateId root="2.16.840.1.113883.10.20.1.11" assigningAuthorityName="HL7 CCD"/>
|
5
7
|
<code code="11450-4" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Problem List"/>
|
6
8
|
<title>Problems</title>
|
7
9
|
<text>
|
8
10
|
<table border="1" width="100%">
|
9
11
|
<thead>
|
10
12
|
<tr>
|
11
13
|
<th>Description</th>
|
12
14
|
<th>Code</th>
|
13
15
|
<th>Time</th>
|
14
16
|
</tr>
|
15
17
|
</thead>
|
16
18
|
<tbody>
|
17
19
|
<tr ID="PROBSUMMARY_1">
|
18
20
|
<td ID="PROBKIND_1">No current problems or disability</td>
|
21
|
+
<td>160245001</td>
|
19
22
|
<td><%= Time.now.utc.to_formatted_s(:number) %></td>
|
20
23
|
</tr>
|
21
24
|
</tbody>
|
22
25
|
</table>
|
23
26
|
</text>
|
24
27
|
<entry typeCode="DRIV">
|
25
28
|
<act classCode="ACT" moodCode="EVN">
|
26
29
|
<templateId root="2.16.840.1.113883.3.88.11.83.7" assigningAuthorityName="HITSP C83"/>
|
27
30
|
<templateId root="2.16.840.1.113883.10.20.1.27" assigningAuthorityName="CCD"/>
|
28
31
|
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.5.1" assigningAuthorityName="IHE PCC"/>
|
29
32
|
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.5.2" assigningAuthorityName="IHE PCC"/>
|
30
33
|
<id root="<%= UUID.generate %>"/>
|
31
34
|
<code nullFlavor="NA"/>
|
32
35
|
<statusCode code="completed"/>
|
33
36
|
<effectiveTime>
|
34
37
|
<low value="<%= Time.now.utc.to_formatted_s(:number) %>"/>
|
35
38
|
<high nullFlavor="UNK"/>
|
36
39
|
</effectiveTime>
|
37
40
|
<entryRelationship typeCode="SUBJ" inversionInd="false">
|
38
41
|
<observation classCode="OBS" moodCode="EVN" negationInd="false">
|
39
42
|
<templateId root="2.16.840.1.113883.10.20.1.28" assigningAuthorityName="CCD"/>
|
40
43
|
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.5" assigningAuthorityName="IHE PCC"/>
|
41
44
|
<id root="<%= UUID.generate %>"/>
|
42
45
|
<code code="404684003" displayName="Finding" codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMED-CT"/>
|
43
46
|
<text>
|
44
47
|
<reference value="#PROBKIND_1"/>
|
45
48
|
</text>
|
46
49
|
<statusCode code="completed"/>
|
47
50
|
<effectiveTime>
|
48
51
|
<low value="<%= Time.now.utc.to_formatted_s(:number) %>"/>
|
49
52
|
<high nullFlavor="UNK"/>
|
50
53
|
</effectiveTime>
|
51
54
|
<value xsi:type="CD" displayName="No current problems or disability" code="160245001" codeSystemName="SNOMED-CT" codeSystem="2.16.840.1.113883.6.96"/>
|
52
55
|
</observation>
|
53
56
|
</entryRelationship>
|
54
57
|
</act>
|
55
58
|
</entry>
|
56
59
|
</section>
|
57
60
|
</component>
|
@@ -0,0 +1,32 @@
|
|
1
|
+
<component>
|
2
|
<!-- Medications: patient has no medications -->
|
1
3
|
<section>
|
4
|
+
<templateId root="2.16.840.1.113883.10.20.1.8" assigningAuthorityName="HL7 SDTC CCD"/>
|
5
|
+
<templateId root="2.16.840.1.113883.3.88.11.83.112" assigningAuthorityName="HITSP"/>
|
6
|
+
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.3.19" assigningAuthorityName="IHE"/>
|
7
|
+
<code code="10160-0" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="History of medication use"/>
|
8
|
+
<title>Medications - Prescription and Non-Prescription</title>
|
2
9
|
<text>
|
3
10
|
<table border="1" width="100%">
|
4
11
|
<thead>
|
5
12
|
<tr>
|
6
13
|
<th>Description</th>
|
7
14
|
<th>Code</th>
|
8
15
|
<th>Time</th>
|
9
16
|
</tr>
|
10
17
|
</thead>
|
11
18
|
<tbody>
|
12
19
|
<tr ID="nomeds_summary">
|
13
20
|
<td ID="nomeds_kind">Patient not on any medication</td>
|
21
|
+
<td>182849000</td>
|
14
22
|
<td><%= Time.now.utc.to_formatted_s(:number) %></td>
|
15
23
|
</tr>
|
16
24
|
</tbody>
|
17
25
|
</table>
|
18
26
|
</text>
|
19
27
|
<entry typeCode="DRIV">
|
28
|
+
<substanceAdministration classCode="SBADM" moodCode="EVN">
|
29
|
+
<templateId root="2.16.840.1.113883.3.88.11.83.8" assigningAuthorityName="HITSP C83"/>
|
30
|
+
<templateId root="2.16.840.1.113883.10.20.1.24" assigningAuthorityName="CCD"/>
|
31
|
+
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.7" assigningAuthorityName="IHE PCC"/>
|
32
|
+
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.7.1" assigningAuthorityName="IHE PCC"/>
|
33
|
+
<id root="4edd8de0-66e3-4ca6-b287-f0736022f2b3"/>
|
34
|
+
<code code="182849000" codeSystem="2.16.840.1.113883.6.96" displayName="No Drug Therapy Prescribed" codeSystemName="SNOMED CT" />
|
35
|
+
<statusCode code="completed"/> <consumable>
|
36
|
+
<manufacturedProduct>
|
37
|
+
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.4.7.2" assigningAuthorityName="IHE PCC"/>
|
38
|
+
<templateId root="2.16.840.1.113883.3.88.11.83.8.2" assigningAuthorityName="HITSP C83"/>
|
39
|
+
<templateId root="2.16.840.1.113883.10.20.1.53"assigningAuthorityName="CCD"/>
|
40
|
+
<manufacturedMaterial>
|
41
|
+
<code>
|
42
|
+
<originalText>
|
43
|
+
<reference value="#nomeds_kind">
|
44
|
+
</originalText>
|
45
|
+
</code>
|
46
|
+
</manufacturedMaterial>
|
47
|
+
</manufacturedProduct>
|
48
|
+
</consumable>
|
49
|
+
</substanceAdministration>
|
50
|
+
</entry>
|
51
|
+
</section>
|
52
|
+
</component>
|
@@ -7,6 +7,7 @@
|
|
7
7
|
<templateId root="1.3.6.1.4.1.19376.1.5.3.1.3.11" assigningAuthorityName="IHE PCC"/>
|
8
8
|
<!--Surgeries section template-->
|
9
9
|
<code code="47519-4" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="List of surgeries"/>
|
10
|
+
<title>Surgeries</title>
|
10
11
|
<%== render :partial => 'narrative_block', :locals => {:entries => entries, :section => 'procedures'} %>
|
11
12
|
<% entries.each_with_index do |entry, i| -%>
|
12
13
|
<entry typeCode="DRIV">
|
data/templates/show.c32.erb
CHANGED
@@ -67,15 +67,21 @@
|
|
67
67
|
<structuredBody>
|
68
68
|
<% if patient.allergies.present? -%>
|
69
69
|
<%== render :partial => 'allergies', :locals => {:entries => patient.allergies} %>
|
70
|
+
<% else %>
|
71
|
+
<%== render :partial => 'allergies_no_current', :locals => {:entries => patient.allergies} %>
|
70
72
|
<% end -%>
|
71
73
|
<% if patient.medications.present? -%>
|
72
74
|
<%== render :partial => 'medications', :locals => {:entries => patient.medications} %>
|
75
|
+
<% else %>
|
76
|
+
<%== render :partial => 'medications_no_current', :locals => {:entries => patient.medications} %>
|
73
77
|
<% end -%>
|
74
78
|
<% if patient.encounters.present? -%>
|
75
79
|
<%== render :partial => 'encounters', :locals => {:entries => patient.encounters} %>
|
76
80
|
<% end -%>
|
77
81
|
<% if patient.conditions.present? -%>
|
78
82
|
<%== render :partial => 'conditions', :locals => {:entries => patient.conditions} %>
|
83
|
+
<% else %>
|
84
|
+
<%== render :partial => 'conditions_no_current', :locals => {:entries => patient.conditions} %>
|
79
85
|
<% end -%>
|
80
86
|
<% if patient.vital_signs.present? -%>
|
81
87
|
<%== render :partial => 'vital_signs', :locals => {:entries => patient.vital_signs} %>
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: health-data-standards
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,12 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2012-01-31 00:00:00.000000000 -05:00
|
13
|
+
default_executable:
|
13
14
|
dependencies:
|
14
15
|
- !ruby/object:Gem::Dependency
|
15
16
|
name: erubis
|
16
|
-
requirement: &
|
17
|
+
requirement: &2152718120 !ruby/object:Gem::Requirement
|
17
18
|
none: false
|
18
19
|
requirements:
|
19
20
|
- - ~>
|
@@ -21,21 +22,21 @@ dependencies:
|
|
21
22
|
version: '2.6'
|
22
23
|
type: :runtime
|
23
24
|
prerelease: false
|
24
|
-
version_requirements: *
|
25
|
+
version_requirements: *2152718120
|
25
26
|
- !ruby/object:Gem::Dependency
|
26
27
|
name: mongoid
|
27
|
-
requirement: &
|
28
|
+
requirement: &2152717640 !ruby/object:Gem::Requirement
|
28
29
|
none: false
|
29
30
|
requirements:
|
30
31
|
- - ~>
|
31
32
|
- !ruby/object:Gem::Version
|
32
|
-
version: 2.
|
33
|
+
version: 2.4.2
|
33
34
|
type: :runtime
|
34
35
|
prerelease: false
|
35
|
-
version_requirements: *
|
36
|
+
version_requirements: *2152717640
|
36
37
|
- !ruby/object:Gem::Dependency
|
37
38
|
name: uuid
|
38
|
-
requirement: &
|
39
|
+
requirement: &2152717180 !ruby/object:Gem::Requirement
|
39
40
|
none: false
|
40
41
|
requirements:
|
41
42
|
- - ~>
|
@@ -43,10 +44,10 @@ dependencies:
|
|
43
44
|
version: 2.3.4
|
44
45
|
type: :runtime
|
45
46
|
prerelease: false
|
46
|
-
version_requirements: *
|
47
|
+
version_requirements: *2152717180
|
47
48
|
- !ruby/object:Gem::Dependency
|
48
49
|
name: builder
|
49
|
-
requirement: &
|
50
|
+
requirement: &2152716720 !ruby/object:Gem::Requirement
|
50
51
|
none: false
|
51
52
|
requirements:
|
52
53
|
- - ~>
|
@@ -54,10 +55,10 @@ dependencies:
|
|
54
55
|
version: 3.0.0
|
55
56
|
type: :runtime
|
56
57
|
prerelease: false
|
57
|
-
version_requirements: *
|
58
|
+
version_requirements: *2152716720
|
58
59
|
- !ruby/object:Gem::Dependency
|
59
60
|
name: nokogiri
|
60
|
-
requirement: &
|
61
|
+
requirement: &2152716260 !ruby/object:Gem::Requirement
|
61
62
|
none: false
|
62
63
|
requirements:
|
63
64
|
- - ~>
|
@@ -65,7 +66,7 @@ dependencies:
|
|
65
66
|
version: 1.4.7
|
66
67
|
type: :runtime
|
67
68
|
prerelease: false
|
68
|
-
version_requirements: *
|
69
|
+
version_requirements: *2152716260
|
69
70
|
description: A library for generating and consuming various healthcare related formats.
|
70
71
|
This includes HITSP C32, ASTM CCR and PQRI.
|
71
72
|
email: talk@projectpophealth.org
|
@@ -104,13 +105,16 @@ files:
|
|
104
105
|
- lib/health-data-standards/util/hl7_helper.rb
|
105
106
|
- lib/health-data-standards.rb
|
106
107
|
- templates/_allergies.c32.erb
|
108
|
+
- templates/_allergies_no_current.c32.erb
|
107
109
|
- templates/_care_goals.c32.erb
|
108
110
|
- templates/_code_with_reference.c32.erb
|
109
111
|
- templates/_conditions.c32.erb
|
112
|
+
- templates/_conditions_no_current.c32.erb
|
110
113
|
- templates/_encounters.c32.erb
|
111
114
|
- templates/_immunizations.c32.erb
|
112
115
|
- templates/_medical_equipment.c32.erb
|
113
116
|
- templates/_medications.c32.erb
|
117
|
+
- templates/_medications_no_current.c32.erb
|
114
118
|
- templates/_narrative_block.c32.erb
|
115
119
|
- templates/_procedures.c32.erb
|
116
120
|
- templates/_results.c32.erb
|
@@ -121,6 +125,7 @@ files:
|
|
121
125
|
- README.md
|
122
126
|
- Rakefile
|
123
127
|
- VERSION
|
128
|
+
has_rdoc: true
|
124
129
|
homepage: http://barrel.mitre.org/health-data-standards
|
125
130
|
licenses: []
|
126
131
|
post_install_message:
|
@@ -141,9 +146,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
141
146
|
version: '0'
|
142
147
|
requirements: []
|
143
148
|
rubyforge_project:
|
144
|
-
rubygems_version: 1.
|
149
|
+
rubygems_version: 1.6.2
|
145
150
|
signing_key:
|
146
151
|
specification_version: 3
|
147
152
|
summary: A library for generating and consuming various healthcare related formats.
|
148
153
|
test_files: []
|
149
|
-
has_rdoc:
|