Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fixed an error with obtaining health data
  • Loading branch information
Catchit committed Feb 23, 2012
1 parent d4468c7 commit 252be9b
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions application/app/models/report.rb
Expand Up @@ -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
Expand All @@ -1053,7 +1056,7 @@ def self.get_call_summary(patient_id, encounter_date)
end
}
end
end
end
end

if danger_signs.length != 0
Expand Down

0 comments on commit 252be9b

Please sign in to comment.