Skip to content
Browse files

fixed an error with obtaining health data

  • Loading branch information...
1 parent d4468c7 commit 252be9b4be9b0b0b73e419861dc54e433aed35f3 Catchit committed Feb 23, 2012
Showing with 7 additions and 4 deletions.
  1. +7 −4 application/app/models/report.rb
View
11 application/app/models/report.rb
@@ -1033,16 +1033,19 @@ def self.get_call_summary(patient_id, encounter_date)
patient_encounters.each do |a_encounter|
for obs in a_encounter.observations do
- if obs.name_to_s != "CALL ID"
- name_tag_id = ConceptNameTagMap.find(:all,
- :conditions =>["concept_name_id = ?", obs.concept_id],
+ if obs.name_to_s != "Call ID"
+ name_tag_id = ConceptNameTagMap.find(:all,
+ :joins => "INNER JOIN concept_name
+ ON concept_name.concept_name_id = concept_name_tag_map.concept_name_id ",
+ :conditions =>["concept_name.concept_id = ?", obs.concept_id],
:select => "concept_name_tag_id"
).last
symptom_type = ConceptNameTag.find(:all,
:conditions =>["concept_name_tag_id = ?", name_tag_id.concept_name_tag_id],
:select => "tag"
).uniq
+
symptom_type.each{|symptom|
if symptom.tag == "HEALTH INFORMATION"
health_information << obs.name_to_s.capitalize
@@ -1053,7 +1056,7 @@ def self.get_call_summary(patient_id, encounter_date)
end
}
end
- end
+ end
end
if danger_signs.length != 0

0 comments on commit 252be9b

Please sign in to comment.
Something went wrong with that request. Please try again.