<commit_before>-# Copyright (C) 2007, 2008, 2009 The Collaborative Software Foundation
-# 
-# This file is part of TriSano.
-# 
-# TriSano is free software: you can redistribute it and/or modify it under the 
-# terms of the GNU Affero General Public License as published by the 
-# Free Software Foundation, either version 3 of the License, or 
-# (at your option) any later version.
-# 
-# TriSano is distributed in the hope that it will be useful, but 
-# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public License 
-# for more details.
-# 
-# You should have received a copy of the GNU Affero General Public License along 
-# with TriSano. If not, see http://www.gnu.org/licenses/agpl-3.0.txt.

%fieldset.form
  %legend Address
  -if event.nil?
    - address_type = :canonical_address
  -else
    - address_type = :address

  - f.fields_for(address_type, :builder => ExtendedFormBuilder) do |a|
    %div.data_address
      %fieldset.vert-break
        - core_element :street_number, a, :horiz do
          = a.label(:street_number)
          %span.data_street_number= a.core_text_field(:street_number, {:size => 10, :maxlength=> 10}, event)
        - core_element :street_name, a, :horiz do
          = a.label(:street_name)
          %span.data_street_name= a.core_text_field(:street_name, {:size => 50, :maxlength=> 50}, event)
        - core_element :unit_number, a, :horiz do
          = a.label(:unit_number)
          %span.data_unit_number= a.core_text_field(:unit_number, {:size => 10, :maxlength=> 10}, event)

      %fieldset.vert-break
        - core_element :city, a, :horiz do
          = a.label(:city, "City")
          %span.data_city= a.core_text_field(:city, {:size => 30, :maxlength=> 255}, event)
        - core_element :state_id, a, :horiz do
          = a.label(:state_id, "State")
          %span.data_state= a.dropdown_code_field(:state_id, 'state', {:include_blank => true}, {}, event)
        - core_element :county_id, a, :horiz do
          = a.label(:county_id, "County")
          %span.data_county= a.dropdown_code_field(:county_id, 'county', {:include_blank => true}, {}, event)
        - core_element :postal_code, a, :horiz do
          = a.label(:postal_code, "Zip code")
          %span.data_postal_code= a.core_text_field(:postal_code, {:size => 7, :maxlength=> 10}, event)
        %label
          District
          - address = event.nil? ? @person.canonical_address : event.address
          - if address.county && address.county.jurisdiction
            %span.data_jurisdiction_name= h(address.county.jurisdiction.name)
    
      = render_geocode_form_section(a, event)

      -if event.is_a?(ContactEvent)
        %fieldset.vert-break
          = button_to_function('Copy From Original Patient', "contact_parent_address(#{@event.id})")<commit_msg>District field on events is displaying wrong in edit mode : http://www.pivotaltracker.com/story/show/1054671<commit_after>-# Copyright (C) 2007, 2008, 2009 The Collaborative Software Foundation
-# 
-# This file is part of TriSano.
-# 
-# TriSano is free software: you can redistribute it and/or modify it under the 
-# terms of the GNU Affero General Public License as published by the 
-# Free Software Foundation, either version 3 of the License, or 
-# (at your option) any later version.
-# 
-# TriSano is distributed in the hope that it will be useful, but 
-# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public License 
-# for more details.
-# 
-# You should have received a copy of the GNU Affero General Public License along 
-# with TriSano. If not, see http://www.gnu.org/licenses/agpl-3.0.txt.

%fieldset.form
  %legend Address
  -if event.nil?
    - address_type = :canonical_address
  -else
    - address_type = :address

  - f.fields_for(address_type, :builder => ExtendedFormBuilder) do |a|
    %div.data_address
      %fieldset.vert-break
        - core_element :street_number, a, :horiz do
          = a.label(:street_number)
          %span.data_street_number= a.core_text_field(:street_number, {:size => 10, :maxlength=> 10}, event)
        - core_element :street_name, a, :horiz do
          = a.label(:street_name)
          %span.data_street_name= a.core_text_field(:street_name, {:size => 50, :maxlength=> 50}, event)
        - core_element :unit_number, a, :horiz do
          = a.label(:unit_number)
          %span.data_unit_number= a.core_text_field(:unit_number, {:size => 10, :maxlength=> 10}, event)

      %fieldset.vert-break
        - core_element :city, a, :horiz do
          = a.label(:city, "City")
          %span.data_city= a.core_text_field(:city, {:size => 30, :maxlength=> 255}, event)
        - core_element :state_id, a, :horiz do
          = a.label(:state_id, "State")
          %span.data_state= a.dropdown_code_field(:state_id, 'state', {:include_blank => true}, {}, event)
        - core_element :county_id, a, :horiz do
          = a.label(:county_id, "County")
          %span.data_county= a.dropdown_code_field(:county_id, 'county', {:include_blank => true}, {}, event)
        - core_element :postal_code, a, :horiz do
          = a.label(:postal_code, "Zip code")
          %span.data_postal_code= a.core_text_field(:postal_code, {:size => 7, :maxlength=> 10}, event)
        %label
          District
        - address = event.nil? ? @person.canonical_address : event.address
        - if address.county && address.county.jurisdiction
          %span.data_jurisdiction_name= h(address.county.jurisdiction.name)
    
      = render_geocode_form_section(a, event)

      -if event.is_a?(ContactEvent)
        %fieldset.vert-break
          = button_to_function('Copy From Original Patient', "contact_parent_address(#{@event.id})")
{'fraction_non_alphanumeric': 0.12336225965628722, 'fraction_numerical': 0.01310192274970223, 'mean_word_length': 3.056590752242926, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 3, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '363719', 'n_tokens_mistral': 2002, 'n_tokens_neox': 1865, 'n_words': 505}