<commit_before>{% extends "dossiers/base.html" %}
{% load url from future %}

{% block extrascripts %}
<link rel="stylesheet" type="text/css" media="all" href="{{ STATIC_URL }}filter-widget/css/filter-widget.css"/>
<script src="{{ STATIC_URL }}js/jquery.parse-url.js"></script>
<script src="{{ STATIC_URL }}js/calebasse.dossiers.js"></script>
<script src="{{ STATIC_URL }}filter-widget/js/i18n.js"></script>
<script src="{{ STATIC_URL }}filter-widget/js/core.js"></script>
<script src="{{ STATIC_URL }}filter-widget/js/SelectBox.js"></script>
<script src="{{ STATIC_URL }}filter-widget/js/SelectFilter2.js"></script>
{% endblock %}


{% block appbar %}
<h2><span class="lastname">{{ object.last_name }}</span> {{ object.first_name }} - Dossier {{ object.paper_id|default_if_none:"" }}</h2>
<span id="ajax-redirect" data-url="{{ object.id }}/view"/>
<a href="..">Retourner aux dossiers</a>
{% if object.can_be_deleted %}<button id="patientrecord-delete">Supprimer</button>{% endif %}
{% endblock %}

{% block content %}

{% if messages %}
<ul class="messages">
    {% for message in messages %}
    <li{% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message }}</li>
    {% endfor %}
</ul>
<script type="text/javascript">
$('.messages').delay(1000*(1+{{ messages|length }})).fadeOut('slow');
</script>
{% endif %}

<div id="tabs">
  <ul>
    <li><a data-id="0" class="atabs" href="#tabs-1">Général</a></li>
    <li><a data-id="1" class="atabs" href="#tabs-2">Fiche administrative</a></li>
    <li><a data-id="2" class="atabs" href="#tabs-3">Adresses / contacts</a></li>
    {% if object.service.name == "CMPP" %}
    <li><a data-id="3"  class="atabs" href="#tabs-4">Prise en charge</a></li>
    {% endif %}
    {% if object.service.name == "SESSAD TED" or object.service.name == "SESSAD DYS" %}
    <li><a data-id="3" class="atabs" href="#tabs-4">Notifications</a></li>
    {% endif %}
    <li><a data-id="4" class="atabs" href="#tabs-5">Actes passés</a>
    <li><a data-id="5" class="atabs" href="#tabs-6">Prochains rendez-vous</a>
    <li><a data-id="6" class="atabs" href="#tabs-7">Socialisation</a>
    <li><a data-id="7" class="atabs" href="#tabs-8">Données à caractère médical</a>
  </ul>
  <div id="tabs-1"> <!-- Général -->
      {% include "dossiers/patientrecord_tab1.html" %}
  </div>

  <div id="tabs-2"> <!-- Fiche administrative -->
      {% include "dossiers/patientrecord_tab2.html" %}
  </div>

    <div id="tabs-3"> <!-- Adresses / Contacts -->
        <button id="new-address-btn">Nouvelle adresse</button>
        <button id="new-contact-btn">Nouveau contact</button>
    <form method="post" id="policyholder-form" class="patientrecordform">{% csrf_token %}
        {% for address in object.addresses.all %}
        <div class="frame">
            <h3>{% if not address.display_name %}Non renseigné{% else %}{{ address.display_name }}{% endif %}</h3>
            <div class="buttons">
                <button type="button" data-id="{{ address.id }}" class="del-address icon-minus" title="Supprimer"></button>
                <button type="button" data-id="{{ address.id }}" class="update-address-btn icon-edit" title="Modifier"></button>
            </div>
            <div class="right">
                <input type="checkbox" data-id="{{ address.id }}" class="place_of_life" {% if address.place_of_life %}checked{% endif %}>Lieu de vie</input>
            </div>
            {% if address.phone %}<p><span class="icon-home-space">{{ address.phone }}</span></p>{% endif %}
            {% if address.comment %}<p><label>Commentaire :</label>{{ address.comment }}</p>{% endif %}
            {% if not address.phone and not address.comment %}<p>&nbsp;<!-- intentionaly empty --></p>{% endif %}
            {% for contact in address.patientcontact_set.all  %}
            <div class="contact{% if contact.id == object.id %} patient{% endif %}">
                <h4>{% if contact.gender == 1 %}M.{% elif contact.gender == 2 %}Mme{% endif %}
                    {{ contact.first_name }} <span class="lastname">{{ contact.last_name }}</span> {% if contact.id == object.id %} (PATIENT){% endif %}</h4>
                <div class="right">Assuré
                    <input type="radio"
                    {% if object.policyholder.id == contact.id %} checked="checked" {% endif %}
                    id="id_policyholder-policyholder_{{ contact.id }}"
                    value="{{ contact.id }}"
                    class="policyholder-radio"
                    name="policyholder-policyholder">
                    <button type="button" data-id="{{ contact.id }}" data-address-id="{{ address.id }}" class="del-contact icon-minus" title="Supprimer"></button>
                    <button type="button" data-id="{{ contact.id }}" class="update-contact-btn icon-edit" title="Modifier"></button>
                </div>
                <div>
                    <ul>
                        {% if contact.parente %}
                            <li><label>Lien avec le patient :</label>
                            {{ contact.parente }}</li>
                        {% endif %}
                        {% if contact.mobile %}
                            <li>
                            <span class="icon-user-space">{{ contact.mobile }} (perso)</span>
                            </li>
                        {% endif %}
                        {% if contact.phone %}
                            <li>
                            <span class="icon-user-space">{{ contact.phone }} (pro)</span>
                            </li>
                        {% endif %}
                        {% if contact.email %}
                            <li>
                            <label>Courriel :</label>
                            {{ contact.email }}
                            </li>
                        {% endif %}
                        {% if contact.job %}
                            <li>
                            <label>Profession :</label>
                            {{ contact.job }}
                            </li>
                        {% endif %}
                        {% if contact.contact_comment %}
                            <li>
                            <label>Commentaire :</label>
                            {{ contact.contact_comment }}
                            </li>
                        {% endif %}
                        <li><label>Données d'assuré social</label>
<!--                            <button class="blind">détails</button>-->
                            <ul>
                            {% if contact.social_security_id %}
                                <li><label>Numéro d'assuré social :</label>
                                {{ contact.social_security_id }} {{ contact.get_control_key }}</li>
                            {% endif %}
                            {% if contact.birthdate %}
                                <li><label>Date de naissance :</label>
                                {{ contact.birthdate }}</li>
                            {% endif %}
                            {% if contact.birthplace %}
                                <li><label>Lieu de naissance :</label>
                                {{ contact.birthplace }}</li>
                            {% endif %}
                            {% if contact.begin_rights %}
                                <li><label>Début de droits :</label>
                                {{ contact.begin_rights }}</li>
                            {% endif %}
                            {% if contact.end_rights %}
                                <li><label>Fin de droits :</label>
                                {{ contact.end_rights }}</li>
                            {% endif %}
                            {% if contact.health_center %}
                                <li><label>Centre de santé :</label>
                                {{ contact.health_center }}</li>
                            {% endif %}
                            <li><label>Tiers-payant :</label>
                                {% if contact.thirdparty_payer %}
                                    Oui
                                {% else %}
                                    Non
                                {% endif %}
                            </li>
                            {% if contact.twinning_rank %}
                                <li><label>Rang (gémellité) :</label>
                                {{ contact.twinning_rank }}</li>
                            {% endif %}
                            </ul>
                        </li>
                    </ul>
                </div>
            </div>
            {% endfor %}
        </div>
        {% endfor %}<commit_msg>dossiers: patient contact is not in adress frame (fixex #2172).<commit_after>{% extends "dossiers/base.html" %}
{% load url from future %}

{% block extrascripts %}
<link rel="stylesheet" type="text/css" media="all" href="{{ STATIC_URL }}filter-widget/css/filter-widget.css"/>
<script src="{{ STATIC_URL }}js/jquery.parse-url.js"></script>
<script src="{{ STATIC_URL }}js/calebasse.dossiers.js"></script>
<script src="{{ STATIC_URL }}filter-widget/js/i18n.js"></script>
<script src="{{ STATIC_URL }}filter-widget/js/core.js"></script>
<script src="{{ STATIC_URL }}filter-widget/js/SelectBox.js"></script>
<script src="{{ STATIC_URL }}filter-widget/js/SelectFilter2.js"></script>
{% endblock %}


{% block appbar %}
<h2><span class="lastname">{{ object.last_name }}</span> {{ object.first_name }} - Dossier {{ object.paper_id|default_if_none:"" }}</h2>
<span id="ajax-redirect" data-url="{{ object.id }}/view"/>
<a href="..">Retourner aux dossiers</a>
{% if object.can_be_deleted %}<button id="patientrecord-delete">Supprimer</button>{% endif %}
{% endblock %}

{% block content %}

{% if messages %}
<ul class="messages">
    {% for message in messages %}
    <li{% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message }}</li>
    {% endfor %}
</ul>
<script type="text/javascript">
$('.messages').delay(1000*(1+{{ messages|length }})).fadeOut('slow');
</script>
{% endif %}

<div id="tabs">
  <ul>
    <li><a data-id="0" class="atabs" href="#tabs-1">Général</a></li>
    <li><a data-id="1" class="atabs" href="#tabs-2">Fiche administrative</a></li>
    <li><a data-id="2" class="atabs" href="#tabs-3">Adresses / contacts</a></li>
    {% if object.service.name == "CMPP" %}
    <li><a data-id="3"  class="atabs" href="#tabs-4">Prise en charge</a></li>
    {% endif %}
    {% if object.service.name == "SESSAD TED" or object.service.name == "SESSAD DYS" %}
    <li><a data-id="3" class="atabs" href="#tabs-4">Notifications</a></li>
    {% endif %}
    <li><a data-id="4" class="atabs" href="#tabs-5">Actes passés</a>
    <li><a data-id="5" class="atabs" href="#tabs-6">Prochains rendez-vous</a>
    <li><a data-id="6" class="atabs" href="#tabs-7">Socialisation</a>
    <li><a data-id="7" class="atabs" href="#tabs-8">Données à caractère médical</a>
  </ul>
  <div id="tabs-1"> <!-- Général -->
      {% include "dossiers/patientrecord_tab1.html" %}
  </div>

  <div id="tabs-2"> <!-- Fiche administrative -->
      {% include "dossiers/patientrecord_tab2.html" %}
  </div>

    <div id="tabs-3"> <!-- Adresses / Contacts -->
    <form method="post" id="policyholder-form" class="patientrecordform">{% csrf_token %}

            <div class="contact patient">
                <h4>{% if object.gender == 1 %}M.{% elif object.gender == 2 %}Mme{% endif %}
                    {{ object.first_name }} <span class="lastname">{{ object.last_name }}</span> {% if object.id == object.id %} (PATIENT){% endif %}</h4>
                <div class="right">Assuré
                    <input type="radio"
                    {% if object.policyholder.id == object.id %} checked="checked" {% endif %}
                    id="id_policyholder-policyholder_{{ object.id }}"
                    value="{{ object.id }}"
                    class="policyholder-radio"
                    name="policyholder-policyholder">
                    <button type="button" data-id="{{ object.id }}" class="update-contact-btn icon-edit" title="Modifier"></button>
                </div>
                <div>
                    <ul>
                        {% if object.parente %}
                            <li><label>Lien avec le patient :</label>
                            {{ object.parente }}</li>
                        {% endif %}
                        {% if object.mobile %}
                            <li>
                            <span class="icon-user-space">{{ object.mobile }} (perso)</span>
                            </li>
                        {% endif %}
                        {% if object.phone %}
                            <li>
                            <span class="icon-user-space">{{ object.phone }} (pro)</span>
                            </li>
                        {% endif %}
                        {% if object.email %}
                            <li>
                            <label>Courriel :</label>
                            {{ object.email }}
                            </li>
                        {% endif %}
                        {% if object.job %}
                            <li>
                            <label>Profession :</label>
                            {{ object.job }}
                            </li>
                        {% endif %}
                        {% if object.contact_comment %}
                            <li>
                            <label>Commentaire :</label>
                            {{ object.contact_comment }}
                            </li>
                        {% endif %}
                        <li><label>Données d'assuré social</label>
<!--                            <button class="blind">détails</button>-->
                            <ul>
                            {% if object.social_security_id %}
                                <li><label>Numéro d'assuré social :</label>
                                {{ object.social_security_id }} {{ object.get_control_key }}</li>
                            {% endif %}
                            {% if object.birthdate %}
                                <li><label>Date de naissance :</label>
                                {{ object.birthdate }}</li>
                            {% endif %}
                            {% if object.birthplace %}
                                <li><label>Lieu de naissance :</label>
                                {{ object.birthplace }}</li>
                            {% endif %}
                            {% if object.begin_rights %}
                                <li><label>Début de droits :</label>
                                {{ object.begin_rights }}</li>
                            {% endif %}
                            {% if object.end_rights %}
                                <li><label>Fin de droits :</label>
                                {{ object.end_rights }}</li>
                            {% endif %}
                            {% if object.health_center %}
                                <li><label>Caisse :</label>
                                {{ object.health_center }}</li>
                            {% endif %}
                            {% if object.other_health_center %}
                                <li><label>Centre spécifique :</label>
                                {{ object.other_health_center }}</li>
                            {% endif %}
                            <li><label>Tiers-payant :</label>
                                {% if object.thirdparty_payer %}
                                    Oui
                                {% else %}
                                    Non
                                {% endif %}
                            </li>
                            {% if object.twinning_rank %}
                                <li><label>Rang (gémellité) :</label>
                                {{ object.twinning_rank }}</li>
                            {% endif %}
                            </ul>
                        </li>
                    </ul>
                </div>
            </div>

        <button id="new-address-btn">Nouvelle adresse</button>
        <button id="new-contact-btn">Nouveau contact</button>

        {% for address in object.addresses.all %}
        <div class="frame">
            <h3>{% if not address.display_name %}Non renseigné{% else %}{{ address.display_name }}{% endif %}</h3>
            <div class="buttons">
                <button type="button" data-id="{{ address.id }}" class="del-address icon-minus" title="Supprimer"></button>
                <button type="button" data-id="{{ address.id }}" class="update-address-btn icon-edit" title="Modifier"></button>
            </div>
            <div class="right">
                <input type="checkbox" data-id="{{ address.id }}" class="place_of_life" {% if address.place_of_life %}checked{% endif %}>Lieu de vie</input>
            </div>
            {% if address.phone %}<p><span class="icon-home-space">{{ address.phone }}</span></p>{% endif %}
            {% if address.comment %}<p><label>Commentaire :</label>{{ address.comment }}</p>{% endif %}
            {% if not address.phone and not address.comment %}<p>&nbsp;<!-- intentionaly empty --></p>{% endif %}
            {% for contact in address.patientcontact_set.all  %}
            {% if contact.id != object.id %}
            <div class="contact{% if contact.id == object.id %} patient{% endif %}">
                <h4>{% if contact.gender == 1 %}M.{% elif contact.gender == 2 %}Mme{% endif %}
                    {{ contact.first_name }} <span class="lastname">{{ contact.last_name }}</span> {% if contact.id == object.id %} (PATIENT){% endif %}</h4>
                <div class="right">Assuré
                    <input type="radio"
                    {% if object.policyholder.id == contact.id %} checked="checked" {% endif %}
                    id="id_policyholder-policyholder_{{ contact.id }}"
                    value="{{ contact.id }}"
                    class="policyholder-radio"
                    name="policyholder-policyholder">
                    <button type="button" data-id="{{ contact.id }}" data-address-id="{{ address.id }}" class="del-contact icon-minus" title="Supprimer"></button>
                    <button type="button" data-id="{{ contact.id }}" class="update-contact-btn icon-edit" title="Modifier"></button>
                </div>
                <div>
                    <ul>
                        {% if contact.parente %}
                            <li><label>Lien avec le patient :</label>
                            {{ contact.parente }}</li>
                        {% endif %}
                        {% if contact.mobile %}
                            <li>
                            <span class="icon-user-space">{{ contact.mobile }} (perso)</span>
                            </li>
                        {% endif %}
                        {% if contact.phone %}
                            <li>
                            <span class="icon-user-space">{{ contact.phone }} (pro)</span>
                            </li>
                        {% endif %}
                        {% if contact.email %}
                            <li>
                            <label>Courriel :</label>
                            {{ contact.email }}
                            </li>
                        {% endif %}
                        {% if contact.job %}
                            <li>
                            <label>Profession :</label>
                            {{ contact.job }}
                            </li>
                        {% endif %}
                        {% if contact.contact_comment %}
                            <li>
                            <label>Commentaire :</label>
                            {{ contact.contact_comment }}
                            </li>
                        {% endif %}
                        <li><label>Données d'assuré social</label>
<!--                            <button class="blind">détails</button>-->
                            <ul>
                            {% if contact.social_security_id %}
                                <li><label>Numéro d'assuré social :</label>
                                {{ contact.social_security_id }} {{ contact.get_control_key }}</li>
                            {% endif %}
                            {% if contact.birthdate %}
                                <li><label>Date de naissance :</label>
                                {{ contact.birthdate }}</li>
                            {% endif %}
                            {% if contact.birthplace %}
                                <li><label>Lieu de naissance :</label>
                                {{ contact.birthplace }}</li>
                            {% endif %}
                            {% if contact.begin_rights %}
                                <li><label>Début de droits :</label>
                                {{ contact.begin_rights }}</li>
                            {% endif %}
                            {% if contact.end_rights %}
                                <li><label>Fin de droits :</label>
                                {{ contact.end_rights }}</li>
                            {% endif %}
                            {% if contact.health_center %}
                                <li><label>Centre de santé :</label>
                                {{ contact.health_center }}</li>
                            {% endif %}
                            <li><label>Tiers-payant :</label>
                                {% if contact.thirdparty_payer %}
                                    Oui
                                {% else %}
                                    Non
                                {% endif %}
                            </li>
                            {% if contact.twinning_rank %}
                                <li><label>Rang (gémellité) :</label>
                                {{ contact.twinning_rank }}</li>
                            {% endif %}
                            </ul>
                        </li>
                    </ul>
                </div>
            </div>
            {% endif %}
            {% endfor %}
        </div>
        {% endfor %}
{'fraction_non_alphanumeric': 0.15790881133841422, 'fraction_numerical': 0.003832954494807684, 'mean_word_length': 1.2198258804907005, 'pattern_counts': {'":': 0, '<': 453, '<?xml version=': 0, '>': 453, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 15, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '373756', 'n_tokens_mistral': 6380, 'n_tokens_neox': 5733, 'n_words': 1123}