health-data-standards 1.0.1 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Gemfile +5 -5
 - data/lib/health-data-standards.rb +8 -0
 - data/lib/health-data-standards/export/ccda.rb +15 -0
 - data/lib/health-data-standards/export/ccr.rb +24 -20
 - data/lib/health-data-standards/export/html.rb +4 -8
 - data/lib/health-data-standards/export/template_helper.rb +7 -1
 - data/lib/health-data-standards/export/view_helper.rb +24 -4
 - data/lib/health-data-standards/import/c32/allergy_importer.rb +2 -1
 - data/lib/health-data-standards/import/c32/care_goal_importer.rb +2 -1
 - data/lib/health-data-standards/import/c32/condition_importer.rb +23 -2
 - data/lib/health-data-standards/import/c32/encounter_importer.rb +6 -5
 - data/lib/health-data-standards/import/c32/immunization_importer.rb +1 -15
 - data/lib/health-data-standards/import/c32/medication_importer.rb +1 -0
 - data/lib/health-data-standards/import/c32/patient_importer.rb +13 -0
 - data/lib/health-data-standards/import/c32/procedure_importer.rb +1 -0
 - data/lib/health-data-standards/import/c32/provider_importer.rb +1 -1
 - data/lib/health-data-standards/import/c32/result_importer.rb +1 -0
 - data/lib/health-data-standards/import/c32/section_importer.rb +17 -22
 - data/lib/health-data-standards/import/ccda/medical_equipment_importer.rb +1 -2
 - data/lib/health-data-standards/import/ccda/result_importer.rb +1 -0
 - data/lib/health-data-standards/import/ccr/provider_importer.rb +0 -1
 - data/lib/health-data-standards/import/green_c32/immunization_importer.rb +1 -1
 - data/lib/health-data-standards/import/green_c32/section_importer.rb +7 -5
 - data/lib/health-data-standards/import/provider_import_utils.rb +1 -1
 - data/lib/health-data-standards/models/coded_result_value.rb +3 -0
 - data/lib/health-data-standards/models/condition.rb +7 -5
 - data/lib/health-data-standards/models/encounter.rb +5 -2
 - data/lib/health-data-standards/models/entry.rb +48 -68
 - data/lib/health-data-standards/models/facility.rb +9 -0
 - data/lib/health-data-standards/models/functional_status.rb +25 -0
 - data/lib/health-data-standards/models/immunization.rb +4 -6
 - data/lib/health-data-standards/models/medication.rb +6 -0
 - data/lib/health-data-standards/models/physical_quantity_result_value.rb +4 -0
 - data/lib/health-data-standards/models/record.rb +11 -2
 - data/lib/health-data-standards/models/result_value.rb +4 -0
 - data/lib/health-data-standards/models/thing_with_codes.rb +52 -0
 - data/lib/health-data-standards/util/code_system_helper.rb +5 -2
 - data/lib/health-data-standards/util/qrda_template_helper.rb +20 -0
 - data/templates/_allergies_no_current.c32.erb +26 -4
 - data/templates/_conditions_no_current.c32.erb +1 -2
 - data/templates/_medications_no_current.c32.erb +1 -1
 - data/templates/_narrative_block.c32.erb +14 -2
 - data/templates/_result.gc32.erb +3 -1
 - data/templates/_results.c32.erb +9 -8
 - data/templates/_social_history.gc32.erb +1 -1
 - data/templates/_vital_sign.gc32.erb +1 -1
 - data/templates/_vital_signs.c32.erb +12 -11
 - data/templates/show.c32.erb +1 -1
 - metadata +55 -21
 - data/templates/show.html.erb +0 -287
 
    
        data/templates/show.html.erb
    DELETED
    
    | 
         @@ -1,287 +0,0 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
             
         
     | 
| 
       2 
     | 
    
         
            -
                <script language="javascript">
         
     | 
| 
       3 
     | 
    
         
            -
                var cur_view = "section";
         
     | 
| 
       4 
     | 
    
         
            -
                  function toggle(id) {
         
     | 
| 
       5 
     | 
    
         
            -
                    var e = document.getElementById(id);
         
     | 
| 
       6 
     | 
    
         
            -
                    if (cur_view=="section"){
         
     | 
| 
       7 
     | 
    
         
            -
                      document.getElementById("patient_information_by_section").style.display = 'none';
         
     | 
| 
       8 
     | 
    
         
            -
                      document.getElementById("table_by_encounter").style.display = 'block';
         
     | 
| 
       9 
     | 
    
         
            -
                      document.getElementById('toggle_button').innerHTML="View By Section";
         
     | 
| 
       10 
     | 
    
         
            -
                      cur_view = "encounter";
         
     | 
| 
       11 
     | 
    
         
            -
                    }else{
         
     | 
| 
       12 
     | 
    
         
            -
                      document.getElementById("patient_information_by_section").style.display = 'block';
         
     | 
| 
       13 
     | 
    
         
            -
                      document.getElementById("table_by_encounter").style.display = 'none';
         
     | 
| 
       14 
     | 
    
         
            -
                      document.getElementById('toggle_button').innerHTML="View By Encounter";
         
     | 
| 
       15 
     | 
    
         
            -
                      cur_view = "section";
         
     | 
| 
       16 
     | 
    
         
            -
                    }         
         
     | 
| 
       17 
     | 
    
         
            -
                  }
         
     | 
| 
       18 
     | 
    
         
            -
                </script>
         
     | 
| 
       19 
     | 
    
         
            -
                 <div>
         
     | 
| 
       20 
     | 
    
         
            -
                  <h3><a href="#" onclick="toggle('table_by_encounter');" id='toggle_button'>View By Encounter</a></h3>
         
     | 
| 
       21 
     | 
    
         
            -
                 </div>
         
     | 
| 
       22 
     | 
    
         
            -
                 <div id="table_by_encounter" style="display:none">
         
     | 
| 
       23 
     | 
    
         
            -
                    <% patient.encounters.sort! { |a,b| a.start_time <=> b.start_time } %>
         
     | 
| 
       24 
     | 
    
         
            -
                    <% patient.encounters.each_with_index do |encounter,idx| %>
         
     | 
| 
       25 
     | 
    
         
            -
             
     | 
| 
       26 
     | 
    
         
            -
                      <%
         
     | 
| 
       27 
     | 
    
         
            -
                        encounter_allergies=0
         
     | 
| 
       28 
     | 
    
         
            -
                        encounter_care_goals=0
         
     | 
| 
       29 
     | 
    
         
            -
                        encounter_vital_signs=0
         
     | 
| 
       30 
     | 
    
         
            -
                        encounter_results=0
         
     | 
| 
       31 
     | 
    
         
            -
                        encounter_conditions=0
         
     | 
| 
       32 
     | 
    
         
            -
                        encounter_procedures=0
         
     | 
| 
       33 
     | 
    
         
            -
                        encounter_medications=0
         
     | 
| 
       34 
     | 
    
         
            -
                        encounter_social_history=0
         
     | 
| 
       35 
     | 
    
         
            -
                        encounter_immunizations=0
         
     | 
| 
       36 
     | 
    
         
            -
                        encounter_medical_equipment=0
         
     | 
| 
       37 
     | 
    
         
            -
                      %>
         
     | 
| 
       38 
     | 
    
         
            -
             
     | 
| 
       39 
     | 
    
         
            -
                        <br/><br/>
         
     | 
| 
       40 
     | 
    
         
            -
                        <h3>Encounter <%= patient.encounters.count - idx %></h3>
         
     | 
| 
       41 
     | 
    
         
            -
                        <table border="1" width="100%" class="narr_table">
         
     | 
| 
       42 
     | 
    
         
            -
                          
         
     | 
| 
       43 
     | 
    
         
            -
                          <tbody>                
         
     | 
| 
       44 
     | 
    
         
            -
                            <tr>
         
     | 
| 
       45 
     | 
    
         
            -
                              <th class="narr_th">Description</th>
         
     | 
| 
       46 
     | 
    
         
            -
                              <th class="narr_th">Codes</th>
         
     | 
| 
       47 
     | 
    
         
            -
                              <th class="narr_th">Time</th>
         
     | 
| 
       48 
     | 
    
         
            -
                             
         
     | 
| 
       49 
     | 
    
         
            -
                                <th class="narr_th">Status</th>
         
     | 
| 
       50 
     | 
    
         
            -
                           
         
     | 
| 
       51 
     | 
    
         
            -
                              
         
     | 
| 
       52 
     | 
    
         
            -
                              
         
     | 
| 
       53 
     | 
    
         
            -
                                <th class="narr_th">Value</th>
         
     | 
| 
       54 
     | 
    
         
            -
                              
         
     | 
| 
       55 
     | 
    
         
            -
                            </tr>        
         
     | 
| 
       56 
     | 
    
         
            -
                               <tr class="narr_tr">
         
     | 
| 
       57 
     | 
    
         
            -
                                    <td ID="encounters-desc-<%= idx %>"><%= encounter.description %></td>
         
     | 
| 
       58 
     | 
    
         
            -
                                    <td ID="encounters-code-<%= idx %>"><b><%= encounter.codes_to_s %></b><br/><i><%= encounter.specifics %></i></td>
         
     | 
| 
       59 
     | 
    
         
            -
                                    <td><%= encounter.times_to_s %></td>
         
     | 
| 
       60 
     | 
    
         
            -
                                    <td> </td>   
         
     | 
| 
       61 
     | 
    
         
            -
                                    <td> </td>   
         
     | 
| 
       62 
     | 
    
         
            -
                                     
         
     | 
| 
       63 
     | 
    
         
            -
                                  </tr>
         
     | 
| 
       64 
     | 
    
         
            -
                            <!-- Select Allergies for this Encounter -->
         
     | 
| 
       65 
     | 
    
         
            -
                           
         
     | 
| 
       66 
     | 
    
         
            -
                           
         
     | 
| 
       67 
     | 
    
         
            -
                            <% patient.allergies.each_with_index do |entry, i| %>               
         
     | 
| 
       68 
     | 
    
         
            -
                              <% if encounter.times_to_s == entry.times_to_s -%>
         
     | 
| 
       69 
     | 
    
         
            -
                                <% if encounter_allergies==0 -%>
         
     | 
| 
       70 
     | 
    
         
            -
                                   <tr class="narr_tr">
         
     | 
| 
       71 
     | 
    
         
            -
                                    <th class="narr_th" colspan="5">Allergies</th>
         
     | 
| 
       72 
     | 
    
         
            -
                                  </tr>
         
     | 
| 
       73 
     | 
    
         
            -
                                  <% encounter_allergies=1 %>
         
     | 
| 
       74 
     | 
    
         
            -
                                <% end %>
         
     | 
| 
       75 
     | 
    
         
            -
                                  <tr class="narr_tr">
         
     | 
| 
       76 
     | 
    
         
            -
                                    <td ID="allergies-desc-<%= i %>"><%= entry.description %></td>
         
     | 
| 
       77 
     | 
    
         
            -
                                    <td ID="allergies-code-<%= i %>"><b><%= entry.codes_to_s %></b><br/><i><%= entry.specifics %></i></td>
         
     | 
| 
       78 
     | 
    
         
            -
                                    <td><%= entry.times_to_s %></td>  
         
     | 
| 
       79 
     | 
    
         
            -
                                    <td> </td>
         
     | 
| 
       80 
     | 
    
         
            -
                                    <td> </td>                     
         
     | 
| 
       81 
     | 
    
         
            -
                                  </tr>
         
     | 
| 
       82 
     | 
    
         
            -
                              <% end %>
         
     | 
| 
       83 
     | 
    
         
            -
                            <% end %>
         
     | 
| 
       84 
     | 
    
         
            -
                         
         
     | 
| 
       85 
     | 
    
         
            -
             
     | 
| 
       86 
     | 
    
         
            -
                            <!-- Select Car Goals for this Encounter -->
         
     | 
| 
       87 
     | 
    
         
            -
                            
         
     | 
| 
       88 
     | 
    
         
            -
                            
         
     | 
| 
       89 
     | 
    
         
            -
                             <% patient.care_goals.each_with_index do |entry, i| %>               
         
     | 
| 
       90 
     | 
    
         
            -
                                <% if encounter.times_to_s == entry.times_to_s -%>
         
     | 
| 
       91 
     | 
    
         
            -
                                   <% if encounter_care_goals==0 -%>
         
     | 
| 
       92 
     | 
    
         
            -
                                    <tr class="narr_tr">
         
     | 
| 
       93 
     | 
    
         
            -
                                      <th class="narr_th" colspan="5">Care Goals</th>
         
     | 
| 
       94 
     | 
    
         
            -
                                    </tr>
         
     | 
| 
       95 
     | 
    
         
            -
                                    <% encounter_care_goals=1 %>
         
     | 
| 
       96 
     | 
    
         
            -
                                  <% end %>
         
     | 
| 
       97 
     | 
    
         
            -
                                  <tr class="narr_tr">
         
     | 
| 
       98 
     | 
    
         
            -
                                    <td ID="care_goals-desc-<%= i %>"><%= entry.description %></td>
         
     | 
| 
       99 
     | 
    
         
            -
                                    <td ID="care_goals-code-<%= i %>"><b><%= entry.codes_to_s %></b><br/><i><%= entry.specifics %></i></td>
         
     | 
| 
       100 
     | 
    
         
            -
                                    <td><%= entry.times_to_s %></td>   
         
     | 
| 
       101 
     | 
    
         
            -
                                    <td> </td>
         
     | 
| 
       102 
     | 
    
         
            -
                                    <td> </td>                     
         
     | 
| 
       103 
     | 
    
         
            -
                                  </tr>
         
     | 
| 
       104 
     | 
    
         
            -
                                <% end %>
         
     | 
| 
       105 
     | 
    
         
            -
                            <% end %>
         
     | 
| 
       106 
     | 
    
         
            -
                         
         
     | 
| 
       107 
     | 
    
         
            -
             
     | 
| 
       108 
     | 
    
         
            -
                           <!-- Select Vitals for this Encounter -->
         
     | 
| 
       109 
     | 
    
         
            -
                             <% patient.vital_signs.each_with_index do |entry, i| %>               
         
     | 
| 
       110 
     | 
    
         
            -
                                <% if encounter.times_to_s == entry.times_to_s -%>
         
     | 
| 
       111 
     | 
    
         
            -
                                  <% if encounter_vital_signs==0 -%>
         
     | 
| 
       112 
     | 
    
         
            -
                                    <tr class="narr_tr">
         
     | 
| 
       113 
     | 
    
         
            -
                                      <th class="narr_th" colspan="5">Vital Signs</th>
         
     | 
| 
       114 
     | 
    
         
            -
                                    </tr>
         
     | 
| 
       115 
     | 
    
         
            -
                                    <% encounter_vital_signs=1 %>
         
     | 
| 
       116 
     | 
    
         
            -
                                  <% end %>
         
     | 
| 
       117 
     | 
    
         
            -
                                  <tr class="narr_tr">
         
     | 
| 
       118 
     | 
    
         
            -
                                    <td ID="vitals-desc-<%= i %>"><%= entry.description %></td>
         
     | 
| 
       119 
     | 
    
         
            -
                                    <td ID="vitals-code-<%= i %>"><b><%= entry.codes_to_s %></b><br/><i><%= entry.specifics %></i></td>
         
     | 
| 
       120 
     | 
    
         
            -
                                    <td><%= entry.times_to_s %></td> 
         
     | 
| 
       121 
     | 
    
         
            -
                                    <td> </td>                          
         
     | 
| 
       122 
     | 
    
         
            -
                                    <td><%= entry.value["scalar"] %></td>   
         
     | 
| 
       123 
     | 
    
         
            -
                                                     
         
     | 
| 
       124 
     | 
    
         
            -
                                  </tr>
         
     | 
| 
       125 
     | 
    
         
            -
                                <% end %>
         
     | 
| 
       126 
     | 
    
         
            -
                            <% end %>
         
     | 
| 
       127 
     | 
    
         
            -
                          
         
     | 
| 
       128 
     | 
    
         
            -
             
     | 
| 
       129 
     | 
    
         
            -
                           <!-- Select lab results for this Encounter -->
         
     | 
| 
       130 
     | 
    
         
            -
                           <% patient.results.each_with_index do |entry, i| %>               
         
     | 
| 
       131 
     | 
    
         
            -
                                <% if encounter.times_to_s == entry.times_to_s -%>
         
     | 
| 
       132 
     | 
    
         
            -
                                  <% if encounter_results==0 -%>
         
     | 
| 
       133 
     | 
    
         
            -
                                      <tr class="narr_tr">
         
     | 
| 
       134 
     | 
    
         
            -
                                      <th class="narr_th" colspan="5">Lab Results</th>
         
     | 
| 
       135 
     | 
    
         
            -
                                    </tr>
         
     | 
| 
       136 
     | 
    
         
            -
                                    <% encounter_results=1 %>
         
     | 
| 
       137 
     | 
    
         
            -
                                  <% end %>
         
     | 
| 
       138 
     | 
    
         
            -
                                  <tr class="narr_tr">
         
     | 
| 
       139 
     | 
    
         
            -
                                    <td ID="results-desc-<%= i %>"><%= entry.description %></td>
         
     | 
| 
       140 
     | 
    
         
            -
                                    <td ID="results-code-<%= i %>"><b><%= entry.codes_to_s %></b><br/><i><%= entry.specifics %></i></td>
         
     | 
| 
       141 
     | 
    
         
            -
                                    <td><%= entry.times_to_s %></td>
         
     | 
| 
       142 
     | 
    
         
            -
                                    <td> </td>   
         
     | 
| 
       143 
     | 
    
         
            -
                                    <td><%= entry.value["scalar"] %></td>  
         
     | 
| 
       144 
     | 
    
         
            -
                                                  
         
     | 
| 
       145 
     | 
    
         
            -
                                  </tr>
         
     | 
| 
       146 
     | 
    
         
            -
                                <% end %>
         
     | 
| 
       147 
     | 
    
         
            -
                            <% end %>
         
     | 
| 
       148 
     | 
    
         
            -
                         
         
     | 
| 
       149 
     | 
    
         
            -
             
     | 
| 
       150 
     | 
    
         
            -
                             <!-- Select conditions for this Encounter -->
         
     | 
| 
       151 
     | 
    
         
            -
                           
         
     | 
| 
       152 
     | 
    
         
            -
                            
         
     | 
| 
       153 
     | 
    
         
            -
                             <% patient.conditions.each_with_index do |entry, i| %>               
         
     | 
| 
       154 
     | 
    
         
            -
                                <% if encounter.times_to_s == entry.times_to_s -%>
         
     | 
| 
       155 
     | 
    
         
            -
                                  <% if encounter_conditions==0 -%>
         
     | 
| 
       156 
     | 
    
         
            -
                                      <tr class="narr_tr">
         
     | 
| 
       157 
     | 
    
         
            -
                                        <th class="narr_th" colspan="5">Problems</th>
         
     | 
| 
       158 
     | 
    
         
            -
                                      </tr>
         
     | 
| 
       159 
     | 
    
         
            -
                                      <% encounter_conditions=1 %>
         
     | 
| 
       160 
     | 
    
         
            -
                                  <% end %>
         
     | 
| 
       161 
     | 
    
         
            -
                                  <tr class="narr_tr">
         
     | 
| 
       162 
     | 
    
         
            -
                                    <td ID="conditions-desc-<%= i %>"><%= entry.description %></td>
         
     | 
| 
       163 
     | 
    
         
            -
                                    <td ID="conditions-code-<%= i %>"><b><%= entry.codes_to_s %></b><br/><i><%= entry.specifics %></i></td>
         
     | 
| 
       164 
     | 
    
         
            -
                                    <td><%= entry.times_to_s %></td>                        
         
     | 
| 
       165 
     | 
    
         
            -
                                    <td><%= entry.status %></td>
         
     | 
| 
       166 
     | 
    
         
            -
                                    <td> </td>   
         
     | 
| 
       167 
     | 
    
         
            -
                                  </tr>
         
     | 
| 
       168 
     | 
    
         
            -
                                <% end %>              
         
     | 
| 
       169 
     | 
    
         
            -
                             <% end %>
         
     | 
| 
       170 
     | 
    
         
            -
             
     | 
| 
       171 
     | 
    
         
            -
                           <!-- Select procedures for this Encounter -->
         
     | 
| 
       172 
     | 
    
         
            -
                         
         
     | 
| 
       173 
     | 
    
         
            -
                            
         
     | 
| 
       174 
     | 
    
         
            -
                             <% patient.procedures.each_with_index do |entry, i| %>               
         
     | 
| 
       175 
     | 
    
         
            -
                                <% if encounter.times_to_s == entry.times_to_s -%>
         
     | 
| 
       176 
     | 
    
         
            -
                                  <% if encounter_procedures==0 -%>
         
     | 
| 
       177 
     | 
    
         
            -
                                    <tr class="narr_tr">
         
     | 
| 
       178 
     | 
    
         
            -
                                      <th class="narr_th" colspan="5">Procedures</th>
         
     | 
| 
       179 
     | 
    
         
            -
                                     </tr>
         
     | 
| 
       180 
     | 
    
         
            -
                                    <% encounter_procedures=1 %>
         
     | 
| 
       181 
     | 
    
         
            -
                                  <% end %>
         
     | 
| 
       182 
     | 
    
         
            -
                                  <tr class="narr_tr">
         
     | 
| 
       183 
     | 
    
         
            -
                                    <td ID="procedures-desc-<%= i %>"><%= entry.description %></td>
         
     | 
| 
       184 
     | 
    
         
            -
                                    <td ID="procedures-code-<%= i %>"><b><%= entry.codes_to_s %></b><br/><i><%= entry.specifics %></i></td>
         
     | 
| 
       185 
     | 
    
         
            -
                                    <td><%= entry.times_to_s %></td>
         
     | 
| 
       186 
     | 
    
         
            -
                                    <td> </td>   
         
     | 
| 
       187 
     | 
    
         
            -
                                    <td> </td>                           
         
     | 
| 
       188 
     | 
    
         
            -
                                  </tr>
         
     | 
| 
       189 
     | 
    
         
            -
                                <% end %>
         
     | 
| 
       190 
     | 
    
         
            -
                            <% end %>
         
     | 
| 
       191 
     | 
    
         
            -
                          
         
     | 
| 
       192 
     | 
    
         
            -
             
     | 
| 
       193 
     | 
    
         
            -
                            <!-- Select Medications for this Encounter -->
         
     | 
| 
       194 
     | 
    
         
            -
                         
         
     | 
| 
       195 
     | 
    
         
            -
                           
         
     | 
| 
       196 
     | 
    
         
            -
                             <% patient.medications.each_with_index do |entry, i| %>               
         
     | 
| 
       197 
     | 
    
         
            -
                                <% if encounter.times_to_s == entry.times_to_s -%>
         
     | 
| 
       198 
     | 
    
         
            -
                                  <% if encounter_medications==0 -%>
         
     | 
| 
       199 
     | 
    
         
            -
                                    <tr class="narr_tr">
         
     | 
| 
       200 
     | 
    
         
            -
                                      <th class="narr_th" colspan="5">Medications</th>
         
     | 
| 
       201 
     | 
    
         
            -
                                    </tr>
         
     | 
| 
       202 
     | 
    
         
            -
                                  <% encounter_medications=1 %>
         
     | 
| 
       203 
     | 
    
         
            -
                                  <% end %>
         
     | 
| 
       204 
     | 
    
         
            -
                                  <tr class="narr_tr">
         
     | 
| 
       205 
     | 
    
         
            -
                                    <td ID="medications-desc-<%= i %>"><%= entry.description %></td>
         
     | 
| 
       206 
     | 
    
         
            -
                                    <td ID="medications-code-<%= i %>"><b><%= entry.codes_to_s %></b><br/><i><%= entry.specifics %></i></td>
         
     | 
| 
       207 
     | 
    
         
            -
                                    <td><%= entry.times_to_s %></td>                        
         
     | 
| 
       208 
     | 
    
         
            -
                                    <td><%= entry.status %></td> 
         
     | 
| 
       209 
     | 
    
         
            -
                                    <td> </td>                          
         
     | 
| 
       210 
     | 
    
         
            -
                                  </tr>
         
     | 
| 
       211 
     | 
    
         
            -
                                <% end %>
         
     | 
| 
       212 
     | 
    
         
            -
                              <% end %>
         
     | 
| 
       213 
     | 
    
         
            -
                          
         
     | 
| 
       214 
     | 
    
         
            -
             
     | 
| 
       215 
     | 
    
         
            -
                             <!-- Select Social History for this Encounter -->
         
     | 
| 
       216 
     | 
    
         
            -
                            
         
     | 
| 
       217 
     | 
    
         
            -
                           
         
     | 
| 
       218 
     | 
    
         
            -
                             <% patient.social_history.each_with_index do |entry, i| %>               
         
     | 
| 
       219 
     | 
    
         
            -
                                <% if encounter.times_to_s == entry.times_to_s -%>
         
     | 
| 
       220 
     | 
    
         
            -
                                  <% if encounter_social_history==0 -%>
         
     | 
| 
       221 
     | 
    
         
            -
                                      <tr class="narr_tr">
         
     | 
| 
       222 
     | 
    
         
            -
                                        <th class="narr_th" colspan="5">Social History</th>
         
     | 
| 
       223 
     | 
    
         
            -
                                      </tr>
         
     | 
| 
       224 
     | 
    
         
            -
                                    <% encounter_social_history=1 %>
         
     | 
| 
       225 
     | 
    
         
            -
                                  <% end %>
         
     | 
| 
       226 
     | 
    
         
            -
                                  <tr class="narr_tr">
         
     | 
| 
       227 
     | 
    
         
            -
                                    <td ID="social_history-desc-<%= i %>"><%= entry.description %></td>
         
     | 
| 
       228 
     | 
    
         
            -
                                    <td ID="social_history-code-<%= i %>"><b><%= entry.codes_to_s %></b><br/><i><%= entry.specifics %></i></td>
         
     | 
| 
       229 
     | 
    
         
            -
                                    <td><%= entry.times_to_s %></td> 
         
     | 
| 
       230 
     | 
    
         
            -
                                    <td> </td>   
         
     | 
| 
       231 
     | 
    
         
            -
                                    <td> </td>                           
         
     | 
| 
       232 
     | 
    
         
            -
                                  </tr>
         
     | 
| 
       233 
     | 
    
         
            -
                                <% end %>
         
     | 
| 
       234 
     | 
    
         
            -
                             <% end %>
         
     | 
| 
       235 
     | 
    
         
            -
                          
         
     | 
| 
       236 
     | 
    
         
            -
             
     | 
| 
       237 
     | 
    
         
            -
                             <!-- Select immunizations for this Encounter -->
         
     | 
| 
       238 
     | 
    
         
            -
                            
         
     | 
| 
       239 
     | 
    
         
            -
                            
         
     | 
| 
       240 
     | 
    
         
            -
                             <% patient.immunizations.each_with_index do |entry, i| %>               
         
     | 
| 
       241 
     | 
    
         
            -
                                <% if encounter.times_to_s == entry.times_to_s -%>
         
     | 
| 
       242 
     | 
    
         
            -
                                  <% if encounter_immunizations==0 -%>
         
     | 
| 
       243 
     | 
    
         
            -
                                    <tr class="narr_tr">
         
     | 
| 
       244 
     | 
    
         
            -
                                     <th class="narr_th" colspan="5">Immunizations</th>
         
     | 
| 
       245 
     | 
    
         
            -
                                    </tr>
         
     | 
| 
       246 
     | 
    
         
            -
                                    <% encounter_immunizations=1 %>
         
     | 
| 
       247 
     | 
    
         
            -
                                  <% end %>
         
     | 
| 
       248 
     | 
    
         
            -
                                  <tr class="narr_tr">
         
     | 
| 
       249 
     | 
    
         
            -
                                    <td ID="immunizations-desc-<%= i %>"><%= entry.description %></td>
         
     | 
| 
       250 
     | 
    
         
            -
                                    <td ID="immunizations-code-<%= i %>"><b><%= entry.codes_to_s %></b><br/><i><%= entry.specifics %></i></td>
         
     | 
| 
       251 
     | 
    
         
            -
                                    <td><%= entry.times_to_s %></td> 
         
     | 
| 
       252 
     | 
    
         
            -
                                    <td> </td>   
         
     | 
| 
       253 
     | 
    
         
            -
                                    <td> </td>                          
         
     | 
| 
       254 
     | 
    
         
            -
                                  </tr>
         
     | 
| 
       255 
     | 
    
         
            -
                                <% end %>
         
     | 
| 
       256 
     | 
    
         
            -
                              <% end %>
         
     | 
| 
       257 
     | 
    
         
            -
                           
         
     | 
| 
       258 
     | 
    
         
            -
             
     | 
| 
       259 
     | 
    
         
            -
                             <!-- Select medical_equipment for this Encounter -->
         
     | 
| 
       260 
     | 
    
         
            -
                           
         
     | 
| 
       261 
     | 
    
         
            -
                           
         
     | 
| 
       262 
     | 
    
         
            -
                             <% patient.medical_equipment.each_with_index do |entry, i| %>               
         
     | 
| 
       263 
     | 
    
         
            -
                               <% if encounter.times_to_s == entry.times_to_s -%>
         
     | 
| 
       264 
     | 
    
         
            -
                                   <% if encounter_medical_equipment==0 -%>
         
     | 
| 
       265 
     | 
    
         
            -
                                      <tr class="narr_tr">
         
     | 
| 
       266 
     | 
    
         
            -
                                        <th class="narr_th" colspan="5">Medical Equipment</th>
         
     | 
| 
       267 
     | 
    
         
            -
                                      </tr>
         
     | 
| 
       268 
     | 
    
         
            -
                                    <% encounter_medical_equipment=1 %>
         
     | 
| 
       269 
     | 
    
         
            -
                                  <% end %>
         
     | 
| 
       270 
     | 
    
         
            -
                                  <tr class="narr_tr">
         
     | 
| 
       271 
     | 
    
         
            -
                                    <td ID="medical_equipment-desc-<%= i %>"><%= entry.description %></td>
         
     | 
| 
       272 
     | 
    
         
            -
                                    <td ID="medical_equipment-code-<%= i %>"><b><%= entry.codes_to_s %></b><br/><i><%= entry.specifics %></i></td>
         
     | 
| 
       273 
     | 
    
         
            -
                                    <td><%= entry.times_to_s %></td>  
         
     | 
| 
       274 
     | 
    
         
            -
                                    <td> </td>   
         
     | 
| 
       275 
     | 
    
         
            -
                                    <td> </td>                         
         
     | 
| 
       276 
     | 
    
         
            -
                                  </tr>
         
     | 
| 
       277 
     | 
    
         
            -
                              <% end %>
         
     | 
| 
       278 
     | 
    
         
            -
                             <% end %>
         
     | 
| 
       279 
     | 
    
         
            -
                 
         
     | 
| 
       280 
     | 
    
         
            -
                           
         
     | 
| 
       281 
     | 
    
         
            -
                          </tbody>
         
     | 
| 
       282 
     | 
    
         
            -
                        </table>
         
     | 
| 
       283 
     | 
    
         
            -
                   
         
     | 
| 
       284 
     | 
    
         
            -
               
         
     | 
| 
       285 
     | 
    
         
            -
                  <% end %>
         
     | 
| 
       286 
     | 
    
         
            -
              </div>
         
     | 
| 
       287 
     | 
    
         
            -
               
         
     |