Class: Result

Inherits:
AbstractResult show all
Defined in:
app/models/result.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from AbstractResult

#code_system_code, #code_system_name, new, #randomize, #requirements, #statement_ccd_template_id, #to_c32, #value

Methods included from Commentable

included

Methods included from PatientChild

included

Class Method Details

.c32_component(results, xml) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# File 'app/models/result.rb', line 7

def self.c32_component(results, xml)
  # Start Results
  unless results.empty?
    xml.component do
      xml.section do
        xml.templateId("root" => "2.16.840.1.113883.10.20.1.14", 
                       "assigningAuthorityName" => "CCD")
        xml.code("code" => "30954-2", 
                 "displayName" => "Relevant diagnostic tests", 
                 "codeSystem" => "2.16.840.1.113883.6.1", 
                 "codeSystemName" => "LOINC")
        xml.title("Results")
        xml.text do
          xml.table("border" => "1", "width" => "100%") do
            xml.thead do
              xml.tr do
                xml.th "Result ID"
                xml.th "Result Date"
                xml.th "Result Display Name"
                xml.th "Result Value"
                xml.th "Result Unit"
              end
            end
            xml.tbody do
              results.each do |result|
                xml.tr do 
                  xml.td do
                    xml.content(result.result_id, "ID" => "result-#{result.result_id}")
                  end
                  xml.td(result.result_date)
                  xml.td(result.result_code_display_name)
                  xml.td(result.value_scalar)
                  xml.td(result.value_unit)
                end
              end
            end
          end

        end

        yield


      end
    end
  end
  # End Results
end

Instance Method Details

#statement_c32_template_idObject



3
4
5
# File 'app/models/result.rb', line 3

def statement_c32_template_id
  '2.16.840.1.113883.3.88.11.32.16'
end