From 6dcb853267d4f888229dbc7bc7720e7af147a933 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Fran=C3=A7a?= Date: Mon, 23 Apr 2018 08:46:56 -0300 Subject: [PATCH 001/271] Updating the risks document Add the informations of risks for Sprint 6 and 7 --- docs/eps/RISKS.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs/eps/RISKS.md b/docs/eps/RISKS.md index 87c21f44..d2c207c6 100644 --- a/docs/eps/RISKS.md +++ b/docs/eps/RISKS.md @@ -50,6 +50,18 @@ |:--------------:|:-------------------|:-------------------| | Atraso na implementação da arquitetura do projeto | - apresentar as features com antecedência para o arquiteto do software para que ele possa planejar como implementá-las com antecedência;
- checar o andamento do planejamento e implementação da arquitetura constantemente com o arquiteto | - analisar o que houve de errado na implementação para remediar;
- incluir no planejamento das sprints seguintes histórias para tirar o atraso da implementação da arquitetura +## Sprint 6 + +### Score: 51 + +## Sprint 7 + +### Score: 45 + +| **Risco** | **Ações para prevení-lo** | **Ações para mitigá-lo** | +|:--------------:|:-------------------|:-------------------| +| Aceitação do software pelo cliente | - levantar o que o cliente o que ele acha do planejamento das features a serem implementadas, antes de elas serem incluídas em uma sprint;
-arrumar o que for necessário a partir do feedback do cliente | - levantar com o cliente o que está errado no que foi feito;
- elencar possíveis soluções para os problemas apontados e apresentá-las ao cliente, até que ele esteja de acordo;
- corrigir os erros nas sprints seguintes, o mais rápido possível + ## Burndown de Riscos Essa escala deve ser usada para pontuar o impacto (usando como referência uma estimativa do número de dias necessários para mitigar os efeitos da ocorrência do risco): From aee22fad06e31c7372481c0360dd9ef5ff5531bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Pedro=20Sconetto?= Date: Sat, 28 Apr 2018 10:10:25 -0300 Subject: [PATCH 002/271] Fixing docker login error Fixing staging and prod deploy scritps Moving travis after_succes to after_script due after_success was not executing Co-authored-by: Victor Arnaud --- .travis.yml | 7 +++---- production-deploy.sh | 2 +- staging-deploy.sh | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6cd64982..434ddc3d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -39,10 +39,6 @@ script: - docker-compose -f local.yml run --rm django py.test - docker-compose -f local.yml run --rm django coverage run -m py.test - docker-compose -f local.yml run --rm django coverage xml -after_sucess: - - make -C docs/ latexpdf - - mv docs/_build/latex/drdown.pdf docs/drdown.pdf - - if [[ $DEPLOY_DOCS == "true" ]]; then echo "Preparing to build and deploy documentation" ; ./mkdocs-build.sh ; echo "Completed deploying documentation" ; fi deploy: # deploy develop to the staging environment - provider: script @@ -56,3 +52,6 @@ deploy: branch: master after_script: - ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT -t coverage.py + - make -C docs/ latexpdf + - mv docs/_build/latex/drdown.pdf docs/drdown.pdf + - if [[ $DEPLOY_DOCS == "true" ]]; then echo "Preparing to build and deploy documentation" ; ./mkdocs-build.sh ; echo "Completed deploying documentation" ; fi diff --git a/production-deploy.sh b/production-deploy.sh index bab4b50e..0589df34 100755 --- a/production-deploy.sh +++ b/production-deploy.sh @@ -4,7 +4,7 @@ # # Author: João Pedro Sconetto -echo $DOCKER_ID_USER_PASSWORD | docker login --username $DOCKER_ID_USER --password-stdin +docker login --username $DOCKER_ID_USER --password $DOCKER_ID_USER_PASSWORD docker tag 20181drdown_django_1 $DOCKER_ID_USER/20181-dr-down_django docker push $DOCKER_ID_USER/20181-dr-down_django diff --git a/staging-deploy.sh b/staging-deploy.sh index e09aa00e..c2868158 100755 --- a/staging-deploy.sh +++ b/staging-deploy.sh @@ -4,7 +4,7 @@ # # Author: João Pedro Sconetto -echo $DOCKER_ID_USER_PASSWORD | docker login --username $DOCKER_ID_USER --password-stdin +docker login --username $DOCKER_ID_USER --password $DOCKER_ID_USER_PASSWORD docker tag 20181drdown_django_1 $DOCKER_ID_USER/20181-dr-down_django docker push $DOCKER_ID_USER/20181-dr-down_django From a548cbbb0e73de1c6cabd187e4f7632cd5e40775 Mon Sep 17 00:00:00 2001 From: VictorArnaud Date: Sat, 28 Apr 2018 10:43:55 -0300 Subject: [PATCH 003/271] Inserting components to sprint 09 to 12 Co-authored-by: Victor Arnaud --- docs/mds/ARCHITECTURE_DOCUMENT.md | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/docs/mds/ARCHITECTURE_DOCUMENT.md b/docs/mds/ARCHITECTURE_DOCUMENT.md index 315d1ba3..9166d7f3 100644 --- a/docs/mds/ARCHITECTURE_DOCUMENT.md +++ b/docs/mds/ARCHITECTURE_DOCUMENT.md @@ -23,6 +23,7 @@ | 15/04/2018 | 1.4.0 | Modificando imagem da arquitetura | Victor Arnaud e Geovana Ramos | | 22/04/2018 | 2.0.0 | Versão 2.0 do Arquitetura e componentes da sprint 07 | Victor Arnaud, Geovana Ramos e Gabriela Medeiros | | 26/04/2018 | 2.1.0 | Inserindo componentes da sprint 08 | Victor Arnaud | +| 01/05/2018 | 2.2.0 | Inserindo componentes para as sprints 09 a 12 | Victor Arnaud | ## 1: Introdução @@ -107,7 +108,7 @@ Critérios de aceitação de um componente: 5. **Extensibilidade**: Um componente pode ser estendido a partir de outro componente para fornecer um novo comportamento. 6. **Encapsulamento**: O componente deve expor uma interface para os invocadores utilizarem suas funcionalidades e não revelar detalhes do seu processo interno, das variáveis internas e de seu estado. 7. **Externo ao projeto**: O componente deve estar disponibilizado no **pypi**. -8. **Qualidade**: O componente deve estar testado e ter build funcionando, além de ser completo e estar em uma versão estável. +8. **Qualidade**: O componente deve estar testado e ter build funcionando, além de ser completo e estar em uma versão estável, ou seja, o componente deve funcionar na nova versão 2.0 do Django. A cada sprint do projeto será definido a utilização ou não de cada componente disponibilizado nas tabelas abaixo. Os microsserviços e APIs consumidas também serão listados nas tabelas abaixo. As tabelas abaixo está mapeada com a EAP do projeto. @@ -134,12 +135,8 @@ A cada sprint do projeto será definido a utilização ou não de cada component |Aplicação|Descrição da aplicação|Foi utilizado?|Motivo da utilização ou não| |---------|----------------------|:------------:|---------------------------| |[pinax-calendars](https://github.com/pinax/pinax-calendars/)|Aplicação django para publicar eventos como um calendario|A decidir|A aplicação ainda está sendo avaliada pela equipe.| -|[django-calendarium](https://github.com/bitlabstudio/django-calendarium)|Um aplicativo Django reutilizável para gerenciar e exibir um calendário em seus modelos.|A decidir|A aplicação ainda está sendo avaliada pela equipe.| |[django-scheduler](https://github.com/llazzaro/django-scheduler)|Uma aplicação de calendario do django|A decidir|A aplicação ainda está sendo avaliada pela equipe.| -|[django-schedule-thauber](https://github.com/thauber/django-schedule)|Uma aplicação de calendario do django|A decidir|A aplicação ainda está sendo avaliada| |[pinax-notifications](https://github.com/pinax/pinax-notifications/)|Gerenciamento de notificação de usuário para o framework web Django|A decidir|A aplicação ainda está sendo avaliada| -|[django-frontend-notification](https://github.com/areski/django-frontend-notification)|Aplicativo Django para exibir no frontend a lista de notificações e executar algumas ações básicas como "visualizar todas as notificações", "excluir notificações", ele também fornece ajudantes para exibir notificações|A decidir|A aplicação ainda está sendo avaliada| -|[django-webline-notifications](https://github.com/alireza-molaee/django-webline-notifications)|É uma biblioteca python, que permite notificar tudo para o(s) usuário(s)|A decidir|A aplicação ainda está sendo avaliada| #### Ficha de acompanhamento e Relatórios @@ -147,14 +144,16 @@ A cada sprint do projeto será definido a utilização ou não de cada component |---------|----------------------|:------------:|---------------------------| |[django-pagedown](https://github.com/timmyomahony/django-pagedown)|Um aplicativo django que permite a fácil adição do editor de marcação "PageDown" do Stack Overflow a um campo de formulário django, seja em um aplicativo personalizado ou no Django Admin.|Sim|O componente está sendo usado no prontuário| |[django-markdown-deux](https://github.com/trentm/django-markdown-deux)|Componente para evitar a inserção de código malicioso no markdown|Sim|O componente está sendo usado no prontuário| -|[pdf-report](https://github.com/Edinburgh-Genome-Foundry/pdf_reports)|Biblioteca Python e tema CSS para gerar relatórios em PDF a partir de HTML/Pug|A decidir|A aplicação está sendo avaliada pela equipe| -|[django-easy-pdf](https://github.com/nigma/django-easy-pdf)|Visualização de PDF de uma maneira fácil|A decidir|A aplicação está sendo avaliada pela equipe| +|[pdf-report](https://github.com/Edinburgh-Genome-Foundry/pdf_reports)|Biblioteca Python e tema CSS para gerar relatórios em PDF a partir de HTML/Pug|Não|A documentação do Django aconselha utilizar o ReportLab, logo iremos utilizat esse component.| +|[reportlab](https://pypi.org/project/reportlab/)|O Toolkit do ReportLab. Uma biblioteca Python de código aberto para gerar PDFs e gráficos.|Sim|Recomendação da documentação do [django](https://docs.djangoproject.com/pt-br/2.0/howto/outputting-pdf/), será utilizado para gerar os PDFs e gráficos do projeto| +|[django-easy-pdf](https://github.com/nigma/django-easy-pdf)|Visualização de PDF de uma maneira fácil|Não|A documentação do Django aconselha utilizar o ReportLab, logo iremos utilizar esse component.| #### Localização |Aplicação|Descrição da aplicação|Foi utilizado?|Motivo da utilização ou não| |---------|----------------------|:------------:|---------------------------| |[GoogleMapsAPI](https://developers.google.com/places/web-service/?hl=pt-br)|API do Google Maps com informações sobre milhões de locais|A decidir|A API ainda está sendo avaliada pela equipe.| +|[google-maps-services-python](https://github.com/googlemaps/google-maps-services-python)|Componente python para utilização da API do google maps|A decidir|O componente está sendo avaliado pela equipe.| #### Outros @@ -162,17 +161,9 @@ A cada sprint do projeto será definido a utilização ou não de cada component |---------|----------------------|:------------:|---------------------------| |[django-role-permissions](https://github.com/vintasoftware/django-role-permissions)|É um aplicativo de Django para permissões baseadas em função. Ele é construído sobre as funcionalidades Group e Permission do usuário do Django contrib.auth e não adiciona nenhum outro modelo ao seu projeto, ou seja, é totalmente independente.|Sim|Ele será utilizado no projeto para a criação de permissões de cada tipo de usuário do sistema e as permissões de acesso a determinadas páginas| |[django-crispy-forms](http://django-crispy-forms.readthedocs.io/en/latest/)|É um aplicativo do Django que permite a construção, customização e reutilização de formulários facilmente, podendo usar qualquer framework CSS, sem escrever código de template e sem ter que cuidar de outros tipos de detalhes.|Sim|Foi utilizado para facilitar a criação de formulários| -|[django-simple-search](https://github.com/gregplaysguitar/django-simple-search)|A busca simples do Django fornece a mesma funcionalidade e conveniência que o search fields faz no admin do django.|A decidir|A aplicação ainda está sendo avaliada| +|[django-simple-search](https://github.com/gregplaysguitar/django-simple-search)|A busca simples do Django fornece a mesma funcionalidade e conveniência que o search fields faz no admin do django.|Não|Foi decidido a utilização do django-search-view pelo fato de utilizar CBV.| |[django-search-view](https://github.com/inmagik/django-search-views)|Componente para pesquisa e filtros usando Class Based Views|Sim|O componentes está sendo usando em algumas partes do software que precisa pesquisar algo.| - -#### Comunicação entre usuários (Removido do escopo) - -|Aplicação|Descrição da aplicação|Foi utilizado?|Motivo da utilização ou não| -|---------|----------------------|:------------:|---------------------------| -|[Rocket.Chat](https://github.com/jadolg/rocketchat_API)|É um microserviço de chat open source baseado no Slack e construído em Meteor|Não|O chat foi removido do escopo do projeto.| -|[Receita-Mais](https://github.com/fga-gpp-mds/2017.2-Receita-Mais)|Software responsável por auxiliar na prescrição de medicamentos|Não|Não passou em quase todos os critérios definidos acima, a aplicação chat do projeto está bastante acoplada, ou seja, teria dificuldade de desacoplar e empacotar o mesmo, gastando tempo e esforço| -|[django-private-chat](https://github.com/Bearle/django-private-chat)|Chat assíncrono baseado em WebSocket|Não|O chat foi removido do escopo do projeto.| -|[django-tawkto](https://github.com/CleitonDeLima/django-tawkto)|Projeto simples integrado com o chat [tawk.to](https://www.tawk.to/)|Não|O chat foi removido do escopo do projeto.| +|[django-anymail](https://github.com/anymail/django-anymail)|Backends e webhooks de e-mail do Django para Amazon SES, Mailgun, Mailjet, Carimbo Postal, SendGrid, SendinBlue, SparkPost e mais|A decidir|A equipe está avaliando a possibilidade de utiliza-lo.| ### 2.3 Banco de dados PostgreSQL From 21c2d5fdd0a35050c94ac990f8999b4811ff7c83 Mon Sep 17 00:00:00 2001 From: GeovanaRamos Date: Sun, 29 Apr 2018 15:36:30 -0300 Subject: [PATCH 004/271] Starting appointments app Adding empty python folders: models, tests, views, templates, static, migrations Adding empty python files: admin, apps, urls Adding app to base settings Co-authored-by: Gabriela Medeiros --- config/settings/base.py | 1 + drdown/appointments/__init__.py | 0 drdown/appointments/admin.py | 3 +++ drdown/appointments/apps.py | 6 ++++++ drdown/appointments/migrations/__init__.py | 0 drdown/appointments/models/__init__.py | 0 drdown/appointments/tests/__init__.py | 0 drdown/appointments/urls.py | 0 drdown/appointments/views/__init__.py | 0 9 files changed, 10 insertions(+) create mode 100644 drdown/appointments/__init__.py create mode 100644 drdown/appointments/admin.py create mode 100644 drdown/appointments/apps.py create mode 100644 drdown/appointments/migrations/__init__.py create mode 100644 drdown/appointments/models/__init__.py create mode 100644 drdown/appointments/tests/__init__.py create mode 100644 drdown/appointments/urls.py create mode 100644 drdown/appointments/views/__init__.py diff --git a/config/settings/base.py b/config/settings/base.py index a233b463..fc8aca3d 100644 --- a/config/settings/base.py +++ b/config/settings/base.py @@ -85,6 +85,7 @@ 'drdown.core.apps.CoreConfig', 'drdown.careline.apps.CarelineConfig', 'drdown.medicalrecords.apps.MedicalRecordsConfig', + 'drdown.appointments.apps.AppointmentsConfig', ] # https://docs.djangoproject.com/en/dev/ref/settings/#installed-apps INSTALLED_APPS = DJANGO_APPS + THIRD_PARTY_APPS + LOCAL_APPS diff --git a/drdown/appointments/__init__.py b/drdown/appointments/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/drdown/appointments/admin.py b/drdown/appointments/admin.py new file mode 100644 index 00000000..8c38f3f3 --- /dev/null +++ b/drdown/appointments/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/drdown/appointments/apps.py b/drdown/appointments/apps.py new file mode 100644 index 00000000..bfcf1faf --- /dev/null +++ b/drdown/appointments/apps.py @@ -0,0 +1,6 @@ +from django.apps import AppConfig + + +class AppointmentsConfig(AppConfig): + name = 'drdown.appointments' + verbose_name = 'Appointments' diff --git a/drdown/appointments/migrations/__init__.py b/drdown/appointments/migrations/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/drdown/appointments/models/__init__.py b/drdown/appointments/models/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/drdown/appointments/tests/__init__.py b/drdown/appointments/tests/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/drdown/appointments/urls.py b/drdown/appointments/urls.py new file mode 100644 index 00000000..e69de29b diff --git a/drdown/appointments/views/__init__.py b/drdown/appointments/views/__init__.py new file mode 100644 index 00000000..e69de29b From cce4d3bff2778085922cf6f066e25c15a73fc19c Mon Sep 17 00:00:00 2001 From: GeovanaRamos Date: Sun, 29 Apr 2018 17:41:32 -0300 Subject: [PATCH 005/271] Creating model Appointment Adding attributes, __string__ and class meta Adding model to admin and init Creating migration Co-authored-by: Gabriela Medeiros --- drdown/appointments/admin.py | 2 + .../appointments/migrations/0001_initial.py | 33 ++++++ drdown/appointments/models/__init__.py | 1 + .../appointments/models/model_appointment.py | 102 ++++++++++++++++++ 4 files changed, 138 insertions(+) create mode 100644 drdown/appointments/migrations/0001_initial.py create mode 100644 drdown/appointments/models/model_appointment.py diff --git a/drdown/appointments/admin.py b/drdown/appointments/admin.py index 8c38f3f3..a81f24c1 100644 --- a/drdown/appointments/admin.py +++ b/drdown/appointments/admin.py @@ -1,3 +1,5 @@ from django.contrib import admin +from .models.model_appointment import Appointment # Register your models here. +admin.site.register(Appointment) diff --git a/drdown/appointments/migrations/0001_initial.py b/drdown/appointments/migrations/0001_initial.py new file mode 100644 index 00000000..747740c1 --- /dev/null +++ b/drdown/appointments/migrations/0001_initial.py @@ -0,0 +1,33 @@ +# Generated by Django 2.0.3 on 2018-04-29 20:39 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ('users', '0015_auto_20180428_1306'), + ] + + operations = [ + migrations.CreateModel( + name='Appointment', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('shift', models.CharField(choices=[('M', 'Morning'), ('A', 'Afternoon')], help_text='Shift of appointment', max_length=10, verbose_name='Shift')), + ('date_time', models.DateTimeField(help_text='Date and time of appointment', max_length=50, verbose_name='Date and Time')), + ('motive', models.TextField(help_text='Why are you requesting an appointment?', max_length=500, verbose_name='Motive')), + ('speciality', models.CharField(choices=[('Speech Therapy', 'Speech Therapy'), ('Psychology', 'Psychology'), ('Physiotherapy', 'Physiotherapy'), ('Occupational Therapy', 'Occupational Therapy'), ('Doctor', 'Doctor'), ('Cardiology', 'Cardiology'), ('Neurology', 'Neurology'), ('Pediatrics', 'Pediatrics'), ('Nursing', 'Nursing')], help_text='Speciality of appointment', max_length=30, verbose_name='Speciality')), + ('status', models.CharField(choices=[('Scheduled', 'Scheduled'), ('Canceled', 'Canceled'), ('Done', 'Done')], default='Scheduled', help_text='Is the appointment still scheduled?', max_length=20, verbose_name='Status')), + ('doctor', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='appointments', to='users.HealthTeam', verbose_name='Doctor')), + ('patient', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='appointments', to='users.Patient', verbose_name='Patient')), + ], + options={ + 'verbose_name': 'Appointment', + 'verbose_name_plural': 'Appointments', + }, + ), + ] diff --git a/drdown/appointments/models/__init__.py b/drdown/appointments/models/__init__.py index e69de29b..558d3c32 100644 --- a/drdown/appointments/models/__init__.py +++ b/drdown/appointments/models/__init__.py @@ -0,0 +1 @@ +from .model_appointment import Appointment diff --git a/drdown/appointments/models/model_appointment.py b/drdown/appointments/models/model_appointment.py new file mode 100644 index 00000000..d1264e7d --- /dev/null +++ b/drdown/appointments/models/model_appointment.py @@ -0,0 +1,102 @@ +from django.db import models +from drdown.users.models.model_health_team import HealthTeam +from drdown.users.models.model_patient import Patient +from django.utils.translation import ugettext_lazy as _ + + +class Appointment(models.Model): + + MORNING = 'M' + AFTERNOON = 'A' + + SHIFT_CHOICES = ( + (MORNING, _('Morning')), + (AFTERNOON, _('Afternoon')), + ) + + shift = models.CharField( + _('Shift'), + choices=SHIFT_CHOICES, + help_text=_('Shift of appointment'), + max_length=10 + ) + + date_time = models.DateTimeField( + _('Date and Time'), + help_text=_('Date and time of appointment'), + max_length=50 + ) + + motive = models.TextField( + _('Motive'), + help_text=_('Why are you requesting an appointment?'), + max_length=500 + ) + + SPEECH_THERAPHY = _("Speech Therapy") + PSYCHOLOGY = _("Psychology") + PHYSIOTHERAPY = _("Physiotherapy") + OCCUPATIONAL_THERAPY = _("Occupational Therapy") + DOCTOR = _("Doctor") + CARDIOLOGY = _("Cardiology") + NEUROLOGY = _("Neurology") + PEDIATRICS = _("Pediatrics") + NURSING = _("Nursing") + + SPECIALITY_CHOICES = ( + (SPEECH_THERAPHY, _('Speech Therapy')), + (PSYCHOLOGY, _('Psychology')), + (PHYSIOTHERAPY, _('Physiotherapy')), + (OCCUPATIONAL_THERAPY, _('Occupational Therapy')), + (DOCTOR, _('Doctor')), + (CARDIOLOGY, _('Cardiology')), + (NEUROLOGY, _('Neurology')), + (PEDIATRICS, _('Pediatrics')), + (NURSING, _('Nursing')), + ) + + speciality = models.CharField( + _('Speciality'), + choices=SPECIALITY_CHOICES, + help_text=_("Speciality of appointment"), + max_length=30 + ) + + doctor = models.ForeignKey( + HealthTeam, + on_delete=models.CASCADE, + verbose_name=_('Doctor'), + related_name='appointments', + ) + + patient = models.ForeignKey( + Patient, + on_delete=models.CASCADE, + verbose_name=_('Patient'), + related_name='appointments', + ) + + SCHEDULED = _('Scheduled') + CANCELED = _('Canceled') + DONE = _('Done') + + STATUS_CHOICES = ( + (SCHEDULED, _('Scheduled')), + (CANCELED, _('Canceled')), + (DONE, _('Done')) + ) + + status = models.CharField( + _('Status'), + choices=STATUS_CHOICES, + help_text=_("Is the appointment still scheduled?"), + default=SCHEDULED, + max_length=20 + ) + + def __str__(self): + return _('Appointment of ') + self.patient + + class Meta: + verbose_name = _("Appointment") + verbose_name_plural = _("Appointments") From 10094f1379672a68ebcdd914f6d8dd5700fc5967 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Pedro=20Sconetto?= Date: Sun, 29 Apr 2018 22:24:11 -0300 Subject: [PATCH 006/271] Adding release 2 evm Add image and information for the first and second release and the second release evm Co-authored-by: Mariana Mendes --- docs/eps/EVM_AGILE.md | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/docs/eps/EVM_AGILE.md b/docs/eps/EVM_AGILE.md index 7f63d212..b049c313 100644 --- a/docs/eps/EVM_AGILE.md +++ b/docs/eps/EVM_AGILE.md @@ -4,6 +4,7 @@ | Data | Versão | Descrição | Autores | | --- | --- | --- | --- | | 28/03/2018 | 0.0.1 | Criação do documento | João Pedro Sconetto | +| 29/04/2019 | 0.1.0 | Adição da EVM da segunda _release_ | João Pedro Sconetto e Mariana de Souza Mendes | ## EVM Agile @@ -13,6 +14,8 @@ O __EVM__ (_Earned Value Management_ ou Gerenciamento de Valor agregado) se trat - e etc. ### Dados Fixos + +#### _Release 1_ | Identificador | Descrição | Valor | | --- | --- | --- | | BAC | Orçamento disponível para a primeira _release_ | R$ 34.039,38 | @@ -21,9 +24,18 @@ O __EVM__ (_Earned Value Management_ ou Gerenciamento de Valor agregado) se trat | SD | Data de início | 05/03/2018 | | PRP | Pontos planejados para a primeira _release_ | 172 | +#### _Release 2_ +| Identificador | Descrição | Valor | +| --- | --- | --- | +| BAC | Orçamento disponível para a segunda _release_ | R$ 34.039,38 | +| L | Tamanho da sprint em dias | 7 | +| PS | Total de sprints planejadas | 8 | +| SD | Data de início | 14/04/2018 | +| PRP | Pontos planejados para a segunda _release_ | 200 | + ### Legenda: | Identificador | Descrição | -| --- | --- | +| --- | --- | | PRP | O PRP foi modificado para ser a soma de todos os pontos reavaliados das histórias. | | RPC | De forma análoga, o RPC é avaliado como o somatório dos pontos concluídos até a sprint atual. | | PPC | Esse valor é o somatório da razão entre a duração da sprint atual sobre o número de sprints da _release_ até a sprint atual. | @@ -44,6 +56,19 @@ O __EVM__ (_Earned Value Management_ ou Gerenciamento de Valor agregado) se trat ### Planilha EVM Link para a planilha EVM no [Google Docs](https://docs.google.com/spreadsheets/d/1ZHlVvq_5Sjnyp-sH-7Zfn_KFYzFxoZwtOBWQ92yfd3M/edit?usp=sharing). +### Imagem da EVM +#### _Release_ 1 +Abaixo segue a imagem da EVM para a primeira _release_, esta que já foi concluída. +As informações podem ser melhor vistas no link disponibilizado acima. + +![EVM-Release 01](https://i.imgur.com/eBpsQLy.png) + +#### _Release_ 2 +Abaixo segue a imagem da EVM da segunda _release_, que ainda está em execução, logo não está completamente preenchida. +As informações podem ser melhor vistas no link disponibilizado acima. + +![EVM-Release 02](https://i.imgur.com/xOnnli4.png) + ## Referências HiFlex Consultoria. Gerenciamento de valor agregado (EVM) em projetos agéis. Vitor Massari. Acesso em: codetiburon. Earned Value Management (EVM) for Agile Software Projects. Olga Yatskevich. Acesso em: From e5b8e7f262f9111036da1ff4139b8f5c7c9db181 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Pedro=20Sconetto?= Date: Sun, 29 Apr 2018 23:13:01 -0300 Subject: [PATCH 007/271] Fixing some travis errors Modifying the mkdocs shell script permission Adding shpinx to the installation step Co-authored-by: Mariana Mendes --- .travis.yml | 1 + mkdocs-build.sh | 0 2 files changed, 1 insertion(+) mode change 100644 => 100755 mkdocs-build.sh diff --git a/.travis.yml b/.travis.yml index 434ddc3d..9060b3f2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,6 +26,7 @@ before_install: - docker-compose --version - sudo apt-get install texlive-latex-base texlive-fonts-recommended -y - sudo apt-get install texlive-fonts-extra texlive-latex-extra -y + - sudo apt-get install python-sphinx -y - python3 -m pip install pip -U - python3 -m pip install mkdocs before_script: diff --git a/mkdocs-build.sh b/mkdocs-build.sh old mode 100644 new mode 100755 From 4bbab8eef225b501ddfd3557a81b290183806670 Mon Sep 17 00:00:00 2001 From: guilherme1guy Date: Sun, 29 Apr 2018 23:22:39 -0300 Subject: [PATCH 008/271] Fixing error in test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It was using datetime, but it should use only date. Co-authored-by: João Sconetto --- drdown/users/tests/test_model_user.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drdown/users/tests/test_model_user.py b/drdown/users/tests/test_model_user.py index 1522f077..ee362b92 100644 --- a/drdown/users/tests/test_model_user.py +++ b/drdown/users/tests/test_model_user.py @@ -55,7 +55,7 @@ def test_age(self): 5, 10, 4, 66, 12 ] - today = timezone.datetime.today() + today = timezone.localdate() for test_age in test_ages: self.user.birthday = timezone.datetime( From 011777b29388ed80acdef39aef0829c3dfb80d8b Mon Sep 17 00:00:00 2001 From: Mariana Mendes Date: Mon, 30 Apr 2018 11:13:33 -0300 Subject: [PATCH 009/271] Adding the sprint 07 folder MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add the results of sprint 07 Add the planning of sprint 07 Co-authored-by: Diego França --- docs/sprints/07/planning.md | 52 +++++++++++++++++++++++++++++++++++++ docs/sprints/07/results.md | 39 ++++++++++++++++++++++++++++ 2 files changed, 91 insertions(+) create mode 100644 docs/sprints/07/planning.md create mode 100644 docs/sprints/07/results.md diff --git a/docs/sprints/07/planning.md b/docs/sprints/07/planning.md new file mode 100644 index 00000000..98280c1a --- /dev/null +++ b/docs/sprints/07/planning.md @@ -0,0 +1,52 @@ +# Planejamento da Sprint 7 + +## 1. Resumo da Sprint + +__Número da sprint:__ 7 + +__Data de início:__ 21/04/2018 + +__Data de Término:__ 27/04/2018 + +__Duração__: 6 dias + +__Pontos Planejados:__ 23 pontos + +__Membros presentes:__ Todos + +## 2. Papéis + +- Scrum Master: + - Diego França + +- Product Owner: + - Mariana Mendes + +- DevOps: + - João Sconetto + +- Arquiteto: + - Victor Arnaud + +- Time de Desenvolvimento: + - Daniel Maike + - Elias Bernardo + - Gabriela Medeiros + - Geovana Ramos + - Guilherme Guy + - Joberth Rodrigues + +## 3. Pareamento + + +## 4. Planejamento da Sprint + + +## 5. Mudanças + + +## 6. Backlog da Sprint + + +## 7. Risk Burndown + diff --git a/docs/sprints/07/results.md b/docs/sprints/07/results.md new file mode 100644 index 00000000..8674ea49 --- /dev/null +++ b/docs/sprints/07/results.md @@ -0,0 +1,39 @@ +# Fechamento da sprint + +## Sumário + +## 1. Resumo da Sprint + +__Pontos Planejados__: 23 pontos + +__Pontos concluídos__: 23 pontos + +__Dívidas técnicas__: 0 pontos + +__Histórias entregues:__ + + +## 2. Retrospectiva da Sprint + +| Pontos Positivos | Pontos Negativos | Sugestão de Melhoria | +| ----- | ----- | ---- | +| Os pontos positivos das sprints passada se manteram | - | Ser mais críticos na hora das pontuações | +| Foi criado um canal de bug no slack e ele está ajudando muito | Pareamento não deu muito certo pra uma dupla | - | +| - | Issues depentes de outras issues | - | +| - | Cliente estava viajando, ou seja a comunicação não foi muito boa | Tentar manter o frontend(padrão + + +## 3. Quadro de Conhecimento + + +## 5. Gráfico do Burndown + + +## 6. Velocity + + +## 7. Gráfico de Commits + + +## 9. Análise do Scrum Master + From fedd7dd2f99aa59ed4de76d5ab272363f79da9ec Mon Sep 17 00:00:00 2001 From: Mariana Mendes Date: Mon, 30 Apr 2018 11:25:35 -0300 Subject: [PATCH 010/271] Adding the sprint 07 on mkdocs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add the results and planning of sprint 07 on mkdocs page Co-authored-by: Diego França --- mkdocs.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mkdocs.yml b/mkdocs.yml index 2be5eae3..1f7f55e7 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -47,4 +47,7 @@ pages: - Sprint 6: - Planejamento: sprints/06/planning.md - Resultado: sprints/06/results.md + - Sprint 7: + - Planejamento: sprints/07/planning.md + - Resultado: sprints/07/results.md From f24a195697f6c0195c262ce917bc4b3eb66cbc51 Mon Sep 17 00:00:00 2001 From: guilherme1guy Date: Mon, 30 Apr 2018 12:10:49 -0300 Subject: [PATCH 011/271] Fixing a edge case error in test Date was calculated wrongly on the final day of the month, now its fixed Changing model user age calculation, so it cannot return a negative result --- drdown/users/models/model_user.py | 2 +- drdown/users/tests/test_model_user.py | 4 +++- requirements/base.txt | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/drdown/users/models/model_user.py b/drdown/users/models/model_user.py index 5431460e..7448e90c 100644 --- a/drdown/users/models/model_user.py +++ b/drdown/users/models/model_user.py @@ -90,7 +90,7 @@ def age(self): today.day) < (self.birthday.month, self.birthday.day)) - if age is 0: + if age <= 0: diff_month = (today.year - self.birthday.year) * 12 + \ today.month - self.birthday.month age = 0 if diff_month < 6 else 0.5 diff --git a/drdown/users/tests/test_model_user.py b/drdown/users/tests/test_model_user.py index ee362b92..fc5f8a8e 100644 --- a/drdown/users/tests/test_model_user.py +++ b/drdown/users/tests/test_model_user.py @@ -2,6 +2,7 @@ from drdown.users.models import User from django.core.exceptions import ValidationError from django.utils import timezone +from dateutil.relativedelta import relativedelta from ..models import Employee, HealthTeam, Patient, Responsible @@ -73,6 +74,7 @@ def test_age(self): ) edge_cases_months = [ + -1, 0, 1, 5, @@ -86,7 +88,7 @@ def test_age(self): ] for months in edge_cases_months: - self.user.birthday = today - timezone.timedelta(days=30*months) + self.user.birthday = today + relativedelta(months=-months) self.user.save() self.user.refresh_from_db() diff --git a/requirements/base.txt b/requirements/base.txt index 294dfe8b..fa276617 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -6,6 +6,7 @@ whitenoise==3.3.1 # https://github.com/evansd/whitenoise redis>=2.10.5 # https://github.com/antirez/redis celery==3.1.25 # pyup: <4.0 # https://github.com/celery/celery raven==6.6.0 # https://github.com/getsentry/raven-python +python-dateutil==2.7.2 # https://github.com/dateutil/dateutil # Django # ------------------------------------------------------------------------------ From 8c46664efd06c998cb9a5235265f2a40cac1f11f Mon Sep 17 00:00:00 2001 From: guilherme1guy Date: Mon, 30 Apr 2018 16:34:14 -0300 Subject: [PATCH 012/271] Adding validation to user birthday Adds checks on clean of user model Adds error in html frontend Adds tests to cover changes Co-authored-by: joberth rogers --- drdown/users/models/model_user.py | 16 ++++++++++++++++ drdown/users/templates/users/user_form.html | 7 +++++++ drdown/users/tests/test_model_user.py | 16 ++++++++++++++++ 3 files changed, 39 insertions(+) diff --git a/drdown/users/models/model_user.py b/drdown/users/models/model_user.py index 7448e90c..36a979e4 100644 --- a/drdown/users/models/model_user.py +++ b/drdown/users/models/model_user.py @@ -133,6 +133,22 @@ def clean(self, *args, **kwargs): else: self.has_specialization = (self.count_user_specialization() is 1) + if isinstance(self.birthday, timezone.datetime): + self.birthday = self.birthday.date() + + if self.birthday: + if timezone.localdate().isoformat() < str(self.birthday): + raise ValidationError( + {'birthday': _("The birthday cannot be in the future!")} + ) + elif ( + timezone.datetime.strptime(str(self.birthday), "%Y-%m-%d") < + timezone.datetime.strptime("1900-01-01", "%Y-%m-%d") + ): + raise ValidationError( + {'birthday': _("This birthday is too old.")} + ) + return data def save(self, *args, **kwargs): diff --git a/drdown/users/templates/users/user_form.html b/drdown/users/templates/users/user_form.html index 445868c7..5758ebad 100644 --- a/drdown/users/templates/users/user_form.html +++ b/drdown/users/templates/users/user_form.html @@ -97,6 +97,13 @@

{{ user.username }}

+ + {% for error in form.birthday.errors %} + + {% endfor %} + {% if object.birthday %} {% else %} diff --git a/drdown/users/tests/test_model_user.py b/drdown/users/tests/test_model_user.py index fc5f8a8e..aba1a8aa 100644 --- a/drdown/users/tests/test_model_user.py +++ b/drdown/users/tests/test_model_user.py @@ -3,6 +3,7 @@ from django.core.exceptions import ValidationError from django.utils import timezone from dateutil.relativedelta import relativedelta +from datetime import date from ..models import Employee, HealthTeam, Patient, Responsible @@ -111,6 +112,21 @@ def test_age(self): 1 ) + def test_invalid_birthday(self): + today = timezone.localdate() + tomorrow = today + relativedelta(days=1) + past = date(1800, 1, 1) + + with self.assertRaises(ValidationError): + self.user.birthday = tomorrow + self.user.save() + self.user.clean() + + with self.assertRaises(ValidationError): + self.user.birthday = past + self.user.save() + self.user.clean() + class TestField(TestCase): From 885ae67b63dc82725533215f79f0fcb221222d6f Mon Sep 17 00:00:00 2001 From: guilherme1guy Date: Mon, 30 Apr 2018 17:50:01 -0300 Subject: [PATCH 013/271] Modifying user update frontend Adds error message for telephone number Co-authored-by: joberth rogers --- drdown/users/templates/users/user_form.html | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drdown/users/templates/users/user_form.html b/drdown/users/templates/users/user_form.html index 5758ebad..d93e6c8b 100644 --- a/drdown/users/templates/users/user_form.html +++ b/drdown/users/templates/users/user_form.html @@ -86,6 +86,13 @@

{{ user.username }}

{% trans 'Telephone' %}*
+ + {% for error in form.telephone.errors %} + + {% endfor %} + {% if object.telephone %} {% else %} From 89442b99977b3b7944200d19679928c4003460fa Mon Sep 17 00:00:00 2001 From: GeovanaRamos Date: Mon, 30 Apr 2018 19:26:18 -0300 Subject: [PATCH 014/271] Creating appointment list view and correcting model Creating list view and adding to urls Adding html with archive index sidebar and list of appointments Creating css for appointment archive Correcting __str__ method from model Co-authored-by: Gabriela Medeiros --- config/urls.py | 6 +-- .../appointments/models/model_appointment.py | 2 +- .../static/appointments/css/appointment.css | 18 +++++++ .../appointments/appointment_list.html | 48 +++++++++++++++++ drdown/appointments/urls.py | 11 ++++ drdown/appointments/views/view_appointment.py | 53 +++++++++++++++++++ 6 files changed, 133 insertions(+), 5 deletions(-) create mode 100644 drdown/appointments/static/appointments/css/appointment.css create mode 100644 drdown/appointments/templates/appointments/appointment_list.html create mode 100644 drdown/appointments/views/view_appointment.py diff --git a/config/urls.py b/config/urls.py index f8e9f700..d314a9f7 100644 --- a/config/urls.py +++ b/config/urls.py @@ -17,10 +17,8 @@ # Your stuff: custom urls includes go here url(r'^forum/', include('drdown.forum.urls', namespace='forum')), url(r'^careline/', include('drdown.careline.urls', namespace='careline')), - - # Medical Records urls - url(r'^medicalrecords/', include('drdown.medicalrecords.urls', namespace='medicalrecords')) - + url(r'^medicalrecords/', include('drdown.medicalrecords.urls', namespace='medicalrecords')), + url(r'^appointments/', include('drdown.appointments.urls', namespace='appointments')), ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) diff --git a/drdown/appointments/models/model_appointment.py b/drdown/appointments/models/model_appointment.py index d1264e7d..0f8fa0f2 100644 --- a/drdown/appointments/models/model_appointment.py +++ b/drdown/appointments/models/model_appointment.py @@ -95,7 +95,7 @@ class Appointment(models.Model): ) def __str__(self): - return _('Appointment of ') + self.patient + return _('Appointment of ') + self.patient.user.name class Meta: verbose_name = _("Appointment") diff --git a/drdown/appointments/static/appointments/css/appointment.css b/drdown/appointments/static/appointments/css/appointment.css new file mode 100644 index 00000000..4495fef3 --- /dev/null +++ b/drdown/appointments/static/appointments/css/appointment.css @@ -0,0 +1,18 @@ +.panel-heading.collapsed .fa-chevron-down, +.panel-heading .fa-chevron-right { + display: none; +} + +.panel-heading.collapsed .fa-chevron-right, +.panel-heading .fa-chevron-down { + display: inline-block; +} + +i.fa { + cursor: pointer; + margin-right: 5px; +} + +.collapsed ~ .panel-body { + padding: 0; +} diff --git a/drdown/appointments/templates/appointments/appointment_list.html b/drdown/appointments/templates/appointments/appointment_list.html new file mode 100644 index 00000000..10f8ef49 --- /dev/null +++ b/drdown/appointments/templates/appointments/appointment_list.html @@ -0,0 +1,48 @@ +{% extends "core/base.html" %} +{% load static i18n %} + +{% block css %} + {{block.super}} + +{% endblock %} + +{% block content %} + +
+ {% for year in years %} +
+ +
+ +
+ {% for month in months %} + {{month}}
+ {% endfor %} +
+
+
+ {% endfor %} +
+ + {% for appointment in appointment_list %} + +
+
+
{{appointment.patient.user.name}}
+

{{appointment.motive}}

+

{% trans 'Date'%} {{ appointment.date_time}}

+ {% trans "Edit" %} + {% trans "Change Status" %}

+
+
+ {% empty %} +

{% trans 'There are no appointments scheduled'%}

+ {% endfor %} + +{% endblock %} + + diff --git a/drdown/appointments/urls.py b/drdown/appointments/urls.py index e69de29b..80c8be46 100644 --- a/drdown/appointments/urls.py +++ b/drdown/appointments/urls.py @@ -0,0 +1,11 @@ +from django.conf.urls import url +from drdown.appointments.views.view_appointment import AppointmentListView + +app_name = 'appointments' +urlpatterns = [ + url( + regex=r'^$', + view=AppointmentListView.as_view(), + name='list_appointments' + ), +] diff --git a/drdown/appointments/views/view_appointment.py b/drdown/appointments/views/view_appointment.py new file mode 100644 index 00000000..48ffc3b6 --- /dev/null +++ b/drdown/appointments/views/view_appointment.py @@ -0,0 +1,53 @@ +from django.views.generic import ListView +from django.views.generic import CreateView +from django.views.generic import UpdateView +from drdown.appointments.models import Appointment + + +class AppointmentListView(ListView): + model = Appointment + + def get_year_range_of_appointment(self): + first = 3000 + last = 0 + for appointment in Appointment.objects.all(): + date = appointment.date_time.year + if date < first: + first = date + if date > last: + last = date + + return [first, last] + + def get_list_of_years(self, range_years): + years = [] + first = range_years[0] + last = range_years[1] + if first == last: + years.append(first) + else: + for year in range(last, first-1, -1): + years.append(year) + return years + + def get_context_data(self, **kwargs): + context = super(AppointmentListView, self).get_context_data(**kwargs) + months = [ + 'January', + 'February', + 'March', + 'April', + 'May', + 'June', + 'July', + 'August', + 'September', + 'October', + 'November', + 'December' + ] + range_years = self.get_year_range_of_appointment() + context['years'] = self.get_list_of_years(range_years) + context['months'] = months + return context + From e8675be0b3c636f23e6fdee3f9a81b59d4cd5d7e Mon Sep 17 00:00:00 2001 From: GeovanaRamos Date: Mon, 30 Apr 2018 19:57:45 -0300 Subject: [PATCH 015/271] Changing list view archive Changing years order Uncollapse current year Co-authored-by: Gabriela Medeiros --- .../appointments/appointment_list.html | 37 +++++++++++++------ drdown/appointments/views/view_appointment.py | 4 +- 2 files changed, 29 insertions(+), 12 deletions(-) diff --git a/drdown/appointments/templates/appointments/appointment_list.html b/drdown/appointments/templates/appointments/appointment_list.html index 10f8ef49..618c1c21 100644 --- a/drdown/appointments/templates/appointments/appointment_list.html +++ b/drdown/appointments/templates/appointments/appointment_list.html @@ -11,18 +11,33 @@
{% for year in years %}
- -
- -
- {% for month in months %} - {{month}}
- {% endfor %} + {% if year == current_year %} +
+ + + {{year}}
+ {% else %} + + {% endif %} +
+ {% if year == current_year %} +
+ {% for month in months %} + {{month}}
+ {% endfor %} +
+ {% else %} +
+ {% for month in months %} + {{month}}
+ {% endfor %} +
+ {% endif %}
{% endfor %} diff --git a/drdown/appointments/views/view_appointment.py b/drdown/appointments/views/view_appointment.py index 48ffc3b6..a2ab526f 100644 --- a/drdown/appointments/views/view_appointment.py +++ b/drdown/appointments/views/view_appointment.py @@ -2,6 +2,7 @@ from django.views.generic import CreateView from django.views.generic import UpdateView from drdown.appointments.models import Appointment +from django.utils import timezone class AppointmentListView(ListView): @@ -26,7 +27,7 @@ def get_list_of_years(self, range_years): if first == last: years.append(first) else: - for year in range(last, first-1, -1): + for year in range(first, last+1): years.append(year) return years @@ -49,5 +50,6 @@ def get_context_data(self, **kwargs): range_years = self.get_year_range_of_appointment() context['years'] = self.get_list_of_years(range_years) context['months'] = months + context['current_year'] = timezone.now().year return context From db3a3783c8850bf8472a037c3d179ff7177f017b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Pedro=20Sconetto?= Date: Mon, 30 Apr 2018 14:46:36 -0300 Subject: [PATCH 016/271] Corrections into deploy steps and files Skip clean up step Fixing image name on shell script Co-authored-by: Mariana Mendes --- .travis.yml | 1 + production-deploy.sh | 4 ++-- staging-deploy.sh | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9060b3f2..d6e8412a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -41,6 +41,7 @@ script: - docker-compose -f local.yml run --rm django coverage run -m py.test - docker-compose -f local.yml run --rm django coverage xml deploy: + skip_cleanup: true # deploy develop to the staging environment - provider: script script: bash staging-deploy.sh diff --git a/production-deploy.sh b/production-deploy.sh index 0589df34..bd987cdf 100755 --- a/production-deploy.sh +++ b/production-deploy.sh @@ -4,8 +4,8 @@ # # Author: João Pedro Sconetto -docker login --username $DOCKER_ID_USER --password $DOCKER_ID_USER_PASSWORD -docker tag 20181drdown_django_1 $DOCKER_ID_USER/20181-dr-down_django +echo $DOCKER_ID_USER_PASSWORD | docker login --username $DOCKER_ID_USER --password-stdin +docker tag 20181drdown_django $DOCKER_ID_USER/20181-dr-down_django docker push $DOCKER_ID_USER/20181-dr-down_django sudo apt-get install sshpass -y diff --git a/staging-deploy.sh b/staging-deploy.sh index c2868158..407d4b4c 100755 --- a/staging-deploy.sh +++ b/staging-deploy.sh @@ -4,8 +4,8 @@ # # Author: João Pedro Sconetto -docker login --username $DOCKER_ID_USER --password $DOCKER_ID_USER_PASSWORD -docker tag 20181drdown_django_1 $DOCKER_ID_USER/20181-dr-down_django +echo $DOCKER_ID_USER_PASSWORD | docker login --username $DOCKER_ID_USER --password-stdin +docker tag 20181drdown_django $DOCKER_ID_USER/20181-dr-down_django docker push $DOCKER_ID_USER/20181-dr-down_django sudo apt-get install sshpass -y From 0f6faf8cd963a08f2219fd07bd3fe3b97cf4a4af Mon Sep 17 00:00:00 2001 From: Joberth Rogers Date: Mon, 30 Apr 2018 22:21:23 -0300 Subject: [PATCH 017/271] Translate page Some atributes in page admin was translate to portuguese Co-authored-by: Co-authored-by: Guilherme Guy --- .../locale/pt_BR/LC_MESSAGES/django.po | 3 +- .../core/locale/pt_BR/LC_MESSAGES/django.po | 44 ++-- .../forum/locale/pt_BR/LC_MESSAGES/django.po | 7 +- drdown/medicalrecords/apps.py | 4 +- .../locale/pt_BR/LC_MESSAGES/django.po | 76 +++---- drdown/users/apps.py | 3 +- .../users/locale/pt_BR/LC_MESSAGES/django.po | 203 ++++++++++-------- drdown/users/models/model_patient.py | 9 +- 8 files changed, 191 insertions(+), 158 deletions(-) diff --git a/drdown/careline/locale/pt_BR/LC_MESSAGES/django.po b/drdown/careline/locale/pt_BR/LC_MESSAGES/django.po index 8cc8bbe2..a20dc392 100644 --- a/drdown/careline/locale/pt_BR/LC_MESSAGES/django.po +++ b/drdown/careline/locale/pt_BR/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-04-27 21:38+0000\n" +"POT-Creation-Date: 2018-05-01 01:13+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -186,7 +186,6 @@ msgid "There are no patients for this user." msgstr "Não há pacientes para este usuário." #: drdown/careline/views/view_checklist.py:184 -#| msgid "Error: You cannot change data on this form." msgid "" "Error: You cannot change data on this form. You need to be at least 13 years " "old." diff --git a/drdown/core/locale/pt_BR/LC_MESSAGES/django.po b/drdown/core/locale/pt_BR/LC_MESSAGES/django.po index 35fc1e88..dc711187 100644 --- a/drdown/core/locale/pt_BR/LC_MESSAGES/django.po +++ b/drdown/core/locale/pt_BR/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-04-28 01:16+0000\n" +"POT-Creation-Date: 2018-05-01 01:13+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -473,8 +473,8 @@ msgid "" "communicate with the doctor and visualize general information." msgstr "" "Dr. Down é uma ferramenta de gerenciamento para o CRIS DOWN (Centro de " -"Referência em Síndrome de Down) que possibilita agendar consultas, " -"comunicar-se com o médico e visualizar informações." +"Referência em Síndrome de Down) que possibilita agendar consultas, comunicar-" +"se com o médico e visualizar informações." #: drdown/core/templates/core/home.html:39 msgid "" @@ -503,24 +503,24 @@ msgid "Frequently Asked Questions (FAQ)" msgstr "Dúvidas Frequentes" #: drdown/core/templates/core/info.html:37 -#: drdown/core/templates/core/info.html:96 +#: drdown/core/templates/core/info.html:98 msgid "What can be done to prevent Down's Syndrome?" msgstr "Como prevenir a Síndrome de Down?" #: drdown/core/templates/core/info.html:40 -#: drdown/core/templates/core/info.html:105 +#: drdown/core/templates/core/info.html:107 msgid "Is Down Syndrome a Disease? Can I catch it during my life?" msgstr "" "A Síndrome de Down é uma doença? Eu posso pegar/desenvolver ela durante " "minha vida?" #: drdown/core/templates/core/info.html:41 -#: drdown/core/templates/core/info.html:115 +#: drdown/core/templates/core/info.html:117 msgid "How can I identify Down Syndrome?" msgstr "Como posso identificar a Síndrome de Down?" #: drdown/core/templates/core/info.html:42 -#: drdown/core/templates/core/info.html:125 +#: drdown/core/templates/core/info.html:127 msgid "How far does the autonomy of a child with Down syndrome develop?" msgstr "" "Até onde se desenvolve a autonomia de uma criança com Síndrome de Down?" @@ -606,7 +606,7 @@ msgstr "" msgid "Frequently Asked Questions" msgstr "Dúvidas Frequentes" -#: drdown/core/templates/core/info.html:99 +#: drdown/core/templates/core/info.html:101 msgid "" "Even though the chance of Down's syndrome increases according to the age " "range of the child's parents, Down's syndrome is not caused by the parents, " @@ -620,7 +620,7 @@ msgstr "" "Essa síndrome afeta pessoas de todas as raças, níveis de estudo, classes " "sociais e outros." -#: drdown/core/templates/core/info.html:108 +#: drdown/core/templates/core/info.html:110 msgid "" "Down Syndrome is not a disease, just a condition that affects the life of an " "individual since birth and requires greater attention and care from the " @@ -630,7 +630,7 @@ msgstr "" "um indivíduo desde o seu nascimento, o que exige uma maior atenção e cuidado " "por parte dos pais e familiares." -#: drdown/core/templates/core/info.html:118 +#: drdown/core/templates/core/info.html:120 msgid "" "Down Syndrome can be detected during pregnancy. You should see a doctor for " "the diagnosis." @@ -638,7 +638,7 @@ msgstr "" "A Síndrome de Down pode ser detectada durante a gestação. Deve-se procurar " "um médico para que o diagnóstico seja feito." -#: drdown/core/templates/core/info.html:128 +#: drdown/core/templates/core/info.html:130 msgid "" "There is no fixed limit that represents a developmental apex of a child with " "Down Syndrome. It is common for medical monitoring and the help of family " @@ -649,19 +649,19 @@ msgstr "" "a ajuda dos familiares ou responsáveis facilitem o desenvolvimento da " "criança." -#: drdown/core/templates/core/info.html:137 +#: drdown/core/templates/core/info.html:139 msgid "Further reading" msgstr "Leituras complementares" -msgid "Hey! You have procedures to be made." -msgstr "Oi! Você tem procedimentos que precisam ser feitos." +#~ msgid "Hey! You have procedures to be made." +#~ msgstr "Oi! Você tem procedimentos que precisam ser feitos." -msgid "Click here to check it" -msgstr "Clique aqui para conferir" +#~ msgid "Click here to check it" +#~ msgstr "Clique aqui para conferir" -msgid "" -"One or more of your patients needs attention. Some procedures may be " -"behind schedule." -msgstr "" -"Um ou mais de seus pacientes precisa de atenção. Alguns procedimentos " -"podem estar atrasados." +#~ msgid "" +#~ "One or more of your patients needs attention. Some procedures may be " +#~ "behind schedule." +#~ msgstr "" +#~ "Um ou mais de seus pacientes precisa de atenção. Alguns procedimentos " +#~ "podem estar atrasados." diff --git a/drdown/forum/locale/pt_BR/LC_MESSAGES/django.po b/drdown/forum/locale/pt_BR/LC_MESSAGES/django.po index 2ec81bf8..e194d3ae 100644 --- a/drdown/forum/locale/pt_BR/LC_MESSAGES/django.po +++ b/drdown/forum/locale/pt_BR/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-04-24 01:32+0000\n" +"POT-Creation-Date: 2018-05-01 01:13+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -45,7 +45,6 @@ msgid "Category" msgstr "Categoria" #: drdown/forum/models/model_category.py:28 -#: drdown/forum/templates/forum/category_list.html:3 #: drdown/forum/templates/forum/category_list.html:7 #: drdown/forum/templates/forum/commentary_list.html:16 #: drdown/forum/templates/forum/form_commentary.html:9 @@ -128,6 +127,10 @@ msgstr "Mensagem do post" msgid "Posts" msgstr "Posts" +#: drdown/forum/templates/forum/category_list.html:3 +msgid "Care ine" +msgstr "" + #: drdown/forum/templates/forum/category_list.html:16 msgid "There are no categories." msgstr "Não há categorias" diff --git a/drdown/medicalrecords/apps.py b/drdown/medicalrecords/apps.py index ba90297e..aaad49a6 100644 --- a/drdown/medicalrecords/apps.py +++ b/drdown/medicalrecords/apps.py @@ -1,6 +1,6 @@ from django.apps import AppConfig - +from django.utils.translation import ugettext_lazy as _ class MedicalRecordsConfig(AppConfig): name = 'drdown.medicalrecords' - verbose_name = 'Medical Records' + verbose_name = _("Medical Record") diff --git a/drdown/medicalrecords/locale/pt_BR/LC_MESSAGES/django.po b/drdown/medicalrecords/locale/pt_BR/LC_MESSAGES/django.po index bb8b09d7..d96f6aa2 100644 --- a/drdown/medicalrecords/locale/pt_BR/LC_MESSAGES/django.po +++ b/drdown/medicalrecords/locale/pt_BR/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-04-27 20:13+0000\n" +"POT-Creation-Date: 2018-05-01 01:13+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -18,30 +18,37 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" -#: drdown/medicalrecords/forms/medicalrecords_forms.py:22 -#: drdown/medicalrecords/forms/medicalrecords_forms.py:42 +#: drdown/medicalrecords/apps.py:6 +#: drdown/medicalrecords/models/model_medical_record.py:38 +#: drdown/medicalrecords/templates/medicalrecords/medicalrecord_confirm_delete.html:5 +#: drdown/medicalrecords/templates/medicalrecords/medicalrecord_list.html:14 +msgid "Medical Record" +msgstr "Prontuário" + +#: drdown/medicalrecords/forms/medicalrecords_forms.py:23 +#: drdown/medicalrecords/forms/medicalrecords_forms.py:47 msgid "search here!" msgstr "busque aqui!" -#: drdown/medicalrecords/forms/medicalrecords_forms.py:28 -#: drdown/medicalrecords/forms/medicalrecords_forms.py:48 +#: drdown/medicalrecords/forms/medicalrecords_forms.py:31 +#: drdown/medicalrecords/forms/medicalrecords_forms.py:55 msgid "(Year)-(Month)-(Day)" msgstr "(Ano)-(Mês)-(Dia)" -#: drdown/medicalrecords/forms/medicalrecords_forms.py:34 -#: drdown/medicalrecords/forms/medicalrecords_forms.py:54 +#: drdown/medicalrecords/forms/medicalrecords_forms.py:38 +#: drdown/medicalrecords/forms/medicalrecords_forms.py:62 #, fuzzy #| msgid "author" msgid "Search author!" msgstr "Buscar autor" -#: drdown/medicalrecords/forms/medicalrecords_forms.py:41 -#: drdown/medicalrecords/forms/medicalrecords_forms.py:60 -#: drdown/medicalrecords/forms/medicalrecords_forms.py:69 +#: drdown/medicalrecords/forms/medicalrecords_forms.py:45 +#: drdown/medicalrecords/forms/medicalrecords_forms.py:68 +#: drdown/medicalrecords/forms/medicalrecords_forms.py:77 msgid "Search patient!" msgstr "Buscar paciente" -#: drdown/medicalrecords/forms/medicalrecords_forms.py:47 +#: drdown/medicalrecords/forms/medicalrecords_forms.py:53 #, fuzzy #| msgid "Search" msgid "Search date!" @@ -75,12 +82,6 @@ msgstr "Não há prontuários.Mensagem do prontuário" msgid "Author" msgstr "Autor" -#: drdown/medicalrecords/models/model_medical_record.py:38 -#: drdown/medicalrecords/templates/medicalrecords/medicalrecord_confirm_delete.html:5 -#: drdown/medicalrecords/templates/medicalrecords/medicalrecord_list.html:14 -msgid "Medical Record" -msgstr "Prontuário" - #: drdown/medicalrecords/models/model_medical_record.py:39 #: drdown/medicalrecords/templates/medicalrecords/medicalrecord_patient_list.html:13 #: drdown/medicalrecords/templates/medicalrecords/medicalrecord_search_list.html:12 @@ -89,8 +90,8 @@ msgstr "Prontuários" #: drdown/medicalrecords/templates/medicalrecords/medicalrecord_confirm_delete.html:8 #: drdown/medicalrecords/templates/medicalrecords/medicalrecord_confirm_delete.html:14 -#: drdown/medicalrecords/templates/medicalrecords/medicalrecord_list.html:66 -#: drdown/medicalrecords/templates/medicalrecords/medicalrecord_search_list.html:42 +#: drdown/medicalrecords/templates/medicalrecords/medicalrecord_list.html:67 +#: drdown/medicalrecords/templates/medicalrecords/medicalrecord_search_list.html:41 msgid "Delete" msgstr "Apagar" @@ -135,53 +136,53 @@ msgid "New" msgstr "Novo" #: drdown/medicalrecords/templates/medicalrecords/medicalrecord_list.html:22 -#: drdown/medicalrecords/templates/medicalrecords/medicalrecord_list.html:59 +#: drdown/medicalrecords/templates/medicalrecords/medicalrecord_list.html:60 #: drdown/medicalrecords/templates/medicalrecords/medicalrecord_search_list.html:16 msgid "author" msgstr "autor" #: drdown/medicalrecords/templates/medicalrecords/medicalrecord_list.html:23 -#: drdown/medicalrecords/templates/medicalrecords/medicalrecord_search_list.html:18 +#: drdown/medicalrecords/templates/medicalrecords/medicalrecord_search_list.html:17 msgid "date" msgstr "data" #: drdown/medicalrecords/templates/medicalrecords/medicalrecord_list.html:24 #: drdown/medicalrecords/templates/medicalrecords/medicalrecord_patient_list.html:18 -#: drdown/medicalrecords/templates/medicalrecords/medicalrecord_search_list.html:21 +#: drdown/medicalrecords/templates/medicalrecords/medicalrecord_search_list.html:20 msgid "Search" msgstr "Buscar" -#: drdown/medicalrecords/templates/medicalrecords/medicalrecord_list.html:28 -#: drdown/medicalrecords/templates/medicalrecords/medicalrecord_search_list.html:22 +#: drdown/medicalrecords/templates/medicalrecords/medicalrecord_list.html:31 +#: drdown/medicalrecords/templates/medicalrecords/medicalrecord_search_list.html:21 msgid "Return" msgstr "Retornar" -#: drdown/medicalrecords/templates/medicalrecords/medicalrecord_list.html:41 +#: drdown/medicalrecords/templates/medicalrecords/medicalrecord_list.html:42 msgid "Name: " msgstr "Nome: " -#: drdown/medicalrecords/templates/medicalrecords/medicalrecord_list.html:42 +#: drdown/medicalrecords/templates/medicalrecords/medicalrecord_list.html:43 msgid "SUS: " msgstr "SUS: " -#: drdown/medicalrecords/templates/medicalrecords/medicalrecord_list.html:43 +#: drdown/medicalrecords/templates/medicalrecords/medicalrecord_list.html:44 msgid "birthday: " msgstr "Data de nascimento: " -#: drdown/medicalrecords/templates/medicalrecords/medicalrecord_list.html:45 +#: drdown/medicalrecords/templates/medicalrecords/medicalrecord_list.html:46 msgid "cpf: " msgstr "CPF" -#: drdown/medicalrecords/templates/medicalrecords/medicalrecord_list.html:61 +#: drdown/medicalrecords/templates/medicalrecords/medicalrecord_list.html:62 msgid "Anexo:" msgstr "Anexo:" -#: drdown/medicalrecords/templates/medicalrecords/medicalrecord_list.html:63 +#: drdown/medicalrecords/templates/medicalrecords/medicalrecord_list.html:64 msgid "care day" msgstr "Dia de atendimento" -#: drdown/medicalrecords/templates/medicalrecords/medicalrecord_list.html:65 -#: drdown/medicalrecords/templates/medicalrecords/medicalrecord_search_list.html:41 +#: drdown/medicalrecords/templates/medicalrecords/medicalrecord_list.html:66 +#: drdown/medicalrecords/templates/medicalrecords/medicalrecord_search_list.html:40 msgid "Edit" msgstr "Editar" @@ -197,11 +198,7 @@ msgstr "Não há prontuários." msgid "Search a Medical Records:" msgstr "Buscar um prontuário:" -#: drdown/medicalrecords/templates/medicalrecords/medicalrecord_search_list.html:17 -msgid "message" -msgstr "mensagem" - -#: drdown/medicalrecords/templates/medicalrecords/medicalrecord_search_list.html:19 +#: drdown/medicalrecords/templates/medicalrecords/medicalrecord_search_list.html:18 msgid "paciente" msgstr "paciente" @@ -215,10 +212,13 @@ msgstr "Anterior" msgid "Next" msgstr "Proximo" -#: drdown/medicalrecords/tests/test_medical_records_view.py:82 +#: drdown/medicalrecords/tests/test_medical_records_view.py:85 msgid "This field is required." msgstr "Este campo é obrigatório." +#~ msgid "message" +#~ msgstr "mensagem" + #, fuzzy #~| msgid "Attachments" #~ msgid "Documents" diff --git a/drdown/users/apps.py b/drdown/users/apps.py index a9f4d7dc..da73017e 100644 --- a/drdown/users/apps.py +++ b/drdown/users/apps.py @@ -1,9 +1,10 @@ from django.apps import AppConfig +from django.utils.translation import ugettext_lazy as _ class UsersConfig(AppConfig): name = 'drdown.users' - verbose_name = "Users" + verbose_name = _("Users") def ready(self): """Override this to put in: diff --git a/drdown/users/locale/pt_BR/LC_MESSAGES/django.po b/drdown/users/locale/pt_BR/LC_MESSAGES/django.po index ceb7546f..346b165f 100644 --- a/drdown/users/locale/pt_BR/LC_MESSAGES/django.po +++ b/drdown/users/locale/pt_BR/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-04-24 21:10+0000\n" +"POT-Creation-Date: 2018-05-01 01:13+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -18,9 +18,13 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" +#: drdown/users/apps.py:7 drdown/users/templates/users/user_list.html:7 +msgid "Users" +msgstr "Usuários" + #: drdown/users/models/model_employee.py:21 #: drdown/users/models/model_health_team.py:20 -#: drdown/users/models/model_patient.py:20 +#: drdown/users/models/model_patient.py:25 #: drdown/users/models/model_responsible.py:17 msgid "User" msgstr "Usuário" @@ -55,13 +59,13 @@ msgstr "O departamento no qual o usuário trabalha" #: drdown/users/models/model_employee.py:74 #: drdown/users/models/model_health_team.py:198 -#: drdown/users/models/model_patient.py:110 -#: drdown/users/models/model_responsible.py:35 +#: drdown/users/models/model_patient.py:157 +#: drdown/users/models/model_responsible.py:47 msgid "Don't change users" msgstr "Não alterar usuário" #: drdown/users/models/model_employee.py:123 -#: drdown/users/templates/users/user_detail.html:67 +#: drdown/users/templates/users/user_detail.html:88 msgid "Employee" msgstr "Funcionário" @@ -155,126 +159,128 @@ msgstr "A especialidade do membro da equipe médica." msgid "" "The %(register)s doesn't inscribe professionalswith %(speciality)s " "graduation, please correct" -msgstr "O %(register)s não registra profissionais com formação em %(speciality)s, favor corrigir" +msgstr "" +"O %(register)s não registra profissionais com formação em %(speciality)s, " +"favor corrigir" #: drdown/users/models/model_health_team.py:252 #: drdown/users/models/model_health_team.py:253 -#: drdown/users/templates/users/user_detail.html:95 +#: drdown/users/templates/users/user_detail.html:116 msgid "Health Team" msgstr "Equipe Médica" -#: drdown/users/models/model_patient.py:23 +#: drdown/users/models/model_patient.py:28 msgid "Please, enter the valid SES number" msgstr "Por favor, insira um número de SES válido" -#: drdown/users/models/model_patient.py:34 -#: drdown/users/models/model_responsible.py:58 -#: drdown/users/templates/users/user_detail.html:221 +#: drdown/users/models/model_patient.py:39 +#: drdown/users/models/model_responsible.py:70 +#: drdown/users/templates/users/user_detail.html:241 msgid "Responsible" msgstr "Responsável" -#: drdown/users/models/model_patient.py:38 +#: drdown/users/models/model_patient.py:43 msgid "Not urgent" msgstr "Não urgente" -#: drdown/users/models/model_patient.py:39 +#: drdown/users/models/model_patient.py:44 msgid "Not very urgent" msgstr "Não muito urgente" -#: drdown/users/models/model_patient.py:40 +#: drdown/users/models/model_patient.py:45 msgid "Urgent" msgstr "Urgente" -#: drdown/users/models/model_patient.py:41 +#: drdown/users/models/model_patient.py:46 msgid "Very urgent" msgstr "Muito urgente" -#: drdown/users/models/model_patient.py:42 +#: drdown/users/models/model_patient.py:47 msgid "Emerging" msgstr "Emergencial" -#: drdown/users/models/model_patient.py:45 +#: drdown/users/models/model_patient.py:50 msgid "Priority" msgstr "Prioridade" -#: drdown/users/models/model_patient.py:47 +#: drdown/users/models/model_patient.py:52 msgid "Please, insert the degree of priority of the patient" msgstr "Por favor, insira o grau de priodade do paciente" -#: drdown/users/models/model_patient.py:51 +#: drdown/users/models/model_patient.py:56 msgid "Name of mother" msgstr "Nome da mãe" -#: drdown/users/models/model_patient.py:52 +#: drdown/users/models/model_patient.py:57 msgid "Please, insert your mother name" msgstr "Por favor, insira o nome da sua mãe" -#: drdown/users/models/model_patient.py:58 +#: drdown/users/models/model_patient.py:63 msgid "Name of father" msgstr "Nome do pai" -#: drdown/users/models/model_patient.py:59 +#: drdown/users/models/model_patient.py:64 msgid "Please, insert your father name" msgstr "Por favor, insira o nome do seu pai" -#: drdown/users/models/model_patient.py:65 +#: drdown/users/models/model_patient.py:70 msgid "White" msgstr "Branco" -#: drdown/users/models/model_patient.py:66 +#: drdown/users/models/model_patient.py:71 msgid "Black" msgstr "Negro" -#: drdown/users/models/model_patient.py:67 +#: drdown/users/models/model_patient.py:72 msgid "Yellow" msgstr "Amarelo" -#: drdown/users/models/model_patient.py:68 +#: drdown/users/models/model_patient.py:73 msgid "Brown" msgstr "Pardo" -#: drdown/users/models/model_patient.py:69 +#: drdown/users/models/model_patient.py:74 msgid "Indigenous" msgstr "Indígena" -#: drdown/users/models/model_patient.py:72 +#: drdown/users/models/model_patient.py:77 msgid "Ethnicity" msgstr "Etnia" -#: drdown/users/models/model_patient.py:74 +#: drdown/users/models/model_patient.py:79 msgid "Please insert the ethnicity of the patient" msgstr "Por favor, insira a etnia do paciente" -#: drdown/users/models/model_patient.py:77 +#: drdown/users/models/model_patient.py:82 msgid "SUS number" msgstr "Número do SUS" -#: drdown/users/models/model_patient.py:78 +#: drdown/users/models/model_patient.py:83 msgid "Please, enter valid SUS in format: XXXXXXXXXXXXXXX" msgstr "Por favor, insira o número do SUS no seguinte formato: XXXXXXXXXXXXXXX" -#: drdown/users/models/model_patient.py:84 +#: drdown/users/models/model_patient.py:89 msgid "Civil register of birth" msgstr "Registro civil de nascimento" -#: drdown/users/models/model_patient.py:85 +#: drdown/users/models/model_patient.py:90 msgid "Please, enter the civil registry of birth number" msgstr "Por favor, insira o número do seu registro civil de nascimento" -#: drdown/users/models/model_patient.py:92 +#: drdown/users/models/model_patient.py:97 msgid "Declaration of live birth" msgstr "Declaração de nascido vivo" -#: drdown/users/models/model_patient.py:93 +#: drdown/users/models/model_patient.py:98 msgid "Please, enter the declaration of live birth number" msgstr "Por favor, insira o número da declaração de nascido vivo" -#: drdown/users/models/model_patient.py:130 -#: drdown/users/templates/users/user_detail.html:140 +#: drdown/users/models/model_patient.py:186 +#: drdown/users/templates/users/user_detail.html:160 msgid "Patient" msgstr "Paciente" -#: drdown/users/models/model_patient.py:131 +#: drdown/users/models/model_patient.py:187 msgid "Patients" msgstr "Pacientes" @@ -282,74 +288,84 @@ msgstr "Pacientes" msgid "Please, use enter a valid CPF inthe following format: XXX.XXX.XXX-XX" msgstr "Por favor, insira um número de CPF no seguinte formato: XXX.XXX.XXX-XX" -#: drdown/users/models/model_responsible.py:59 +#: drdown/users/models/model_responsible.py:71 msgid "Responsibles" msgstr "Responsáveis" -#: drdown/users/models/model_user.py:17 +#: drdown/users/models/model_user.py:18 msgid "Photo of user." msgstr "Foto do usuário" -#: drdown/users/models/model_user.py:18 -#: drdown/users/templates/users/user_form.html:89 +#: drdown/users/models/model_user.py:19 +#: drdown/users/templates/users/user_form.html:123 msgid "Photo" msgstr "Foto" -#: drdown/users/models/model_user.py:24 -#: drdown/users/templates/users/user_form.html:46 +#: drdown/users/models/model_user.py:25 +#: drdown/users/templates/users/user_form.html:47 msgid "Name" msgstr "Nome" -#: drdown/users/models/model_user.py:27 -#: drdown/users/templates/users/user_form.html:51 +#: drdown/users/models/model_user.py:28 +#: drdown/users/templates/users/user_form.html:55 msgid "Full user name" msgstr "Nome do usuário" -#: drdown/users/models/model_user.py:32 -#: drdown/users/templates/users/user_form.html:57 +#: drdown/users/models/model_user.py:33 +#: drdown/users/templates/users/user_form.html:62 msgid "Gender" msgstr "Gênero" -#: drdown/users/models/model_user.py:34 -#: drdown/users/templates/users/user_form.html:63 +#: drdown/users/models/model_user.py:35 +#: drdown/users/templates/users/user_form.html:73 +#: drdown/users/templates/users/user_form.html:78 msgid "Male" msgstr "Masculino" -#: drdown/users/models/model_user.py:35 -#: drdown/users/templates/users/user_form.html:65 +#: drdown/users/models/model_user.py:36 +#: drdown/users/templates/users/user_form.html:75 +#: drdown/users/templates/users/user_form.html:77 msgid "Female" msgstr "Feminino" -#: drdown/users/models/model_user.py:43 -#: drdown/users/templates/users/user_form.html:73 +#: drdown/users/models/model_user.py:44 +#: drdown/users/templates/users/user_form.html:86 msgid "Telephone" msgstr "Telefone" -#: drdown/users/models/model_user.py:48 +#: drdown/users/models/model_user.py:49 msgid "(xx)xxxxx-xxxx or (xx)xxxx-xxxx" msgstr "(xx)xxxxx-xxxx ou (xx)xxxx-xxxx" -#: drdown/users/models/model_user.py:53 -#: drdown/users/templates/users/user_form.html:81 +#: drdown/users/models/model_user.py:54 +#: drdown/users/templates/users/user_form.html:105 msgid "Birthday" msgstr "Data de aniversário" -#: drdown/users/models/model_user.py:54 +#: drdown/users/models/model_user.py:55 msgid "xx/xx/xxxx" msgstr "xx/xx/xxxx" -#: drdown/users/models/model_user.py:60 +#: drdown/users/models/model_user.py:61 msgid "Created at" msgstr "Criado em" -#: drdown/users/models/model_user.py:66 +#: drdown/users/models/model_user.py:67 msgid "Updated at" msgstr "Atualizado em" -#: drdown/users/models/model_user.py:114 +#: drdown/users/models/model_user.py:129 msgid "This user is already specialized!" msgstr "Esse usuário já é éspecializado!" +#: drdown/users/models/model_user.py:142 +msgid "The birthday cannot be in the future!" +msgstr "" + +#: drdown/users/models/model_user.py:149 +msgid "This birthday is too old." +msgstr "" + #: drdown/users/templates/admin/users/change_form.html:5 msgid "Make sure user is confirmed before adding a specialization." msgstr "Tenha certeza de ter um usuário criado antes de especializá-lo." @@ -360,7 +376,7 @@ msgstr "Sair" #: drdown/users/templates/users/user_confirm_delete.html:8 #: drdown/users/templates/users/user_confirm_delete.html:13 -#: drdown/users/templates/users/user_detail.html:254 +#: drdown/users/templates/users/user_detail.html:274 msgid "Delete" msgstr "Excluir" @@ -376,89 +392,104 @@ msgstr "Cancelar" msgid "User:" msgstr "Usuário: " +#: drdown/users/templates/users/user_detail.html:17 +msgid "Hey! You have procedures to be made." +msgstr "" + +#: drdown/users/templates/users/user_detail.html:17 #: drdown/users/templates/users/user_detail.html:26 +msgid "Click here to check it" +msgstr "" + +#: drdown/users/templates/users/user_detail.html:26 +msgid "" +"One or more of your patients needs attention. Some procedures may be behind " +"schedule." +msgstr "" + +#: drdown/users/templates/users/user_detail.html:48 msgid "Name: " msgstr "Nome: " -#: drdown/users/templates/users/user_detail.html:35 +#: drdown/users/templates/users/user_detail.html:57 msgid "Gender: " msgstr "Gênero: " -#: drdown/users/templates/users/user_detail.html:44 +#: drdown/users/templates/users/user_detail.html:65 msgid "Telephone: " msgstr "Telefone: " -#: drdown/users/templates/users/user_detail.html:53 +#: drdown/users/templates/users/user_detail.html:74 msgid "Birthday: " msgstr "Data de nascimento: " -#: drdown/users/templates/users/user_detail.html:71 -#: drdown/users/templates/users/user_detail.html:98 -#: drdown/users/templates/users/user_detail.html:224 +#: drdown/users/templates/users/user_detail.html:92 +#: drdown/users/templates/users/user_detail.html:119 +#: drdown/users/templates/users/user_detail.html:244 msgid "CPF: " msgstr "CPF: " -#: drdown/users/templates/users/user_detail.html:80 +#: drdown/users/templates/users/user_detail.html:101 msgid "Department: " msgstr "Departamento: " -#: drdown/users/templates/users/user_detail.html:116 +#: drdown/users/templates/users/user_detail.html:136 msgid "Registration State: " msgstr "Estado do Registro: " -#: drdown/users/templates/users/user_detail.html:125 +#: drdown/users/templates/users/user_detail.html:145 msgid "Speciality: " msgstr "Especialidade: " -#: drdown/users/templates/users/user_detail.html:143 +#: drdown/users/templates/users/user_detail.html:163 msgid "SES: " msgstr "SES: " -#: drdown/users/templates/users/user_detail.html:152 +#: drdown/users/templates/users/user_detail.html:172 msgid "Priority: " msgstr "Prioridade: " -#: drdown/users/templates/users/user_detail.html:161 +#: drdown/users/templates/users/user_detail.html:181 msgid "Mother Name: " msgstr "Nome da Mãe: " -#: drdown/users/templates/users/user_detail.html:170 +#: drdown/users/templates/users/user_detail.html:190 msgid "Father Name: " msgstr "Nome do Pai: " -#: drdown/users/templates/users/user_detail.html:179 +#: drdown/users/templates/users/user_detail.html:199 msgid "Ethnicity: " msgstr "Etnia: " -#: drdown/users/templates/users/user_detail.html:188 +#: drdown/users/templates/users/user_detail.html:208 msgid "SUS: " msgstr "SUS: " -#: drdown/users/templates/users/user_detail.html:197 +#: drdown/users/templates/users/user_detail.html:217 msgid "Civil registry of birth: " msgstr "Registro civil de nascimento: " -#: drdown/users/templates/users/user_detail.html:206 +#: drdown/users/templates/users/user_detail.html:226 msgid "Declaration of live birth: " msgstr "Declaração de nascido vivo: " -#: drdown/users/templates/users/user_detail.html:233 +#: drdown/users/templates/users/user_detail.html:253 msgid "Patient: " msgstr "Paciente" -#: drdown/users/templates/users/user_detail.html:249 +#: drdown/users/templates/users/user_detail.html:269 msgid "Confirm data" msgstr "Confirmar dados" -#: drdown/users/templates/users/user_detail.html:252 +#: drdown/users/templates/users/user_detail.html:272 msgid "My Medical Records" msgstr "Minhas Consultas" -#: drdown/users/templates/users/user_form.html:93 +#: drdown/users/templates/users/user_form.html:127 msgid "Photo of user" msgstr "Foto do usuário" -#: drdown/users/templates/users/user_form.html:99 +#: drdown/users/templates/users/user_form.html:133 msgid "Update" msgstr "Atualizar" @@ -466,10 +497,6 @@ msgstr "Atualizar" msgid "Members" msgstr "Membros" -#: drdown/users/templates/users/user_list.html:7 -msgid "Users" -msgstr "Usuários" - #: drdown/users/utils/validators.py:19 msgid "Wrong CPF format" msgstr "CPF inválido" diff --git a/drdown/users/models/model_patient.py b/drdown/users/models/model_patient.py index 515a548c..a340ca93 100644 --- a/drdown/users/models/model_patient.py +++ b/drdown/users/models/model_patient.py @@ -174,12 +174,15 @@ def delete(self, *args, **kwargs): super().delete(*args, **kwargs) + class Meta: + verbose_name = _("Patient") + verbose_name_plural = _("Patients") + @receiver(post_save, sender=Patient) def create_procedures(sender, instance, **kwargs): if not hasattr(instance, 'checklist'): apps.get_model('careline', 'Checklist') \ .objects.create(patient=instance) - class Meta: - verbose_name = _('Patient') - verbose_name_plural = _('Patients') + + From 1b4b7a0b9dda7d0908fb6d8795586f0db510ff80 Mon Sep 17 00:00:00 2001 From: Joberth Rogers Date: Mon, 30 Apr 2018 23:55:50 -0300 Subject: [PATCH 018/271] Fixing template Error from detail user patient template now correct Co-authored-by: Guilherme Guy --- drdown/users/templates/users/user_detail.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drdown/users/templates/users/user_detail.html b/drdown/users/templates/users/user_detail.html index 4580ee94..d0b09591 100644 --- a/drdown/users/templates/users/user_detail.html +++ b/drdown/users/templates/users/user_detail.html @@ -154,7 +154,7 @@

{% trans 'Health Team' %}

{% endif %} {% if user.patient %} -
+

{% trans 'Patient' %}

@@ -259,7 +259,7 @@

{% trans 'Responsible' %}

{% endfor %}
-
+ {% endif %} {% if object == request.user %} From 198e98833a48d8c265999905411e175d46cf4c0b Mon Sep 17 00:00:00 2001 From: guilherme1guy Date: Sun, 29 Apr 2018 23:22:39 -0300 Subject: [PATCH 019/271] Fixing error in test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It was using datetime, but it should use only date. Co-authored-by: João Sconetto --- drdown/users/tests/test_model_user.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drdown/users/tests/test_model_user.py b/drdown/users/tests/test_model_user.py index 1522f077..ee362b92 100644 --- a/drdown/users/tests/test_model_user.py +++ b/drdown/users/tests/test_model_user.py @@ -55,7 +55,7 @@ def test_age(self): 5, 10, 4, 66, 12 ] - today = timezone.datetime.today() + today = timezone.localdate() for test_age in test_ages: self.user.birthday = timezone.datetime( From 1efebe0dccee8032bcbb821add3a6cfe0106aee6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Pedro=20Sconetto?= Date: Tue, 1 May 2018 09:38:50 -0300 Subject: [PATCH 020/271] Reconfiguring travis CI Changing the way of install docker and docker-compose Minor travis steps corrections Removing force push from mkdocs-build Co-authored-by: Mariana Mendes --- .travis.yml | 19 ++++++++++++------- mkdocs-build.sh | 2 +- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index bb2b9afd..eb253f9d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,10 +8,6 @@ addons: - 159.203.182.32 env: global: - - SITE_URL: https://fga-gpp-mds.github.io/2018.1-Dr-Down/ - - GH_USER_NAME: "Robot Down" - - GH_USER_EMAIL: equipe.drdown@gmail.com - - GH_REF: github.com/fga-gpp-mds/2018.1-Dr-Down.git - secure: "wrb7hIKvhTmybgkW/kAubZmmdnIeKlXG6vczz8ct2ZbvVBvPflOQCDLQuqoRWDHDPs8PdLHwLZ6J3zlFCtkxBX0AKrSC1fCedkZSoTYEzrI3hj3k+IhTthWPao1GYuIyE+/GUIY82+4b8AHuE3weTSjl0JlOVpxIFfOXL9T2oRhZxjxdGJmUkJgWLXZIsDjvX1bmBZ/SbdMgGGer1YSu8UoiAAr94IrEU5dyJ9Yc8sX6HTZnCdkGgMckPMyZkVwbW9sw9DcjSCB0W/h3aYIP86zocBUk1xGD0tzbnd1mEYaScXRU1rxVBYoe0XnTmFAhyAae1NTtw+6Pqrz1RDudbfTxJBLvkkaBse1w5XN3oBUeuOFLGyoagItnxqzbprt3QN6Tno23LLrefhShVAvzemRceB/Ie6NWRmyhDbsEJpLgAhUpdAGY+Phh2iFRjAsfCnsHT1AKJIoNBoJoi8d79dSOHTK1XxgdBJi9zfhIXB3jjFPhKIx0UHd4aNsIzfuTQWWC8cm05UcdWiTAxunWumoh94jQ6flkIk7RdNyeM+dytJW9mqTvw2lxCRAuyYo7eGs5jqTMqokSAuSDzRFPMUDlP+t/lewAsuwLsxXVOjrMn8TnT28yimay4bK4ZocYP6M3EJPg1DsJ/QOyCqFIFqEMs8lAqJDNky/cJ/79ZIY=" - CC_TEST_REPORTER_ID=bf64f4cd10722061b8cad12ca638ebfa7d3c1494df117613b2acd357bfd7aeb0 notifications: @@ -21,9 +17,17 @@ notifications: services: - docker before_install: + - sudo apt-get remove docker docker-engine docker.io - sudo apt-get update - - sudo apt-get install -o Dpkg::Options::="--force-confold" --force-yes -y docker-ce - - docker-compose --version + - sudo apt-get install apt-transport-https ca-certificates curl software-properties-common + - curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - + - sudo curl -L https://github.com/docker/compose/releases/download/1.21.0/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose + - sudo chmod +x /usr/local/bin/docker-compose + - sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" + - sudo apt-get update + - sudo apt-get install docker-ce + - docker-compose version + - docker version - sudo apt-get install texlive-latex-base texlive-fonts-recommended -y - sudo apt-get install texlive-fonts-extra texlive-latex-extra -y - sudo apt-get install python-sphinx -y @@ -41,15 +45,16 @@ script: - docker-compose -f local.yml run --rm django coverage run -m py.test - docker-compose -f local.yml run --rm django coverage xml deploy: - - skip_cleanup: true # deploy develop to the staging environment - provider: script script: bash staging-deploy.sh + skip_cleanup: true on: branch: develop # deploy master to production - provider: script script: bash production-deploy.sh + skip_cleanup: true on: branch: master after_script: diff --git a/mkdocs-build.sh b/mkdocs-build.sh index ea445bd5..c72c169f 100755 --- a/mkdocs-build.sh +++ b/mkdocs-build.sh @@ -16,7 +16,7 @@ rev=$(git rev-parse --short HEAD) ( git add docs/drdown.pdf git commit -m "Rebuild sphinx documentation at ${rev} " - git push --force origin develop + git push origin develop ) # Running mkdocs build to gh-pages From 666d5d5d9bff1dd9d62591f9e7b23776db6344b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Pedro=20Sconetto?= Date: Tue, 1 May 2018 10:29:00 -0300 Subject: [PATCH 021/271] Modifying deploy scripts Chaging docker image name because of error on travis Adding login onto .travis.yml instead of in the shell script Co-authored-by: Mariana Mendes --- .travis.yml | 1 + production-deploy.sh | 3 +-- staging-deploy.sh | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index eb253f9d..b05aa604 100644 --- a/.travis.yml +++ b/.travis.yml @@ -41,6 +41,7 @@ before_script: - docker-compose -f local.yml pull - docker-compose -f local.yml up --build -d script: + - echo $DOCKER_ID_USER_PASSWORD | docker login -u $DOCKER_ID_USER --password-stdin - docker-compose -f local.yml run --rm django py.test - docker-compose -f local.yml run --rm django coverage run -m py.test - docker-compose -f local.yml run --rm django coverage xml diff --git a/production-deploy.sh b/production-deploy.sh index bd987cdf..a4639812 100755 --- a/production-deploy.sh +++ b/production-deploy.sh @@ -4,8 +4,7 @@ # # Author: João Pedro Sconetto -echo $DOCKER_ID_USER_PASSWORD | docker login --username $DOCKER_ID_USER --password-stdin -docker tag 20181drdown_django $DOCKER_ID_USER/20181-dr-down_django +docker tag 20181drdown_django_1 $DOCKER_ID_USER/20181-dr-down_django docker push $DOCKER_ID_USER/20181-dr-down_django sudo apt-get install sshpass -y diff --git a/staging-deploy.sh b/staging-deploy.sh index 407d4b4c..5d0e737c 100755 --- a/staging-deploy.sh +++ b/staging-deploy.sh @@ -4,8 +4,7 @@ # # Author: João Pedro Sconetto -echo $DOCKER_ID_USER_PASSWORD | docker login --username $DOCKER_ID_USER --password-stdin -docker tag 20181drdown_django $DOCKER_ID_USER/20181-dr-down_django +docker tag 20181drdown_django_1 $DOCKER_ID_USER/20181-dr-down_django docker push $DOCKER_ID_USER/20181-dr-down_django sudo apt-get install sshpass -y From c5f1961ed1e8464388f60e34420b013ad87cfba2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Pedro=20Sconetto?= Date: Tue, 1 May 2018 11:11:37 -0300 Subject: [PATCH 022/271] Changing docker tag name Chaging name on docker tag to fix deploy error Co-authored-by: Mariana Mendes --- production-deploy.sh | 2 +- staging-deploy.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/production-deploy.sh b/production-deploy.sh index a4639812..de9c19a1 100755 --- a/production-deploy.sh +++ b/production-deploy.sh @@ -4,7 +4,7 @@ # # Author: João Pedro Sconetto -docker tag 20181drdown_django_1 $DOCKER_ID_USER/20181-dr-down_django +docker tag 20181-dr-down_django:latest $DOCKER_ID_USER/20181-dr-down_django docker push $DOCKER_ID_USER/20181-dr-down_django sudo apt-get install sshpass -y diff --git a/staging-deploy.sh b/staging-deploy.sh index 5d0e737c..ccc1e6df 100755 --- a/staging-deploy.sh +++ b/staging-deploy.sh @@ -4,7 +4,7 @@ # # Author: João Pedro Sconetto -docker tag 20181drdown_django_1 $DOCKER_ID_USER/20181-dr-down_django +docker tag 20181-dr-down_django:latest $DOCKER_ID_USER/20181-dr-down_django docker push $DOCKER_ID_USER/20181-dr-down_django sudo apt-get install sshpass -y From 2aaf2aa6bfebdf404c32561f0118ad9168722218 Mon Sep 17 00:00:00 2001 From: Gabriela Medeiros Date: Tue, 1 May 2018 12:20:55 -0300 Subject: [PATCH 023/271] Adding functionality create appointment Adding new appointment url and view Co-authored-by: Geovana Ramos --- drdown/appointments/urls.py | 7 +++++++ drdown/appointments/views/view_appointment.py | 20 ++++++++++++++++++- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/drdown/appointments/urls.py b/drdown/appointments/urls.py index 80c8be46..d8d2e803 100644 --- a/drdown/appointments/urls.py +++ b/drdown/appointments/urls.py @@ -1,5 +1,6 @@ from django.conf.urls import url from drdown.appointments.views.view_appointment import AppointmentListView +from drdown.appointments.views.view_appointment import AppointmentCreateView app_name = 'appointments' urlpatterns = [ @@ -8,4 +9,10 @@ view=AppointmentListView.as_view(), name='list_appointments' ), + url( + regex=r'^new/$', + view=AppointmentCreateView.as_view(), + name='create_appointment' + ), + ] diff --git a/drdown/appointments/views/view_appointment.py b/drdown/appointments/views/view_appointment.py index a2ab526f..aa7d852d 100644 --- a/drdown/appointments/views/view_appointment.py +++ b/drdown/appointments/views/view_appointment.py @@ -3,6 +3,7 @@ from django.views.generic import UpdateView from drdown.appointments.models import Appointment from django.utils import timezone +from django.urls import reverse class AppointmentListView(ListView): @@ -27,7 +28,7 @@ def get_list_of_years(self, range_years): if first == last: years.append(first) else: - for year in range(first, last+1): + for year in range(first, last + 1): years.append(year) return years @@ -53,3 +54,20 @@ def get_context_data(self, **kwargs): context['current_year'] = timezone.now().year return context + +class AppointmentCreateView(CreateView): + model = Appointment + template_name = 'appointments/form_appointment.html' + fields = ['speciality', + 'shift', + 'doctor', + 'patient', + 'date_time', + 'motive', ] + + def get_success_url(self, **kwargs): + success_create_url = reverse( + viewname='appointments:list_appointments', + ) + + return success_create_url From d3173acd6465f0dfc0dbfd6566c2e47f6694af3f Mon Sep 17 00:00:00 2001 From: Gabriela Medeiros Date: Tue, 1 May 2018 12:22:15 -0300 Subject: [PATCH 024/271] Creating new appointment template Creating new appointment form Co-authored-by: Geovana Ramos --- .../appointments/form_appointment.html | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 drdown/appointments/templates/appointments/form_appointment.html diff --git a/drdown/appointments/templates/appointments/form_appointment.html b/drdown/appointments/templates/appointments/form_appointment.html new file mode 100644 index 00000000..8a1d5ff1 --- /dev/null +++ b/drdown/appointments/templates/appointments/form_appointment.html @@ -0,0 +1,23 @@ +{% extends 'core/base.html' %} +{% load static i18n %} + +{% block title %}{% trans "New Appointment" %}{% endblock %} + +{% block content %} +
+

{% trans "New Appointment" %}

+
+ {% csrf_token %} + {% for field in form %} +
+ {{ field.errors }} +

+ {{ field.label_tag }}
+ {{ field }} +

+
+ {% endfor %} + +
+
+{% endblock %} \ No newline at end of file From 5764ed3c1c721395dac5015d94242a6ecf31fca1 Mon Sep 17 00:00:00 2001 From: GeovanaRamos Date: Tue, 1 May 2018 15:06:56 -0300 Subject: [PATCH 025/271] Separating templates Creating a base template Adding side archive to base template Co-authored-by: Gabriela Medeiros --- .../appointments/appointment_list.html | 44 +--------------- .../templates/appointments/base.html | 51 +++++++++++++++++++ 2 files changed, 53 insertions(+), 42 deletions(-) create mode 100644 drdown/appointments/templates/appointments/base.html diff --git a/drdown/appointments/templates/appointments/appointment_list.html b/drdown/appointments/templates/appointments/appointment_list.html index 618c1c21..a82f0625 100644 --- a/drdown/appointments/templates/appointments/appointment_list.html +++ b/drdown/appointments/templates/appointments/appointment_list.html @@ -1,47 +1,7 @@ -{% extends "core/base.html" %} +{% extends "appointments/base.html" %} {% load static i18n %} -{% block css %} - {{block.super}} - -{% endblock %} - -{% block content %} - -
- {% for year in years %} -
- {% if year == current_year %} -
- - - {{year}} -
- {% else %} - - {% endif %} -
- {% if year == current_year %} -
- {% for month in months %} - {{month}}
- {% endfor %} -
- {% else %} -
- {% for month in months %} - {{month}}
- {% endfor %} -
- {% endif %} -
-
- {% endfor %} -
+{% block content-appointment %} {% for appointment in appointment_list %} diff --git a/drdown/appointments/templates/appointments/base.html b/drdown/appointments/templates/appointments/base.html new file mode 100644 index 00000000..add617ea --- /dev/null +++ b/drdown/appointments/templates/appointments/base.html @@ -0,0 +1,51 @@ +{% extends "core/base.html" %} +{% load static i18n %} + +{% block css %} + {{block.super}} + +{% endblock %} + +{% block content %} + +
+ {% for year in years %} +
+ {% if year == current_year %} +
+ + + {{year}} +
+ {% else %} + + {% endif %} +
+ {% if year == current_year %} +
+ {% for month in months %} + {{month}}
+ {% endfor %} +
+ {% else %} +
+ {% for month in months %} + {{month}}
+ {% endfor %} +
+ {% endif %} +
+
+ {% endfor %} +
+ + {% block content-appointment %} + {% endblock %} + +{% endblock %} + + From 76005e24f0618fd0269f259f4b2f0b85805ec8e4 Mon Sep 17 00:00:00 2001 From: guilherme1guy Date: Tue, 1 May 2018 16:01:47 -0300 Subject: [PATCH 026/271] Fixing errors in frontend The user page for a responsible wouldn't render properly. Co-authored-by: joberth rogers --- drdown/users/templates/users/user_detail.html | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drdown/users/templates/users/user_detail.html b/drdown/users/templates/users/user_detail.html index d0b09591..61905724 100644 --- a/drdown/users/templates/users/user_detail.html +++ b/drdown/users/templates/users/user_detail.html @@ -235,7 +235,7 @@

{% trans 'Patient' %}

{% endif %} {% if user.responsible %} -
+

{% trans 'Responsible' %}

@@ -247,18 +247,21 @@

{% trans 'Responsible' %}

{% endif %} + {% for patient in responsible_patient %} - {% if patient %} +
- {% endif %} + {% endfor %} +
+
{% endif %} From 576d23f68da9a018973a4c7a5c1c185168093434 Mon Sep 17 00:00:00 2001 From: guilherme1guy Date: Tue, 1 May 2018 16:03:02 -0300 Subject: [PATCH 027/271] Adding pt-br translations to error message Co-authored-by: joberth rogers --- drdown/users/locale/pt_BR/LC_MESSAGES/django.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drdown/users/locale/pt_BR/LC_MESSAGES/django.po b/drdown/users/locale/pt_BR/LC_MESSAGES/django.po index 346b165f..bfdefeac 100644 --- a/drdown/users/locale/pt_BR/LC_MESSAGES/django.po +++ b/drdown/users/locale/pt_BR/LC_MESSAGES/django.po @@ -360,11 +360,11 @@ msgstr "Esse usuário já é éspecializado!" #: drdown/users/models/model_user.py:142 msgid "The birthday cannot be in the future!" -msgstr "" +msgstr "A data de nascimento não pode estar no futuro!" #: drdown/users/models/model_user.py:149 msgid "This birthday is too old." -msgstr "" +msgstr "Essa data de nascimento é muito antiga." #: drdown/users/templates/admin/users/change_form.html:5 msgid "Make sure user is confirmed before adding a specialization." From 48b584a566230a6b8cb3dde435000866284638aa Mon Sep 17 00:00:00 2001 From: guilherme1guy Date: Tue, 1 May 2018 16:14:49 -0300 Subject: [PATCH 028/271] Improving code style Fixing pep8 errors Co-authored-by: joberth rogers --- drdown/users/models/model_patient.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drdown/users/models/model_patient.py b/drdown/users/models/model_patient.py index a340ca93..50d4e90f 100644 --- a/drdown/users/models/model_patient.py +++ b/drdown/users/models/model_patient.py @@ -173,16 +173,13 @@ def delete(self, *args, **kwargs): self.user.save() super().delete(*args, **kwargs) - class Meta: verbose_name = _("Patient") verbose_name_plural = _("Patients") + @receiver(post_save, sender=Patient) def create_procedures(sender, instance, **kwargs): if not hasattr(instance, 'checklist'): apps.get_model('careline', 'Checklist') \ .objects.create(patient=instance) - - - From c619293d780750dc27ee7d9192d04a201cfd16b2 Mon Sep 17 00:00:00 2001 From: GeovanaRamos Date: Tue, 1 May 2018 16:40:18 -0300 Subject: [PATCH 029/271] Creating views for month related appointments Adding month archive view Adding links to sidebar Co-authored-by: Gabriela Medeiros --- .../templates/appointments/base.html | 4 +-- drdown/appointments/urls.py | 7 +++++ drdown/appointments/views/view_appointment.py | 31 +++++++++++++++---- 3 files changed, 34 insertions(+), 8 deletions(-) diff --git a/drdown/appointments/templates/appointments/base.html b/drdown/appointments/templates/appointments/base.html index add617ea..7310ba2e 100644 --- a/drdown/appointments/templates/appointments/base.html +++ b/drdown/appointments/templates/appointments/base.html @@ -28,13 +28,13 @@ {% if year == current_year %}
{% for month in months %} - {{month}}
+ {{month}}
{% endfor %}
{% else %}
{% for month in months %} - {{month}}
+ {{month}}
{% endfor %}
{% endif %} diff --git a/drdown/appointments/urls.py b/drdown/appointments/urls.py index d8d2e803..351bac0e 100644 --- a/drdown/appointments/urls.py +++ b/drdown/appointments/urls.py @@ -1,6 +1,8 @@ from django.conf.urls import url from drdown.appointments.views.view_appointment import AppointmentListView from drdown.appointments.views.view_appointment import AppointmentCreateView +from drdown.appointments.views.view_appointment import AppointmentMonthArchiveView + app_name = 'appointments' urlpatterns = [ @@ -14,5 +16,10 @@ view=AppointmentCreateView.as_view(), name='create_appointment' ), + url( + regex=r'^(?P\d{4})/(?P\d+)/$', + view=AppointmentMonthArchiveView.as_view(month_format='%m'), + name="archive_month" + ), ] diff --git a/drdown/appointments/views/view_appointment.py b/drdown/appointments/views/view_appointment.py index aa7d852d..6f7e2918 100644 --- a/drdown/appointments/views/view_appointment.py +++ b/drdown/appointments/views/view_appointment.py @@ -1,6 +1,7 @@ from django.views.generic import ListView from django.views.generic import CreateView from django.views.generic import UpdateView +from django.views.generic.dates import MonthArchiveView from drdown.appointments.models import Appointment from django.utils import timezone from django.urls import reverse @@ -9,7 +10,8 @@ class AppointmentListView(ListView): model = Appointment - def get_year_range_of_appointment(self): + @staticmethod + def get_year_range_of_appointment(): first = 3000 last = 0 for appointment in Appointment.objects.all(): @@ -21,7 +23,8 @@ def get_year_range_of_appointment(self): return [first, last] - def get_list_of_years(self, range_years): + @staticmethod + def get_list_of_years(range_years): years = [] first = range_years[0] last = range_years[1] @@ -32,8 +35,8 @@ def get_list_of_years(self, range_years): years.append(year) return years - def get_context_data(self, **kwargs): - context = super(AppointmentListView, self).get_context_data(**kwargs) + @staticmethod + def prepare_context(context): months = [ 'January', 'February', @@ -48,12 +51,16 @@ def get_context_data(self, **kwargs): 'November', 'December' ] - range_years = self.get_year_range_of_appointment() - context['years'] = self.get_list_of_years(range_years) + range_years = AppointmentListView.get_year_range_of_appointment() + context['years'] = AppointmentListView.get_list_of_years(range_years) context['months'] = months context['current_year'] = timezone.now().year return context + def get_context_data(self, **kwargs): + context = super(AppointmentListView, self).get_context_data(**kwargs) + return self.prepare_context(context) + class AppointmentCreateView(CreateView): model = Appointment @@ -71,3 +78,15 @@ def get_success_url(self, **kwargs): ) return success_create_url + + +class AppointmentMonthArchiveView(MonthArchiveView): + queryset = Appointment.objects.all() + date_field = "date_time" + allow_future = True + template_name = 'appointments/appointment_list.html' + allow_empty = True + + def get_context_data(self, **kwargs): + context = super(AppointmentMonthArchiveView, self).get_context_data(**kwargs) + return AppointmentListView.prepare_context(context) From b67e34ad4c08b5b006793a7c4dc0b3576bf850f5 Mon Sep 17 00:00:00 2001 From: GeovanaRamos Date: Tue, 1 May 2018 17:05:27 -0300 Subject: [PATCH 030/271] Changing model Motive field can be null Co-authored-by: Gabriela Medeiros --- drdown/appointments/migrations/0001_initial.py | 4 ++-- drdown/appointments/models/model_appointment.py | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/drdown/appointments/migrations/0001_initial.py b/drdown/appointments/migrations/0001_initial.py index 747740c1..e6cf2a04 100644 --- a/drdown/appointments/migrations/0001_initial.py +++ b/drdown/appointments/migrations/0001_initial.py @@ -1,4 +1,4 @@ -# Generated by Django 2.0.3 on 2018-04-29 20:39 +# Generated by Django 2.0.3 on 2018-05-01 20:04 from django.db import migrations, models import django.db.models.deletion @@ -19,7 +19,7 @@ class Migration(migrations.Migration): ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('shift', models.CharField(choices=[('M', 'Morning'), ('A', 'Afternoon')], help_text='Shift of appointment', max_length=10, verbose_name='Shift')), ('date_time', models.DateTimeField(help_text='Date and time of appointment', max_length=50, verbose_name='Date and Time')), - ('motive', models.TextField(help_text='Why are you requesting an appointment?', max_length=500, verbose_name='Motive')), + ('motive', models.TextField(help_text='Why are you requesting an appointment?', max_length=500, null=True, verbose_name='Motive')), ('speciality', models.CharField(choices=[('Speech Therapy', 'Speech Therapy'), ('Psychology', 'Psychology'), ('Physiotherapy', 'Physiotherapy'), ('Occupational Therapy', 'Occupational Therapy'), ('Doctor', 'Doctor'), ('Cardiology', 'Cardiology'), ('Neurology', 'Neurology'), ('Pediatrics', 'Pediatrics'), ('Nursing', 'Nursing')], help_text='Speciality of appointment', max_length=30, verbose_name='Speciality')), ('status', models.CharField(choices=[('Scheduled', 'Scheduled'), ('Canceled', 'Canceled'), ('Done', 'Done')], default='Scheduled', help_text='Is the appointment still scheduled?', max_length=20, verbose_name='Status')), ('doctor', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='appointments', to='users.HealthTeam', verbose_name='Doctor')), diff --git a/drdown/appointments/models/model_appointment.py b/drdown/appointments/models/model_appointment.py index 0f8fa0f2..6354daa2 100644 --- a/drdown/appointments/models/model_appointment.py +++ b/drdown/appointments/models/model_appointment.py @@ -30,7 +30,8 @@ class Appointment(models.Model): motive = models.TextField( _('Motive'), help_text=_('Why are you requesting an appointment?'), - max_length=500 + max_length=500, + null=True, ) SPEECH_THERAPHY = _("Speech Therapy") From 439741b248af61284e5b520cc3693691ef7c0a38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Fran=C3=A7a?= Date: Tue, 1 May 2018 17:17:43 -0300 Subject: [PATCH 031/271] Improving the documentation of the Sprint 7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add charts in planning and results documents Add Sprint's 7 stories in planning and results documents Add the Scrum Master comments in planning and results documents Co-authored-by: Mariana Mendes Co-authored-by: João Sconetto --- docs/sprints/07/planning.md | 17 ++++++++++++++++- docs/sprints/07/results.md | 23 ++++++++++++++++------- 2 files changed, 32 insertions(+), 8 deletions(-) diff --git a/docs/sprints/07/planning.md b/docs/sprints/07/planning.md index 98280c1a..32121fe2 100644 --- a/docs/sprints/07/planning.md +++ b/docs/sprints/07/planning.md @@ -38,15 +38,30 @@ __Membros presentes:__ Todos ## 3. Pareamento +- Daniel e Guilherme + +- Elias e Joberth + +- Gabriela e Geovana ## 4. Planejamento da Sprint +Nessa sprint, serão iniciadas as histórias relacionadas à ficha de acompanhamento dos pacientes. As primeiras funcionalidades a serem feitas serão o prontuário eletrônico dos pacientes (que levará em conta as especificidades do paciente com Síndrome de Down) e também o checklist de cuidados e recomendações a serem feitos com pessoas com a Síndrome. + +Nela também será revisado tanto a integração contínua do projeto quanto a sua arquitetura. ## 5. Mudanças +Mudanças foram feitas nesta sprint relacionadas à arquitetura. A partir da Sprint 7, o arquiteto selecionará diversos componentes que poderão ser utilizados nas histórias, e caberá às duplas responsáveis por elas definir quais adotarão. ## 6. Backlog da Sprint +- [TS69 - Refatorar arquitetura do projeto e seu respectivo documento](https://github.com/fga-gpp-mds/2018.1-Dr-Down/issues/160) +- [US70 - Prontuário](https://github.com/fga-gpp-mds/2018.1-Dr-Down/issues/161) +- [US71 - Checklist](https://github.com/fga-gpp-mds/2018.1-Dr-Down/issues/162) +- [TS72 - Refatorar equipe de saúde](https://github.com/fga-gpp-mds/2018.1-Dr-Down/issues/163) +- [TS73 - Revisar a Integração Contínua](https://github.com/fga-gpp-mds/2018.1-Dr-Down/issues/164) +- [TS74 - Documentar a Sprint 6](https://github.com/fga-gpp-mds/2018.1-Dr-Down/issues/166) ## 7. Risk Burndown - +![Burndown de risco da Sprint 7](https://uploaddeimagens.com.br/images/001/398/142/full/riscos_S7.png?1525202634) diff --git a/docs/sprints/07/results.md b/docs/sprints/07/results.md index 8674ea49..7023e697 100644 --- a/docs/sprints/07/results.md +++ b/docs/sprints/07/results.md @@ -1,7 +1,5 @@ # Fechamento da sprint -## Sumário - ## 1. Resumo da Sprint __Pontos Planejados__: 23 pontos @@ -12,28 +10,39 @@ __Dívidas técnicas__: 0 pontos __Histórias entregues:__ +- [TS69 - Refatorar arquitetura do projeto e seu respectivo documento](https://github.com/fga-gpp-mds/2018.1-Dr-Down/issues/160) +- [US70 - Prontuário](https://github.com/fga-gpp-mds/2018.1-Dr-Down/issues/161) +- [US71 - Checklist](https://github.com/fga-gpp-mds/2018.1-Dr-Down/issues/162) +- [TS72 - Refatorar equipe de saúde](https://github.com/fga-gpp-mds/2018.1-Dr-Down/issues/163) +- [TS73 - Revisar a Integração Contínua](https://github.com/fga-gpp-mds/2018.1-Dr-Down/issues/164) +- [TS74 - Documentar a Sprint 6](https://github.com/fga-gpp-mds/2018.1-Dr-Down/issues/166) ## 2. Retrospectiva da Sprint | Pontos Positivos | Pontos Negativos | Sugestão de Melhoria | | ----- | ----- | ---- | -| Os pontos positivos das sprints passada se manteram | - | Ser mais críticos na hora das pontuações | -| Foi criado um canal de bug no slack e ele está ajudando muito | Pareamento não deu muito certo pra uma dupla | - | -| - | Issues depentes de outras issues | - | -| - | Cliente estava viajando, ou seja a comunicação não foi muito boa | Tentar manter o frontend(padrão - +| Os pontos positivos das sprints passada se mantiveram | Pareamento não deu tão certo pra uma dupla | Tomar mais cuidado na hora de pontuar as histórias | +| Foi criado um canal de bug no Slack e ele está ajudando todos | Issues depentes do término de outras | Maior preocupação em manter a uniformidade e padronização do frontend | +| - | Um dos clientes estava viajando, dificultando a comunicação com ele | - | ## 3. Quadro de Conhecimento +![Quadro de conhecimento da Sprint 7](https://uploaddeimagens.com.br/images/001/398/170/full/quadro_conhecimento_S7.png?1525204302) ## 5. Gráfico do Burndown +![Gráfico do burndown da Sprint 7](https://uploaddeimagens.com.br/images/001/398/174/full/burndown_S7.png?1525204456) ## 6. Velocity +![Gráfico do velocity da Sprint 7](https://uploaddeimagens.com.br/images/001/398/181/full/velocity_S7.png?1525204706) ## 7. Gráfico de Commits +![Gráfico de commits da Sprint 7](https://uploaddeimagens.com.br/images/001/398/189/full/commits_S7.png?1525204960) ## 9. Análise do Scrum Master +Nessa sprint, 2 das histórias tiveram pontuações abaixo do esforço necessário, de acordo com as duplas responsáveis por elas. Para evitar que isso se repita, já no planejamento da Sprint 8 a equipe terá um maior cuidado para pontuar as histórias. + +De resto, a sprint ocorreu com tranquilidade e sem dívidas, já que o problema apresentado com relação ao pareamento de uma das duplas foi devido à greve da universidade, que atrapalhou a programação deles trabalharem juntos mas não a entrega da história. From 8cf188b8c25373e12e134cfc4314b7943a0c9143 Mon Sep 17 00:00:00 2001 From: GeovanaRamos Date: Tue, 1 May 2018 17:56:00 -0300 Subject: [PATCH 032/271] Filtering appointments Adding queryset to views Showing different appointments for each user Co-authored-by: Gabriela Medeiros --- drdown/appointments/views/view_appointment.py | 28 ++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/drdown/appointments/views/view_appointment.py b/drdown/appointments/views/view_appointment.py index 6f7e2918..42520268 100644 --- a/drdown/appointments/views/view_appointment.py +++ b/drdown/appointments/views/view_appointment.py @@ -57,10 +57,34 @@ def prepare_context(context): context['current_year'] = timezone.now().year return context + @staticmethod + def prepare_queryset(request): + user = request.user + if hasattr(user, 'patient'): + queryset = Appointment.objects.filter( + patient=user.patient + ) + elif hasattr(user, 'responsible'): + queryset = Appointment.objects.filter( + patient=user.responsible.patient + ) + elif hasattr(user, 'employee'): + queryset = Appointment.objects.all() + elif hasattr(user, 'healthteam'): + queryset = Appointment.objects.filter( + doctor=user.healthteam + ) + else: + queryset = Appointment.objects.none() + return queryset + def get_context_data(self, **kwargs): context = super(AppointmentListView, self).get_context_data(**kwargs) return self.prepare_context(context) + def get_queryset(self): + return self.prepare_queryset(self.request) + class AppointmentCreateView(CreateView): model = Appointment @@ -81,7 +105,6 @@ def get_success_url(self, **kwargs): class AppointmentMonthArchiveView(MonthArchiveView): - queryset = Appointment.objects.all() date_field = "date_time" allow_future = True template_name = 'appointments/appointment_list.html' @@ -90,3 +113,6 @@ class AppointmentMonthArchiveView(MonthArchiveView): def get_context_data(self, **kwargs): context = super(AppointmentMonthArchiveView, self).get_context_data(**kwargs) return AppointmentListView.prepare_context(context) + + def get_queryset(self): + return AppointmentListView.prepare_queryset(self.request) From c92a721db2bf022dfaa8cedf9122b174d94e30a7 Mon Sep 17 00:00:00 2001 From: GeovanaRamos Date: Tue, 1 May 2018 18:34:58 -0300 Subject: [PATCH 033/271] Adding Search List api to appointments Adding search to home list Adding forms, filter and field to template Co-authored-by: Gabriela Medeiros --- .../appointments/forms/appointments_form.py | 37 +++++++++++++++++++ ...appointment.html => appointment_form.html} | 0 .../appointments/appointment_list.html | 5 +++ drdown/appointments/views/view_appointment.py | 18 ++++++++- 4 files changed, 58 insertions(+), 2 deletions(-) create mode 100644 drdown/appointments/forms/appointments_form.py rename drdown/appointments/templates/appointments/{form_appointment.html => appointment_form.html} (100%) diff --git a/drdown/appointments/forms/appointments_form.py b/drdown/appointments/forms/appointments_form.py new file mode 100644 index 00000000..2937c4c7 --- /dev/null +++ b/drdown/appointments/forms/appointments_form.py @@ -0,0 +1,37 @@ +from drdown.appointments.models.model_appointment import Appointment +from django import forms +from drdown.users.models.model_health_team import HealthTeam +from drdown.users.models.model_patient import Patient +from pagedown.widgets import PagedownWidget +from django.utils.translation import ugettext_lazy as _ + + +class AppointmentSearchForm(forms.Form): + search_speciality = forms.CharField( + required=False, + label=_('Search speciality!'), + widget=forms.TextInput( + attrs={'placeholder': _('search here!')} + ) + ) + + search_date = forms.DateField( + required=False, + label=_('Search date!'), + widget=forms.TextInput( + attrs={'placeholder': _('(Year)-(Month)-(Day)')} + ) + ) + + search_doctor = forms.ModelChoiceField( + queryset=HealthTeam.objects.all(), + required=False, + label=_('Search doctor!') + ) + + search_patient = forms.ModelChoiceField( + queryset=Patient.objects.all(), + required=False, + label=_('Search patient!') + ) + diff --git a/drdown/appointments/templates/appointments/form_appointment.html b/drdown/appointments/templates/appointments/appointment_form.html similarity index 100% rename from drdown/appointments/templates/appointments/form_appointment.html rename to drdown/appointments/templates/appointments/appointment_form.html diff --git a/drdown/appointments/templates/appointments/appointment_list.html b/drdown/appointments/templates/appointments/appointment_list.html index a82f0625..e4fcafa5 100644 --- a/drdown/appointments/templates/appointments/appointment_list.html +++ b/drdown/appointments/templates/appointments/appointment_list.html @@ -2,6 +2,11 @@ {% load static i18n %} {% block content-appointment %} +
+ {{ form }} + + +
{% for appointment in appointment_list %} diff --git a/drdown/appointments/views/view_appointment.py b/drdown/appointments/views/view_appointment.py index 42520268..61090a56 100644 --- a/drdown/appointments/views/view_appointment.py +++ b/drdown/appointments/views/view_appointment.py @@ -1,14 +1,28 @@ -from django.views.generic import ListView +from search_views.search import SearchListView +from search_views.filters import BaseFilter from django.views.generic import CreateView from django.views.generic import UpdateView from django.views.generic.dates import MonthArchiveView from drdown.appointments.models import Appointment +from ..forms.appointments_form import AppointmentSearchForm from django.utils import timezone from django.urls import reverse -class AppointmentListView(ListView): +class AppointmentFilter(BaseFilter): + search_fields = { + 'search_date': ['date_time'], + 'search_speciality': ['speciality'], + 'search_doctor': ['doctor__id'], + 'search_patient': ['patient__id'], +} + + +class AppointmentListView(SearchListView): model = Appointment + template_name = 'appointments/appointment_list.html' + form_class = AppointmentSearchForm + filter_class = AppointmentFilter @staticmethod def get_year_range_of_appointment(): From eace521d4a47ef9b17bf05dcacf9ae407c8a8544 Mon Sep 17 00:00:00 2001 From: Gabriela Medeiros Date: Tue, 1 May 2018 23:55:45 -0300 Subject: [PATCH 034/271] Editing new appointment form Editing imput fields Modifying submit button location Co-authored-by: Geovana Ramos --- .../appointments/appointment_form.html | 74 +++++++++++++++---- drdown/appointments/views/view_appointment.py | 38 +++++++++- 2 files changed, 96 insertions(+), 16 deletions(-) diff --git a/drdown/appointments/templates/appointments/appointment_form.html b/drdown/appointments/templates/appointments/appointment_form.html index 8a1d5ff1..3efbfe11 100644 --- a/drdown/appointments/templates/appointments/appointment_form.html +++ b/drdown/appointments/templates/appointments/appointment_form.html @@ -5,19 +5,67 @@ {% block content %}
-

{% trans "New Appointment" %}

-
- {% csrf_token %} - {% for field in form %} -
- {{ field.errors }} -

- {{ field.label_tag }}
- {{ field }} -

-
- {% endfor %} - +

{% trans "New Appointment" %}

+ + {% csrf_token %} +
+ + +
+ +
+
+ +
+ +
+
+ +
+ +
+
+ +
+ +
+
+ + + {% trans 'Enter a date and time in format: dd/mm/yyyy hh:mm' %} +
+ +
+
+ +
+
{% endblock %} \ No newline at end of file diff --git a/drdown/appointments/views/view_appointment.py b/drdown/appointments/views/view_appointment.py index 61090a56..6fa06377 100644 --- a/drdown/appointments/views/view_appointment.py +++ b/drdown/appointments/views/view_appointment.py @@ -4,6 +4,8 @@ from django.views.generic import UpdateView from django.views.generic.dates import MonthArchiveView from drdown.appointments.models import Appointment +from drdown.users.models.model_health_team import HealthTeam +from drdown.users.models.model_patient import Patient from ..forms.appointments_form import AppointmentSearchForm from django.utils import timezone from django.urls import reverse @@ -15,7 +17,7 @@ class AppointmentFilter(BaseFilter): 'search_speciality': ['speciality'], 'search_doctor': ['doctor__id'], 'search_patient': ['patient__id'], -} + } class AppointmentListView(SearchListView): @@ -102,7 +104,8 @@ def get_queryset(self): class AppointmentCreateView(CreateView): model = Appointment - template_name = 'appointments/form_appointment.html' + sucess_url = 'appointmentslist_appointments' + template_name = 'appointments/appointment_form.html' fields = ['speciality', 'shift', 'doctor', @@ -111,12 +114,40 @@ class AppointmentCreateView(CreateView): 'motive', ] def get_success_url(self, **kwargs): + print("Entra em get_success_url") success_create_url = reverse( viewname='appointments:list_appointments', ) return success_create_url + def form_valid(self, form): + form.save() + return super(AppointmentCreateView, self).form_valid(form) + + def get_health_team(self): + health_team = [] + + for doctor in HealthTeam.objects.all(): + health_team.append(doctor) + + return health_team + + def get_patients(self): + patients = [] + + for patient in Patient.objects.all(): + patients.append(patient) + + return patients + + def get_context_data(self, **kwargs): + context = super(AppointmentCreateView, self).get_context_data(**kwargs) + + context['health_team'] = self.get_health_team() + context['patients'] = self.get_patients() + return context + class AppointmentMonthArchiveView(MonthArchiveView): date_field = "date_time" @@ -125,7 +156,8 @@ class AppointmentMonthArchiveView(MonthArchiveView): allow_empty = True def get_context_data(self, **kwargs): - context = super(AppointmentMonthArchiveView, self).get_context_data(**kwargs) + context = super(AppointmentMonthArchiveView, + self).get_context_data(**kwargs) return AppointmentListView.prepare_context(context) def get_queryset(self): From 82321f9913167b97ce76383176e5c83eed630896 Mon Sep 17 00:00:00 2001 From: GeovanaRamos Date: Wed, 2 May 2018 06:59:07 -0300 Subject: [PATCH 035/271] Creating search link Adding search link to side bar Co-authored-by: Gabriela Medeiros --- drdown/appointments/templates/appointments/base.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drdown/appointments/templates/appointments/base.html b/drdown/appointments/templates/appointments/base.html index 7310ba2e..15916249 100644 --- a/drdown/appointments/templates/appointments/base.html +++ b/drdown/appointments/templates/appointments/base.html @@ -9,6 +9,8 @@ {% block content %}
+ + {% trans "Search All" %} {% for year in years %}
{% if year == current_year %} From 7647598c362da6786ee5e600336706a20ea395e8 Mon Sep 17 00:00:00 2001 From: guilherme1guy Date: Wed, 2 May 2018 09:39:11 -0300 Subject: [PATCH 036/271] Fixing errors in translation Co-authored-by: joberth rogers --- .../core/locale/pt_BR/LC_MESSAGES/django.po | 24 +++++++++---------- .../forum/locale/pt_BR/LC_MESSAGES/django.po | 7 ++---- .../forum/templates/forum/category_list.html | 2 +- 3 files changed, 15 insertions(+), 18 deletions(-) diff --git a/drdown/core/locale/pt_BR/LC_MESSAGES/django.po b/drdown/core/locale/pt_BR/LC_MESSAGES/django.po index dc711187..6dc896b4 100644 --- a/drdown/core/locale/pt_BR/LC_MESSAGES/django.po +++ b/drdown/core/locale/pt_BR/LC_MESSAGES/django.po @@ -653,15 +653,15 @@ msgstr "" msgid "Further reading" msgstr "Leituras complementares" -#~ msgid "Hey! You have procedures to be made." -#~ msgstr "Oi! Você tem procedimentos que precisam ser feitos." - -#~ msgid "Click here to check it" -#~ msgstr "Clique aqui para conferir" - -#~ msgid "" -#~ "One or more of your patients needs attention. Some procedures may be " -#~ "behind schedule." -#~ msgstr "" -#~ "Um ou mais de seus pacientes precisa de atenção. Alguns procedimentos " -#~ "podem estar atrasados." +msgid "Hey! You have procedures to be made." +msgstr "Oi! Você tem procedimentos que precisam ser feitos." + +msgid "Click here to check it" +msgstr "Clique aqui para conferir" + +msgid "" +"One or more of your patients needs attention. Some procedures may be " +"behind schedule." +msgstr "" +"Um ou mais de seus pacientes precisa de atenção. Alguns procedimentos " +"podem estar atrasados." diff --git a/drdown/forum/locale/pt_BR/LC_MESSAGES/django.po b/drdown/forum/locale/pt_BR/LC_MESSAGES/django.po index e194d3ae..f467d6d9 100644 --- a/drdown/forum/locale/pt_BR/LC_MESSAGES/django.po +++ b/drdown/forum/locale/pt_BR/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-05-01 01:13+0000\n" +"POT-Creation-Date: 2018-05-02 12:47+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -45,6 +45,7 @@ msgid "Category" msgstr "Categoria" #: drdown/forum/models/model_category.py:28 +#: drdown/forum/templates/forum/category_list.html:3 #: drdown/forum/templates/forum/category_list.html:7 #: drdown/forum/templates/forum/commentary_list.html:16 #: drdown/forum/templates/forum/form_commentary.html:9 @@ -127,10 +128,6 @@ msgstr "Mensagem do post" msgid "Posts" msgstr "Posts" -#: drdown/forum/templates/forum/category_list.html:3 -msgid "Care ine" -msgstr "" - #: drdown/forum/templates/forum/category_list.html:16 msgid "There are no categories." msgstr "Não há categorias" diff --git a/drdown/forum/templates/forum/category_list.html b/drdown/forum/templates/forum/category_list.html index 403f63a2..de0216f6 100644 --- a/drdown/forum/templates/forum/category_list.html +++ b/drdown/forum/templates/forum/category_list.html @@ -1,6 +1,6 @@ {% extends "core/base.html" %} {% load static i18n %} -{% block title %}{% trans "Care ine" %}{% endblock %} +{% block title %}{% trans "Categories" %}{% endblock %} {% block content %}
From e73e16a6437cfe794c3f0b7a96f40b103968cd75 Mon Sep 17 00:00:00 2001 From: guilherme1guy Date: Wed, 2 May 2018 09:39:42 -0300 Subject: [PATCH 037/271] Correcting code style Co-authored-by: joberth rogers --- drdown/medicalrecords/apps.py | 1 + 1 file changed, 1 insertion(+) diff --git a/drdown/medicalrecords/apps.py b/drdown/medicalrecords/apps.py index aaad49a6..a31d0787 100644 --- a/drdown/medicalrecords/apps.py +++ b/drdown/medicalrecords/apps.py @@ -1,6 +1,7 @@ from django.apps import AppConfig from django.utils.translation import ugettext_lazy as _ + class MedicalRecordsConfig(AppConfig): name = 'drdown.medicalrecords' verbose_name = _("Medical Record") From f49f306f18be95aa5091caee02cd09645d7f5487 Mon Sep 17 00:00:00 2001 From: Gabriela Medeiros Date: Wed, 2 May 2018 10:57:44 -0300 Subject: [PATCH 038/271] Editing appointment list templates Removing base template Checking if search box is needed Editing appointments spacing Co-authored-by: Geovana Ramos --- .../static/appointments/css/appointment.css | 24 +++++ .../appointments/appointment_list.html | 98 +++++++++++++++---- .../templates/appointments/base.html | 53 ---------- 3 files changed, 101 insertions(+), 74 deletions(-) delete mode 100644 drdown/appointments/templates/appointments/base.html diff --git a/drdown/appointments/static/appointments/css/appointment.css b/drdown/appointments/static/appointments/css/appointment.css index 4495fef3..54c92206 100644 --- a/drdown/appointments/static/appointments/css/appointment.css +++ b/drdown/appointments/static/appointments/css/appointment.css @@ -16,3 +16,27 @@ i.fa { .collapsed ~ .panel-body { padding: 0; } + +.h-100{ + height: 100%; +} + +.w-100{ + width: 100%; +} + +.w-82{ + width: 82%; +} + +.w-70{ + width: 70%; +} + +.w-18{ + width: 18%; +} + +.clear-right{ + clear:right; +} diff --git a/drdown/appointments/templates/appointments/appointment_list.html b/drdown/appointments/templates/appointments/appointment_list.html index e4fcafa5..9c8f7f2f 100644 --- a/drdown/appointments/templates/appointments/appointment_list.html +++ b/drdown/appointments/templates/appointments/appointment_list.html @@ -1,28 +1,84 @@ -{% extends "appointments/base.html" %} +{% extends "core/base.html" %} {% load static i18n %} -{% block content-appointment %} -
- {{ form }} - - -
- - {% for appointment in appointment_list %} - -
-
-
{{appointment.patient.user.name}}
-

{{appointment.motive}}

-

{% trans 'Date'%} {{ appointment.date_time}}

- {% trans "Edit" %} - {% trans "Change Status" %}

+{% block css %} + {{block.super}} + +{% endblock %} + +{% block title %}{% trans "Appointments" %}{% endblock %} + +{% block content %} +
+

{% trans 'Appointments' %}

+ + {% url 'appointments:list_appointments' as url %} + {% if request.path == url %} + -
- {% empty %} -

{% trans 'There are no appointments scheduled'%}

- {% endfor %} + {% endif %} +
+
+ {% for appointment in appointment_list %} + +
+
+
{{appointment.patient.user.name}}
+

{{appointment.motive}}

+

{% trans 'Date'%} {{ appointment.date_time}}

+ {% trans "Edit" %} + {% trans "Change Status" %}

+
+
+ {% empty %} +

{% trans 'There are no appointments scheduled'%}

+ {% endfor %} +
+ + +
+
{% endblock %} diff --git a/drdown/appointments/templates/appointments/base.html b/drdown/appointments/templates/appointments/base.html deleted file mode 100644 index 15916249..00000000 --- a/drdown/appointments/templates/appointments/base.html +++ /dev/null @@ -1,53 +0,0 @@ -{% extends "core/base.html" %} -{% load static i18n %} - -{% block css %} - {{block.super}} - -{% endblock %} - -{% block content %} - -
- - {% trans "Search All" %} - {% for year in years %} -
- {% if year == current_year %} -
- - - {{year}} -
- {% else %} - - {% endif %} -
- {% if year == current_year %} -
- {% for month in months %} - {{month}}
- {% endfor %} -
- {% else %} -
- {% for month in months %} - {{month}}
- {% endfor %} -
- {% endif %} -
-
- {% endfor %} -
- - {% block content-appointment %} - {% endblock %} - -{% endblock %} - - From 769de4a434970e8471a2df1e0efac51b90b237b1 Mon Sep 17 00:00:00 2001 From: Daniel Maike Date: Wed, 2 May 2018 15:41:01 +0000 Subject: [PATCH 039/271] Creating vaccine schedule template Adding url route Adding vaccine schedule table Co-authored-by: Elias Bernardo --- .../core/templates/core/vaccine_schedule.html | 297 ++++++++++++++++++ drdown/core/urls.py | 5 + 2 files changed, 302 insertions(+) create mode 100644 drdown/core/templates/core/vaccine_schedule.html diff --git a/drdown/core/templates/core/vaccine_schedule.html b/drdown/core/templates/core/vaccine_schedule.html new file mode 100644 index 00000000..432ec4a3 --- /dev/null +++ b/drdown/core/templates/core/vaccine_schedule.html @@ -0,0 +1,297 @@ +{% extends "core/base.html" %} +{% load static %} +{% load i18n %} +{% block css %} + + + + + + + + + +{% endblock css %} + +{% block content %} + +






+

{% trans "Vaccine Schedule" %}

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{% trans 'Vaccines'%}{% trans 'OF BIRTH TO THE 10 YEARS OF AGE'%}{% trans 'ADOLESCENT'%}{% trans 'ADULT'%}{% trans 'OLD MAN'%}
{% trans 'At birth'%}{% trans '1 month'%}{% trans '2 months'%}{% trans '3 months'%}{% trans '4 months'%}{% trans '5 months'%}{% trans '6 months'%}{% trans '7 months'%}{% trans '8 months'%}{% trans '9 months'%}{% trans '12 months'%}{% trans '15 months'%}{% trans '18 months'%}{% trans '24 months'%}{% trans '4 years'%}{% trans '5 years'%}{% trans '6 years'%}{% trans '9 years'%}{% trans '10 years'%}{% trans '11 to 19 years'%}{% trans '20 to 59 years'%}{% trans 'From 60 years old'%}
{% trans 'BCG ID'%}{% trans 'One dose'%}{% trans 'Vaccinate the previously unvaccinated'%}{% trans 'Vaccinate people who contacted leprosy'%}
{% trans 'Hepatitis B'%}{% trans 'Three or four doses from birth'%}{% trans 'Vaccinate the previously unvaccinated'%}
{% trans 'Rotavirus'%}{% trans 'Two or three doses. Initiate vaccination before 15 weeks of age'%}{% trans 'CONTRAINDICATED'%}
{% trans 'Bacterial triple (DTPw, DTPa, ou dTpa)'%}{% trans 'Four doses of DTPa or DTPw starting at 2 months of age'%}{% trans 'Reinforcement with DTPa, DTPw or dTpa'%}{% trans 'Reinforcement with dTpa from 9 years of age and every 10 years (or, in the case of dTpa, do dT)'%}
{% trans 'Haemophilus influenzae type b'%}{% trans 'Four doses starting at 2 months of age'%}{% trans 'Vaccinate the previously unvaccinated'%}{% trans 'Vaccinate people in special risk situations'%}
{% trans 'Poliomyelitis (inactivated virus)'%}{% trans 'Five doses starting at 2 months of age'%}{% trans 'Vaccinate people in special risk situations'%}
{% trans 'Pneumococcal conjugate'%}{% trans 'Four doses starting at 2 months of age - VPC10 or VPC13'%}{% trans 'VPC10 or VPC13 - Vaccinate the previously unvaccinated'%}{% trans 'PCV13: vaccinating people in special risk situations'%}{% trans 'VPC13: one dose'%}
{% trans 'Meningococcal conjugate C or ACWY'%}{% trans 'With menACWY: three doses beginning at 3 months of age. Or with menC: two doses beginning at 3 months of age'%}{% trans 'REINFORCEMENT'%}{% trans 'REINFORCEMENT'%}{% trans 'REINFORCED at age 11. For those not previously vaccinated: two doses'%}{% trans 'Vaccinate people in special risk situations'%}
{% trans 'Meningococcal B'%}{% trans 'Three doses beginning at 3 months of age'%}{% trans 'REINFORCEMENT'%}{% trans 'For those not previously vaccinated: two doses'%}{% trans 'Vaccinate people in special risk situations'%}
{% trans 'Oral poliomyelitis (live attenuated virus)'%}{% trans 'NATIONAL VACCINATION CAMPAIGNS'%}
{% trans 'Influenza (flu)'%}{% trans 'ANNUAL VACCINATION'%}
{% trans 'Yellow fever'%}{% trans 'IN REGIONS WITH RECOMMENDATION OF VACCINATION (ACCORDING TO CLASSIFICATION OF MS) - single dose at 9 months of age. Not previously vaccinated: single dose'%}
{% trans 'Viral triple (measles, mumps and rubella)'%}{% trans 'Two doses after 12 months'%}{% trans 'Vaccinate the previously unvaccinated'%}{% trans 'Vaccinate people in special risk situations'%}
{% trans 'Varicella (chickenpox)'%}{% trans 'Two doses after 12 months'%}{% trans 'Vaccinate previously unvaccinated susceptibles'%}
{% trans 'Hepatitis A'%}{% trans 'Two doses after 12 months'%}{% trans 'Vaccinate the previously unvaccinated'%}{% trans 'Vaccinate people in special risk situations'%}
{% trans 'HPV'%}{% trans 'Three doses for girls and boys'%}{% trans 'Vaccinate the previously unvaccinated'%}{% trans 'Vaccinate the non-vaccinated formerly: at the discretion of the physician'%}
{% trans 'Pneumococcal 23 courageous'%}{% trans 'Vaccinate people in special risk situations'%}{% trans 'Two doses at five-year intervals'%}
{% trans 'Herpes zoster'%}{% trans 'From 50 to 59 years old: at medical discretion'%}{% trans 'One dose'%}
{% trans 'Dengue'%}{% trans 'CONTRAINDICATED'%}{% trans 'To vaccinate people aged 9 to 45 years previously infected with the virus (seropositive) with three doses: 0 - 6 - 12 months'%}{% trans 'CONTRAINDICATED'%}
+

+ +{% endblock content %} diff --git a/drdown/core/urls.py b/drdown/core/urls.py index cf64f569..f6b572e7 100644 --- a/drdown/core/urls.py +++ b/drdown/core/urls.py @@ -14,4 +14,9 @@ view=TemplateView.as_view(template_name='core/info.html'), name='about' ), + url( + regex=r'^vaccine/$', + view=TemplateView.as_view(template_name='core/vaccine_schedule.html'), + name='vaccine' + ), ] From 3eb91940931ed1d0cb93abd2f4ccc0eefd4a6f08 Mon Sep 17 00:00:00 2001 From: Daniel Maike Date: Wed, 2 May 2018 15:46:24 +0000 Subject: [PATCH 040/271] Modifying vaccine schedule table Adding green color on columns Co-authored-by: Elias Bernardo --- .../core/templates/core/vaccine_schedule.html | 56 ++++++++++--------- 1 file changed, 29 insertions(+), 27 deletions(-) diff --git a/drdown/core/templates/core/vaccine_schedule.html b/drdown/core/templates/core/vaccine_schedule.html index 432ec4a3..d7afb912 100644 --- a/drdown/core/templates/core/vaccine_schedule.html +++ b/drdown/core/templates/core/vaccine_schedule.html @@ -56,37 +56,37 @@ {% trans 'BCG ID'%} - {% trans 'One dose'%} + {% trans 'One dose'%} {% trans 'Vaccinate the previously unvaccinated'%} {% trans 'Vaccinate people who contacted leprosy'%} {% trans 'Hepatitis B'%} - {% trans 'Three or four doses from birth'%} + {% trans 'Three or four doses from birth'%} {% trans 'Vaccinate the previously unvaccinated'%} {% trans 'Rotavirus'%} - {% trans 'Two or three doses. Initiate vaccination before 15 weeks of age'%} + {% trans 'Two or three doses. Initiate vaccination before 15 weeks of age'%} {% trans 'CONTRAINDICATED'%} {% trans 'Bacterial triple (DTPw, DTPa, ou dTpa)'%} - {% trans 'Four doses of DTPa or DTPw starting at 2 months of age'%} + {% trans 'Four doses of DTPa or DTPw starting at 2 months of age'%} - {% trans 'Reinforcement with DTPa, DTPw or dTpa'%} + {% trans 'Reinforcement with DTPa, DTPw or dTpa'%} - {% trans 'Reinforcement with dTpa from 9 years of age and every 10 years (or, in the case of dTpa, do dT)'%} + {% trans 'Reinforcement with dTpa from 9 years of age and every 10 years (or, in the case of dTpa, do dT)'%} {% trans 'Haemophilus influenzae type b'%} - {% trans 'Four doses starting at 2 months of age'%} + {% trans 'Four doses starting at 2 months of age'%} {% trans 'Vaccinate the previously unvaccinated'%} {% trans 'Vaccinate people in special risk situations'%} @@ -94,29 +94,29 @@ {% trans 'Poliomyelitis (inactivated virus)'%} - {% trans 'Five doses starting at 2 months of age'%} + {% trans 'Five doses starting at 2 months of age'%} {% trans 'Vaccinate people in special risk situations'%} {% trans 'Pneumococcal conjugate'%} - {% trans 'Four doses starting at 2 months of age - VPC10 or VPC13'%} + {% trans 'Four doses starting at 2 months of age - VPC10 or VPC13'%} {% trans 'VPC10 or VPC13 - Vaccinate the previously unvaccinated'%} {% trans 'PCV13: vaccinating people in special risk situations'%} - {% trans 'VPC13: one dose'%} + {% trans 'VPC13: one dose'%} {% trans 'Meningococcal conjugate C or ACWY'%} - {% trans 'With menACWY: three doses beginning at 3 months of age. Or with menC: two doses beginning at 3 months of age'%} - {% trans 'REINFORCEMENT'%} + {% trans 'With menACWY: three doses beginning at 3 months of age. Or with menC: two doses beginning at 3 months of age'%} + {% trans 'REINFORCEMENT'%} - {% trans 'REINFORCEMENT'%} + {% trans 'REINFORCEMENT'%} - {% trans 'REINFORCED at age 11. For those not previously vaccinated: two doses'%} + {% trans 'REINFORCED at age 11. For those not previously vaccinated: two doses'%} {% trans 'Vaccinate people in special risk situations'%} @@ -124,9 +124,9 @@ - {% trans 'Three doses beginning at 3 months of age'%} - {% trans 'REINFORCEMENT'%} - {% trans 'For those not previously vaccinated: two doses'%} + {% trans 'Three doses beginning at 3 months of age'%} + {% trans 'REINFORCEMENT'%} + {% trans 'For those not previously vaccinated: two doses'%} {% trans 'Vaccinate people in special risk situations'%} @@ -138,7 +138,7 @@ - {% trans 'NATIONAL VACCINATION CAMPAIGNS'%} + {% trans 'NATIONAL VACCINATION CAMPAIGNS'%} @@ -154,7 +154,7 @@ - {% trans 'ANNUAL VACCINATION'%} + {% trans 'ANNUAL VACCINATION'%} {% trans 'Yellow fever'%} @@ -167,7 +167,7 @@ - {% trans 'IN REGIONS WITH RECOMMENDATION OF VACCINATION (ACCORDING TO CLASSIFICATION OF MS) - single dose at 9 months of age. Not previously vaccinated: single dose'%} + {% trans 'IN REGIONS WITH RECOMMENDATION OF VACCINATION (ACCORDING TO CLASSIFICATION OF MS) - single dose at 9 months of age. Not previously vaccinated: single dose'%} {% trans 'Viral triple (measles, mumps and rubella)'%} @@ -181,7 +181,7 @@ - {% trans 'Two doses after 12 months'%} + {% trans 'Two doses after 12 months'%} {% trans 'Vaccinate the previously unvaccinated'%} {% trans 'Vaccinate people in special risk situations'%} @@ -197,7 +197,7 @@ - {% trans 'Two doses after 12 months'%} + {% trans 'Two doses after 12 months'%} {% trans 'Vaccinate previously unvaccinated susceptibles'%} @@ -213,7 +213,7 @@ - {% trans 'Two doses after 12 months'%} + {% trans 'Two doses after 12 months'%} {% trans 'Vaccinate the previously unvaccinated'%} {% trans 'Vaccinate people in special risk situations'%} @@ -236,7 +236,7 @@ - {% trans 'Three doses for girls and boys'%} + {% trans 'Three doses for girls and boys'%} {% trans 'Vaccinate the previously unvaccinated'%} {% trans 'Vaccinate the non-vaccinated formerly: at the discretion of the physician'%} @@ -257,7 +257,7 @@ {% trans 'Vaccinate people in special risk situations'%} - {% trans 'Two doses at five-year intervals'%} + {% trans 'Two doses at five-year intervals'%} {% trans 'Herpes zoster'%} @@ -282,16 +282,18 @@ {% trans 'From 50 to 59 years old: at medical discretion'%} - {% trans 'One dose'%} + {% trans 'One dose'%} {% trans 'Dengue'%} {% trans 'CONTRAINDICATED'%} - {% trans 'To vaccinate people aged 9 to 45 years previously infected with the virus (seropositive) with three doses: 0 - 6 - 12 months'%} + {% trans 'To vaccinate people aged 9 to 45 years previously infected with the virus (seropositive) with three doses: 0 - 6 - 12 months'%} {% trans 'CONTRAINDICATED'%} + +

{% endblock content %} From ffb1d057eb9eae68f20ff0f9d82a36da2597c870 Mon Sep 17 00:00:00 2001 From: Daniel Maike Date: Wed, 2 May 2018 15:51:26 +0000 Subject: [PATCH 041/271] Adding alert color on vaccine schedule table Adding red color to columns Co-authored-by: Elias Bernardo --- drdown/core/templates/core/vaccine_schedule.html | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drdown/core/templates/core/vaccine_schedule.html b/drdown/core/templates/core/vaccine_schedule.html index d7afb912..10f26743 100644 --- a/drdown/core/templates/core/vaccine_schedule.html +++ b/drdown/core/templates/core/vaccine_schedule.html @@ -18,6 +18,7 @@






{% trans "Vaccine Schedule" %}


+ @@ -70,7 +71,7 @@ - + @@ -286,9 +287,9 @@ - + - +
{% trans 'Two or three doses. Initiate vaccination before 15 weeks of age'%}{% trans 'CONTRAINDICATED'%}{% trans 'CONTRAINDICATED'%}
{% trans 'Bacterial triple (DTPw, DTPa, ou dTpa)'%}
{% trans 'Dengue'%}{% trans 'CONTRAINDICATED'%}{% trans 'CONTRAINDICATED'%} {% trans 'To vaccinate people aged 9 to 45 years previously infected with the virus (seropositive) with three doses: 0 - 6 - 12 months'%}{% trans 'CONTRAINDICATED'%}{% trans 'CONTRAINDICATED'%}
From 100b7062c3dfb3f25e1ccb4b9e666a11a868333e Mon Sep 17 00:00:00 2001 From: Daniel Maike Date: Wed, 2 May 2018 15:56:35 +0000 Subject: [PATCH 042/271] Modifying vaccine schedule table format Adding striped table Adding yellow color to required columns Co-authored-by: Elias Bernardo --- .../core/templates/core/vaccine_schedule.html | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/drdown/core/templates/core/vaccine_schedule.html b/drdown/core/templates/core/vaccine_schedule.html index 10f26743..6145cf7b 100644 --- a/drdown/core/templates/core/vaccine_schedule.html +++ b/drdown/core/templates/core/vaccine_schedule.html @@ -18,8 +18,8 @@






{% trans "Vaccine Schedule" %}


- - + +
@@ -59,7 +59,7 @@ - + @@ -89,14 +89,14 @@ - + - + @@ -104,7 +104,7 @@ - + @@ -118,7 +118,7 @@ - + @@ -184,7 +184,7 @@ - + @@ -216,7 +216,7 @@ - + @@ -257,7 +257,7 @@ - + @@ -282,7 +282,7 @@ - + From 8b8107ea00674d245167a96ac30cab4aece126a2 Mon Sep 17 00:00:00 2001 From: Daniel Maike Date: Wed, 2 May 2018 16:01:36 +0000 Subject: [PATCH 043/271] Adding blue color to required fields Co-authored-by: Elias Bernardo --- .../core/templates/core/vaccine_schedule.html | 544 +++++++++--------- 1 file changed, 272 insertions(+), 272 deletions(-) diff --git a/drdown/core/templates/core/vaccine_schedule.html b/drdown/core/templates/core/vaccine_schedule.html index 6145cf7b..305a8290 100644 --- a/drdown/core/templates/core/vaccine_schedule.html +++ b/drdown/core/templates/core/vaccine_schedule.html @@ -20,279 +20,279 @@
{% trans 'Vaccines'%}{% trans 'BCG ID'%} {% trans 'One dose'%} {% trans 'Vaccinate the previously unvaccinated'%}{% trans 'Vaccinate people who contacted leprosy'%}{% trans 'Vaccinate people who contacted leprosy'%}
{% trans 'Hepatitis B'%} {% trans 'Four doses starting at 2 months of age'%} {% trans 'Vaccinate the previously unvaccinated'%}{% trans 'Vaccinate people in special risk situations'%}{% trans 'Vaccinate people in special risk situations'%}
{% trans 'Poliomyelitis (inactivated virus)'%} {% trans 'Five doses starting at 2 months of age'%}{% trans 'Vaccinate people in special risk situations'%}{% trans 'Vaccinate people in special risk situations'%}
{% trans 'Pneumococcal conjugate'%} {% trans 'Four doses starting at 2 months of age - VPC10 or VPC13'%} {% trans 'VPC10 or VPC13 - Vaccinate the previously unvaccinated'%}{% trans 'PCV13: vaccinating people in special risk situations'%}{% trans 'PCV13: vaccinating people in special risk situations'%} {% trans 'VPC13: one dose'%}
{% trans 'REINFORCEMENT'%} {% trans 'REINFORCED at age 11. For those not previously vaccinated: two doses'%}{% trans 'Vaccinate people in special risk situations'%}{% trans 'Vaccinate people in special risk situations'%}
{% trans 'Meningococcal B'%} {% trans 'Two doses after 12 months'%} {% trans 'Vaccinate the previously unvaccinated'%}{% trans 'Vaccinate people in special risk situations'%}{% trans 'Vaccinate people in special risk situations'%}
{% trans 'Varicella (chickenpox)'%} {% trans 'Two doses after 12 months'%} {% trans 'Vaccinate the previously unvaccinated'%}{% trans 'Vaccinate people in special risk situations'%}{% trans 'Vaccinate people in special risk situations'%}
{% trans 'HPV'%} {% trans 'Vaccinate people in special risk situations'%}{% trans 'Vaccinate people in special risk situations'%} {% trans 'Two doses at five-year intervals'%}
{% trans 'From 50 to 59 years old: at medical discretion'%}{% trans 'From 50 to 59 years old: at medical discretion'%} {% trans 'One dose'%}
- - - - - - - - + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
{% trans 'Vaccines'%}{% trans 'OF BIRTH TO THE 10 YEARS OF AGE'%}{% trans 'ADOLESCENT'%}{% trans 'ADULT'%}{% trans 'OLD MAN'%}
{% trans 'Vaccines'%}{% trans 'OF BIRTH TO THE 10 YEARS OF AGE'%}{% trans 'ADOLESCENT'%}{% trans 'ADULT'%}{% trans 'OLD MAN'%}
{% trans 'At birth'%}{% trans '1 month'%}{% trans '2 months'%}{% trans '3 months'%}{% trans '4 months'%}{% trans '5 months'%}{% trans '6 months'%}{% trans '7 months'%}{% trans '8 months'%}{% trans '9 months'%}{% trans '12 months'%}{% trans '15 months'%}{% trans '18 months'%}{% trans '24 months'%}{% trans '4 years'%}{% trans '5 years'%}{% trans '6 years'%}{% trans '9 years'%}{% trans '10 years'%}{% trans '11 to 19 years'%}{% trans '20 to 59 years'%}{% trans 'From 60 years old'%}
{% trans 'BCG ID'%}{% trans 'One dose'%}{% trans 'Vaccinate the previously unvaccinated'%}{% trans 'Vaccinate people who contacted leprosy'%}
{% trans 'Hepatitis B'%}{% trans 'Three or four doses from birth'%}{% trans 'Vaccinate the previously unvaccinated'%}
{% trans 'Rotavirus'%}{% trans 'Two or three doses. Initiate vaccination before 15 weeks of age'%}{% trans 'CONTRAINDICATED'%}
{% trans 'Bacterial triple (DTPw, DTPa, ou dTpa)'%}{% trans 'Four doses of DTPa or DTPw starting at 2 months of age'%}{% trans 'Reinforcement with DTPa, DTPw or dTpa'%}{% trans 'Reinforcement with dTpa from 9 years of age and every 10 years (or, in the case of dTpa, do dT)'%}
{% trans 'Haemophilus influenzae type b'%}{% trans 'Four doses starting at 2 months of age'%}{% trans 'Vaccinate the previously unvaccinated'%}{% trans 'Vaccinate people in special risk situations'%}
{% trans 'Poliomyelitis (inactivated virus)'%}{% trans 'Five doses starting at 2 months of age'%}{% trans 'Vaccinate people in special risk situations'%}
{% trans 'Pneumococcal conjugate'%}{% trans 'Four doses starting at 2 months of age - VPC10 or VPC13'%}{% trans 'VPC10 or VPC13 - Vaccinate the previously unvaccinated'%}{% trans 'PCV13: vaccinating people in special risk situations'%}{% trans 'VPC13: one dose'%}
{% trans 'Meningococcal conjugate C or ACWY'%}{% trans 'With menACWY: three doses beginning at 3 months of age. Or with menC: two doses beginning at 3 months of age'%}{% trans 'REINFORCEMENT'%}{% trans 'REINFORCEMENT'%}{% trans 'REINFORCED at age 11. For those not previously vaccinated: two doses'%}{% trans 'Vaccinate people in special risk situations'%}
{% trans 'Meningococcal B'%}{% trans 'Three doses beginning at 3 months of age'%}{% trans 'REINFORCEMENT'%}{% trans 'For those not previously vaccinated: two doses'%}{% trans 'Vaccinate people in special risk situations'%}
{% trans 'Oral poliomyelitis (live attenuated virus)'%}{% trans 'NATIONAL VACCINATION CAMPAIGNS'%}
{% trans 'Influenza (flu)'%}{% trans 'ANNUAL VACCINATION'%}
{% trans 'Yellow fever'%}{% trans 'IN REGIONS WITH RECOMMENDATION OF VACCINATION (ACCORDING TO CLASSIFICATION OF MS) - single dose at 9 months of age. Not previously vaccinated: single dose'%}
{% trans 'Viral triple (measles, mumps and rubella)'%}{% trans 'Two doses after 12 months'%}{% trans 'Vaccinate the previously unvaccinated'%}{% trans 'Vaccinate people in special risk situations'%}
{% trans 'Varicella (chickenpox)'%}{% trans 'Two doses after 12 months'%}{% trans 'Vaccinate previously unvaccinated susceptibles'%}
{% trans 'Hepatitis A'%}{% trans 'Two doses after 12 months'%}{% trans 'Vaccinate the previously unvaccinated'%}{% trans 'Vaccinate people in special risk situations'%}
{% trans 'HPV'%}{% trans 'Three doses for girls and boys'%}{% trans 'Vaccinate the previously unvaccinated'%}{% trans 'Vaccinate the non-vaccinated formerly: at the discretion of the physician'%}
{% trans 'Pneumococcal 23 courageous'%}{% trans 'Vaccinate people in special risk situations'%}{% trans 'Two doses at five-year intervals'%}
{% trans 'Herpes zoster'%}{% trans 'From 50 to 59 years old: at medical discretion'%}{% trans 'One dose'%}
{% trans 'Dengue'%}{% trans 'CONTRAINDICATED'%}{% trans 'To vaccinate people aged 9 to 45 years previously infected with the virus (seropositive) with three doses: 0 - 6 - 12 months'%}{% trans 'CONTRAINDICATED'%}
+ + {% trans 'At birth'%} + {% trans '1 month'%} + {% trans '2 months'%} + {% trans '3 months'%} + {% trans '4 months'%} + {% trans '5 months'%} + {% trans '6 months'%} + {% trans '7 months'%} + {% trans '8 months'%} + {% trans '9 months'%} + {% trans '12 months'%} + {% trans '15 months'%} + {% trans '18 months'%} + {% trans '24 months'%} + {% trans '4 years'%} + {% trans '5 years'%} + {% trans '6 years'%} + {% trans '9 years'%} + {% trans '10 years'%} + {% trans '11 to 19 years'%} + {% trans '20 to 59 years'%} + {% trans 'From 60 years old'%} + + + + + {% trans 'BCG ID'%} + {% trans 'One dose'%} + {% trans 'Vaccinate the previously unvaccinated'%} + {% trans 'Vaccinate people who contacted leprosy'%} + + + {% trans 'Hepatitis B'%} + {% trans 'Three or four doses from birth'%} + {% trans 'Vaccinate the previously unvaccinated'%} + + + {% trans 'Rotavirus'%} + + + {% trans 'Two or three doses. Initiate vaccination before 15 weeks of age'%} + {% trans 'CONTRAINDICATED'%} + + + {% trans 'Bacterial triple (DTPw, DTPa, ou dTpa)'%} + + + {% trans 'Four doses of DTPa or DTPw starting at 2 months of age'%} + + {% trans 'Reinforcement with DTPa, DTPw or dTpa'%} + + {% trans 'Reinforcement with dTpa from 9 years of age and every 10 years (or, in the case of dTpa, do dT)'%} + + + {% trans 'Haemophilus influenzae type b'%} + + + {% trans 'Four doses starting at 2 months of age'%} + {% trans 'Vaccinate the previously unvaccinated'%} + {% trans 'Vaccinate people in special risk situations'%} + + + {% trans 'Poliomyelitis (inactivated virus)'%} + + + {% trans 'Five doses starting at 2 months of age'%} + {% trans 'Vaccinate people in special risk situations'%} + + + {% trans 'Pneumococcal conjugate'%} + + + {% trans 'Four doses starting at 2 months of age - VPC10 or VPC13'%} + {% trans 'VPC10 or VPC13 - Vaccinate the previously unvaccinated'%} + {% trans 'PCV13: vaccinating people in special risk situations'%} + {% trans 'VPC13: one dose'%} + + + {% trans 'Meningococcal conjugate C or ACWY'%} + + + + {% trans 'With menACWY: three doses beginning at 3 months of age. Or with menC: two doses beginning at 3 months of age'%} + {% trans 'REINFORCEMENT'%} + + {% trans 'REINFORCEMENT'%} + + {% trans 'REINFORCED at age 11. For those not previously vaccinated: two doses'%} + {% trans 'Vaccinate people in special risk situations'%} + + + {% trans 'Meningococcal B'%} + + + + {% trans 'Three doses beginning at 3 months of age'%} + {% trans 'REINFORCEMENT'%} + {% trans 'For those not previously vaccinated: two doses'%} + {% trans 'Vaccinate people in special risk situations'%} + + + {% trans 'Oral poliomyelitis (live attenuated virus)'%} + + + + + + + + {% trans 'NATIONAL VACCINATION CAMPAIGNS'%} + + + + + + + + + {% trans 'Influenza (flu)'%} + + + + + + + {% trans 'ANNUAL VACCINATION'%} + + + {% trans 'Yellow fever'%} + + + + + + + + + + {% trans 'IN REGIONS WITH RECOMMENDATION OF VACCINATION (ACCORDING TO CLASSIFICATION OF MS) - single dose at 9 months of age. Not previously vaccinated: single dose'%} + + + {% trans 'Viral triple (measles, mumps and rubella)'%} + + + + + + + + + + + {% trans 'Two doses after 12 months'%} + {% trans 'Vaccinate the previously unvaccinated'%} + {% trans 'Vaccinate people in special risk situations'%} + + + {% trans 'Varicella (chickenpox)'%} + + + + + + + + + + + {% trans 'Two doses after 12 months'%} + {% trans 'Vaccinate previously unvaccinated susceptibles'%} + + + + {% trans 'Hepatitis A'%} + + + + + + + + + + + {% trans 'Two doses after 12 months'%} + {% trans 'Vaccinate the previously unvaccinated'%} + {% trans 'Vaccinate people in special risk situations'%} + + + {% trans 'HPV'%} + + + + + + + + + + + + + + + + + + {% trans 'Three doses for girls and boys'%} + {% trans 'Vaccinate the previously unvaccinated'%} + {% trans 'Vaccinate the non-vaccinated formerly: at the discretion of the physician'%} + + + + {% trans 'Pneumococcal 23 courageous'%} + + + + + + + + + + + + + + {% trans 'Vaccinate people in special risk situations'%} + {% trans 'Two doses at five-year intervals'%} + + + {% trans 'Herpes zoster'%} + + + + + + + + + + + + + + + + + + + + + {% trans 'From 50 to 59 years old: at medical discretion'%} + {% trans 'One dose'%} + + + {% trans 'Dengue'%} + {% trans 'CONTRAINDICATED'%} + {% trans 'To vaccinate people aged 9 to 45 years previously infected with the virus (seropositive) with three doses: 0 - 6 - 12 months'%} + {% trans 'CONTRAINDICATED'%} + + +

From 2eba3e53b9a1e9ef8b52737d25b29fde846ab372 Mon Sep 17 00:00:00 2001 From: GeovanaRamos Date: Wed, 2 May 2018 13:08:44 -0300 Subject: [PATCH 044/271] Separating date and time on model Deleting date_time field and creating date and time field Co-authored-by: Gabriela Medeiros --- .../appointments/migrations/0001_initial.py | 9 ++++--- .../appointments/models/model_appointment.py | 19 +++++++++----- .../appointments/appointment_form.html | 15 +++++++---- drdown/appointments/views/view_appointment.py | 25 +++++++++++-------- 4 files changed, 42 insertions(+), 26 deletions(-) diff --git a/drdown/appointments/migrations/0001_initial.py b/drdown/appointments/migrations/0001_initial.py index e6cf2a04..cebf7c5b 100644 --- a/drdown/appointments/migrations/0001_initial.py +++ b/drdown/appointments/migrations/0001_initial.py @@ -1,4 +1,4 @@ -# Generated by Django 2.0.3 on 2018-05-01 20:04 +# Generated by Django 2.0.3 on 2018-05-02 15:39 from django.db import migrations, models import django.db.models.deletion @@ -18,10 +18,11 @@ class Migration(migrations.Migration): fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('shift', models.CharField(choices=[('M', 'Morning'), ('A', 'Afternoon')], help_text='Shift of appointment', max_length=10, verbose_name='Shift')), - ('date_time', models.DateTimeField(help_text='Date and time of appointment', max_length=50, verbose_name='Date and Time')), - ('motive', models.TextField(help_text='Why are you requesting an appointment?', max_length=500, null=True, verbose_name='Motive')), + ('date', models.DateField(help_text='Date of appointment', max_length=50, verbose_name='Date')), + ('time', models.TimeField(help_text='Time of appointment', max_length=50, verbose_name='Time')), + ('motive', models.TextField(blank=True, help_text='Why are you requesting an appointment?', max_length=500, verbose_name='Motive')), ('speciality', models.CharField(choices=[('Speech Therapy', 'Speech Therapy'), ('Psychology', 'Psychology'), ('Physiotherapy', 'Physiotherapy'), ('Occupational Therapy', 'Occupational Therapy'), ('Doctor', 'Doctor'), ('Cardiology', 'Cardiology'), ('Neurology', 'Neurology'), ('Pediatrics', 'Pediatrics'), ('Nursing', 'Nursing')], help_text='Speciality of appointment', max_length=30, verbose_name='Speciality')), - ('status', models.CharField(choices=[('Scheduled', 'Scheduled'), ('Canceled', 'Canceled'), ('Done', 'Done')], default='Scheduled', help_text='Is the appointment still scheduled?', max_length=20, verbose_name='Status')), + ('status', models.CharField(choices=[('Scheduled', 'Scheduled'), ('Canceled', 'Canceled'), ('Done', 'Done')], default='Scheduled', editable=False, help_text='Is this appointment still scheduled?', max_length=20, verbose_name='Status')), ('doctor', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='appointments', to='users.HealthTeam', verbose_name='Doctor')), ('patient', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='appointments', to='users.Patient', verbose_name='Patient')), ], diff --git a/drdown/appointments/models/model_appointment.py b/drdown/appointments/models/model_appointment.py index 6354daa2..45fc46fd 100644 --- a/drdown/appointments/models/model_appointment.py +++ b/drdown/appointments/models/model_appointment.py @@ -21,9 +21,15 @@ class Appointment(models.Model): max_length=10 ) - date_time = models.DateTimeField( - _('Date and Time'), - help_text=_('Date and time of appointment'), + date = models.DateField( + _('Date'), + help_text=_('Date of appointment'), + max_length=50 + ) + + time = models.TimeField( + _('Time'), + help_text=_('Time of appointment'), max_length=50 ) @@ -31,7 +37,7 @@ class Appointment(models.Model): _('Motive'), help_text=_('Why are you requesting an appointment?'), max_length=500, - null=True, + blank=True, ) SPEECH_THERAPHY = _("Speech Therapy") @@ -90,9 +96,10 @@ class Appointment(models.Model): status = models.CharField( _('Status'), choices=STATUS_CHOICES, - help_text=_("Is the appointment still scheduled?"), + help_text=_("Is this appointment still scheduled?"), default=SCHEDULED, - max_length=20 + max_length=20, + editable=False, ) def __str__(self): diff --git a/drdown/appointments/templates/appointments/appointment_form.html b/drdown/appointments/templates/appointments/appointment_form.html index 3efbfe11..f7abacad 100644 --- a/drdown/appointments/templates/appointments/appointment_form.html +++ b/drdown/appointments/templates/appointments/appointment_form.html @@ -54,18 +54,23 @@

{% trans "New Appointment" %}

-
- +
+ + +
+ +
+
+ - {% trans 'Enter a date and time in format: dd/mm/yyyy hh:mm' %}

-
-{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/drdown/appointments/views/view_appointment.py b/drdown/appointments/views/view_appointment.py index 6fa06377..8dfac2a9 100644 --- a/drdown/appointments/views/view_appointment.py +++ b/drdown/appointments/views/view_appointment.py @@ -13,7 +13,7 @@ class AppointmentFilter(BaseFilter): search_fields = { - 'search_date': ['date_time'], + 'search_date': ['date'], 'search_speciality': ['speciality'], 'search_doctor': ['doctor__id'], 'search_patient': ['patient__id'], @@ -31,10 +31,10 @@ def get_year_range_of_appointment(): first = 3000 last = 0 for appointment in Appointment.objects.all(): - date = appointment.date_time.year - if date < first: + year = appointment.date.year + if year < first: first = date - if date > last: + if year > last: last = date return [first, last] @@ -106,12 +106,15 @@ class AppointmentCreateView(CreateView): model = Appointment sucess_url = 'appointmentslist_appointments' template_name = 'appointments/appointment_form.html' - fields = ['speciality', - 'shift', - 'doctor', - 'patient', - 'date_time', - 'motive', ] + fields = [ + 'speciality', + 'shift', + 'doctor', + 'patient', + 'date', + 'time', + 'motive', + ] def get_success_url(self, **kwargs): print("Entra em get_success_url") @@ -150,7 +153,7 @@ def get_context_data(self, **kwargs): class AppointmentMonthArchiveView(MonthArchiveView): - date_field = "date_time" + date_field = "date" allow_future = True template_name = 'appointments/appointment_list.html' allow_empty = True From 963ee1f6649e727df9b5fee76a3d3cc2e6c927ec Mon Sep 17 00:00:00 2001 From: Daniel Maike Date: Wed, 2 May 2018 16:27:01 +0000 Subject: [PATCH 045/271] Improving the vaccine schedule table Aligning texts Adding color to titles Fixing some html errors Co-authored-by: Elias Bernardo --- .../core/templates/core/vaccine_schedule.html | 544 +++++++++--------- 1 file changed, 272 insertions(+), 272 deletions(-) diff --git a/drdown/core/templates/core/vaccine_schedule.html b/drdown/core/templates/core/vaccine_schedule.html index 305a8290..aaf4f4a7 100644 --- a/drdown/core/templates/core/vaccine_schedule.html +++ b/drdown/core/templates/core/vaccine_schedule.html @@ -20,279 +20,279 @@
- - - - - - - - + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
{% trans 'Vaccines'%}{% trans 'OF BIRTH TO THE 10 YEARS OF AGE'%}{% trans 'ADOLESCENT'%}{% trans 'ADULT'%}{% trans 'OLD MAN'%}

{% trans 'Vaccines'%}

{% trans 'OF BIRTH TO THE 10 YEARS OF AGE'%}{% trans 'ADOLESCENT'%}{% trans 'ADULT'%}{% trans 'OLD MAN'%}
{% trans 'At birth'%}{% trans '1 month'%}{% trans '2 months'%}{% trans '3 months'%}{% trans '4 months'%}{% trans '5 months'%}{% trans '6 months'%}{% trans '7 months'%}{% trans '8 months'%}{% trans '9 months'%}{% trans '12 months'%}{% trans '15 months'%}{% trans '18 months'%}{% trans '24 months'%}{% trans '4 years'%}{% trans '5 years'%}{% trans '6 years'%}{% trans '9 years'%}{% trans '10 years'%}{% trans '11 to 19 years'%}{% trans '20 to 59 years'%}{% trans 'From 60 years old'%}
{% trans 'BCG ID'%}{% trans 'One dose'%}{% trans 'Vaccinate the previously unvaccinated'%}{% trans 'Vaccinate people who contacted leprosy'%}
{% trans 'Hepatitis B'%}{% trans 'Three or four doses from birth'%}{% trans 'Vaccinate the previously unvaccinated'%}
{% trans 'Rotavirus'%}{% trans 'Two or three doses. Initiate vaccination before 15 weeks of age'%}{% trans 'CONTRAINDICATED'%}
{% trans 'Bacterial triple (DTPw, DTPa, ou dTpa)'%}{% trans 'Four doses of DTPa or DTPw starting at 2 months of age'%}{% trans 'Reinforcement with DTPa, DTPw or dTpa'%}{% trans 'Reinforcement with dTpa from 9 years of age and every 10 years (or, in the case of dTpa, do dT)'%}
{% trans 'Haemophilus influenzae type b'%}{% trans 'Four doses starting at 2 months of age'%}{% trans 'Vaccinate the previously unvaccinated'%}{% trans 'Vaccinate people in special risk situations'%}
{% trans 'Poliomyelitis (inactivated virus)'%}{% trans 'Five doses starting at 2 months of age'%}{% trans 'Vaccinate people in special risk situations'%}
{% trans 'Pneumococcal conjugate'%}{% trans 'Four doses starting at 2 months of age - VPC10 or VPC13'%}{% trans 'VPC10 or VPC13 - Vaccinate the previously unvaccinated'%}{% trans 'PCV13: vaccinating people in special risk situations'%}{% trans 'VPC13: one dose'%}
{% trans 'Meningococcal conjugate C or ACWY'%}{% trans 'With menACWY: three doses beginning at 3 months of age. Or with menC: two doses beginning at 3 months of age'%}{% trans 'REINFORCEMENT'%}{% trans 'REINFORCEMENT'%}{% trans 'REINFORCED at age 11. For those not previously vaccinated: two doses'%}{% trans 'Vaccinate people in special risk situations'%}
{% trans 'Meningococcal B'%}{% trans 'Three doses beginning at 3 months of age'%}{% trans 'REINFORCEMENT'%}{% trans 'For those not previously vaccinated: two doses'%}{% trans 'Vaccinate people in special risk situations'%}
{% trans 'Oral poliomyelitis (live attenuated virus)'%}{% trans 'NATIONAL VACCINATION CAMPAIGNS'%}
{% trans 'Influenza (flu)'%}{% trans 'ANNUAL VACCINATION'%}
{% trans 'Yellow fever'%}{% trans 'IN REGIONS WITH RECOMMENDATION OF VACCINATION (ACCORDING TO CLASSIFICATION OF MS) - single dose at 9 months of age. Not previously vaccinated: single dose'%}
{% trans 'Viral triple (measles, mumps and rubella)'%}{% trans 'Two doses after 12 months'%}{% trans 'Vaccinate the previously unvaccinated'%}{% trans 'Vaccinate people in special risk situations'%}
{% trans 'Varicella (chickenpox)'%}{% trans 'Two doses after 12 months'%}{% trans 'Vaccinate previously unvaccinated susceptibles'%}
{% trans 'Hepatitis A'%}{% trans 'Two doses after 12 months'%}{% trans 'Vaccinate the previously unvaccinated'%}{% trans 'Vaccinate people in special risk situations'%}
{% trans 'HPV'%}{% trans 'Three doses for girls and boys'%}{% trans 'Vaccinate the previously unvaccinated'%}{% trans 'Vaccinate the non-vaccinated formerly: at the discretion of the physician'%}
{% trans 'Pneumococcal 23 courageous'%}{% trans 'Vaccinate people in special risk situations'%}{% trans 'Two doses at five-year intervals'%}
{% trans 'Herpes zoster'%}{% trans 'From 50 to 59 years old: at medical discretion'%}{% trans 'One dose'%}
{% trans 'Dengue'%}{% trans 'CONTRAINDICATED'%}{% trans 'To vaccinate people aged 9 to 45 years previously infected with the virus (seropositive) with three doses: 0 - 6 - 12 months'%}{% trans 'CONTRAINDICATED'%}
+ + {% trans 'B'%} + {% trans '1 M'%} + {% trans '2 M'%} + {% trans '3 M'%} + {% trans '4 M'%} + {% trans '5 M'%} + {% trans '6 M'%} + {% trans '7 M'%} + {% trans '8 M'%} + {% trans '9 M'%} + {% trans '12 M'%} + {% trans '15 M'%} + {% trans '18 M'%} + {% trans '24 M'%} + {% trans '4 Y'%} + {% trans '5 Y'%} + {% trans '6 Y'%} + {% trans '9 Y'%} + {% trans '10 Y'%} + {% trans '11-19 Y'%} + {% trans '20-59 Y'%} + {% trans '60 Y+'%} + + + + + {% trans 'BCG ID'%} + {% trans 'One dose'%} + {% trans 'Vaccinate the previously unvaccinated'%} + {% trans 'Vaccinate people who contacted leprosy'%} + + + {% trans 'Hepatitis B'%} + {% trans 'Three or four doses from birth'%} + {% trans 'Vaccinate the previously unvaccinated'%} + + + {% trans 'Rotavirus'%} + + + {% trans 'Two or three doses. Initiate vaccination before 15 weeks of age'%} + {% trans 'CONTRAINDICATED'%} + + + {% trans 'Bacterial triple (DTPw, DTPa, ou dTpa)'%} + + + {% trans 'Four doses of DTPa or DTPw starting at 2 months of age'%} + + {% trans 'Reinforcement with DTPa, DTPw or dTpa'%} + + {% trans 'Reinforcement with dTpa from 9 years of age and every 10 years (or, in the case of dTpa, do dT)'%} + + + {% trans 'Haemophilus influenzae type b'%} + + + {% trans 'Four doses starting at 2 months of age'%} + {% trans 'Vaccinate the previously unvaccinated'%} + {% trans 'Vaccinate people in special risk situations'%} + + + {% trans 'Poliomyelitis (inactivated virus)'%} + + + {% trans 'Five doses starting at 2 months of age'%} + {% trans 'Vaccinate people in special risk situations'%} + + + {% trans 'Pneumococcal conjugate'%} + + + {% trans 'Four doses starting at 2 months of age - VPC10 or VPC13'%} + {% trans 'VPC10 or VPC13 - Vaccinate the previously unvaccinated'%} + {% trans 'PCV13: vaccinating people in special risk situations'%} + {% trans 'VPC13: one dose'%} + + + {% trans 'Meningococcal conjugate C or ACWY'%} + + + + {% trans 'With menACWY: three doses beginning at 3 months of age. Or with menC: two doses beginning at 3 months of age'%} + {% trans 'REINFORCEMENT'%} + + {% trans 'REINFORCEMENT'%} + + {% trans 'REINFORCED at age 11. For those not previously vaccinated: two doses'%} + {% trans 'Vaccinate people in special risk situations'%} + + + {% trans 'Meningococcal B'%} + + + + {% trans 'Three doses beginning at 3 months of age'%} + {% trans 'REINFORCEMENT'%} + {% trans 'For those not previously vaccinated: two doses'%} + {% trans 'Vaccinate people in special risk situations'%} + + + {% trans 'Oral poliomyelitis (live attenuated virus)'%} + + + + + + + + {% trans 'NATIONAL VACCINATION CAMPAIGNS'%} + + + + + + + + + {% trans 'Influenza (flu)'%} + + + + + + + {% trans 'ANNUAL VACCINATION'%} + + + {% trans 'Yellow fever'%} + + + + + + + + + + {% trans 'IN REGIONS WITH RECOMMENDATION OF VACCINATION (ACCORDING TO CLASSIFICATION OF MS) - single dose at 9 months of age. Not previously vaccinated: single dose'%} + + + {% trans 'Viral triple (measles, mumps and rubella)'%} + + + + + + + + + + + {% trans 'Two doses after 12 months'%} + {% trans 'Vaccinate the previously unvaccinated'%} + {% trans 'Vaccinate people in special risk situations'%} + + + {% trans 'Varicella (chickenpox)'%} + + + + + + + + + + + {% trans 'Two doses after 12 months'%} + {% trans 'Vaccinate previously unvaccinated susceptibles'%} + + + + {% trans 'Hepatitis A'%} + + + + + + + + + + + {% trans 'Two doses after 12 months'%} + {% trans 'Vaccinate the previously unvaccinated'%} + {% trans 'Vaccinate people in special risk situations'%} + + + {% trans 'HPV'%} + + + + + + + + + + + + + + + + + + {% trans 'Three doses for girls and boys'%} + {% trans 'Vaccinate the previously unvaccinated'%} + {% trans 'Vaccinate the non-vaccinated formerly: at the discretion of the physician'%} + + + + {% trans 'Pneumococcal 23 courageous'%} + + + + + + + + + + + + + + {% trans 'Vaccinate people in special risk situations'%} + {% trans 'Two doses at five-year intervals'%} + + + {% trans 'Herpes zoster'%} + + + + + + + + + + + + + + + + + + + + + {% trans 'From 50 to 59 years old: at medical discretion'%} + {% trans 'One dose'%} + + + {% trans 'Dengue'%} + {% trans 'CONTRAINDICATED'%} + {% trans 'To vaccinate people aged 9 to 45 years previously infected with the virus (seropositive) with three doses: 0 - 6 - 12 months'%} + {% trans 'CONTRAINDICATED'%} + + +

From 912052302877ef6c1109f41b543e3ed71cfee792 Mon Sep 17 00:00:00 2001 From: Gabriela Medeiros Date: Wed, 2 May 2018 13:31:23 -0300 Subject: [PATCH 046/271] Creating update view Creating url Correcting view error Adapting appointment form Co-authored-by: Geovana Ramos --- drdown/appointments/urls.py | 13 +++++--- drdown/appointments/views/view_appointment.py | 30 +++++++++++++++++-- 2 files changed, 37 insertions(+), 6 deletions(-) diff --git a/drdown/appointments/urls.py b/drdown/appointments/urls.py index 351bac0e..6d87bb50 100644 --- a/drdown/appointments/urls.py +++ b/drdown/appointments/urls.py @@ -1,6 +1,7 @@ from django.conf.urls import url from drdown.appointments.views.view_appointment import AppointmentListView from drdown.appointments.views.view_appointment import AppointmentCreateView +from drdown.appointments.views.view_appointment import AppointmentUpdateView from drdown.appointments.views.view_appointment import AppointmentMonthArchiveView @@ -17,9 +18,13 @@ name='create_appointment' ), url( - regex=r'^(?P\d{4})/(?P\d+)/$', - view=AppointmentMonthArchiveView.as_view(month_format='%m'), - name="archive_month" + regex=r'^(?P\d{4})/(?P\d+)/$', + view=AppointmentMonthArchiveView.as_view(month_format='%m'), + name="archive_month" ), - + url( + regex=r'^update/(?P\d+)/$', + view=AppointmentUpdateView.as_view(), + name='update_appointment' + ) ] diff --git a/drdown/appointments/views/view_appointment.py b/drdown/appointments/views/view_appointment.py index 8dfac2a9..0b97c63c 100644 --- a/drdown/appointments/views/view_appointment.py +++ b/drdown/appointments/views/view_appointment.py @@ -33,9 +33,9 @@ def get_year_range_of_appointment(): for appointment in Appointment.objects.all(): year = appointment.date.year if year < first: - first = date + first = year if year > last: - last = date + last = year return [first, last] @@ -128,6 +128,7 @@ def form_valid(self, form): form.save() return super(AppointmentCreateView, self).form_valid(form) + @staticmethod def get_health_team(self): health_team = [] @@ -136,6 +137,7 @@ def get_health_team(self): return health_team + @staticmethod def get_patients(self): patients = [] @@ -165,3 +167,27 @@ def get_context_data(self, **kwargs): def get_queryset(self): return AppointmentListView.prepare_queryset(self.request) + + +class AppointmentUpdateView(UpdateView): + model = Appointment + template_name = 'appointments/appointment_form.html' + fields = ['speciality', + 'shift', + 'doctor', + 'patient', + 'date_time', + 'motive', ] + + def get_object(self): + appointment = Appointment.objects.get( + pk=self.kwargs.get('appointment_pk') + ) + return appointment + + def get_context_data(self, **kwargs): + context = super(AppointmentUpdateView, self).get_context_data(**kwargs) + + context['health_team'] = self.get_health_team() + context['patients'] = self.get_patients() + return context From 0d1d67ea3fa4e3854e0481c7756b41c829ea03f1 Mon Sep 17 00:00:00 2001 From: Gabriela Medeiros Date: Wed, 2 May 2018 13:42:25 -0300 Subject: [PATCH 047/271] Correcting update view error Changing static methods parameters Co-authored-by: Geovana Ramos --- drdown/appointments/views/view_appointment.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drdown/appointments/views/view_appointment.py b/drdown/appointments/views/view_appointment.py index 0b97c63c..05a050e8 100644 --- a/drdown/appointments/views/view_appointment.py +++ b/drdown/appointments/views/view_appointment.py @@ -129,7 +129,7 @@ def form_valid(self, form): return super(AppointmentCreateView, self).form_valid(form) @staticmethod - def get_health_team(self): + def get_health_team(): health_team = [] for doctor in HealthTeam.objects.all(): @@ -138,7 +138,7 @@ def get_health_team(self): return health_team @staticmethod - def get_patients(self): + def get_patients(): patients = [] for patient in Patient.objects.all(): @@ -188,6 +188,6 @@ def get_object(self): def get_context_data(self, **kwargs): context = super(AppointmentUpdateView, self).get_context_data(**kwargs) - context['health_team'] = self.get_health_team() - context['patients'] = self.get_patients() + context['health_team'] = AppointmentCreateView.get_health_team() + context['patients'] = AppointmentCreateView.get_patients() return context From a7c5a61d9a019a71eb626a91a1c4d59fa26fc2e1 Mon Sep 17 00:00:00 2001 From: GeovanaRamos Date: Wed, 2 May 2018 13:49:49 -0300 Subject: [PATCH 048/271] Changing search labels Leaving only field name on search field Co-authored-by: Gabriela Medeiros --- drdown/appointments/forms/appointments_form.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drdown/appointments/forms/appointments_form.py b/drdown/appointments/forms/appointments_form.py index 2937c4c7..3433453b 100644 --- a/drdown/appointments/forms/appointments_form.py +++ b/drdown/appointments/forms/appointments_form.py @@ -2,14 +2,13 @@ from django import forms from drdown.users.models.model_health_team import HealthTeam from drdown.users.models.model_patient import Patient -from pagedown.widgets import PagedownWidget from django.utils.translation import ugettext_lazy as _ class AppointmentSearchForm(forms.Form): search_speciality = forms.CharField( required=False, - label=_('Search speciality!'), + label=_('Speciality'), widget=forms.TextInput( attrs={'placeholder': _('search here!')} ) @@ -17,7 +16,7 @@ class AppointmentSearchForm(forms.Form): search_date = forms.DateField( required=False, - label=_('Search date!'), + label=_('Date'), widget=forms.TextInput( attrs={'placeholder': _('(Year)-(Month)-(Day)')} ) @@ -26,12 +25,12 @@ class AppointmentSearchForm(forms.Form): search_doctor = forms.ModelChoiceField( queryset=HealthTeam.objects.all(), required=False, - label=_('Search doctor!') + label=_('Doctor') ) search_patient = forms.ModelChoiceField( queryset=Patient.objects.all(), required=False, - label=_('Search patient!') + label=_('Patient') ) From df931b00c296724863981bf92f0902ba6fff7cb3 Mon Sep 17 00:00:00 2001 From: guilherme1guy Date: Wed, 2 May 2018 14:35:29 -0300 Subject: [PATCH 049/271] Changing views of checklist Transforming ListView into a RedirectView so it will redirect to new list page Co-authored-by: joberth rogers --- .../templates/careline/checklist_list.html | 29 --------- drdown/careline/urls.py | 4 +- drdown/careline/views/__init__.py | 2 +- drdown/careline/views/view_checklist.py | 60 +++---------------- 4 files changed, 11 insertions(+), 84 deletions(-) delete mode 100644 drdown/careline/templates/careline/checklist_list.html diff --git a/drdown/careline/templates/careline/checklist_list.html b/drdown/careline/templates/careline/checklist_list.html deleted file mode 100644 index e80c112d..00000000 --- a/drdown/careline/templates/careline/checklist_list.html +++ /dev/null @@ -1,29 +0,0 @@ -{% extends "core/base.html" %} -{% load static i18n %} -{% block title %}{% trans "Care Line" %}{% endblock %} - -{% block content %} -
-

{% trans "Care Line" %}

- -
- {% for patient in patient_list %} - -
- {% if patient.user.photo %} - - {% else %} - - {% endif %} -
-

{{ patient.user.name }}

-

{% trans 'SES: ' %} {{patient.ses}}

-
-
-
- {% empty %} -

{% trans 'There are no patients for this user.'%}

- {% endfor %} -
-
-{% endblock content %} diff --git a/drdown/careline/urls.py b/drdown/careline/urls.py index a260ee47..914958ed 100644 --- a/drdown/careline/urls.py +++ b/drdown/careline/urls.py @@ -2,7 +2,7 @@ from .views import ( ChecklistDetailView, - ChecklistListView, + ChecklistRedirectView, ChecklistUpdateView ) @@ -10,7 +10,7 @@ urlpatterns = [ url( regex=r'^$', - view=ChecklistListView.as_view(), + view=ChecklistRedirectView.as_view(), name='checklist_list' ), url( diff --git a/drdown/careline/views/__init__.py b/drdown/careline/views/__init__.py index a4ad3f92..9a41a18d 100644 --- a/drdown/careline/views/__init__.py +++ b/drdown/careline/views/__init__.py @@ -1,5 +1,5 @@ from .view_checklist import ( ChecklistDetailView, - ChecklistListView, + ChecklistRedirectView, ChecklistUpdateView ) diff --git a/drdown/careline/views/view_checklist.py b/drdown/careline/views/view_checklist.py index 0dfc4158..b943b6bf 100644 --- a/drdown/careline/views/view_checklist.py +++ b/drdown/careline/views/view_checklist.py @@ -3,7 +3,8 @@ HttpResponseRedirect, HttpResponse, HttpResponseForbidden, - HttpResponseServerError + HttpResponseServerError, + HttpResponsePermanentRedirect ) from django.urls import reverse @@ -23,60 +24,15 @@ from drdown.users.models import User, Patient -class ChecklistListView(ListView): +class ChecklistRedirectView(RedirectView): - # the List View for Checklists will list the patients that belong to the - # current user (specialized as a responsible), only responsibles will - # access this view - model = Checklist - template_name = 'careline/checklist_list.html' + # redirect this page to user list of + # medical follow-up sheet page + url = 'users:patient_list' + permanent = True def get(self, request, *args, **kwargs): - - if not request.user.is_authenticated: - # redirect not not authenticated to login screen - url = reverse( - viewname='account_login', - ) - return redirect(url) - - if hasattr(request.user, 'patient'): - # redirect user_patient to the checklist detail view - url = reverse( - viewname='careline:checklist_detail', - kwargs={'username': request.user.username} - ) - return redirect(url) - - if not hasattr(request.user, 'responsible'): - url = reverse( - viewname='users:detail', - kwargs={'username': request.user.username} - ) - return redirect(url) - - return super().get(request, *args, **kwargs) - - def get_queryset(self, *args, **kwargs): - - user = self.request.user - - queryset = None - - if hasattr(user, "responsible"): - queryset = Patient.objects.filter(responsible=user.responsible) - - return queryset - - def get_context_data(self, **kwargs): - context = super().get_context_data(**kwargs) - - user = self.request.user - patients = Patient.objects.filter(responsible=user.responsible) - - context['patient_list'] = patients - - return context + return HttpResponsePermanentRedirect(reverse(self.url), request) class ChecklistDetailView(DetailView): From 104d30449121b0c3a0004c8e22e67639033a968b Mon Sep 17 00:00:00 2001 From: guilherme1guy Date: Wed, 2 May 2018 14:37:31 -0300 Subject: [PATCH 050/271] Adding basic PatientListView At this moment its just a copy of the old ListView from the checklist Co-authored-by: joberth rogers --- .../users/templates/users/patient_list.html | 33 +++++++++++ drdown/users/urls.py | 5 ++ drdown/users/views/__init__.py | 7 ++- drdown/users/views/view_user.py | 59 ++++++++++++++++++- 4 files changed, 101 insertions(+), 3 deletions(-) create mode 100644 drdown/users/templates/users/patient_list.html diff --git a/drdown/users/templates/users/patient_list.html b/drdown/users/templates/users/patient_list.html new file mode 100644 index 00000000..6fa73848 --- /dev/null +++ b/drdown/users/templates/users/patient_list.html @@ -0,0 +1,33 @@ +{% extends "core/base.html" %} +{% load static i18n %} +{% block title %}{% trans "Select a patient" %}{% endblock %} + +{% block content %} +
+

{% trans "Select a patient" %}

+ +
+ + {% for patient in patient_list %} + +
+ + {% if patient.user.photo %} + + {% else %} + + {% endif %} + +
+

{{ patient.user.name }}

+

{% trans 'SES: ' %} {{patient.ses}}

+
+
+
+ {% empty %} +

{% trans 'There are no patients for this user.'%}

+ {% endfor %} + +
+
+{% endblock content %} diff --git a/drdown/users/urls.py b/drdown/users/urls.py index ac7a4232..6683c68e 100644 --- a/drdown/users/urls.py +++ b/drdown/users/urls.py @@ -30,5 +30,10 @@ regex=r'^~delete/', view=views.UserDeleteView.as_view(), name='delete' + ), + url( + regex=r'^~patients/$', + view=views.PatientListView.as_view(), + name='patient_list' ), ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) diff --git a/drdown/users/views/__init__.py b/drdown/users/views/__init__.py index 9e43be1b..7ec037a5 100644 --- a/drdown/users/views/__init__.py +++ b/drdown/users/views/__init__.py @@ -1,2 +1,5 @@ -from .view_user import (UserDetailView, UserRedirectView, - UserUpdateView, UserListView, UserDeleteView, ) +from .view_user import ( + UserDetailView, UserRedirectView, + UserUpdateView, UserListView, + UserDeleteView, PatientListView +) diff --git a/drdown/users/views/view_user.py b/drdown/users/views/view_user.py index 2650b627..0280b8f2 100644 --- a/drdown/users/views/view_user.py +++ b/drdown/users/views/view_user.py @@ -6,7 +6,7 @@ from django.views.generic import (DetailView, ListView, RedirectView, UpdateView, DeleteView) from django.urls import reverse_lazy -from ..models import User +from ..models import User, Patient, Employee, HealthTeam, Responsible class UserDeleteView (LoginRequiredMixin, DeleteView): @@ -121,3 +121,60 @@ class UserListView(LoginRequiredMixin, ListView): # These next two lines tell the view to index lookups by username slug_field = 'username' slug_url_kwarg = 'username' + + +class PatientListView(ListView): + + # the List View for Checklists will list the patients that belong to the + # current user (specialized as a responsible), only responsibles will + # access this view + model = User + template_name = 'users/patient_list.html' + + def get(self, request, *args, **kwargs): + + if not request.user.is_authenticated: + # redirect not not authenticated to login screen + url = reverse( + viewname='account_login', + ) + return redirect(url) + + if hasattr(request.user, 'patient'): + # redirect user_patient to the checklist detail view + url = reverse( + viewname='careline:checklist_detail', + kwargs={'username': request.user.username} + ) + return redirect(url) + + if not hasattr(request.user, 'responsible'): + url = reverse( + viewname='users:detail', + kwargs={'username': request.user.username} + ) + return redirect(url) + + return super().get(request, *args, **kwargs) + + def get_queryset(self, *args, **kwargs): + + user = self.request.user + + queryset = None + + if hasattr(user, "responsible"): + queryset = Patient.objects.filter(responsible=user.responsible) + + return queryset + + def get_context_data(self, **kwargs): + context = super().get_context_data(**kwargs) + + user = self.request.user + patients = Patient.objects.filter(responsible=user.responsible) + + context['patient_list'] = patients + + return context + From 1ad6b6aa82e577e4629148a9240d51cb3e3e982a Mon Sep 17 00:00:00 2001 From: Daniel Maike Date: Wed, 2 May 2018 17:47:11 +0000 Subject: [PATCH 051/271] Creating button Adding button to vaccine schedule Co-authored-by: Elias Bernardo --- drdown/careline/templates/careline/checklist_detail.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drdown/careline/templates/careline/checklist_detail.html b/drdown/careline/templates/careline/checklist_detail.html index 998fa6a7..399bc4dd 100644 --- a/drdown/careline/templates/careline/checklist_detail.html +++ b/drdown/careline/templates/careline/checklist_detail.html @@ -102,6 +102,7 @@

{% trans "Care Line" %}


{% trans 'Name: ' %}{{ checklist.patient.user.name }}
+ {% trans 'Vaccine Schedule' %} {% if age == 0 %}
{% trans 'Age: ' %} {% trans "Newborn" %}
@@ -114,6 +115,7 @@
{% trans 'Age: ' %} {{ age }}
{% trans 'SES: ' %} {{ checklist.patient.ses}}
+ From 8d543af63c61c08c11aa10af19130d4a792948aa Mon Sep 17 00:00:00 2001 From: Daniel Maike Date: Wed, 2 May 2018 17:47:53 +0000 Subject: [PATCH 052/271] Adding link in FURTHER READING Adding link to vaccine schedule Co-authored-by: Elias Bernardo --- drdown/core/templates/core/info.html | 1 + 1 file changed, 1 insertion(+) diff --git a/drdown/core/templates/core/info.html b/drdown/core/templates/core/info.html index 3927e1c3..0fddb0a5 100644 --- a/drdown/core/templates/core/info.html +++ b/drdown/core/templates/core/info.html @@ -141,6 +141,7 @@

{%

+

{% trans "Vaccine Schedule" %}

O que é Síndrome de Down? - Movimento Down

O que é Síndrome de Down? - Fundação Síndrome de Down

CUIDADOS DE SAÚDE ÀS PESSOAS COM SÍNDROME DE DOWN - MINISTÉRIO DA SAÚDE (PDF)

From 5e9dd7c71902b168e34ab5e083b3034753b7eea5 Mon Sep 17 00:00:00 2001 From: Daniel Maike Date: Wed, 2 May 2018 17:48:39 +0000 Subject: [PATCH 053/271] Improving vaccine schedule table Styling table Adding new color to titles Adding subtitle Co-authored-by: Elias Bernardo --- .../core/templates/core/vaccine_schedule.html | 98 ++++++++++++++----- 1 file changed, 71 insertions(+), 27 deletions(-) diff --git a/drdown/core/templates/core/vaccine_schedule.html b/drdown/core/templates/core/vaccine_schedule.html index aaf4f4a7..de93b7a2 100644 --- a/drdown/core/templates/core/vaccine_schedule.html +++ b/drdown/core/templates/core/vaccine_schedule.html @@ -22,36 +22,36 @@

- - - - - + + + + + - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + @@ -292,6 +292,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

{% trans 'Vaccines'%}

{% trans 'OF BIRTH TO THE 10 YEARS OF AGE'%}{% trans 'ADOLESCENT'%}{% trans 'ADULT'%}{% trans 'OLD MAN'%}

{% trans 'Vaccines'%}

{% trans 'OF BIRTH TO THE 10 YEARS OF AGE'%}{% trans 'ADOLESCENT'%}{% trans 'ADULT'%}{% trans 'OLD MAN'%}
{% trans 'B'%}{% trans '1 M'%}{% trans '2 M'%}{% trans '3 M'%}{% trans '4 M'%}{% trans '5 M'%}{% trans '6 M'%}{% trans '7 M'%}{% trans '8 M'%}{% trans '9 M'%}{% trans '12 M'%}{% trans '15 M'%}{% trans '18 M'%}{% trans '24 M'%}{% trans '4 Y'%}{% trans '5 Y'%}{% trans '6 Y'%}{% trans '9 Y'%}{% trans '10 Y'%}{% trans '11-19 Y'%}{% trans '20-59 Y'%}{% trans '60 Y+'%}{% trans 'At Birth'%}{% trans '1 Month'%}{% trans '2 Months'%}{% trans '3 Months'%}{% trans '4 Months'%}{% trans '5 Months'%}{% trans '6 Months'%}{% trans '7 Months'%}{% trans '8 Months'%}{% trans '9 Months'%}{% trans '12 Months'%}{% trans '15 Months'%}{% trans '18 Months'%}{% trans '24 Months'%}{% trans '4 Years'%}{% trans '5 Years'%}{% trans '6 Years'%}{% trans '9 Years'%}{% trans '10 Years'%}{% trans '11-19 Years'%}{% trans '20-59 Years'%}{% trans '60+ Years'%}
{% trans 'CONTRAINDICATED'%}

{% trans 'Vaccines'%}

{% trans 'At Birth'%}{% trans '1 Month'%}{% trans '2 Months'%}{% trans '3 Months'%}{% trans '4 Months'%}{% trans '5 Months'%}{% trans '6 Months'%}{% trans '7 Months'%}{% trans '8 Months'%}{% trans '9 Months'%}{% trans '12 Months'%}{% trans '15 Months'%}{% trans '18 Months'%}{% trans '24 Months'%}{% trans '4 Years'%}{% trans '5 Years'%}{% trans '6 Years'%}{% trans '9 Years'%}{% trans '10 Years'%}{% trans '11-19 Years'%}{% trans '20-59 Years'%}{% trans '60+ Years'%}
{% trans 'OF BIRTH TO THE 10 YEARS OF AGE'%}{% trans 'ADOLESCENT'%}{% trans 'ADULT'%}{% trans 'OLD MAN'%}
{% trans 'Subtitle: '%}
{% trans 'Routine'%}
{% trans 'Vaccinate Unvaccinated'%}
{% trans 'Special Situations'%}
{% trans 'Contraindicated'%}
From 9c17055e27c2a36a5df68a5f193034d8602b4e04 Mon Sep 17 00:00:00 2001 From: guilherme1guy Date: Wed, 2 May 2018 14:58:33 -0300 Subject: [PATCH 054/271] Adding basic medical follow-up sheet view Create class in views Change redirect parameters (View and HTML) Add path to url Fix missing import Co-authored-by: joberth rogers --- drdown/users/templates/users/patient_list.html | 2 +- drdown/users/urls.py | 8 +++++++- drdown/users/views/__init__.py | 3 ++- drdown/users/views/view_user.py | 6 +++++- 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/drdown/users/templates/users/patient_list.html b/drdown/users/templates/users/patient_list.html index 6fa73848..a9da84f9 100644 --- a/drdown/users/templates/users/patient_list.html +++ b/drdown/users/templates/users/patient_list.html @@ -9,7 +9,7 @@

{% trans "Select a patient" %}

{% for patient in patient_list %} - +
{% if patient.user.photo %} diff --git a/drdown/users/urls.py b/drdown/users/urls.py index 6683c68e..07c303f3 100644 --- a/drdown/users/urls.py +++ b/drdown/users/urls.py @@ -30,10 +30,16 @@ regex=r'^~delete/', view=views.UserDeleteView.as_view(), name='delete' - ), + ), url( regex=r'^~patients/$', view=views.PatientListView.as_view(), name='patient_list' ), + url( + regex=r'^~patients/(?P[\w.@+-]+)$', + view=views.PatientDetailView.as_view(), + name='patient_medical_sheet' + ), + ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) diff --git a/drdown/users/views/__init__.py b/drdown/users/views/__init__.py index 7ec037a5..29ea52a9 100644 --- a/drdown/users/views/__init__.py +++ b/drdown/users/views/__init__.py @@ -1,5 +1,6 @@ from .view_user import ( UserDetailView, UserRedirectView, UserUpdateView, UserListView, - UserDeleteView, PatientListView + UserDeleteView, PatientListView, + PatientDetailView ) diff --git a/drdown/users/views/view_user.py b/drdown/users/views/view_user.py index 0280b8f2..3c4bfaf9 100644 --- a/drdown/users/views/view_user.py +++ b/drdown/users/views/view_user.py @@ -3,6 +3,7 @@ from django.contrib.auth.decorators import user_passes_test from django.utils.decorators import method_decorator from django.urls import reverse +from django.shortcuts import redirect from django.views.generic import (DetailView, ListView, RedirectView, UpdateView, DeleteView) from django.urls import reverse_lazy @@ -143,7 +144,7 @@ def get(self, request, *args, **kwargs): if hasattr(request.user, 'patient'): # redirect user_patient to the checklist detail view url = reverse( - viewname='careline:checklist_detail', + viewname='users:patient_medical_sheet', kwargs={'username': request.user.username} ) return redirect(url) @@ -178,3 +179,6 @@ def get_context_data(self, **kwargs): return context + +class PatientDetailView(DetailView): + model = Patient From 017c9753f3b2447a3271da42b05949dad304dd8d Mon Sep 17 00:00:00 2001 From: guilherme1guy Date: Wed, 2 May 2018 15:05:37 -0300 Subject: [PATCH 055/271] Changing patient ListView The redirects and context passed to template were modified to suit the new page Co-authored-by: joberth rogers --- drdown/users/views/view_user.py | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/drdown/users/views/view_user.py b/drdown/users/views/view_user.py index 3c4bfaf9..e86c590d 100644 --- a/drdown/users/views/view_user.py +++ b/drdown/users/views/view_user.py @@ -142,20 +142,13 @@ def get(self, request, *args, **kwargs): return redirect(url) if hasattr(request.user, 'patient'): - # redirect user_patient to the checklist detail view + # redirect user_patient to the its medical sheet view url = reverse( viewname='users:patient_medical_sheet', kwargs={'username': request.user.username} ) return redirect(url) - if not hasattr(request.user, 'responsible'): - url = reverse( - viewname='users:detail', - kwargs={'username': request.user.username} - ) - return redirect(url) - return super().get(request, *args, **kwargs) def get_queryset(self, *args, **kwargs): @@ -173,9 +166,12 @@ def get_context_data(self, **kwargs): context = super().get_context_data(**kwargs) user = self.request.user - patients = Patient.objects.filter(responsible=user.responsible) + context['user'] = user + - context['patient_list'] = patients + if hasattr(user, 'responsible'): + patients = Patient.objects.filter(responsible=user.responsible) + context['patient_list'] = patients return context From 1c8bcfb4d4a6447929229dc8e4eb9c12a2722d8a Mon Sep 17 00:00:00 2001 From: Daniel Maike Date: Wed, 2 May 2018 18:09:05 +0000 Subject: [PATCH 056/271] Adding translations Adding translations referring to the vaccine schedule Co-authored-by: Elias Bernardo --- .../locale/pt_BR/LC_MESSAGES/django.po | 47 +- .../core/locale/pt_BR/LC_MESSAGES/django.po | 441 +++++++++++++++++- 2 files changed, 445 insertions(+), 43 deletions(-) diff --git a/drdown/careline/locale/pt_BR/LC_MESSAGES/django.po b/drdown/careline/locale/pt_BR/LC_MESSAGES/django.po index 8cc8bbe2..25eac4f6 100644 --- a/drdown/careline/locale/pt_BR/LC_MESSAGES/django.po +++ b/drdown/careline/locale/pt_BR/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-04-27 21:38+0000\n" +"POT-Creation-Date: 2018-05-02 17:50+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -101,59 +101,63 @@ msgstr "Linha de Cuidado" msgid "Name: " msgstr "Nome: " -#: drdown/careline/templates/careline/checklist_detail.html:107 -#: drdown/careline/templates/careline/checklist_detail.html:109 -#: drdown/careline/templates/careline/checklist_detail.html:111 +#: drdown/careline/templates/careline/checklist_detail.html:105 +msgid "Vaccine Schedule" +msgstr "Calendário de Vacinas" + +#: drdown/careline/templates/careline/checklist_detail.html:108 +#: drdown/careline/templates/careline/checklist_detail.html:110 +#: drdown/careline/templates/careline/checklist_detail.html:112 msgid "Age: " msgstr "Idade: " -#: drdown/careline/templates/careline/checklist_detail.html:107 -#: drdown/careline/templates/careline/checklist_detail.html:128 +#: drdown/careline/templates/careline/checklist_detail.html:108 +#: drdown/careline/templates/careline/checklist_detail.html:130 msgid "Newborn" msgstr "Recém-Nascido" -#: drdown/careline/templates/careline/checklist_detail.html:109 +#: drdown/careline/templates/careline/checklist_detail.html:110 msgid "Less than 1 year old" msgstr "Menos de 1 ano de idade" -#: drdown/careline/templates/careline/checklist_detail.html:114 +#: drdown/careline/templates/careline/checklist_detail.html:115 #: drdown/careline/templates/careline/checklist_list.html:20 msgid "SES: " msgstr "SES: " -#: drdown/careline/templates/careline/checklist_detail.html:121 +#: drdown/careline/templates/careline/checklist_detail.html:123 msgid "AGE" msgstr "IDADE" -#: drdown/careline/templates/careline/checklist_detail.html:127 +#: drdown/careline/templates/careline/checklist_detail.html:129 msgid "Interventions / Evaluation" msgstr "Intervenções / Avaliação" -#: drdown/careline/templates/careline/checklist_detail.html:130 +#: drdown/careline/templates/careline/checklist_detail.html:132 msgid "Six Months" msgstr "Seis Meses" -#: drdown/careline/templates/careline/checklist_detail.html:133 +#: drdown/careline/templates/careline/checklist_detail.html:135 msgid "One Year" msgstr "Um Ano" -#: drdown/careline/templates/careline/checklist_detail.html:136 +#: drdown/careline/templates/careline/checklist_detail.html:138 msgid "Two Years" msgstr "Dois Anos" -#: drdown/careline/templates/careline/checklist_detail.html:139 +#: drdown/careline/templates/careline/checklist_detail.html:141 msgid "Three Years" msgstr "Três Anos" -#: drdown/careline/templates/careline/checklist_detail.html:142 +#: drdown/careline/templates/careline/checklist_detail.html:144 msgid "Five Years" msgstr "Cinco Anos" -#: drdown/careline/templates/careline/checklist_detail.html:145 +#: drdown/careline/templates/careline/checklist_detail.html:147 msgid "Six to Ten Years" msgstr "Seis a Dez Anos" -#: drdown/careline/templates/careline/checklist_detail.html:345 +#: drdown/careline/templates/careline/checklist_detail.html:347 msgid "" "* Routine as suggested and, if necessary, when initiating physical " "examination or surgical procedure with cervical manipulation." @@ -161,7 +165,7 @@ msgstr "" "* Rotina como sugerido e, se preciso, ao iniciar atividade física ou em " "procedimento cirúrgico com manuseio cervical." -#: drdown/careline/templates/careline/checklist_detail.html:349 +#: drdown/careline/templates/careline/checklist_detail.html:351 msgid "" "** Thyrogram: TSH, free T4. For antithyroid antibodies, routinely request " "between 9 and 12 years or when needed." @@ -169,15 +173,15 @@ msgstr "" "** Tireograma: TSH, T4 livre. Para os anticorpos antitiroidiano, solicitar " "como rotina entre 9 e 12 anos ou quando necessário." -#: drdown/careline/templates/careline/checklist_detail.html:353 +#: drdown/careline/templates/careline/checklist_detail.html:355 msgid "Required" msgstr "Obrigatório" -#: drdown/careline/templates/careline/checklist_detail.html:354 +#: drdown/careline/templates/careline/checklist_detail.html:356 msgid "When Needed" msgstr "Quando Necessário" -#: drdown/careline/templates/careline/checklist_detail.html:355 +#: drdown/careline/templates/careline/checklist_detail.html:357 msgid "Done" msgstr "Feito" @@ -186,7 +190,6 @@ msgid "There are no patients for this user." msgstr "Não há pacientes para este usuário." #: drdown/careline/views/view_checklist.py:184 -#| msgid "Error: You cannot change data on this form." msgid "" "Error: You cannot change data on this form. You need to be at least 13 years " "old." diff --git a/drdown/core/locale/pt_BR/LC_MESSAGES/django.po b/drdown/core/locale/pt_BR/LC_MESSAGES/django.po index 35fc1e88..a27fd93e 100644 --- a/drdown/core/locale/pt_BR/LC_MESSAGES/django.po +++ b/drdown/core/locale/pt_BR/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-04-28 01:16+0000\n" +"POT-Creation-Date: 2018-05-02 17:50+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -407,7 +407,7 @@ msgstr "Eventos" #: drdown/core/templates/core/base.html:84 #: drdown/core/templates/core/base.html:92 msgid "Care Line" -msgstr "" +msgstr "Linha de Cuidado" #: drdown/core/templates/core/base.html:87 msgid "My Patient" @@ -473,8 +473,8 @@ msgid "" "communicate with the doctor and visualize general information." msgstr "" "Dr. Down é uma ferramenta de gerenciamento para o CRIS DOWN (Centro de " -"Referência em Síndrome de Down) que possibilita agendar consultas, " -"comunicar-se com o médico e visualizar informações." +"Referência em Síndrome de Down) que possibilita agendar consultas, comunicar-" +"se com o médico e visualizar informações." #: drdown/core/templates/core/home.html:39 msgid "" @@ -503,24 +503,24 @@ msgid "Frequently Asked Questions (FAQ)" msgstr "Dúvidas Frequentes" #: drdown/core/templates/core/info.html:37 -#: drdown/core/templates/core/info.html:96 +#: drdown/core/templates/core/info.html:98 msgid "What can be done to prevent Down's Syndrome?" msgstr "Como prevenir a Síndrome de Down?" #: drdown/core/templates/core/info.html:40 -#: drdown/core/templates/core/info.html:105 +#: drdown/core/templates/core/info.html:107 msgid "Is Down Syndrome a Disease? Can I catch it during my life?" msgstr "" "A Síndrome de Down é uma doença? Eu posso pegar/desenvolver ela durante " "minha vida?" #: drdown/core/templates/core/info.html:41 -#: drdown/core/templates/core/info.html:115 +#: drdown/core/templates/core/info.html:117 msgid "How can I identify Down Syndrome?" msgstr "Como posso identificar a Síndrome de Down?" #: drdown/core/templates/core/info.html:42 -#: drdown/core/templates/core/info.html:125 +#: drdown/core/templates/core/info.html:127 msgid "How far does the autonomy of a child with Down syndrome develop?" msgstr "" "Até onde se desenvolve a autonomia de uma criança com Síndrome de Down?" @@ -606,7 +606,7 @@ msgstr "" msgid "Frequently Asked Questions" msgstr "Dúvidas Frequentes" -#: drdown/core/templates/core/info.html:99 +#: drdown/core/templates/core/info.html:101 msgid "" "Even though the chance of Down's syndrome increases according to the age " "range of the child's parents, Down's syndrome is not caused by the parents, " @@ -620,7 +620,7 @@ msgstr "" "Essa síndrome afeta pessoas de todas as raças, níveis de estudo, classes " "sociais e outros." -#: drdown/core/templates/core/info.html:108 +#: drdown/core/templates/core/info.html:110 msgid "" "Down Syndrome is not a disease, just a condition that affects the life of an " "individual since birth and requires greater attention and care from the " @@ -630,7 +630,7 @@ msgstr "" "um indivíduo desde o seu nascimento, o que exige uma maior atenção e cuidado " "por parte dos pais e familiares." -#: drdown/core/templates/core/info.html:118 +#: drdown/core/templates/core/info.html:120 msgid "" "Down Syndrome can be detected during pregnancy. You should see a doctor for " "the diagnosis." @@ -638,7 +638,7 @@ msgstr "" "A Síndrome de Down pode ser detectada durante a gestação. Deve-se procurar " "um médico para que o diagnóstico seja feito." -#: drdown/core/templates/core/info.html:128 +#: drdown/core/templates/core/info.html:130 msgid "" "There is no fixed limit that represents a developmental apex of a child with " "Down Syndrome. It is common for medical monitoring and the help of family " @@ -649,19 +649,418 @@ msgstr "" "a ajuda dos familiares ou responsáveis facilitem o desenvolvimento da " "criança." -#: drdown/core/templates/core/info.html:137 +#: drdown/core/templates/core/info.html:139 msgid "Further reading" msgstr "Leituras complementares" -msgid "Hey! You have procedures to be made." -msgstr "Oi! Você tem procedimentos que precisam ser feitos." +#: drdown/core/templates/core/info.html:144 +#: drdown/core/templates/core/vaccine_schedule.html:19 +#, fuzzy +#| msgid "My Schedule" +msgid "Vaccine Schedule" +msgstr "Calendário de Vacinas" + +#: drdown/core/templates/core/vaccine_schedule.html:25 +#: drdown/core/templates/core/vaccine_schedule.html:297 +msgid "Vaccines" +msgstr "Vacinas" + +#: drdown/core/templates/core/vaccine_schedule.html:26 +#: drdown/core/templates/core/vaccine_schedule.html:322 +msgid "OF BIRTH TO THE 10 YEARS OF AGE" +msgstr "DO NASCIMENTO AOS 10 ANOS DE IDADE" + +#: drdown/core/templates/core/vaccine_schedule.html:27 +#: drdown/core/templates/core/vaccine_schedule.html:323 +msgid "ADOLESCENT" +msgstr "ADOLESCENTE" + +#: drdown/core/templates/core/vaccine_schedule.html:28 +#: drdown/core/templates/core/vaccine_schedule.html:324 +msgid "ADULT" +msgstr "ADULTO" + +#: drdown/core/templates/core/vaccine_schedule.html:29 +#: drdown/core/templates/core/vaccine_schedule.html:325 +msgid "OLD MAN" +msgstr "IDOSO" + +#: drdown/core/templates/core/vaccine_schedule.html:33 +#: drdown/core/templates/core/vaccine_schedule.html:298 +msgid "At Birth" +msgstr "Ao Nascer" + +#: drdown/core/templates/core/vaccine_schedule.html:34 +#: drdown/core/templates/core/vaccine_schedule.html:299 +msgid "1 Month" +msgstr "1 Mês" + +#: drdown/core/templates/core/vaccine_schedule.html:35 +#: drdown/core/templates/core/vaccine_schedule.html:300 +msgid "2 Months" +msgstr "2 Meses" + +#: drdown/core/templates/core/vaccine_schedule.html:36 +#: drdown/core/templates/core/vaccine_schedule.html:301 +msgid "3 Months" +msgstr "3 Meses" + +#: drdown/core/templates/core/vaccine_schedule.html:37 +#: drdown/core/templates/core/vaccine_schedule.html:302 +msgid "4 Months" +msgstr "4 Meses" + +#: drdown/core/templates/core/vaccine_schedule.html:38 +#: drdown/core/templates/core/vaccine_schedule.html:303 +msgid "5 Months" +msgstr "5 Meses" + +#: drdown/core/templates/core/vaccine_schedule.html:39 +#: drdown/core/templates/core/vaccine_schedule.html:304 +msgid "6 Months" +msgstr "6 Meses" + +#: drdown/core/templates/core/vaccine_schedule.html:40 +#: drdown/core/templates/core/vaccine_schedule.html:305 +msgid "7 Months" +msgstr "7 Meses" + +#: drdown/core/templates/core/vaccine_schedule.html:41 +#: drdown/core/templates/core/vaccine_schedule.html:306 +msgid "8 Months" +msgstr "8 Meses" + +#: drdown/core/templates/core/vaccine_schedule.html:42 +#: drdown/core/templates/core/vaccine_schedule.html:307 +msgid "9 Months" +msgstr "9 Meses" + +#: drdown/core/templates/core/vaccine_schedule.html:43 +#: drdown/core/templates/core/vaccine_schedule.html:308 +msgid "12 Months" +msgstr "12 Meses" + +#: drdown/core/templates/core/vaccine_schedule.html:44 +#: drdown/core/templates/core/vaccine_schedule.html:309 +msgid "15 Months" +msgstr "15 Meses" + +#: drdown/core/templates/core/vaccine_schedule.html:45 +#: drdown/core/templates/core/vaccine_schedule.html:310 +msgid "18 Months" +msgstr "18 Meses" + +#: drdown/core/templates/core/vaccine_schedule.html:46 +#: drdown/core/templates/core/vaccine_schedule.html:311 +msgid "24 Months" +msgstr "24 Meses" + +#: drdown/core/templates/core/vaccine_schedule.html:47 +#: drdown/core/templates/core/vaccine_schedule.html:312 +msgid "4 Years" +msgstr "4 Anos" + +#: drdown/core/templates/core/vaccine_schedule.html:48 +#: drdown/core/templates/core/vaccine_schedule.html:313 +msgid "5 Years" +msgstr "5 Anos" + +#: drdown/core/templates/core/vaccine_schedule.html:49 +#: drdown/core/templates/core/vaccine_schedule.html:314 +msgid "6 Years" +msgstr "6 Anos" + +#: drdown/core/templates/core/vaccine_schedule.html:50 +#: drdown/core/templates/core/vaccine_schedule.html:315 +msgid "9 Years" +msgstr "9 Anos" + +#: drdown/core/templates/core/vaccine_schedule.html:51 +#: drdown/core/templates/core/vaccine_schedule.html:316 +msgid "10 Years" +msgstr "10 Anos" + +#: drdown/core/templates/core/vaccine_schedule.html:52 +#: drdown/core/templates/core/vaccine_schedule.html:317 +msgid "11-19 Years" +msgstr "11-19 Anos" + +#: drdown/core/templates/core/vaccine_schedule.html:53 +#: drdown/core/templates/core/vaccine_schedule.html:318 +msgid "20-59 Years" +msgstr "20-59 Anos" + +#: drdown/core/templates/core/vaccine_schedule.html:54 +#: drdown/core/templates/core/vaccine_schedule.html:319 +msgid "60+ Years" +msgstr "60+ Anos" + +#: drdown/core/templates/core/vaccine_schedule.html:59 +msgid "BCG ID" +msgstr "BCG ID" + +#: drdown/core/templates/core/vaccine_schedule.html:60 +#: drdown/core/templates/core/vaccine_schedule.html:286 +msgid "One dose" +msgstr "Uma dose" + +#: drdown/core/templates/core/vaccine_schedule.html:61 +#: drdown/core/templates/core/vaccine_schedule.html:67 +#: drdown/core/templates/core/vaccine_schedule.html:91 +#: drdown/core/templates/core/vaccine_schedule.html:186 +#: drdown/core/templates/core/vaccine_schedule.html:218 +#: drdown/core/templates/core/vaccine_schedule.html:241 +msgid "Vaccinate the previously unvaccinated" +msgstr "Vacinar os não vacinados anteriormente" + +#: drdown/core/templates/core/vaccine_schedule.html:62 +msgid "Vaccinate people who contacted leprosy" +msgstr "Vacinar pessoas contactantes de hanseníase" + +#: drdown/core/templates/core/vaccine_schedule.html:65 +msgid "Hepatitis B" +msgstr "Hepatite B" + +#: drdown/core/templates/core/vaccine_schedule.html:66 +msgid "Three or four doses from birth" +msgstr "Três ou quatro doses a partir do nascimento" + +#: drdown/core/templates/core/vaccine_schedule.html:70 +msgid "Rotavirus" +msgstr "Rotavírus" + +#: drdown/core/templates/core/vaccine_schedule.html:73 +msgid "Two or three doses. Initiate vaccination before 15 weeks of age" +msgstr "Duas ou três doses. Iniciar vacinação antes das 15 semanas de vida" + +#: drdown/core/templates/core/vaccine_schedule.html:74 +#: drdown/core/templates/core/vaccine_schedule.html:290 +#: drdown/core/templates/core/vaccine_schedule.html:292 +msgid "CONTRAINDICATED" +msgstr "CONTRAINDICADA" + +#: drdown/core/templates/core/vaccine_schedule.html:77 +msgid "Bacterial triple (DTPw, DTPa, ou dTpa)" +msgstr "Tríplice bacteriana (DTPw, DTPa, ou dTpa)" + +#: drdown/core/templates/core/vaccine_schedule.html:80 +msgid "Four doses of DTPa or DTPw starting at 2 months of age" +msgstr "Quatro doses DTPa ou DTPw iniciando aos 2 meses de idade" + +#: drdown/core/templates/core/vaccine_schedule.html:82 +msgid "Reinforcement with DTPa, DTPw or dTpa" +msgstr "Reforço com DTPa, DTPw ou dTpa" + +#: drdown/core/templates/core/vaccine_schedule.html:84 +msgid "" +"Reinforcement with dTpa from 9 years of age and every 10 years (or, in the " +"case of dTpa, do dT)" +msgstr "" +"Reforço com dTpa a partir dos 9 anos de idade e a cada dez anos (ou, na " +"impossibilidade de dTpa, fazer dT)" + +#: drdown/core/templates/core/vaccine_schedule.html:87 +msgid "Haemophilus influenzae type b" +msgstr "Haemophilus influenzae tipo b" + +#: drdown/core/templates/core/vaccine_schedule.html:90 +msgid "Four doses starting at 2 months of age" +msgstr "Quatro doses iniciando aos 2 meses de idade" + +#: drdown/core/templates/core/vaccine_schedule.html:92 +#: drdown/core/templates/core/vaccine_schedule.html:99 +#: drdown/core/templates/core/vaccine_schedule.html:121 +#: drdown/core/templates/core/vaccine_schedule.html:131 +#: drdown/core/templates/core/vaccine_schedule.html:187 +#: drdown/core/templates/core/vaccine_schedule.html:219 +#: drdown/core/templates/core/vaccine_schedule.html:260 +msgid "Vaccinate people in special risk situations" +msgstr "Vacinar pessoas em situações especiais de risco" + +#: drdown/core/templates/core/vaccine_schedule.html:95 +msgid "Poliomyelitis (inactivated virus)" +msgstr "Poliomielite (vírus inativados)" + +#: drdown/core/templates/core/vaccine_schedule.html:98 +msgid "Five doses starting at 2 months of age" +msgstr "Cinco doses iniciando aos 2 meses de idade" + +#: drdown/core/templates/core/vaccine_schedule.html:102 +msgid "Pneumococcal conjugate" +msgstr "Pneumocócica conjugada" + +#: drdown/core/templates/core/vaccine_schedule.html:105 +msgid "Four doses starting at 2 months of age - VPC10 or VPC13" +msgstr "" + +#: drdown/core/templates/core/vaccine_schedule.html:106 +msgid "VPC10 or VPC13 - Vaccinate the previously unvaccinated" +msgstr "Quatro doses iniciando aos 2 meses de idade - VPC10 ou VPC13" + +#: drdown/core/templates/core/vaccine_schedule.html:107 +msgid "PCV13: vaccinating people in special risk situations" +msgstr "PCV13: vacinar pessoas em situações especiais de risco" + +#: drdown/core/templates/core/vaccine_schedule.html:108 +msgid "VPC13: one dose" +msgstr "VPC13: uma dose" + +#: drdown/core/templates/core/vaccine_schedule.html:111 +msgid "Meningococcal conjugate C or ACWY" +msgstr "Meningocócica conjugada C ou ACWY" + +#: drdown/core/templates/core/vaccine_schedule.html:115 +msgid "" +"With menACWY: three doses beginning at 3 months of age. Or with menC: two " +"doses beginning at 3 months of age" +msgstr "" +"Com menACWY: três doses iniciando aos 3 meses de idade. Ou com menC: duas " +"doses iniciando aos 3 meses de idade" + +#: drdown/core/templates/core/vaccine_schedule.html:116 +#: drdown/core/templates/core/vaccine_schedule.html:118 +#: drdown/core/templates/core/vaccine_schedule.html:129 +msgid "REINFORCEMENT" +msgstr "REFORÇO" + +#: drdown/core/templates/core/vaccine_schedule.html:120 +msgid "REINFORCED at age 11. For those not previously vaccinated: two doses" +msgstr "REFORÇO aos 11 anos. Para os não vacinados anteriormente: duas doses" + +#: drdown/core/templates/core/vaccine_schedule.html:124 +msgid "Meningococcal B" +msgstr "Meningocócica B" + +#: drdown/core/templates/core/vaccine_schedule.html:128 +msgid "Three doses beginning at 3 months of age" +msgstr "Três doses iniciando aos 3 meses de idade" + +#: drdown/core/templates/core/vaccine_schedule.html:130 +msgid "For those not previously vaccinated: two doses" +msgstr "Para os não vacinados anteriormente: duas doses" + +#: drdown/core/templates/core/vaccine_schedule.html:134 +msgid "Oral poliomyelitis (live attenuated virus)" +msgstr "Poliomielite oral (vírus vivos atenuados)" -msgid "Click here to check it" -msgstr "Clique aqui para conferir" +#: drdown/core/templates/core/vaccine_schedule.html:142 +msgid "NATIONAL VACCINATION CAMPAIGNS" +msgstr "CAMPANHAS NACIONAIS DE VACINAÇÃO" +#: drdown/core/templates/core/vaccine_schedule.html:151 +msgid "Influenza (flu)" +msgstr "Influenza (gripe)" + +#: drdown/core/templates/core/vaccine_schedule.html:158 +msgid "ANNUAL VACCINATION" +msgstr "VACINAÇÃO ANUAL" + +#: drdown/core/templates/core/vaccine_schedule.html:161 +msgid "Yellow fever" +msgstr "Febre amarela" + +#: drdown/core/templates/core/vaccine_schedule.html:171 msgid "" -"One or more of your patients needs attention. Some procedures may be " -"behind schedule." +"IN REGIONS WITH RECOMMENDATION OF VACCINATION (ACCORDING TO CLASSIFICATION " +"OF MS) - single dose at 9 months of age. Not previously vaccinated: single " +"dose" msgstr "" -"Um ou mais de seus pacientes precisa de atenção. Alguns procedimentos " -"podem estar atrasados." +"EM REGIÕES COM RECOMENDAÇÃO DE VACINAÇÃO (DE ACORDO COM CLASSIFICAÇÃO " +"DO MS) - dose única aos 9 meses de idade. Para não vacinados anteriormente: dose única" + +#: drdown/core/templates/core/vaccine_schedule.html:174 +msgid "Viral triple (measles, mumps and rubella)" +msgstr "Tríplice viral (sarampo,caxumba e rubéola)" + +#: drdown/core/templates/core/vaccine_schedule.html:185 +#: drdown/core/templates/core/vaccine_schedule.html:201 +#: drdown/core/templates/core/vaccine_schedule.html:217 +msgid "Two doses after 12 months" +msgstr "Duas doses a partir dos 12 meses" + +#: drdown/core/templates/core/vaccine_schedule.html:190 +msgid "Varicella (chickenpox)" +msgstr "Varicela (catapora)" + +#: drdown/core/templates/core/vaccine_schedule.html:202 +msgid "Vaccinate previously unvaccinated susceptibles" +msgstr "Vacinar os suscetíveis não vacinados anteriormente" + +#: drdown/core/templates/core/vaccine_schedule.html:206 +msgid "Hepatitis A" +msgstr "Hepatite A" + +#: drdown/core/templates/core/vaccine_schedule.html:222 +msgid "HPV" +msgstr "HPV" + +#: drdown/core/templates/core/vaccine_schedule.html:240 +msgid "Three doses for girls and boys" +msgstr "Três doses para meninas e meninos" + +#: drdown/core/templates/core/vaccine_schedule.html:242 +msgid "" +"Vaccinate the non-vaccinated formerly: at the discretion of the physician" +msgstr "" +"Vacinar os não vacinados anteriormente: a critério do médico" + +#: drdown/core/templates/core/vaccine_schedule.html:246 +msgid "Pneumococcal 23 courageous" +msgstr "Pneumocócica 23 valente" + +#: drdown/core/templates/core/vaccine_schedule.html:261 +msgid "Two doses at five-year intervals" +msgstr "Duas doses com intervalo de cinco anos" + +#: drdown/core/templates/core/vaccine_schedule.html:264 +msgid "Herpes zoster" +msgstr "Herpes zóster" + +#: drdown/core/templates/core/vaccine_schedule.html:285 +msgid "From 50 to 59 years old: at medical discretion" +msgstr "De 50 a 59 anos: a critério médico" + +#: drdown/core/templates/core/vaccine_schedule.html:289 +msgid "Dengue" +msgstr "Dengue" + +#: drdown/core/templates/core/vaccine_schedule.html:291 +msgid "" +"To vaccinate people aged 9 to 45 years previously infected with the virus " +"(seropositive) with three doses: 0 - 6 - 12 months" +msgstr "" +"Vacinar pessoas de 9 a 45 anos previamente infectadas pelo vírus " +"(soropositivas) com três doses: 0 - 6 - 12 meses" + +#: drdown/core/templates/core/vaccine_schedule.html:329 +msgid "Subtitle: " +msgstr "Legenda: " + +#: drdown/core/templates/core/vaccine_schedule.html:331 +msgid "Routine" +msgstr "Rotina" + +#: drdown/core/templates/core/vaccine_schedule.html:333 +msgid "Vaccinate Unvaccinated" +msgstr "Vacinar não vacinados" + +#: drdown/core/templates/core/vaccine_schedule.html:335 +msgid "Special Situations" +msgstr "Situações especiais" + +#: drdown/core/templates/core/vaccine_schedule.html:337 +msgid "Contraindicated" +msgstr "Contraindicada" + +#~ msgid "Hey! You have procedures to be made." +#~ msgstr "Oi! Você tem procedimentos que precisam ser feitos." + +#~ msgid "Click here to check it" +#~ msgstr "Clique aqui para conferir" + +#~ msgid "" +#~ "One or more of your patients needs attention. Some procedures may be " +#~ "behind schedule." +#~ msgstr "" +#~ "Um ou mais de seus pacientes precisa de atenção. Alguns procedimentos " +#~ "podem estar atrasados." From 8c7495354716f57f5dedba10004ea599739ab215 Mon Sep 17 00:00:00 2001 From: GeovanaRamos Date: Wed, 2 May 2018 15:15:15 -0300 Subject: [PATCH 057/271] Correcting appointments list Adding link to update Adding button to new appointment Changing search button Co-authored-by: Gabriela Medeiros --- .../appointments/appointment_list.html | 18 ++++++++++++------ drdown/appointments/views/view_appointment.py | 13 +++++++++++-- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/drdown/appointments/templates/appointments/appointment_list.html b/drdown/appointments/templates/appointments/appointment_list.html index 9c8f7f2f..9f683df6 100644 --- a/drdown/appointments/templates/appointments/appointment_list.html +++ b/drdown/appointments/templates/appointments/appointment_list.html @@ -10,14 +10,17 @@ {% block content %}
-

{% trans 'Appointments' %}

+ {% if request.user.employee %} +
{% trans "New Appointment" %} + {% endif %} +

{% trans 'Appointments' %}


{% url 'appointments:list_appointments' as url %} {% if request.path == url %} @@ -29,11 +32,14 @@

{% trans 'Appointments' %}

-
{{appointment.patient.user.name}}
+
{% trans 'Patient'%}: {{appointment.patient.user.name}}
+ {% trans 'Doctor'%}: {{ appointment.doctor.name}}
+ {% trans 'Especiality'%}: {{ appointment.speciality}}
+ {% trans 'Date'%}: {{ appointment.date}}
+ {% trans 'Time'%}: {{ appointment.time}}

{{appointment.motive}}

-

{% trans 'Date'%} {{ appointment.date_time}}

- {% trans "Edit" %} - {% trans "Change Status" %}

+ {% trans "Edit" %} + {% trans "Cancel" %}

{% empty %} diff --git a/drdown/appointments/views/view_appointment.py b/drdown/appointments/views/view_appointment.py index 05a050e8..688501bf 100644 --- a/drdown/appointments/views/view_appointment.py +++ b/drdown/appointments/views/view_appointment.py @@ -104,7 +104,6 @@ def get_queryset(self): class AppointmentCreateView(CreateView): model = Appointment - sucess_url = 'appointmentslist_appointments' template_name = 'appointments/appointment_form.html' fields = [ 'speciality', @@ -171,14 +170,24 @@ def get_queryset(self): class AppointmentUpdateView(UpdateView): model = Appointment + sucess_url = 'appointments:list_appointments' template_name = 'appointments/appointment_form.html' fields = ['speciality', 'shift', 'doctor', 'patient', - 'date_time', + 'date', + 'time', 'motive', ] + def get_success_url(self, **kwargs): + print("Entra em get_success_url") + success_create_url = reverse( + viewname='appointments:list_appointments', + ) + + return success_create_url + def get_object(self): appointment = Appointment.objects.get( pk=self.kwargs.get('appointment_pk') From 16ae541cd6a2a73397c93207f6d1152f89898826 Mon Sep 17 00:00:00 2001 From: GeovanaRamos Date: Wed, 2 May 2018 15:44:31 -0300 Subject: [PATCH 058/271] Adding update status view and correcting minor errors Adding view to cancel appointment Removing prints Renaming variables Change side bar year order list Co-authored-by: Gabriela Medeiros --- drdown/appointments/views/view_appointment.py | 38 ++++++++++++++----- 1 file changed, 29 insertions(+), 9 deletions(-) diff --git a/drdown/appointments/views/view_appointment.py b/drdown/appointments/views/view_appointment.py index 688501bf..8911370f 100644 --- a/drdown/appointments/views/view_appointment.py +++ b/drdown/appointments/views/view_appointment.py @@ -47,7 +47,7 @@ def get_list_of_years(range_years): if first == last: years.append(first) else: - for year in range(first, last + 1): + for year in range(last + 1, first, -1): years.append(year) return years @@ -123,10 +123,6 @@ def get_success_url(self, **kwargs): return success_create_url - def form_valid(self, form): - form.save() - return super(AppointmentCreateView, self).form_valid(form) - @staticmethod def get_health_team(): health_team = [] @@ -170,7 +166,6 @@ def get_queryset(self): class AppointmentUpdateView(UpdateView): model = Appointment - sucess_url = 'appointments:list_appointments' template_name = 'appointments/appointment_form.html' fields = ['speciality', 'shift', @@ -181,12 +176,11 @@ class AppointmentUpdateView(UpdateView): 'motive', ] def get_success_url(self, **kwargs): - print("Entra em get_success_url") - success_create_url = reverse( + success_update_url = reverse( viewname='appointments:list_appointments', ) - return success_create_url + return success_update_url def get_object(self): appointment = Appointment.objects.get( @@ -200,3 +194,29 @@ def get_context_data(self, **kwargs): context['health_team'] = AppointmentCreateView.get_health_team() context['patients'] = AppointmentCreateView.get_patients() return context + + +class AppointmentUpdateStatusView(UpdateView): + model = Appointment + template_name = 'appointments/appointment_confirm_cancel.html' + + def get_success_url(self, **kwargs): + success_update_status_url = reverse( + viewname='appointments:list_appointments', + ) + + return success_update_status_url + + def get_object(self): + appointment = Appointment.objects.get( + pk=self.kwargs.get('appointment_pk') + ) + return appointment + + def form_valid(self, form): + form.instance.status = _('Canceled') + form.save() + return super(AppointmentUpdateStatusView, self).form_valid(form) + + + From 6faed76d7a8a03a1eaeafc982cf1a7f6eb9c2f7a Mon Sep 17 00:00:00 2001 From: guilherme1guy Date: Wed, 2 May 2018 16:29:30 -0300 Subject: [PATCH 059/271] Frontend changes Adding button "My patients" on responsible user profile Fixing error in images display on patient list Co-authored-by: joberth rogers --- .../users/templates/users/patient_list.html | 29 ++++++++++--------- drdown/users/templates/users/user_detail.html | 6 ++++ 2 files changed, 22 insertions(+), 13 deletions(-) diff --git a/drdown/users/templates/users/patient_list.html b/drdown/users/templates/users/patient_list.html index a9da84f9..58b6d863 100644 --- a/drdown/users/templates/users/patient_list.html +++ b/drdown/users/templates/users/patient_list.html @@ -4,30 +4,33 @@ {% block content %}
-

{% trans "Select a patient" %}

+

{% trans "Select a patient" %}

+ +
-
+ {% for patient in patient_list %} + + + {% endblock content %} diff --git a/drdown/users/templates/users/user_detail.html b/drdown/users/templates/users/user_detail.html index 61905724..b9afd4de 100644 --- a/drdown/users/templates/users/user_detail.html +++ b/drdown/users/templates/users/user_detail.html @@ -269,8 +269,14 @@

{% trans 'Responsible' %}

+ + {% if user.responsible %} + {% trans 'My Patients' %} + {% endif %} + {% trans 'Confirm data' %} E-Mail + {% if user.patient %} {% trans 'My Medical Records' %} {% endif %} From d653249474fb5338a9037c867f4edfdbbf3d1338 Mon Sep 17 00:00:00 2001 From: guilherme1guy Date: Wed, 2 May 2018 16:30:49 -0300 Subject: [PATCH 060/271] Changes in patient view Simplifying get_query method Starting to implement patient search on list --- drdown/users/forms/__init__.py | 0 drdown/users/forms/users_forms.py | 12 ++++++++ .../users/templates/users/patient_list.html | 30 +++++++++++++------ drdown/users/views/view_user.py | 20 ++++++++++--- 4 files changed, 49 insertions(+), 13 deletions(-) create mode 100644 drdown/users/forms/__init__.py create mode 100644 drdown/users/forms/users_forms.py diff --git a/drdown/users/forms/__init__.py b/drdown/users/forms/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/drdown/users/forms/users_forms.py b/drdown/users/forms/users_forms.py new file mode 100644 index 00000000..fa77c911 --- /dev/null +++ b/drdown/users/forms/users_forms.py @@ -0,0 +1,12 @@ +from django import forms +from drdown.users.models.model_patient import Patient +from django.utils.translation import ugettext_lazy as _ + + +class PatientSearchForm(forms.Form): + + list_patient = forms.ModelChoiceField( + queryset=Patient.objects.all(), + required=False, + label=_('Search patient!') + ) diff --git a/drdown/users/templates/users/patient_list.html b/drdown/users/templates/users/patient_list.html index 58b6d863..182e0d72 100644 --- a/drdown/users/templates/users/patient_list.html +++ b/drdown/users/templates/users/patient_list.html @@ -6,6 +6,18 @@

{% trans "Select a patient" %}

+
+ {% if user.is_authenticated %} + +
+ + + +
+ + {% endif %} +
+
{% for patient in patient_list %} @@ -20,17 +32,17 @@

{% trans "Select a patient" %}

{% endif %}
-

{{ patient.user.name }}

-

{% trans 'SES: ' %} {{patient.ses}}

-
-
+

{{ patient.user.name }}

+

{% trans 'SES: ' %} {{patient.ses}}

+
+
- - {% empty %} -

{% trans 'There are no patients for this user.'%}

- {% endfor %} + + {% empty %} +

{% trans 'There are no patients for this user.'%}

+ {% endfor %} -
+
{% endblock content %} diff --git a/drdown/users/views/view_user.py b/drdown/users/views/view_user.py index e86c590d..742e394e 100644 --- a/drdown/users/views/view_user.py +++ b/drdown/users/views/view_user.py @@ -6,8 +6,17 @@ from django.shortcuts import redirect from django.views.generic import (DetailView, ListView, RedirectView, UpdateView, DeleteView) +from search_views.search import SearchListView +from search_views.filters import BaseFilter from django.urls import reverse_lazy from ..models import User, Patient, Employee, HealthTeam, Responsible +from ..forms.users_forms import PatientSearchForm + + +class PatientFilter(BaseFilter): + search_fields = { + 'patient': ['patient__id'], + } class UserDeleteView (LoginRequiredMixin, DeleteView): @@ -124,13 +133,16 @@ class UserListView(LoginRequiredMixin, ListView): slug_url_kwarg = 'username' -class PatientListView(ListView): +class PatientListView(SearchListView): # the List View for Checklists will list the patients that belong to the # current user (specialized as a responsible), only responsibles will # access this view - model = User + model = Patient template_name = 'users/patient_list.html' + paginate_by = 20 + form_class = PatientSearchForm + filter_class = PatientFilter def get(self, request, *args, **kwargs): @@ -155,10 +167,10 @@ def get_queryset(self, *args, **kwargs): user = self.request.user - queryset = None + queryset = super().get_queryset(*args, **kwargs) if hasattr(user, "responsible"): - queryset = Patient.objects.filter(responsible=user.responsible) + queryset.filter(responsible=user.responsible) return queryset From ac3c12c8e3f8ed5cb6d7191f6b64f62708da88bc Mon Sep 17 00:00:00 2001 From: guilherme1guy Date: Wed, 2 May 2018 17:39:43 -0300 Subject: [PATCH 061/271] Reorganizing views Separated PatientListView in 3. One Selector view and one specific to the responsible and another to the health team. Adds corresponding HTML files Apply search on healthteam view Co-authored-by: joberth rogers --- .../users/healthteam_patient_list.html | 44 ++++++++++ ...ist.html => responsible_patient_list.html} | 14 +--- drdown/users/urls.py | 12 ++- drdown/users/views/__init__.py | 5 +- drdown/users/views/view_user.py | 81 +++++++++++++------ 5 files changed, 114 insertions(+), 42 deletions(-) create mode 100644 drdown/users/templates/users/healthteam_patient_list.html rename drdown/users/templates/users/{patient_list.html => responsible_patient_list.html} (74%) diff --git a/drdown/users/templates/users/healthteam_patient_list.html b/drdown/users/templates/users/healthteam_patient_list.html new file mode 100644 index 00000000..3c7bc837 --- /dev/null +++ b/drdown/users/templates/users/healthteam_patient_list.html @@ -0,0 +1,44 @@ +{% extends "core/base.html" %} +{% load static i18n %} +{% block title %}{% trans "Select a patient" %}{% endblock %} + +{% block content %} +
+

{% trans "Select a patient" %}

+ +
+ + + + {% trans "Return" %} + +
+ +
+ + {% for patient in object_list %} + + +
+ + {% if patient.user.photo %} + + {% else %} + + {% endif %} + +
+

{{ patient.user.name }}

+

{% trans 'SES: ' %} {{patient.ses}}

+
+
+ +
+ {% empty %} +

{% trans 'There are no patients for this user.'%}

+ {% endfor %} + + +
+
+{% endblock content %} diff --git a/drdown/users/templates/users/patient_list.html b/drdown/users/templates/users/responsible_patient_list.html similarity index 74% rename from drdown/users/templates/users/patient_list.html rename to drdown/users/templates/users/responsible_patient_list.html index 182e0d72..f7ddaef2 100644 --- a/drdown/users/templates/users/patient_list.html +++ b/drdown/users/templates/users/responsible_patient_list.html @@ -6,21 +6,9 @@

{% trans "Select a patient" %}

-
- {% if user.is_authenticated %} - -
- - - -
- - {% endif %} -
-
- {% for patient in patient_list %} + {% for patient in object_list %}
diff --git a/drdown/users/urls.py b/drdown/users/urls.py index 07c303f3..fd2475e3 100644 --- a/drdown/users/urls.py +++ b/drdown/users/urls.py @@ -33,9 +33,19 @@ ), url( regex=r'^~patients/$', - view=views.PatientListView.as_view(), + view=views.PatientListViewSelector.as_view(), name='patient_list' ), + url( + regex=r'^~responsible/patients/$', + view=views.ResponsiblePatientListView.as_view(), + name='responsible_patient_list' + ), + url( + regex=r'^~healthteam/patients/$', + view=views.HealthTeamPatientListView.as_view(), + name='healthteam_patient_list' + ), url( regex=r'^~patients/(?P[\w.@+-]+)$', view=views.PatientDetailView.as_view(), diff --git a/drdown/users/views/__init__.py b/drdown/users/views/__init__.py index 29ea52a9..ad787129 100644 --- a/drdown/users/views/__init__.py +++ b/drdown/users/views/__init__.py @@ -1,6 +1,7 @@ from .view_user import ( UserDetailView, UserRedirectView, UserUpdateView, UserListView, - UserDeleteView, PatientListView, - PatientDetailView + UserDeleteView, ResponsiblePatientListView, + PatientDetailView, PatientListViewSelector, + HealthTeamPatientListView ) diff --git a/drdown/users/views/view_user.py b/drdown/users/views/view_user.py index 742e394e..22338429 100644 --- a/drdown/users/views/view_user.py +++ b/drdown/users/views/view_user.py @@ -5,7 +5,7 @@ from django.urls import reverse from django.shortcuts import redirect from django.views.generic import (DetailView, ListView, RedirectView, - UpdateView, DeleteView) + UpdateView, DeleteView, View) from search_views.search import SearchListView from search_views.filters import BaseFilter from django.urls import reverse_lazy @@ -15,7 +15,7 @@ class PatientFilter(BaseFilter): search_fields = { - 'patient': ['patient__id'], + 'list_patient': ['id'], } @@ -133,22 +133,13 @@ class UserListView(LoginRequiredMixin, ListView): slug_url_kwarg = 'username' -class PatientListView(SearchListView): - - # the List View for Checklists will list the patients that belong to the - # current user (specialized as a responsible), only responsibles will - # access this view - model = Patient - template_name = 'users/patient_list.html' - paginate_by = 20 - form_class = PatientSearchForm - filter_class = PatientFilter +class PatientListViewSelector(RedirectView): def get(self, request, *args, **kwargs): if not request.user.is_authenticated: # redirect not not authenticated to login screen - url = reverse( + self.url = reverse( viewname='account_login', ) return redirect(url) @@ -161,31 +152,69 @@ def get(self, request, *args, **kwargs): ) return redirect(url) + if hasattr(request.user, 'responsible'): + url = reverse( + viewname='users:responsible_patient_list', + ) + return redirect(url) + + if hasattr(request.user, 'healthteam'): + url = reverse( + viewname='users:responsible_patient_list', + ) + return redirect(url) + + +class ResponsiblePatientListView(ListView): + + # the List View will list the patients that belong to the + # current user (specialized as a responsible), only responsibles will + # access this view + model = Patient + template_name = 'users/responsible_patient_list.html' + paginate_by = 10 + + def get(self, request, *args, **kwargs): + + if not hasattr(request.user, 'responsible'): + # redirect user_patient to the its medical sheet view + url = reverse( + viewname='account_login', + ) + return redirect(url) + return super().get(request, *args, **kwargs) def get_queryset(self, *args, **kwargs): user = self.request.user + return super().get_queryset(*args, **kwargs).filter( + responsible=user.responsible + ) - queryset = super().get_queryset(*args, **kwargs) - - if hasattr(user, "responsible"): - queryset.filter(responsible=user.responsible) - return queryset +class HealthTeamPatientListView(SearchListView): - def get_context_data(self, **kwargs): - context = super().get_context_data(**kwargs) + # the List View will list patients and will allow + # for the current user (specialized as a healthteam), + # to search them - user = self.request.user - context['user'] = user + model = Patient + template_name = 'users/healthteam_patient_list.html' + form_class = PatientSearchForm + filter_class = PatientFilter + paginate_by = 20 + def get(self, request, *args, **kwargs): - if hasattr(user, 'responsible'): - patients = Patient.objects.filter(responsible=user.responsible) - context['patient_list'] = patients + if not hasattr(request.user, 'healthteam'): + # redirect user_patient to the its medical sheet view + url = reverse( + viewname='account_login', + ) + return redirect(url) - return context + return super().get(request, *args, **kwargs) class PatientDetailView(DetailView): From 33d95d1297c0532b3aef1e9c284922c20e0153ea Mon Sep 17 00:00:00 2001 From: guilherme1guy Date: Wed, 2 May 2018 19:30:45 -0300 Subject: [PATCH 062/271] Reorganizing tests It was needed because of changes in code Co-authored-by: joberth rogers --- .../tests/test_view_checklist_update.py | 9 +- .../tests/test_view_checklst_redirect.py | 49 +++++ .../careline/tests/test_view_checlist_list.py | 162 --------------- drdown/users/tests/test_view_user.py | 194 +++++++++++++++++- 4 files changed, 247 insertions(+), 167 deletions(-) create mode 100644 drdown/careline/tests/test_view_checklst_redirect.py delete mode 100644 drdown/careline/tests/test_view_checlist_list.py diff --git a/drdown/careline/tests/test_view_checklist_update.py b/drdown/careline/tests/test_view_checklist_update.py index d2abfccb..0530aacc 100644 --- a/drdown/careline/tests/test_view_checklist_update.py +++ b/drdown/careline/tests/test_view_checklist_update.py @@ -76,14 +76,15 @@ def test_get_redirect(self): self.client.force_login(user=self.user_responsible) - expected_url = reverse(viewname='careline:checklist_list') response = self.client.get( reverse(viewname="careline:checklist_update") ) - self.assertRedirects( - response=response, - expected_url=expected_url + expected_status_codes = [301, 302] + + self.assertIn( + response.status_code, + expected_status_codes ) def test_process_change(self): diff --git a/drdown/careline/tests/test_view_checklst_redirect.py b/drdown/careline/tests/test_view_checklst_redirect.py new file mode 100644 index 00000000..50cd6962 --- /dev/null +++ b/drdown/careline/tests/test_view_checklst_redirect.py @@ -0,0 +1,49 @@ +from test_plus.test import TestCase +from django.test.client import Client +from django.shortcuts import reverse +from django.utils import timezone + +from drdown.careline.models import Procedure +from drdown.users.models import Patient, Responsible, Employee + +from drdown.careline.views import ChecklistRedirectView + + +class TestViewChecklistRedirectView(TestCase): + """ + Test if the List View of Checklist is working correctly + """ + + def setUp(self): + """ + Runs before every test + """ + + self.user_responsible = self.make_user(username='resp') + + self.user_responsible.birthday = timezone.datetime(1950, 1, 1) + + self.user_responsible.save() + self.user_responsible.refresh_from_db() + + Responsible.objects.create( + user=self.user_responsible, + cpf="974.220.200-16" + ) + + def test_redirect(self): + + self.client.force_login(self.user_responsible) + + response = self.client.get( + path=reverse( + viewname='careline:checklist_list', + ), + follow=True + ) + + url = self.client.get( + path=reverse(viewname='users:patient_list') + ).url + + self.assertRedirects(response=response, expected_url=url) \ No newline at end of file diff --git a/drdown/careline/tests/test_view_checlist_list.py b/drdown/careline/tests/test_view_checlist_list.py deleted file mode 100644 index d473ff35..00000000 --- a/drdown/careline/tests/test_view_checlist_list.py +++ /dev/null @@ -1,162 +0,0 @@ -from test_plus.test import TestCase -from django.test.client import Client -from django.shortcuts import reverse -from django.utils import timezone - -from drdown.careline.models import Procedure -from drdown.users.models import Patient, Responsible, Employee - -from drdown.careline.views import ChecklistListView - - -class TestViewChecklistListView(TestCase): - """ - Test if the List View of Checklist is working correctly - """ - - def setUp(self): - """ - Runs before every test - """ - - self.user_responsible = self.make_user(username='resp') - - self.user_responsible.birthday = timezone.datetime(1950, 1, 1) - - self.user_responsible.save() - self.user_responsible.refresh_from_db() - - Responsible.objects.create( - user=self.user_responsible, - cpf="974.220.200-16" - ) - - self.user_patient1 = self.make_user(username='pat1') - - self.user_patient1.birthday = timezone.datetime(2000, 1, 1) - - Patient.objects.create( - ses="1234567", - user=self.user_patient1, - priority=1, - mother_name="Mae", - father_name="Pai", - ethnicity=3, - sus_number="12345678911", - civil_registry_of_birth="12345678911", - declaration_of_live_birth="12345678911", - responsible=self.user_responsible.responsible - ) - - self.user_patient1.refresh_from_db() - - self.user_patient2 = self.make_user(username='pat2') - - self.user_patient2.birthday = timezone.datetime(2000, 1, 1) - - Patient.objects.create( - ses="1234213", - user=self.user_patient2, - priority=1, - mother_name="Mae", - father_name="Pai", - ethnicity=3, - sus_number="12345633912", - civil_registry_of_birth="12345123911", - declaration_of_live_birth="1212338911", - responsible=self.user_responsible.responsible - ) - - self.client = Client() - self.view = ChecklistListView() - - def test_get_redirect_for_patient(self): - """ - Test if a patient is redirected for its checklist when accessing Checklist List View - """ - - self.client.force_login(self.user_patient1) - - response = self.client.get( - path=reverse( - viewname='careline:checklist_list', - ), - follow=True - ) - - url = reverse(viewname='careline:checklist_detail', kwargs={'username': self.user_patient1.username}) - - self.assertRedirects(response=response, expected_url=url) - - def test_get_redirect_for_not_authenticated(self): - """ - Test if a not authenticated user is redirected to login screen - """ - - response = self.client.get( - path=reverse( - viewname='careline:checklist_list', - ), - follow=True - ) - - url = reverse(viewname='account_login') - - self.assertRedirects(response=response, expected_url=url) - - def test_get_redirect_for_other_specializations_or_no_specialization(self): - """ - Test if a user that is not patient or responsible is redirected for its profile - when accessing Checklist List View - """ - - user = self.make_user(username='nope') - user.birthday = timezone.datetime(1950, 1, 1) - user.save() - - self.client.force_login(user) - - response = self.client.get( - path=reverse( - viewname='careline:checklist_list', - ), - follow=True - ) - - url = reverse(viewname='users:detail', kwargs={'username': user.username}) - - self.assertRedirects(response=response, expected_url=url) - - Employee.objects.create( - cpf="306.585.340-09", - user=user - ) - - user.refresh_from_db() - - response = self.client.get( - path=reverse( - viewname='careline:checklist_list', - ), - follow=True - ) - - url = reverse(viewname='users:detail', kwargs={'username': user.username}) - - self.assertRedirects(response=response, expected_url=url) - - def test_get_page_when_responsible(self): - """ - Test if the page loads when a responsible is the current user - """ - - self.client.force_login(self.user_responsible) - - response = self.client.get( - path=reverse( - viewname='careline:checklist_list', - ), - follow=True - ) - - self.assertEquals(response.status_code, 200) diff --git a/drdown/users/tests/test_view_user.py b/drdown/users/tests/test_view_user.py index ab8c8a10..c883bcac 100644 --- a/drdown/users/tests/test_view_user.py +++ b/drdown/users/tests/test_view_user.py @@ -2,8 +2,12 @@ from django.urls import reverse_lazy from django.test.client import Client from django.urls import reverse +from django.utils import timezone from test_plus.test import TestCase -from ..models import User +from ..models import ( + User, Responsible, Employee, + HealthTeam, Patient +) from ..views import ( UserRedirectView, UserUpdateView @@ -153,3 +157,191 @@ def test_not_logged_user_redirect_detail_view(self): self.assertEquals(response.status_code, 200) + +class TestPatientListViewSelector(TestCase): + """ + Test if the Selector of List View of user is working correctly + """ + + def setUp(self): + """ + Runs before every test + """ + + self.user_responsible = self.make_user(username='resp') + + self.user_responsible.birthday = timezone.datetime(1950, 1, 1) + + self.user_responsible.save() + self.user_responsible.refresh_from_db() + + Responsible.objects.create( + user=self.user_responsible, + cpf="974.220.200-16" + ) + + self.user_patient1 = self.make_user(username='pat1') + + self.user_patient1.birthday = timezone.datetime(2000, 1, 1) + + Patient.objects.create( + ses="1234567", + user=self.user_patient1, + priority=1, + mother_name="Mae", + father_name="Pai", + ethnicity=3, + sus_number="12345678911", + civil_registry_of_birth="12345678911", + declaration_of_live_birth="12345678911", + responsible=self.user_responsible.responsible + ) + + self.user_patient1.refresh_from_db() + + self.user_patient2 = self.make_user(username='pat2') + + self.user_patient2.birthday = timezone.datetime(2000, 1, 1) + + Patient.objects.create( + ses="1234213", + user=self.user_patient2, + priority=1, + mother_name="Mae", + father_name="Pai", + ethnicity=3, + sus_number="12345633912", + civil_registry_of_birth="12345123911", + declaration_of_live_birth="1212338911", + responsible=self.user_responsible.responsible + ) + + self.user_health_team = self.make_user() + self.user_health_team.birthday = timezone.datetime(2000, 1, 1) + + self.health_team = HealthTeam.objects.create( + cpf="057.641.271-65", + user=self.user_health_team, + speciality=HealthTeam.NEUROLOGY, + council_acronym=HealthTeam.CRM, + register_number="1234567", + registration_state=HealthTeam.DF, + ) + + + self.client = Client() + + def test_get_redirect_for_patient(self): + """ + Test if a patient is redirected for its medical follow-up sheet when accessing the List View + """ + + self.client.force_login(self.user_patient1) + + response = self.client.get( + path=reverse( + viewname='users:patient_list', + ), + follow=True + ) + + url = reverse( + viewname='careline:patient_medical_sheet', + kwargs={'username': self.user_patient1.username}, + follow=True + ) + + self.assertRedirects(response=response, expected_url=url) + + def test_get_redirect_for_not_authenticated(self): + """ + Test if a not authenticated user is redirected to login screen + """ + + response = self.client.get( + path=reverse( + viewname='users:patient_list', + ), + follow=True + ) + + url = reverse(viewname='account_login') + + self.assertRedirects(response=response, expected_url=url) + + def test_get_redirect_for_other_specializations_or_no_specialization(self): + """ + Test if a user that is not specialized or employee it is redirected for its profile + when accessing Checklist List View + """ + + user = self.make_user(username='nope') + user.birthday = timezone.datetime(1950, 1, 1) + user.save() + + self.client.force_login(user) + + response = self.client.get( + path=reverse(viewname='careline:checklist_list') + ) + + expected_status_codes = [301, 302] + + self.assertIn( + response.status_code, + expected_status_codes + ) + + Employee.objects.create( + cpf="306.585.340-09", + user=user + ) + + user.refresh_from_db() + + response = self.client.get( + path=reverse(viewname='careline:checklist_list') + ) + + expected_status_codes = [301, 302] + + self.assertIn( + response.status_code, + expected_status_codes + ) + + def test_get_redirect_for_healthteam(self): + """ + Test if the page loads when a health team is the current user + """ + + self.client.force_login(self.user_health_team) + + response = self.client.get( + path=reverse( + viewname='users:patient_list', + ), + follow=True + ) + + url = reverse(viewname='users:healthteam_patient_list') + + self.assertRedirects(response=response, expected_url=url) + + def test_get_redirect_for_responsible(self): + """ + Test if the page loads when a responsible is the current user + """ + + self.client.force_login(self.user_responsible) + + response = self.client.get( + path=reverse( + viewname='users:patient_list', + ), + follow=True + ) + + url = reverse(viewname='users:responsible_patient_list') + + self.assertRedirects(response=response, expected_url=url) \ No newline at end of file From a25b5298c07de770fb4fe7d2beae4bdd58b74807 Mon Sep 17 00:00:00 2001 From: guilherme1guy Date: Wed, 2 May 2018 19:34:02 -0300 Subject: [PATCH 063/271] Correcting errors in views Improves logic of get method on Patiten List View Selector (now the default logic applyes to non logged users) Add ordering field to HealthTeam Patient List View Removes pagination on Responsible Patient List View Change redirect on Checklist Redirect View to better use CBV and reverse_lazy (and optimizes imports) Co-authored-by: joberth rogers --- drdown/careline/views/view_checklist.py | 19 ++++--------------- drdown/users/views/view_user.py | 20 +++++++++++--------- 2 files changed, 15 insertions(+), 24 deletions(-) diff --git a/drdown/careline/views/view_checklist.py b/drdown/careline/views/view_checklist.py index b943b6bf..f84b52fe 100644 --- a/drdown/careline/views/view_checklist.py +++ b/drdown/careline/views/view_checklist.py @@ -1,38 +1,27 @@ -from django.shortcuts import get_object_or_404, render, redirect +from django.shortcuts import get_object_or_404, redirect from django.http import ( - HttpResponseRedirect, HttpResponse, HttpResponseForbidden, - HttpResponseServerError, - HttpResponsePermanentRedirect ) -from django.urls import reverse +from django.urls import reverse, reverse_lazy from django.utils.translation import ugettext_lazy as _ from drdown.careline.models import ( Checklist, - Procedure, - CheckItem ) from django.views.generic import ( DetailView, - ListView, - TemplateView, RedirectView ) -from drdown.users.models import User, Patient +from drdown.users.models import User class ChecklistRedirectView(RedirectView): # redirect this page to user list of # medical follow-up sheet page - url = 'users:patient_list' - permanent = True - - def get(self, request, *args, **kwargs): - return HttpResponsePermanentRedirect(reverse(self.url), request) + url = reverse_lazy('users:patient_list') class ChecklistDetailView(DetailView): diff --git a/drdown/users/views/view_user.py b/drdown/users/views/view_user.py index 22338429..c37ae929 100644 --- a/drdown/users/views/view_user.py +++ b/drdown/users/views/view_user.py @@ -137,13 +137,6 @@ class PatientListViewSelector(RedirectView): def get(self, request, *args, **kwargs): - if not request.user.is_authenticated: - # redirect not not authenticated to login screen - self.url = reverse( - viewname='account_login', - ) - return redirect(url) - if hasattr(request.user, 'patient'): # redirect user_patient to the its medical sheet view url = reverse( @@ -160,10 +153,17 @@ def get(self, request, *args, **kwargs): if hasattr(request.user, 'healthteam'): url = reverse( - viewname='users:responsible_patient_list', + viewname='users:healthteam_patient_list', ) return redirect(url) + # redirect not not authenticated or not specialized + # to login screen + url = reverse( + viewname='account_login', + ) + return redirect(url) + class ResponsiblePatientListView(ListView): @@ -172,7 +172,7 @@ class ResponsiblePatientListView(ListView): # access this view model = Patient template_name = 'users/responsible_patient_list.html' - paginate_by = 10 + def get(self, request, *args, **kwargs): @@ -204,6 +204,7 @@ class HealthTeamPatientListView(SearchListView): form_class = PatientSearchForm filter_class = PatientFilter paginate_by = 20 + ordering = ['user_id'] def get(self, request, *args, **kwargs): @@ -219,3 +220,4 @@ def get(self, request, *args, **kwargs): class PatientDetailView(DetailView): model = Patient + slug = 'username' From fbc96d1acacdcec1c673b98b6dbcb133a862539a Mon Sep 17 00:00:00 2001 From: guilherme1guy Date: Wed, 2 May 2018 20:04:59 -0300 Subject: [PATCH 064/271] Frontend changes Removes duplicated ":" Adds button to patient list to health team and to medical follow-up sheet on patient Fix some div errors Co-authored-by: joberth rogers --- .../users/healthteam_patient_list.html | 16 +++++------ drdown/users/templates/users/user_detail.html | 27 ++++++++++++------- 2 files changed, 26 insertions(+), 17 deletions(-) diff --git a/drdown/users/templates/users/healthteam_patient_list.html b/drdown/users/templates/users/healthteam_patient_list.html index 3c7bc837..15686da5 100644 --- a/drdown/users/templates/users/healthteam_patient_list.html +++ b/drdown/users/templates/users/healthteam_patient_list.html @@ -5,22 +5,22 @@ {% block content %}
+ {% if user.employee %} -
+

{% trans 'Employee' %}

@@ -107,10 +108,12 @@

{% trans 'Employee' %}

+
+ {% endif %} {% if user.healthteam %} -
+

{% trans 'Health Team' %}

@@ -151,6 +154,8 @@

{% trans 'Health Team' %}

+
+ {% endif %} {% if user.patient %} @@ -232,6 +237,7 @@

{% trans 'Patient' %}

+
{% endif %} {% if user.responsible %} @@ -262,24 +268,27 @@

{% trans 'Responsible' %}

- +
{% endif %} {% if object == request.user %}
From b9520011f54afecf030d05df6ccfb26d562d0974 Mon Sep 17 00:00:00 2001 From: GeovanaRamos Date: Wed, 2 May 2018 20:14:00 -0300 Subject: [PATCH 065/271] Implementing cancel appointment Adding template to confirm cancel Adding update view to change appointment status Adding link to cancel button Co-authored-by: Gabriela Medeiros --- .../appointments/appointment_confirm_cancel.html | 16 ++++++++++++++++ .../templates/appointments/appointment_list.html | 3 ++- drdown/appointments/urls.py | 8 +++++++- drdown/appointments/views/view_appointment.py | 2 ++ 4 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 drdown/appointments/templates/appointments/appointment_confirm_cancel.html diff --git a/drdown/appointments/templates/appointments/appointment_confirm_cancel.html b/drdown/appointments/templates/appointments/appointment_confirm_cancel.html new file mode 100644 index 00000000..9b0524d4 --- /dev/null +++ b/drdown/appointments/templates/appointments/appointment_confirm_cancel.html @@ -0,0 +1,16 @@ +{% extends "account/base.html" %} +{% load i18n %} +{% block head_title %}{% trans "Medical Record" %}{% endblock %} + +{% block inner %} +

{% trans 'Cancel Appointment' %}

+ +
+ {% csrf_token %} +

{% trans 'Are you sure you want to cancel this appointment?' %}

+ {% trans 'No' %} + +
+ + +{% endblock %} diff --git a/drdown/appointments/templates/appointments/appointment_list.html b/drdown/appointments/templates/appointments/appointment_list.html index 9f683df6..205e0fa9 100644 --- a/drdown/appointments/templates/appointments/appointment_list.html +++ b/drdown/appointments/templates/appointments/appointment_list.html @@ -37,9 +37,10 @@
{% trans 'Patient'%}: {{appointment.patient.user.name}}
{% trans 'Especiality'%}: {{ appointment.speciality}}
{% trans 'Date'%}: {{ appointment.date}}
{% trans 'Time'%}: {{ appointment.time}}
+ {% trans 'Status'%}: {{ appointment.status}}

{{appointment.motive}}

{% trans "Edit" %} - {% trans "Cancel" %}

+ {% trans "Cancel" %}

{% empty %} diff --git a/drdown/appointments/urls.py b/drdown/appointments/urls.py index 6d87bb50..0fd9a7b4 100644 --- a/drdown/appointments/urls.py +++ b/drdown/appointments/urls.py @@ -3,6 +3,7 @@ from drdown.appointments.views.view_appointment import AppointmentCreateView from drdown.appointments.views.view_appointment import AppointmentUpdateView from drdown.appointments.views.view_appointment import AppointmentMonthArchiveView +from drdown.appointments.views.view_appointment import AppointmentUpdateStatusView app_name = 'appointments' @@ -26,5 +27,10 @@ regex=r'^update/(?P\d+)/$', view=AppointmentUpdateView.as_view(), name='update_appointment' - ) + ), + url( + regex=r'^cancel/(?P\d+)/$', + view=AppointmentUpdateStatusView.as_view(), + name='update_status_appointment' + ), ] diff --git a/drdown/appointments/views/view_appointment.py b/drdown/appointments/views/view_appointment.py index 8911370f..5c6013c2 100644 --- a/drdown/appointments/views/view_appointment.py +++ b/drdown/appointments/views/view_appointment.py @@ -1,3 +1,4 @@ +from django.utils.translation import ugettext_lazy as _ from search_views.search import SearchListView from search_views.filters import BaseFilter from django.views.generic import CreateView @@ -199,6 +200,7 @@ def get_context_data(self, **kwargs): class AppointmentUpdateStatusView(UpdateView): model = Appointment template_name = 'appointments/appointment_confirm_cancel.html' + fields = [] def get_success_url(self, **kwargs): success_update_status_url = reverse( From 5a5baa59049a81f88a4a867e75eb902be03b6871 Mon Sep 17 00:00:00 2001 From: GeovanaRamos Date: Wed, 2 May 2018 20:18:48 -0300 Subject: [PATCH 066/271] Protecting buttons Checking if user is employee to edit/create/cancel appointment Co-authored-by: Gabriela Medeiros --- .../templates/appointments/appointment_list.html | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drdown/appointments/templates/appointments/appointment_list.html b/drdown/appointments/templates/appointments/appointment_list.html index 205e0fa9..b706b2e7 100644 --- a/drdown/appointments/templates/appointments/appointment_list.html +++ b/drdown/appointments/templates/appointments/appointment_list.html @@ -39,8 +39,10 @@
{% trans 'Patient'%}: {{appointment.patient.user.name}}
{% trans 'Time'%}: {{ appointment.time}}
{% trans 'Status'%}: {{ appointment.status}}

{{appointment.motive}}

- {% trans "Edit" %} - {% trans "Cancel" %}

+ {% if request.user.employee %} + {% trans "Edit" %} + {% trans "Cancel" %}

+ {% endif %}
{% empty %} From bfa4930a20aaea73e609e884c05800af414286c5 Mon Sep 17 00:00:00 2001 From: GeovanaRamos Date: Wed, 2 May 2018 20:59:48 -0300 Subject: [PATCH 067/271] Changing list of years and months Getting only years with appointments Getting only months with appointments Co-authored-by: Gabriela Medeiros --- drdown/appointments/views/view_appointment.py | 51 +++++-------------- 1 file changed, 14 insertions(+), 37 deletions(-) diff --git a/drdown/appointments/views/view_appointment.py b/drdown/appointments/views/view_appointment.py index 5c6013c2..ba85da45 100644 --- a/drdown/appointments/views/view_appointment.py +++ b/drdown/appointments/views/view_appointment.py @@ -28,49 +28,26 @@ class AppointmentListView(SearchListView): filter_class = AppointmentFilter @staticmethod - def get_year_range_of_appointment(): - first = 3000 - last = 0 + def get_list_of_years(): + years = [] for appointment in Appointment.objects.all(): - year = appointment.date.year - if year < first: - first = year - if year > last: - last = year - - return [first, last] + if appointment.date.year not in years: + years.append(appointment.date.year) + years.sort(reverse=True) + return years @staticmethod - def get_list_of_years(range_years): - years = [] - first = range_years[0] - last = range_years[1] - if first == last: - years.append(first) - else: - for year in range(last + 1, first, -1): - years.append(year) - return years + def get_list_of_months(): + months = [] + for appointment in Appointment.objects.all(): + if appointment.date.strftime("%B") not in months: + months.append(appointment.date.strftime("%B")) + return months @staticmethod def prepare_context(context): - months = [ - 'January', - 'February', - 'March', - 'April', - 'May', - 'June', - 'July', - 'August', - 'September', - 'October', - 'November', - 'December' - ] - range_years = AppointmentListView.get_year_range_of_appointment() - context['years'] = AppointmentListView.get_list_of_years(range_years) - context['months'] = months + context['years'] = AppointmentListView.get_list_of_years() + context['months'] = AppointmentListView.get_list_of_months() context['current_year'] = timezone.now().year return context From a1e7ed8612d2be35465bdebb240d51f59f7810e2 Mon Sep 17 00:00:00 2001 From: Elias Bernardo Date: Wed, 2 May 2018 21:21:29 -0300 Subject: [PATCH 068/271] Adjusting the table for better viewing The table was divided into 2 for better viewing Co-authored-by: Daniel Maike --- .../core/templates/core/vaccine_schedule.html | 258 ++++++++++++------ 1 file changed, 167 insertions(+), 91 deletions(-) diff --git a/drdown/core/templates/core/vaccine_schedule.html b/drdown/core/templates/core/vaccine_schedule.html index de93b7a2..9c46e3c4 100644 --- a/drdown/core/templates/core/vaccine_schedule.html +++ b/drdown/core/templates/core/vaccine_schedule.html @@ -24,34 +24,28 @@

{% trans 'Vaccines'%}

{% trans 'OF BIRTH TO THE 10 YEARS OF AGE'%} - {% trans 'ADOLESCENT'%} - {% trans 'ADULT'%} - {% trans 'OLD MAN'%} - {% trans 'At Birth'%} - {% trans '1 Month'%} - {% trans '2 Months'%} - {% trans '3 Months'%} - {% trans '4 Months'%} - {% trans '5 Months'%} - {% trans '6 Months'%} - {% trans '7 Months'%} - {% trans '8 Months'%} - {% trans '9 Months'%} - {% trans '12 Months'%} - {% trans '15 Months'%} - {% trans '18 Months'%} - {% trans '24 Months'%} - {% trans '4 Years'%} - {% trans '5 Years'%} - {% trans '6 Years'%} - {% trans '9 Years'%} - {% trans '10 Years'%} - {% trans '11-19 Years'%} - {% trans '20-59 Years'%} - {% trans '60+ Years'%} + {% trans 'Birth'%} + {% trans '1 M'%} + {% trans '2 M'%} + {% trans '3 M'%} + {% trans '4 M'%} + {% trans '5 M'%} + {% trans '6 M'%} + {% trans '7 M'%} + {% trans '8 M'%} + {% trans '9 M'%} + {% trans '12 M'%} + {% trans '15 M'%} + {% trans '18 M'%} + {% trans '24 M'%} + {% trans '4 Y'%} + {% trans '5 Y'%} + {% trans '6 Y'%} + {% trans '9 Y'%} + {% trans '10 Y'%} @@ -59,19 +53,19 @@ {% trans 'BCG ID'%} {% trans 'One dose'%} {% trans 'Vaccinate the previously unvaccinated'%} - {% trans 'Vaccinate people who contacted leprosy'%} + {% trans 'Vaccinate people who contacted leprosy'%} {% trans 'Hepatitis B'%} {% trans 'Three or four doses from birth'%} - {% trans 'Vaccinate the previously unvaccinated'%} + {% trans 'Vaccinate the previously unvaccinated'%} {% trans 'Rotavirus'%} {% trans 'Two or three doses. Initiate vaccination before 15 weeks of age'%} - {% trans 'CONTRAINDICATED'%} + {% trans 'CONTRAINDICATED'%} {% trans 'Bacterial triple (DTPw, DTPa, ou dTpa)'%} @@ -81,7 +75,7 @@ {% trans 'Reinforcement with DTPa, DTPw or dTpa'%} - {% trans 'Reinforcement with dTpa from 9 years of age and every 10 years (or, in the case of dTpa, do dT)'%} + {% trans 'Reinforcement with dTpa from 9 years of age and every 10 years (or, in the case of dTpa, do dT)'%} {% trans 'Haemophilus influenzae type b'%} @@ -89,14 +83,14 @@ {% trans 'Four doses starting at 2 months of age'%} {% trans 'Vaccinate the previously unvaccinated'%} - {% trans 'Vaccinate people in special risk situations'%} + {% trans 'Vaccinate people in special risk situations'%} {% trans 'Poliomyelitis (inactivated virus)'%} {% trans 'Five doses starting at 2 months of age'%} - {% trans 'Vaccinate people in special risk situations'%} + {% trans 'Vaccinate people in special risk situations'%} {% trans 'Pneumococcal conjugate'%} @@ -104,8 +98,7 @@ {% trans 'Four doses starting at 2 months of age - VPC10 or VPC13'%} {% trans 'VPC10 or VPC13 - Vaccinate the previously unvaccinated'%} - {% trans 'PCV13: vaccinating people in special risk situations'%} - {% trans 'VPC13: one dose'%} + {% trans 'PCV13: vaccinating people in special risk situations'%} {% trans 'Meningococcal conjugate C or ACWY'%} @@ -117,8 +110,6 @@ {% trans 'REINFORCEMENT'%} - {% trans 'REINFORCED at age 11. For those not previously vaccinated: two doses'%} - {% trans 'Vaccinate people in special risk situations'%} {% trans 'Meningococcal B'%} @@ -127,8 +118,7 @@ {% trans 'Three doses beginning at 3 months of age'%} {% trans 'REINFORCEMENT'%} - {% trans 'For those not previously vaccinated: two doses'%} - {% trans 'Vaccinate people in special risk situations'%} + {% trans 'For those not previously vaccinated: two doses'%} {% trans 'Oral poliomyelitis (live attenuated virus)'%} @@ -143,9 +133,6 @@ - - - {% trans 'Influenza (flu)'%} @@ -155,7 +142,7 @@ - {% trans 'ANNUAL VACCINATION'%} + {% trans 'ANNUAL VACCINATION'%} {% trans 'Yellow fever'%} @@ -168,7 +155,7 @@ - {% trans 'IN REGIONS WITH RECOMMENDATION OF VACCINATION (ACCORDING TO CLASSIFICATION OF MS) - single dose at 9 months of age. Not previously vaccinated: single dose'%} + {% trans 'IN REGIONS WITH RECOMMENDATION OF VACCINATION (ACCORDING TO CLASSIFICATION OF MS) - single dose at 9 months of age. Not previously vaccinated: single dose'%} {% trans 'Viral triple (measles, mumps and rubella)'%} @@ -183,8 +170,7 @@ {% trans 'Two doses after 12 months'%} - {% trans 'Vaccinate the previously unvaccinated'%} - {% trans 'Vaccinate people in special risk situations'%} + {% trans 'Vaccinate the previously unvaccinated'%} {% trans 'Varicella (chickenpox)'%} @@ -199,8 +185,7 @@ {% trans 'Two doses after 12 months'%} - {% trans 'Vaccinate previously unvaccinated susceptibles'%} - + {% trans 'Vaccinate previously unvaccinated susceptibles'%} {% trans 'Hepatitis A'%} @@ -215,8 +200,7 @@ {% trans 'Two doses after 12 months'%} - {% trans 'Vaccinate the previously unvaccinated'%} - {% trans 'Vaccinate people in special risk situations'%} + {% trans 'Vaccinate the previously unvaccinated'%} {% trans 'HPV'%} @@ -238,9 +222,6 @@ {% trans 'Three doses for girls and boys'%} - {% trans 'Vaccinate the previously unvaccinated'%} - {% trans 'Vaccinate the non-vaccinated formerly: at the discretion of the physician'%} - {% trans 'Pneumococcal 23 courageous'%} @@ -257,39 +238,12 @@ - {% trans 'Vaccinate people in special risk situations'%} - {% trans 'Two doses at five-year intervals'%} - - - {% trans 'Herpes zoster'%} - - - - - - - - - - - - - - - - - - - - - {% trans 'From 50 to 59 years old: at medical discretion'%} - {% trans 'One dose'%} + {% trans 'Vaccinate people in special risk situations'%} - {% trans 'Dengue'%} + {% trans 'Dengue'%} {% trans 'CONTRAINDICATED'%} - {% trans 'To vaccinate people aged 9 to 45 years previously infected with the virus (seropositive) with three doses: 0 - 6 - 12 months'%} - {% trans 'CONTRAINDICATED'%} + {% trans 'To vaccinate people aged 9 to 45 years previously infected with the virus (seropositive) with three doses: 0 - 6 - 12 months'%} @@ -314,30 +268,152 @@ {% trans '6 Years'%} {% trans '9 Years'%} {% trans '10 Years'%} - {% trans '11-19 Years'%} - {% trans '20-59 Years'%} - {% trans '60+ Years'%} {% trans 'OF BIRTH TO THE 10 YEARS OF AGE'%} - {% trans 'ADOLESCENT'%} - {% trans 'ADULT'%} - {% trans 'OLD MAN'%}
{% trans 'Subtitle: '%}
-
{% trans 'Routine'%}
+
{% trans 'Routine'%}
-
{% trans 'Vaccinate Unvaccinated'%}
+
{% trans 'Vaccinate Unvaccinated'%}
-
{% trans 'Special Situations'%}
+
{% trans 'Special Situations'%}
-
{% trans 'Contraindicated'%}
+
{% trans 'Contraindicated'%}
+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

{% trans 'Vaccines'%}

{% trans 'ADOLESCENT'%}{% trans 'ADULT'%}{% trans 'OLD MAN'%}
{% trans '11-19 Years'%}{% trans '20-59 Years'%}{% trans '60+ Years'%}
{% trans 'BCG ID'%}{% trans 'Vaccinate people who contacted leprosy'%}
{% trans 'Hepatitis B'%}{% trans 'Vaccinate the previously unvaccinated'%}
{% trans 'Rotavirus'%}{% trans 'CONTRAINDICATED'%}
{% trans 'Bacterial triple (DTPw, DTPa, ou dTpa)'%}{% trans 'Reinforcement with dTpa from 9 years of age and every 10 years (or, in the case of dTpa, do dT)'%}
{% trans 'Haemophilus influenzae type b'%}{% trans 'Vaccinate people in special risk situations'%}
{% trans 'Poliomyelitis (inactivated virus)'%}{% trans 'Vaccinate people in special risk situations'%}
{% trans 'Pneumococcal conjugate'%}{% trans 'PCV13: vaccinating people in special risk situations'%}{% trans 'VPC13: one dose'%}
{% trans 'Meningococcal conjugate C or ACWY'%}{% trans 'REINFORCED at age 11. For those not previously vaccinated: two doses'%}{% trans 'Vaccinate people in special risk situations'%}
{% trans 'Meningococcal B'%}{% trans 'For those not previously vaccinated: two doses'%}{% trans 'Vaccinate people in special risk situations'%}
{% trans 'Influenza (flu)'%}{% trans 'ANNUAL VACCINATION'%}
{% trans 'Yellow fever'%}{% trans 'IN REGIONS WITH RECOMMENDATION OF VACCINATION (ACCORDING TO CLASSIFICATION OF MS) - single dose at 9 months of age. Not previously vaccinated: single dose'%}
{% trans 'Viral triple (measles, mumps and rubella)'%}{% trans 'Vaccinate the previously unvaccinated'%}{% trans 'Vaccinate people in special risk situations'%}
{% trans 'Varicella (chickenpox)'%}{% trans 'Vaccinate previously unvaccinated susceptibles'%}
{% trans 'Hepatitis A'%}{% trans 'Vaccinate the previously unvaccinated'%}{% trans 'Vaccinate people in special risk situations'%}
{% trans 'HPV'%}{% trans 'Vaccinate the previously unvaccinated'%}{% trans 'Vaccinate the non-vaccinated formerly: at the discretion of the physician'%}
{% trans 'Pneumococcal 23 courageous'%}{% trans 'Vaccinate people in special risk situations'%}{% trans 'Two doses at five-year intervals'%}
{% trans 'Herpes zoster'%}{% trans 'From 50 to 59 years old: at medical discretion'%}{% trans 'One dose'%}
{% trans 'Dengue'%}{% trans 'To vaccinate people aged 9 to 45 years previously infected with the virus (seropositive) with three doses: 0 - 6 - 12 months'%}{% trans 'CONTRAINDICATED'%}

{% trans 'Vaccines'%}

{% trans '11-19 Years'%}{% trans '20-59 Years'%}{% trans '60+ Years'%}
{% trans 'ADOLESCENT'%}{% trans 'ADULT'%}{% trans 'OLD MAN'%}
{% trans 'Subtitle: '%}
{% trans 'Routine'%}
{% trans 'Vaccinate Unvaccinated'%}
{% trans 'Special Situations'%}
{% trans 'Contraindicated'%}


From 908314d35c9501ad258623a2c06046c167e49473 Mon Sep 17 00:00:00 2001 From: Joberth Rogers Date: Wed, 2 May 2018 22:16:19 -0300 Subject: [PATCH 069/271] The show details about patient There is a summary from user for inteligate to other pages Co-authored-by: Guilherme Guy --- .../users/templates/users/patient_detail.html | 32 +++++++++++++++++++ drdown/users/views/view_user.py | 18 +++++++++++ 2 files changed, 50 insertions(+) create mode 100644 drdown/users/templates/users/patient_detail.html diff --git a/drdown/users/templates/users/patient_detail.html b/drdown/users/templates/users/patient_detail.html new file mode 100644 index 00000000..be17bf41 --- /dev/null +++ b/drdown/users/templates/users/patient_detail.html @@ -0,0 +1,32 @@ +{% extends "core/base.html" %} +{% load static i18n %} +{% block title %}{% trans "Detail patient" %}{% endblock %} + +{% block css %} +{{block.super}} + +{% endblock %} + +{% block content %} + +
+ {% if view.related_patient.user.patient %} + {% if view.related_patient.user.photo %} + + {% else %} + + {% endif %} +
+
+
+
+
+
+
+ +
+ {% endif %} +
+ +{% endblock content %} + diff --git a/drdown/users/views/view_user.py b/drdown/users/views/view_user.py index c37ae929..de89d111 100644 --- a/drdown/users/views/view_user.py +++ b/drdown/users/views/view_user.py @@ -221,3 +221,21 @@ def get(self, request, *args, **kwargs): class PatientDetailView(DetailView): model = Patient slug = 'username' + template_name = 'users/patient_detail.html' + + slug_url_kwarg = 'username' + + def get_object(self): + # Only get the User record for the user making the request + return User.objects.get(username=self.request.user.username) + + def related_patient(self): + user = User.objects.get( + username=self.kwargs.get('username') + ) + patient = Patient.objects.get( + user=user + ) + return patient + + From 7164b999627b3aad6c2700dfa9d41480932ea6ef Mon Sep 17 00:00:00 2001 From: Gabriela Medeiros Date: Wed, 2 May 2018 23:04:37 -0300 Subject: [PATCH 070/271] Editing create form Adding size attribute in doctor and patient field Co-authored-by: Geovana Ramos --- .../templates/appointments/appointment_form.html | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drdown/appointments/templates/appointments/appointment_form.html b/drdown/appointments/templates/appointments/appointment_form.html index f7abacad..2474d92c 100644 --- a/drdown/appointments/templates/appointments/appointment_form.html +++ b/drdown/appointments/templates/appointments/appointment_form.html @@ -35,8 +35,7 @@

{% trans "New Appointment" %}


- {% for doctor in health_team %} {% endfor %} @@ -45,8 +44,7 @@

{% trans "New Appointment" %}


- {% for patient in patients %} {% endfor %} From 228a7e735638ca9d223436b9fc9ea1904911c1df Mon Sep 17 00:00:00 2001 From: Joberth Rogers Date: Wed, 2 May 2018 23:46:27 -0300 Subject: [PATCH 071/271] Correcting front-end Detail user buttons now is formated Guilherme Guy --- drdown/users/templates/users/user_detail.html | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/drdown/users/templates/users/user_detail.html b/drdown/users/templates/users/user_detail.html index 91292fa6..526f1d24 100644 --- a/drdown/users/templates/users/user_detail.html +++ b/drdown/users/templates/users/user_detail.html @@ -266,31 +266,31 @@

{% trans 'Responsible' %}

{% endfor %} -
-
- + {% endif %} {% if object == request.user %} -
-
- - {% if user.responsible or user.healthteam%} - {% trans 'My Patients' %} - {% endif %} +
+
From de41c7449d6d758ed68e1555fbda9384a9fbd000 Mon Sep 17 00:00:00 2001 From: Gabriela Medeiros Date: Wed, 2 May 2018 23:52:52 -0300 Subject: [PATCH 072/271] Editing appointment update template Showing field when it exists Co-authored-by: Geovana Ramos --- .../appointments/appointment_form.html | 110 +++++++++++++----- 1 file changed, 83 insertions(+), 27 deletions(-) diff --git a/drdown/appointments/templates/appointments/appointment_form.html b/drdown/appointments/templates/appointments/appointment_form.html index 2474d92c..fe217b84 100644 --- a/drdown/appointments/templates/appointments/appointment_form.html +++ b/drdown/appointments/templates/appointments/appointment_form.html @@ -11,62 +11,118 @@

{% trans "New Appointment" %}

-
+


-
- + + {% if object.date %} + + {% else %} + + {% endif %}
-
- + + {% if object.time %} + + {% else %} + + {% endif %}
-
- + + {% if object.motive %} + + {% else %} + + {% endif %}
From 8530cf3881b1d91c9e632b27c23294fe3c888c99 Mon Sep 17 00:00:00 2001 From: Gabriela Medeiros Date: Wed, 2 May 2018 23:55:32 -0300 Subject: [PATCH 073/271] Correcting list error Editing doctor name attribute Co-authored-by: Geovana Ramos --- .../appointments/templates/appointments/appointment_list.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drdown/appointments/templates/appointments/appointment_list.html b/drdown/appointments/templates/appointments/appointment_list.html index b706b2e7..7383ca15 100644 --- a/drdown/appointments/templates/appointments/appointment_list.html +++ b/drdown/appointments/templates/appointments/appointment_list.html @@ -33,7 +33,7 @@

{% trans 'Appointments' %}


{% trans 'Patient'%}: {{appointment.patient.user.name}}
- {% trans 'Doctor'%}: {{ appointment.doctor.name}}
+ {% trans 'Doctor'%}: {{ appointment.doctor.user.name}}
{% trans 'Especiality'%}: {{ appointment.speciality}}
{% trans 'Date'%}: {{ appointment.date}}
{% trans 'Time'%}: {{ appointment.time}}
From e3a1329d6581cb7aefc8f770b7b86c3b34bedb15 Mon Sep 17 00:00:00 2001 From: Joberth Rogers Date: Thu, 3 May 2018 00:22:47 -0300 Subject: [PATCH 074/271] Make correction and create buttons Corrections in template and create route buttons Co-authored-by: Guilherme Guy --- .../users/templates/users/healthteam_patient_list.html | 5 +++++ drdown/users/templates/users/patient_detail.html | 9 ++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/drdown/users/templates/users/healthteam_patient_list.html b/drdown/users/templates/users/healthteam_patient_list.html index 15686da5..e8544334 100644 --- a/drdown/users/templates/users/healthteam_patient_list.html +++ b/drdown/users/templates/users/healthteam_patient_list.html @@ -2,6 +2,11 @@ {% load static i18n %} {% block title %}{% trans "Select a patient" %}{% endblock %} +{% block css %} +{{block.super}} + +{% endblock %} + {% block content %}

{% trans "Select a patient" %}

diff --git a/drdown/users/templates/users/patient_detail.html b/drdown/users/templates/users/patient_detail.html index be17bf41..e47091f4 100644 --- a/drdown/users/templates/users/patient_detail.html +++ b/drdown/users/templates/users/patient_detail.html @@ -9,10 +9,15 @@ {% block content %} +
+

{% trans 'Patient: ' %} {{ view.related_patient.user.name }}

+ {% trans "Return" %} +
+
{% if view.related_patient.user.patient %} {% if view.related_patient.user.photo %} - + {% else %} {% endif %} @@ -26,6 +31,8 @@
{% endif %} + {% trans "Medical Records" %} + {% trans "Checklist" %}
{% endblock content %} From 70343de8c834971eeb0b2185a52b5f0ee8bcc831 Mon Sep 17 00:00:00 2001 From: guilherme1guy Date: Thu, 3 May 2018 10:53:37 -0300 Subject: [PATCH 075/271] Fixing error in test Co-authored-by: joberth rogers --- drdown/users/tests/test_view_user.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drdown/users/tests/test_view_user.py b/drdown/users/tests/test_view_user.py index c883bcac..a63b4b84 100644 --- a/drdown/users/tests/test_view_user.py +++ b/drdown/users/tests/test_view_user.py @@ -246,9 +246,8 @@ def test_get_redirect_for_patient(self): ) url = reverse( - viewname='careline:patient_medical_sheet', - kwargs={'username': self.user_patient1.username}, - follow=True + viewname='users:patient_medical_sheet', + kwargs={'username': self.user_patient1.username} ) self.assertRedirects(response=response, expected_url=url) From c9f8070d49c75eea51058891ba4a6c9ac0fe4952 Mon Sep 17 00:00:00 2001 From: Joberth Rogers Date: Thu, 3 May 2018 12:33:12 -0300 Subject: [PATCH 076/271] Modifies in view and template Detail patient template now correcting Corrections in healthteam template correction in photo medical records change in view Co-authored-by: Guilherme Guy --- .../medicalrecords/medicalrecord_list.html | 2 +- drdown/users/static/users/css/user_detail.css | 13 ++++++- .../users/healthteam_patient_list.html | 2 +- .../users/templates/users/patient_detail.html | 35 +++++++++++-------- drdown/users/views/view_user.py | 16 +-------- 5 files changed, 35 insertions(+), 33 deletions(-) diff --git a/drdown/medicalrecords/templates/medicalrecords/medicalrecord_list.html b/drdown/medicalrecords/templates/medicalrecords/medicalrecord_list.html index 05e24a06..56c94f34 100644 --- a/drdown/medicalrecords/templates/medicalrecords/medicalrecord_list.html +++ b/drdown/medicalrecords/templates/medicalrecords/medicalrecord_list.html @@ -34,7 +34,7 @@

{% trans 'There are no Medical Records for this patient.'%}

{% if view.related_patient.user.patient %} {% if view.related_patient.user.photo %} - + {% else %} {% endif %} diff --git a/drdown/users/static/users/css/user_detail.css b/drdown/users/static/users/css/user_detail.css index db5ed936..059e721d 100644 --- a/drdown/users/static/users/css/user_detail.css +++ b/drdown/users/static/users/css/user_detail.css @@ -46,4 +46,15 @@ .pr-13 { padding-right: 13rem; -} \ No newline at end of file +} + +.move-div{ + padding-left: 70px; + margin-top: 45px; + margin-top: -120px; +} + +.content-margin { + margin-top: 10rem; + margin-bottom: 0rem; +} diff --git a/drdown/users/templates/users/healthteam_patient_list.html b/drdown/users/templates/users/healthteam_patient_list.html index e8544334..fb251482 100644 --- a/drdown/users/templates/users/healthteam_patient_list.html +++ b/drdown/users/templates/users/healthteam_patient_list.html @@ -11,7 +11,7 @@

{% trans "Select a patient" %}

-
+ diff --git a/drdown/users/templates/users/patient_detail.html b/drdown/users/templates/users/patient_detail.html index e47091f4..0cc43ca5 100644 --- a/drdown/users/templates/users/patient_detail.html +++ b/drdown/users/templates/users/patient_detail.html @@ -5,34 +5,39 @@ {% block css %} {{block.super}} + {% endblock %} {% block content %}
-

{% trans 'Patient: ' %} {{ view.related_patient.user.name }}

- {% trans "Return" %} +

{% trans 'Patient: ' %} {{ view.object.user.name }}

+
- {% if view.related_patient.user.patient %} - {% if view.related_patient.user.photo %} - +
+ {% if view.object.user.patient %} + {% if view.object.user.photo %} + {% else %} - + {% endif %} -
-
-
-
-
-
-
+ + +
+
+
+
+
+
+
+
+
+
{% endif %} - {% trans "Medical Records" %} - {% trans "Checklist" %}
{% endblock content %} diff --git a/drdown/users/views/view_user.py b/drdown/users/views/view_user.py index de89d111..f563f62e 100644 --- a/drdown/users/views/view_user.py +++ b/drdown/users/views/view_user.py @@ -220,22 +220,8 @@ def get(self, request, *args, **kwargs): class PatientDetailView(DetailView): model = Patient - slug = 'username' template_name = 'users/patient_detail.html' - slug_url_kwarg = 'username' - - def get_object(self): - # Only get the User record for the user making the request - return User.objects.get(username=self.request.user.username) - - def related_patient(self): - user = User.objects.get( - username=self.kwargs.get('username') - ) - patient = Patient.objects.get( - user=user - ) - return patient + slug_field = 'user__username' From 8508e125fadf98fcb85884c29b3ad6f1aba361a5 Mon Sep 17 00:00:00 2001 From: Gabriela Medeiros Date: Thu, 3 May 2018 12:58:11 -0300 Subject: [PATCH 077/271] Modifying appointment form page Editing doctor and patient field size Adding appointment date min value Co-authored-by: Geovana Ramos --- .../templates/appointments/appointment_form.html | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drdown/appointments/templates/appointments/appointment_form.html b/drdown/appointments/templates/appointments/appointment_form.html index fe217b84..182eda6f 100644 --- a/drdown/appointments/templates/appointments/appointment_form.html +++ b/drdown/appointments/templates/appointments/appointment_form.html @@ -59,7 +59,7 @@

{% trans "New Appointment" %}


- {% if object.doctor %} {% for doctor in health_team %} @@ -78,7 +78,7 @@

{% trans "New Appointment" %}


- {% if object.patient %} {% for patient in patients %} @@ -97,13 +97,15 @@

{% trans "New Appointment" %}

{% if object.date %} - + {% else %} - + {% endif %}
+ +
{% if object.time %} From 5911aeb022906ae946145afb981bc0ace635346e Mon Sep 17 00:00:00 2001 From: Gabriela Medeiros Date: Thu, 3 May 2018 13:30:59 -0300 Subject: [PATCH 078/271] Filtering sidebar elements Sidebar only shows dates with appointments from request user Co-authored-by: Geovana Ramos --- drdown/appointments/views/view_appointment.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drdown/appointments/views/view_appointment.py b/drdown/appointments/views/view_appointment.py index ba85da45..8c648073 100644 --- a/drdown/appointments/views/view_appointment.py +++ b/drdown/appointments/views/view_appointment.py @@ -28,26 +28,26 @@ class AppointmentListView(SearchListView): filter_class = AppointmentFilter @staticmethod - def get_list_of_years(): + def get_list_of_years(request): years = [] - for appointment in Appointment.objects.all(): + for appointment in AppointmentListView.prepare_queryset(request): if appointment.date.year not in years: years.append(appointment.date.year) years.sort(reverse=True) return years @staticmethod - def get_list_of_months(): + def get_list_of_months(request): months = [] - for appointment in Appointment.objects.all(): + for appointment in AppointmentListView.prepare_queryset(request): if appointment.date.strftime("%B") not in months: months.append(appointment.date.strftime("%B")) return months @staticmethod - def prepare_context(context): - context['years'] = AppointmentListView.get_list_of_years() - context['months'] = AppointmentListView.get_list_of_months() + def prepare_context(context, request): + context['years'] = AppointmentListView.get_list_of_years(request) + context['months'] = AppointmentListView.get_list_of_months(request) context['current_year'] = timezone.now().year return context @@ -74,7 +74,7 @@ def prepare_queryset(request): def get_context_data(self, **kwargs): context = super(AppointmentListView, self).get_context_data(**kwargs) - return self.prepare_context(context) + return self.prepare_context(context, self.request) def get_queryset(self): return self.prepare_queryset(self.request) @@ -136,7 +136,7 @@ class AppointmentMonthArchiveView(MonthArchiveView): def get_context_data(self, **kwargs): context = super(AppointmentMonthArchiveView, self).get_context_data(**kwargs) - return AppointmentListView.prepare_context(context) + return AppointmentListView.prepare_context(context, self.request) def get_queryset(self): return AppointmentListView.prepare_queryset(self.request) From 64ff5b2720eee509b3a3fb2bb682fa1bc27d1353 Mon Sep 17 00:00:00 2001 From: GeovanaRamos Date: Thu, 3 May 2018 13:36:45 -0300 Subject: [PATCH 079/271] Adding all tests for model and correcting model Adding 100% test coverage for models Removing translation tag from constants values Co-authored-by: Gabriela Medeiros --- .../appointments/models/model_appointment.py | 24 +-- .../tests/test_model_appointment.py | 144 ++++++++++++++++++ 2 files changed, 156 insertions(+), 12 deletions(-) create mode 100644 drdown/appointments/tests/test_model_appointment.py diff --git a/drdown/appointments/models/model_appointment.py b/drdown/appointments/models/model_appointment.py index 45fc46fd..85796b57 100644 --- a/drdown/appointments/models/model_appointment.py +++ b/drdown/appointments/models/model_appointment.py @@ -40,15 +40,15 @@ class Appointment(models.Model): blank=True, ) - SPEECH_THERAPHY = _("Speech Therapy") - PSYCHOLOGY = _("Psychology") - PHYSIOTHERAPY = _("Physiotherapy") - OCCUPATIONAL_THERAPY = _("Occupational Therapy") - DOCTOR = _("Doctor") - CARDIOLOGY = _("Cardiology") - NEUROLOGY = _("Neurology") - PEDIATRICS = _("Pediatrics") - NURSING = _("Nursing") + SPEECH_THERAPHY = "Speech Therapy" + PSYCHOLOGY = "Psychology" + PHYSIOTHERAPY = "Physiotherapy" + OCCUPATIONAL_THERAPY = "Occupational Therapy" + DOCTOR = "Doctor" + CARDIOLOGY = "Cardiology" + NEUROLOGY = "Neurology" + PEDIATRICS = "Pediatrics" + NURSING = "Nursing" SPECIALITY_CHOICES = ( (SPEECH_THERAPHY, _('Speech Therapy')), @@ -83,9 +83,9 @@ class Appointment(models.Model): related_name='appointments', ) - SCHEDULED = _('Scheduled') - CANCELED = _('Canceled') - DONE = _('Done') + SCHEDULED = 'Scheduled' + CANCELED = 'Canceled' + DONE = 'Done' STATUS_CHOICES = ( (SCHEDULED, _('Scheduled')), diff --git a/drdown/appointments/tests/test_model_appointment.py b/drdown/appointments/tests/test_model_appointment.py new file mode 100644 index 00000000..01486274 --- /dev/null +++ b/drdown/appointments/tests/test_model_appointment.py @@ -0,0 +1,144 @@ +from test_plus.test import TestCase +from ..models.model_appointment import Appointment +from drdown.users.models.model_health_team import HealthTeam +from drdown.users.models.model_patient import Patient +from django.utils.translation import ugettext_lazy as _ +from django.utils import timezone +import datetime + + +class TestModelAppointment(TestCase): + + def setUp(self): + """ + This method will run before any test case. + """ + + self.user = self.make_user(username='user_1') + self.user2 = self.make_user(username='user_2') + self.patient = Patient.objects.create( + ses="1234567", + user=self.user, + priority=1, + mother_name="Mother", + father_name="Father", + ethnicity=3, + sus_number="12345678911", + civil_registry_of_birth="12345678911", + declaration_of_live_birth="12345678911" + ) + + self.doctor = HealthTeam.objects.create( + cpf="057.641.271-65", + user=self.user2, + speciality=HealthTeam.NEUROLOGY, + council_acronym=HealthTeam.CRM, + register_number="1234567", + registration_state=HealthTeam.DF, + ) + + self.appointment = Appointment.objects.create( + shift=Appointment.MORNING, + date="2040-08-10", + time="15:45", + motive='Some motive', + speciality=Appointment.SPEECH_THERAPHY, + doctor=self.doctor, + patient=self.patient, + status=Appointment.SCHEDULED + ) + + def test_one_to_one_relation(self): + """ + Test to verify if the relations work + """ + + self.assertIs(self.patient, self.appointment.patient) + self.assertIs(self.doctor, self.appointment.doctor) + + def test_delete_cascade_patient(self): + """ + Verify delete the relation objects + """ + + self.patient.delete() + with self.assertRaises(Appointment.DoesNotExist): + Appointment.objects.get() + + def test_delete_cascade_doctor(self): + """ + Verify delete the relation objects + """ + + self.doctor.delete() + with self.assertRaises(Appointment.DoesNotExist): + Appointment.objects.get() + + def test_save_shift_ok(self): + """ + Test to verify if shift is correctly passed + """ + + self.assertEquals(self.appointment.shift, Appointment.MORNING) + + def test_save_date_ok(self): + """ + Test to verify if date is correctly passed + """ + + self.assertEquals(self.appointment.date, '2040-08-10') + + def test_save_time_ok(self): + """ + Test to verify if time is correctly passed + """ + + self.assertEquals(self.appointment.time, "15:45") + + def test_save_motive_ok(self): + """ + Test to verify if motive is correctly passed + """ + + self.assertEquals(self.appointment.motive, 'Some motive') + + def test_save_patient_ok(self): + """ + Test to verify if patient is correctly passed + """ + + self.assertEquals(self.appointment.patient, self.patient) + + def test_save_doctor_ok(self): + """ + Test to verify if doctor is correctly passed + """ + + self.assertEquals(self.appointment.doctor, self.doctor) + + def test_save_status_ok(self): + """ + Test to verify if status is correctly passed + """ + + self.assertEquals(self.appointment.status, Appointment.SCHEDULED) + + def test_save_speciality_ok(self): + """ + Test to verify if speciality is correctly passed + """ + + self.assertEquals( + self.appointment.speciality, + Appointment.SPEECH_THERAPHY + ) + + def test_str_is_equal_to_title(self): + """ + Test if method `__str__` is returning "Appointment of " + """ + self.user.name = 'User' + self.assertEqual( + str(self.appointment), + _('Appointment of ') + self.patient.user.name + ) From f6eef62dd8b97c9200cc98fe750135949727ab26 Mon Sep 17 00:00:00 2001 From: Gabriela Medeiros Date: Thu, 3 May 2018 13:42:09 -0300 Subject: [PATCH 080/271] Protecting appointment views Adding LoginRequiredMixin to views Co-authored-by: Geovana Ramos --- drdown/appointments/views/view_appointment.py | 24 +++++++++---------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/drdown/appointments/views/view_appointment.py b/drdown/appointments/views/view_appointment.py index 8c648073..6b0096e9 100644 --- a/drdown/appointments/views/view_appointment.py +++ b/drdown/appointments/views/view_appointment.py @@ -1,18 +1,19 @@ from django.utils.translation import ugettext_lazy as _ -from search_views.search import SearchListView -from search_views.filters import BaseFilter from django.views.generic import CreateView from django.views.generic import UpdateView from django.views.generic.dates import MonthArchiveView +from django.contrib.auth.mixins import LoginRequiredMixin +from django.utils import timezone +from django.urls import reverse +from search_views.search import SearchListView +from search_views.filters import BaseFilter from drdown.appointments.models import Appointment from drdown.users.models.model_health_team import HealthTeam from drdown.users.models.model_patient import Patient from ..forms.appointments_form import AppointmentSearchForm -from django.utils import timezone -from django.urls import reverse -class AppointmentFilter(BaseFilter): +class AppointmentFilter(LoginRequiredMixin, BaseFilter): search_fields = { 'search_date': ['date'], 'search_speciality': ['speciality'], @@ -21,7 +22,7 @@ class AppointmentFilter(BaseFilter): } -class AppointmentListView(SearchListView): +class AppointmentListView(LoginRequiredMixin, SearchListView): model = Appointment template_name = 'appointments/appointment_list.html' form_class = AppointmentSearchForm @@ -80,7 +81,7 @@ def get_queryset(self): return self.prepare_queryset(self.request) -class AppointmentCreateView(CreateView): +class AppointmentCreateView(LoginRequiredMixin, CreateView): model = Appointment template_name = 'appointments/appointment_form.html' fields = [ @@ -127,7 +128,7 @@ def get_context_data(self, **kwargs): return context -class AppointmentMonthArchiveView(MonthArchiveView): +class AppointmentMonthArchiveView(LoginRequiredMixin, MonthArchiveView): date_field = "date" allow_future = True template_name = 'appointments/appointment_list.html' @@ -142,7 +143,7 @@ def get_queryset(self): return AppointmentListView.prepare_queryset(self.request) -class AppointmentUpdateView(UpdateView): +class AppointmentUpdateView(LoginRequiredMixin, UpdateView): model = Appointment template_name = 'appointments/appointment_form.html' fields = ['speciality', @@ -174,7 +175,7 @@ def get_context_data(self, **kwargs): return context -class AppointmentUpdateStatusView(UpdateView): +class AppointmentUpdateStatusView(LoginRequiredMixin, UpdateView): model = Appointment template_name = 'appointments/appointment_confirm_cancel.html' fields = [] @@ -196,6 +197,3 @@ def form_valid(self, form): form.instance.status = _('Canceled') form.save() return super(AppointmentUpdateStatusView, self).form_valid(form) - - - From d479631ae3cf08aeb76f3c2d606b74c9968a4a37 Mon Sep 17 00:00:00 2001 From: guilherme1guy Date: Thu, 3 May 2018 13:43:22 -0300 Subject: [PATCH 081/271] Improving tests Co-authored-by: joberth rogers --- drdown/users/tests/test_view_user.py | 64 ++++++++++++++++++++++++---- 1 file changed, 55 insertions(+), 9 deletions(-) diff --git a/drdown/users/tests/test_view_user.py b/drdown/users/tests/test_view_user.py index a63b4b84..ec2563b6 100644 --- a/drdown/users/tests/test_view_user.py +++ b/drdown/users/tests/test_view_user.py @@ -184,6 +184,9 @@ def setUp(self): self.user_patient1.birthday = timezone.datetime(2000, 1, 1) + self.user_patient1.save() + self.user_patient1.refresh_from_db() + Patient.objects.create( ses="1234567", user=self.user_patient1, @@ -203,6 +206,9 @@ def setUp(self): self.user_patient2.birthday = timezone.datetime(2000, 1, 1) + self.user_patient2.save() + self.user_patient2.refresh_from_db() + Patient.objects.create( ses="1234213", user=self.user_patient2, @@ -219,6 +225,9 @@ def setUp(self): self.user_health_team = self.make_user() self.user_health_team.birthday = timezone.datetime(2000, 1, 1) + self.user_health_team.save() + self.user_health_team.refresh_from_db() + self.health_team = HealthTeam.objects.create( cpf="057.641.271-65", user=self.user_health_team, @@ -226,8 +235,18 @@ def setUp(self): council_acronym=HealthTeam.CRM, register_number="1234567", registration_state=HealthTeam.DF, - ) + ) + self.user_employee = self.make_user(username="empl") + self.user_employee.birthday = timezone.datetime(2000, 1, 1) + + self.user_employee.save() + self.user_employee.refresh_from_db() + + self.employee = Employee.objects.create( + cpf="057.641.271-65", + user=self.user_employee + ) self.client = Client() @@ -270,7 +289,7 @@ def test_get_redirect_for_not_authenticated(self): def test_get_redirect_for_other_specializations_or_no_specialization(self): """ - Test if a user that is not specialized or employee it is redirected for its profile + Test if a user that is not specialized is redirected for its profile when accessing Checklist List View """ @@ -291,15 +310,19 @@ def test_get_redirect_for_other_specializations_or_no_specialization(self): expected_status_codes ) - Employee.objects.create( - cpf="306.585.340-09", - user=user + response = self.client.get( + path=reverse(viewname='users:healthteam_patient_list') ) - user.refresh_from_db() + expected_status_codes = [301, 302] + + self.assertIn( + response.status_code, + expected_status_codes + ) response = self.client.get( - path=reverse(viewname='careline:checklist_list') + path=reverse(viewname='users:responsible_patient_list') ) expected_status_codes = [301, 302] @@ -309,9 +332,11 @@ def test_get_redirect_for_other_specializations_or_no_specialization(self): expected_status_codes ) + def test_get_redirect_for_healthteam(self): """ - Test if the page loads when a health team is the current user + Test if the page loads when a health team + is the current user """ self.client.force_login(self.user_health_team) @@ -327,6 +352,27 @@ def test_get_redirect_for_healthteam(self): self.assertRedirects(response=response, expected_url=url) + + def test_get_redirect_for_employee(self): + """ + Test if the page loads when a employee + is the current user + """ + + self.client.force_login(self.user_employee) + + response = self.client.get( + path=reverse( + viewname='users:patient_list', + ), + follow=True + ) + + url = reverse(viewname='users:healthteam_patient_list') + + self.assertRedirects(response=response, expected_url=url) + + def test_get_redirect_for_responsible(self): """ Test if the page loads when a responsible is the current user @@ -343,4 +389,4 @@ def test_get_redirect_for_responsible(self): url = reverse(viewname='users:responsible_patient_list') - self.assertRedirects(response=response, expected_url=url) \ No newline at end of file + self.assertRedirects(response=response, expected_url=url) From e8b66d0ed78311c6aa46cc882d92eb355a2379ac Mon Sep 17 00:00:00 2001 From: GeovanaRamos Date: Thu, 3 May 2018 14:56:45 -0300 Subject: [PATCH 082/271] Adding tests and removing unused imports Adding some tests for appointment views Removing unused imports from appointments model tests Co-authored-by: Gabriela Medeiros --- .../tests/test_model_appointment.py | 2 - .../tests/test_view_appointment.py | 183 ++++++++++++++++++ 2 files changed, 183 insertions(+), 2 deletions(-) create mode 100644 drdown/appointments/tests/test_view_appointment.py diff --git a/drdown/appointments/tests/test_model_appointment.py b/drdown/appointments/tests/test_model_appointment.py index 01486274..9873b231 100644 --- a/drdown/appointments/tests/test_model_appointment.py +++ b/drdown/appointments/tests/test_model_appointment.py @@ -3,8 +3,6 @@ from drdown.users.models.model_health_team import HealthTeam from drdown.users.models.model_patient import Patient from django.utils.translation import ugettext_lazy as _ -from django.utils import timezone -import datetime class TestModelAppointment(TestCase): diff --git a/drdown/appointments/tests/test_view_appointment.py b/drdown/appointments/tests/test_view_appointment.py new file mode 100644 index 00000000..f27e2804 --- /dev/null +++ b/drdown/appointments/tests/test_view_appointment.py @@ -0,0 +1,183 @@ +from test_plus.test import TestCase +from ..models.model_appointment import Appointment +from drdown.users.models.model_health_team import HealthTeam +from drdown.users.models.model_patient import Patient +from django.urls import reverse + + +class TestViewAppointment(TestCase): + + def setUp(self): + """ + This method will run before any test case. + """ + self.user = self.make_user(username='user_1') + self.user2 = self.make_user(username='user_2') + self.patient = Patient.objects.create( + ses="1234567", + user=self.user, + priority=1, + mother_name="Mother", + father_name="Father", + ethnicity=3, + sus_number="12345678911", + civil_registry_of_birth="12345678911", + declaration_of_live_birth="12345678911" + ) + + self.doctor = HealthTeam.objects.create( + cpf="057.641.271-65", + user=self.user2, + speciality=HealthTeam.NEUROLOGY, + council_acronym=HealthTeam.CRM, + register_number="1234567", + registration_state=HealthTeam.DF, + ) + + self.appointment = Appointment.objects.create( + shift=Appointment.MORNING, + date="2040-08-10", + time="15:45", + motive='Some motive', + speciality=Appointment.SPEECH_THERAPHY, + doctor=self.doctor, + patient=self.patient, + status=Appointment.SCHEDULED + ) + + self.client.force_login(user=self.user) + + def test_appointment_list_view(self): + """ + Makes sure that the appointment list view is loaded correctly + """ + + response = self.client.get( + path=reverse( + viewname='appointments:list_appointments' + ) + ) + self.assertEquals(response.status_code, 200) + + def test_appointment_create_view(self): + """ + Makes sure that the appointment create view is loaded correctly + """ + response = self.client.get( + path=reverse( + viewname='appointments:create_appointment' + ) + ) + self.assertEquals(response.status_code, 200) + + def test_appointment_update_view(self): + """ + Makes sure that the appointment update view is loaded correctly + """ + response = self.client.get( + path=reverse( + viewname='appointments:update_appointment', + args=(self.appointment.pk,) + ) + ) + self.assertEquals(response.status_code, 200) + + def test_post_cancel_view(self): + """ + Makes sure that the appointment update status is loaded correctly + """ + response = self.client.get( + path=reverse( + viewname='appointments:update_status_appointment', + args=(self.appointment.pk,) + ) + ) + self.assertEquals(response.status_code, 200) + + # def test_form_invalid(self): + # """ + # Test if form is valid with blank fields + # """ + # response = self.client.post( + # path=reverse( + # viewname='forum:create_post', + # args=(self.category.slug, self.category.pk) + # ), + # data={'form': + # {'title': "", + # 'message': "Making a post test case", + # 'user':'self.user'} + # }, + # ) + # self.assertFormError(response, 'form', 'title', _('This field is required.')) + # self.assertEquals(response.status_code, 200) + + # def test_post_form_valid_create_view(self): + # """ + # Test if create form is valid with all required fields + # """ + # self.client.force_login(user=self.user) + # data = { + # 'title': 'Test', + # 'message': 'hello test', + # 'category': 'self.category', + # 'created_at': timezone.now(), + # } + # response = self.client.post( + # path=reverse( + # viewname='forum:create_post', + # args=(self.category.slug, self.category.pk) + # ), + # data=data, + # follow=True) + # self.assertEquals(response.status_code, 200) + # + # def test_post_form_valid_update_view(self): + # """ + # Test if update form is valid with all required fields + # """ + # self.client.force_login(user=self.user) + # data = { + # 'title': 'Test', + # 'message': 'hello test', + # 'category': 'self.category', + # 'created_at': timezone.now(), + # } + # response = self.client.post( + # path=reverse( + # viewname='forum:update_post', + # args=(self.category.slug, self.category.pk, self.post.pk) + # ), + # data=data, + # follow=True) + # self.assertEquals(response.status_code, 200) + # + # def test_redirect_delete_ok(self): + # """ + # Test the home page url status code. + # """ + # + # self.client.force_login(user=self.user) + # data = { + # 'message': 'hello test', + # 'post': 'self.post', + # 'created_at': timezone.now(), + # } + # + # response = self.client.post( + # path=reverse( + # viewname='forum:delete_post', + # args=(self.category.slug, self.category.pk, self.post.pk) + # ), + # data=data, + # follow=True + # ) + # self.assertRedirects( + # response, + # reverse( + # viewname='forum:list_posts', + # args=(self.category.slug, self.category.pk) + # ), + # status_code=302, + # target_status_code=200 + # ) From 65cf9e1b2faae41dcec144e6d242f36fa7d6c217 Mon Sep 17 00:00:00 2001 From: guilherme1guy Date: Thu, 3 May 2018 13:44:05 -0300 Subject: [PATCH 083/271] Changing healthteam list view Now a employee has access to it Co-authored-by: joberth rogers --- drdown/users/views/view_user.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drdown/users/views/view_user.py b/drdown/users/views/view_user.py index f563f62e..9eecf8a0 100644 --- a/drdown/users/views/view_user.py +++ b/drdown/users/views/view_user.py @@ -151,7 +151,10 @@ def get(self, request, *args, **kwargs): ) return redirect(url) - if hasattr(request.user, 'healthteam'): + if ( + hasattr(request.user, 'healthteam') or + hasattr(request.user, 'employee') + ): url = reverse( viewname='users:healthteam_patient_list', ) @@ -208,7 +211,10 @@ class HealthTeamPatientListView(SearchListView): def get(self, request, *args, **kwargs): - if not hasattr(request.user, 'healthteam'): + if ( + not hasattr(request.user, 'healthteam') + and not hasattr(request.user, 'employee') + ): # redirect user_patient to the its medical sheet view url = reverse( viewname='account_login', From 5bfe9565e38798e48c52b1d4de53d9c33fa86038 Mon Sep 17 00:00:00 2001 From: guilherme1guy Date: Thu, 3 May 2018 15:03:00 -0300 Subject: [PATCH 084/271] Changing access level of Checklist Detail View Now a Health Team user can access and edit it Co-authored-by: joberth rogers --- drdown/careline/views/view_checklist.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drdown/careline/views/view_checklist.py b/drdown/careline/views/view_checklist.py index f84b52fe..facae6df 100644 --- a/drdown/careline/views/view_checklist.py +++ b/drdown/careline/views/view_checklist.py @@ -80,6 +80,8 @@ def has_permission(current_user, target_user): for patient in current_user.responsible.patient_set.all(): if patient.user == target_user: allowed = True + elif hasattr(current_user, 'healthteam'): + allowed = True return allowed From 5693e937fb01663ef2208e82b7c5320c831c51aa Mon Sep 17 00:00:00 2001 From: Daniel Maike Date: Thu, 3 May 2018 18:18:16 +0000 Subject: [PATCH 085/271] Fixing html errors Deleting duplicate double quotes in home.html and vaccine_schedule.html Co-authored-by: Elias Bernardo --- drdown/core/templates/core/home.html | 2 +- drdown/core/templates/core/vaccine_schedule.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drdown/core/templates/core/home.html b/drdown/core/templates/core/home.html index 4863cc53..92597d73 100644 --- a/drdown/core/templates/core/home.html +++ b/drdown/core/templates/core/home.html @@ -4,7 +4,7 @@ {% block css %} - + diff --git a/drdown/core/templates/core/vaccine_schedule.html b/drdown/core/templates/core/vaccine_schedule.html index 9c46e3c4..a8b3a637 100644 --- a/drdown/core/templates/core/vaccine_schedule.html +++ b/drdown/core/templates/core/vaccine_schedule.html @@ -4,7 +4,7 @@ {% block css %} - + From ac0472b67853c79613a952f4d44accffa010db66 Mon Sep 17 00:00:00 2001 From: guilherme1guy Date: Thu, 3 May 2018 15:21:49 -0300 Subject: [PATCH 086/271] Improving test coverage Adds a test Co-authored-by: joberth rogers --- .../tests/test_view_checklist_detail.py | 33 ++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/drdown/careline/tests/test_view_checklist_detail.py b/drdown/careline/tests/test_view_checklist_detail.py index 74b1674e..f37edef7 100644 --- a/drdown/careline/tests/test_view_checklist_detail.py +++ b/drdown/careline/tests/test_view_checklist_detail.py @@ -4,7 +4,7 @@ from django.utils import timezone from drdown.careline.models import Procedure -from drdown.users.models import Patient, Responsible +from drdown.users.models import Patient, Responsible, HealthTeam from drdown.careline.views import ChecklistDetailView @@ -66,6 +66,22 @@ def setUp(self): responsible=self.user_responsible.responsible ) + self.user_health_team = self.make_user() + self.user_health_team.birthday = timezone.datetime(2000, 1, 1) + + self.user_health_team.save() + self.user_health_team.refresh_from_db() + + self.health_team = HealthTeam.objects.create( + cpf="057.641.271-65", + user=self.user_health_team, + speciality=HealthTeam.NEUROLOGY, + council_acronym=HealthTeam.CRM, + register_number="1234567", + registration_state=HealthTeam.DF, + ) + + self.client = Client() self.view = ChecklistDetailView() @@ -84,6 +100,21 @@ def test_has_permission_for_responsible(self): True ) + def test_has_permission_for_healthteam(self): + """ + Test if a healthteam have access to a patient + """ + + self.assertEquals( + self.view.has_permission(current_user=self.user_health_team, target_user=self.user_patient1), + True + ) + + self.assertEquals( + self.view.has_permission(current_user=self.user_health_team, target_user=self.user_patient2), + True + ) + def test_has_permission_for_not_responsible(self): """ Test if a user that is not a responsible for a patient cannot access a patient data From 89bc04c3866b41e6f57fcd79268feceb17035fbf Mon Sep 17 00:00:00 2001 From: GeovanaRamos Date: Thu, 3 May 2018 15:41:32 -0300 Subject: [PATCH 087/271] Changing list of months Returning all months of a year Co-authored-by: Gabriela Medeiros --- drdown/appointments/views/view_appointment.py | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/drdown/appointments/views/view_appointment.py b/drdown/appointments/views/view_appointment.py index 6b0096e9..08ca9d83 100644 --- a/drdown/appointments/views/view_appointment.py +++ b/drdown/appointments/views/view_appointment.py @@ -39,10 +39,21 @@ def get_list_of_years(request): @staticmethod def get_list_of_months(request): - months = [] - for appointment in AppointmentListView.prepare_queryset(request): - if appointment.date.strftime("%B") not in months: - months.append(appointment.date.strftime("%B")) + months = [ + _('January'), + _('February'), + _('March'), + _('April'), + _('May'), + _('June'), + _('July'), + _('August'), + _('September'), + _('October'), + _('November'), + _('December'), + ] + return months @staticmethod @@ -95,7 +106,6 @@ class AppointmentCreateView(LoginRequiredMixin, CreateView): ] def get_success_url(self, **kwargs): - print("Entra em get_success_url") success_create_url = reverse( viewname='appointments:list_appointments', ) From 9d9694a70f0e8c047b9838261aec41e26143215e Mon Sep 17 00:00:00 2001 From: Gabriela Medeiros Date: Thu, 3 May 2018 16:43:40 -0300 Subject: [PATCH 088/271] Adding appointment view tests Adding logged user tests Adding list of month tests Co-authored-by: Geovana Ramos --- .../tests/test_view_appointment.py | 165 ++++++++++-------- 1 file changed, 96 insertions(+), 69 deletions(-) diff --git a/drdown/appointments/tests/test_view_appointment.py b/drdown/appointments/tests/test_view_appointment.py index f27e2804..86d64f63 100644 --- a/drdown/appointments/tests/test_view_appointment.py +++ b/drdown/appointments/tests/test_view_appointment.py @@ -87,11 +87,105 @@ def test_post_cancel_view(self): Makes sure that the appointment update status is loaded correctly """ response = self.client.get( + path=reverse( + viewname='appointments:update_status_appointment', + args=(self.appointment.pk,) + ) + ) + self.assertEquals(response.status_code, 200) + + def test_appointment_form_valid_create_view(self): + """ + Test if create form is valid with all required fields + """ + self.client.force_login(user=self.user) + data = { + 'speciality': Appointment.SPEECH_THERAPHY, + 'shift': 'A', + 'doctor': self.doctor.pk, + 'patient': self.patient.pk, + 'date': '2018-05-12', + 'time': '20:00', + } + response = self.client.post( + path=reverse('appointments:create_appointment'), + data=data, + follow=True) + list_appointments = reverse('appointments:list_appointments') + self.assertEquals(response.status_code, 200) + self.assertRedirects(response, list_appointments) + + def test_appointment_form_valid_update_view(self): + """ + Test if update form is valid with all required fields + """ + self.client.force_login(user=self.user) + data = { + 'speciality': Appointment.SPEECH_THERAPHY, + 'shift': 'A', + 'doctor': self.doctor.pk, + 'patient': self.patient.pk, + 'date': '2018-05-12', + 'time': '20:00', + } + response = self.client.post( + path=reverse( + viewname='appointments:update_appointment', + args=(self.appointment.pk,) + ), + data=data, + follow=True) + list_appointments = reverse('appointments:list_appointments') + self.assertEquals(response.status_code, 200) + self.assertRedirects(response, list_appointments) + + def test_redirect_delete_ok(self): + """ + Test the page url status code. + """ + + self.client.force_login(user=self.user) + data = { + 'speciality': Appointment.SPEECH_THERAPHY, + 'shift': 'A', + 'doctor': self.doctor.pk, + 'patient': self.patient.pk, + 'date': '2018-05-12', + 'time': '20:00', + } + + response = self.client.post( path=reverse( viewname='appointments:update_status_appointment', args=(self.appointment.pk,) - ) + ), + data=data, + follow=True ) + list_appointments = reverse('appointments:list_appointments') + self.assertEquals(response.status_code, 200) + self.assertRedirects(response, list_appointments) + + def test_list_view_appointments_patient(self): + self.client.force_login(user=self.user) + + response = self.client.get( + path=reverse( + viewname='appointments:archive_month', + args=('2040', '08'), + ) + ) + self.assertEquals(response.status_code, 200) + + def test_list_view_appointments_health_team(self): + self.client.force_login(user=self.user2) + + response = self.client.get( + path=reverse( + viewname='appointments:archive_month', + args=('2040', '08'), + ) + ) self.assertEquals(response.status_code, 200) # def test_form_invalid(self): @@ -112,72 +206,5 @@ def test_post_cancel_view(self): # self.assertFormError(response, 'form', 'title', _('This field is required.')) # self.assertEquals(response.status_code, 200) - # def test_post_form_valid_create_view(self): - # """ - # Test if create form is valid with all required fields - # """ - # self.client.force_login(user=self.user) - # data = { - # 'title': 'Test', - # 'message': 'hello test', - # 'category': 'self.category', - # 'created_at': timezone.now(), - # } - # response = self.client.post( - # path=reverse( - # viewname='forum:create_post', - # args=(self.category.slug, self.category.pk) - # ), - # data=data, - # follow=True) - # self.assertEquals(response.status_code, 200) # - # def test_post_form_valid_update_view(self): - # """ - # Test if update form is valid with all required fields - # """ - # self.client.force_login(user=self.user) - # data = { - # 'title': 'Test', - # 'message': 'hello test', - # 'category': 'self.category', - # 'created_at': timezone.now(), - # } - # response = self.client.post( - # path=reverse( - # viewname='forum:update_post', - # args=(self.category.slug, self.category.pk, self.post.pk) - # ), - # data=data, - # follow=True) - # self.assertEquals(response.status_code, 200) - # - # def test_redirect_delete_ok(self): - # """ - # Test the home page url status code. - # """ - # - # self.client.force_login(user=self.user) - # data = { - # 'message': 'hello test', - # 'post': 'self.post', - # 'created_at': timezone.now(), - # } - # - # response = self.client.post( - # path=reverse( - # viewname='forum:delete_post', - # args=(self.category.slug, self.category.pk, self.post.pk) - # ), - # data=data, - # follow=True - # ) - # self.assertRedirects( - # response, - # reverse( - # viewname='forum:list_posts', - # args=(self.category.slug, self.category.pk) - # ), - # status_code=302, - # target_status_code=200 - # ) + From 99ce20d4236db56207cdba4eda1150aa28c26de9 Mon Sep 17 00:00:00 2001 From: GeovanaRamos Date: Thu, 3 May 2018 17:33:33 -0300 Subject: [PATCH 089/271] Adding pagination to core app and using on appointments Passing pagination template over to core app Changing pagination path on forum and medicalrecords Including pagination on appointments list Co-authored-by: Gabriela Medeiros --- .../appointments/appointment_list.html | 4 +- drdown/appointments/views/view_appointment.py | 2 + .../templates/core}/pagination.html | 0 drdown/forum/templates/forum/post_list.html | 2 +- .../medicalrecord_search_list.html | 2 +- .../templates/medicalrecords/pagination.html | 39 ------------------- 6 files changed, 7 insertions(+), 42 deletions(-) rename drdown/{forum/templates/forum => core/templates/core}/pagination.html (100%) delete mode 100644 drdown/medicalrecords/templates/medicalrecords/pagination.html diff --git a/drdown/appointments/templates/appointments/appointment_list.html b/drdown/appointments/templates/appointments/appointment_list.html index 7383ca15..f1869e36 100644 --- a/drdown/appointments/templates/appointments/appointment_list.html +++ b/drdown/appointments/templates/appointments/appointment_list.html @@ -26,7 +26,7 @@

{% trans 'Appointments' %}


{% endif %} -
+
{% for appointment in appointment_list %} @@ -87,7 +87,9 @@

{% trans 'There are no appointmen {% endfor %}

+ {% include "core/pagination.html" %}
+ {% endblock %} diff --git a/drdown/appointments/views/view_appointment.py b/drdown/appointments/views/view_appointment.py index 08ca9d83..a69dfab0 100644 --- a/drdown/appointments/views/view_appointment.py +++ b/drdown/appointments/views/view_appointment.py @@ -27,6 +27,7 @@ class AppointmentListView(LoginRequiredMixin, SearchListView): template_name = 'appointments/appointment_list.html' form_class = AppointmentSearchForm filter_class = AppointmentFilter + paginate_by = 10 @staticmethod def get_list_of_years(request): @@ -143,6 +144,7 @@ class AppointmentMonthArchiveView(LoginRequiredMixin, MonthArchiveView): allow_future = True template_name = 'appointments/appointment_list.html' allow_empty = True + paginate_by = 10 def get_context_data(self, **kwargs): context = super(AppointmentMonthArchiveView, diff --git a/drdown/forum/templates/forum/pagination.html b/drdown/core/templates/core/pagination.html similarity index 100% rename from drdown/forum/templates/forum/pagination.html rename to drdown/core/templates/core/pagination.html diff --git a/drdown/forum/templates/forum/post_list.html b/drdown/forum/templates/forum/post_list.html index fab3a020..5cdba82a 100644 --- a/drdown/forum/templates/forum/post_list.html +++ b/drdown/forum/templates/forum/post_list.html @@ -51,7 +51,7 @@

{% trans 'There are no posts in t {% endfor %} - {% include "forum/pagination.html" %} + {% include "core/pagination.html" %}

{% endblock content %} diff --git a/drdown/medicalrecords/templates/medicalrecords/medicalrecord_search_list.html b/drdown/medicalrecords/templates/medicalrecords/medicalrecord_search_list.html index dcee7aac..d87b1153 100644 --- a/drdown/medicalrecords/templates/medicalrecords/medicalrecord_search_list.html +++ b/drdown/medicalrecords/templates/medicalrecords/medicalrecord_search_list.html @@ -43,7 +43,7 @@

{{ medicalrecord.patien {% endfor %}

-

{% include "medicalrecords/pagination.html" %}

+

{% include "core/pagination.html" %}

{% endblock content %} diff --git a/drdown/medicalrecords/templates/medicalrecords/pagination.html b/drdown/medicalrecords/templates/medicalrecords/pagination.html deleted file mode 100644 index 16db9600..00000000 --- a/drdown/medicalrecords/templates/medicalrecords/pagination.html +++ /dev/null @@ -1,39 +0,0 @@ -{% load i18n %} - -{% if is_paginated %} - -{% endif %} From 4e2076458fbbbe49a3f24e182084987ac7989dd9 Mon Sep 17 00:00:00 2001 From: GeovanaRamos Date: Thu, 3 May 2018 17:45:13 -0300 Subject: [PATCH 090/271] Correcting form error Removing translation tags from speciality choices Changing search speciality placeholder Co-authored-by: Gabriela Medeiros --- drdown/appointments/forms/appointments_form.py | 2 +- .../appointments/models/model_appointment.py | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/drdown/appointments/forms/appointments_form.py b/drdown/appointments/forms/appointments_form.py index 3433453b..6be73573 100644 --- a/drdown/appointments/forms/appointments_form.py +++ b/drdown/appointments/forms/appointments_form.py @@ -10,7 +10,7 @@ class AppointmentSearchForm(forms.Form): required=False, label=_('Speciality'), widget=forms.TextInput( - attrs={'placeholder': _('search here!')} + attrs={'placeholder': _('Speciality')} ) ) diff --git a/drdown/appointments/models/model_appointment.py b/drdown/appointments/models/model_appointment.py index 85796b57..397e0f33 100644 --- a/drdown/appointments/models/model_appointment.py +++ b/drdown/appointments/models/model_appointment.py @@ -40,15 +40,15 @@ class Appointment(models.Model): blank=True, ) - SPEECH_THERAPHY = "Speech Therapy" - PSYCHOLOGY = "Psychology" - PHYSIOTHERAPY = "Physiotherapy" - OCCUPATIONAL_THERAPY = "Occupational Therapy" - DOCTOR = "Doctor" - CARDIOLOGY = "Cardiology" - NEUROLOGY = "Neurology" - PEDIATRICS = "Pediatrics" - NURSING = "Nursing" + SPEECH_THERAPHY = _("Speech Therapy") + PSYCHOLOGY = _("Psychology") + PHYSIOTHERAPY = _("Physiotherapy") + OCCUPATIONAL_THERAPY = _("Occupational Therapy") + DOCTOR = _("Doctor") + CARDIOLOGY = _("Cardiology") + NEUROLOGY = _("Neurology") + PEDIATRICS = _("Pediatrics") + NURSING = _("Nursing") SPECIALITY_CHOICES = ( (SPEECH_THERAPHY, _('Speech Therapy')), From 477eed076480214335a1dd97bee4b143c2d8dc28 Mon Sep 17 00:00:00 2001 From: GeovanaRamos Date: Thu, 3 May 2018 18:29:06 -0300 Subject: [PATCH 091/271] Correcting constants and showing status on template Correcting status constants on view and model Adding done status to template Showing buttons only on future date Co-authored-by: Gabriela Medeiros --- .../appointments/models/model_appointment.py | 1 - .../appointments/appointment_list.html | 18 ++++++++++++++---- drdown/appointments/views/view_appointment.py | 3 ++- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/drdown/appointments/models/model_appointment.py b/drdown/appointments/models/model_appointment.py index 397e0f33..eaead054 100644 --- a/drdown/appointments/models/model_appointment.py +++ b/drdown/appointments/models/model_appointment.py @@ -90,7 +90,6 @@ class Appointment(models.Model): STATUS_CHOICES = ( (SCHEDULED, _('Scheduled')), (CANCELED, _('Canceled')), - (DONE, _('Done')) ) status = models.CharField( diff --git a/drdown/appointments/templates/appointments/appointment_list.html b/drdown/appointments/templates/appointments/appointment_list.html index f1869e36..be4d1316 100644 --- a/drdown/appointments/templates/appointments/appointment_list.html +++ b/drdown/appointments/templates/appointments/appointment_list.html @@ -37,11 +37,21 @@
{% trans 'Patient'%}: {{appointment.patient.user.name}}
{% trans 'Especiality'%}: {{ appointment.speciality}}
{% trans 'Date'%}: {{ appointment.date}}
{% trans 'Time'%}: {{ appointment.time}}
- {% trans 'Status'%}: {{ appointment.status}}
+ {% now 'd-m-Y' as today %} + {% now 'H:i' as time %} + {% if appointment.date|date:"d-m-Y" > today %} + {% trans 'Status'%}: {{ appointment.status}}
+ {% elif appointment.date|date:"d-m-Y" == today and appointment.time|time:'H:i' > time %} + {% trans 'Status'%}: {{ appointment.status}}
+ {% elif appointment.date|date:"d-m-Y" == today and appointment.time|time:'H:i' < time %} + {% trans 'Status'%}: {% trans 'Done' %}
+ {% endif %}

{{appointment.motive}}

- {% if request.user.employee %} - {% trans "Edit" %} - {% trans "Cancel" %}

+ {% if request.user.employee and appointment.status != canceled %} + {% if appointment.date|date:"d-m-Y" > today or appointment.date|date:"d-m-Y" == today and appointment.time|time:'H:i' > time %} + {% trans "Edit" %} + {% trans "Cancel" %}

+ {% endif %} {% endif %}
diff --git a/drdown/appointments/views/view_appointment.py b/drdown/appointments/views/view_appointment.py index a69dfab0..6338c4ca 100644 --- a/drdown/appointments/views/view_appointment.py +++ b/drdown/appointments/views/view_appointment.py @@ -62,6 +62,7 @@ def prepare_context(context, request): context['years'] = AppointmentListView.get_list_of_years(request) context['months'] = AppointmentListView.get_list_of_months(request) context['current_year'] = timezone.now().year + context['canceled'] = Appointment.CANCELED return context @staticmethod @@ -206,6 +207,6 @@ def get_object(self): return appointment def form_valid(self, form): - form.instance.status = _('Canceled') + form.instance.status = Appointment.CANCELED form.save() return super(AppointmentUpdateStatusView, self).form_valid(form) From 7af3df0b8612814db35c53b99fd983ac6c30e9bc Mon Sep 17 00:00:00 2001 From: Joberth Rogers Date: Thu, 3 May 2018 18:06:20 -0300 Subject: [PATCH 092/271] Limitation for health team button allowed just for health team buttons return Co-authored-by: Guilherme Guy --- drdown/users/templates/users/patient_detail.html | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drdown/users/templates/users/patient_detail.html b/drdown/users/templates/users/patient_detail.html index 0cc43ca5..9477ca96 100644 --- a/drdown/users/templates/users/patient_detail.html +++ b/drdown/users/templates/users/patient_detail.html @@ -12,7 +12,7 @@

{% trans 'Patient: ' %} {{ view.object.user.name }}

- +
@@ -24,7 +24,9 @@

{% trans 'Patient: ' %} {{ vi {% endif %} - + {% if user.healthteam%} + + {% endif %}

From bf8f6f9c199c64422031ef90a315246b9e896f1b Mon Sep 17 00:00:00 2001 From: Joberth Rogers Date: Thu, 3 May 2018 18:14:46 -0300 Subject: [PATCH 093/271] Change route button Button from detail patient now is by permission Co-authored-by: Guilherme Guy --- drdown/users/templates/users/patient_detail.html | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drdown/users/templates/users/patient_detail.html b/drdown/users/templates/users/patient_detail.html index 9477ca96..2913d494 100644 --- a/drdown/users/templates/users/patient_detail.html +++ b/drdown/users/templates/users/patient_detail.html @@ -12,8 +12,12 @@

{% trans 'Patient: ' %} {{ view.object.user.name }}

+ {% if user.patient %} + + {% else %} -
+ {% endif %} +
From 7e53c316fdd0e5fd7e948f7aaba9967943542457 Mon Sep 17 00:00:00 2001 From: Joberth Rogers Date: Thu, 3 May 2018 18:22:40 -0300 Subject: [PATCH 094/271] Translate Translate form page details patient Co-authored-by: Guilherme Guy --- .../users/locale/pt_BR/LC_MESSAGES/django.po | 181 ++++++++++++------ .../users/templates/users/patient_detail.html | 4 +- 2 files changed, 128 insertions(+), 57 deletions(-) diff --git a/drdown/users/locale/pt_BR/LC_MESSAGES/django.po b/drdown/users/locale/pt_BR/LC_MESSAGES/django.po index bfdefeac..db51cb18 100644 --- a/drdown/users/locale/pt_BR/LC_MESSAGES/django.po +++ b/drdown/users/locale/pt_BR/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-05-01 01:13+0000\n" +"POT-Creation-Date: 2018-05-03 21:17+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -22,6 +22,10 @@ msgstr "" msgid "Users" msgstr "Usuários" +#: drdown/users/forms/users_forms.py:11 +msgid "Search patient!" +msgstr "Pesquisar paciente!" + #: drdown/users/models/model_employee.py:21 #: drdown/users/models/model_health_team.py:20 #: drdown/users/models/model_patient.py:25 @@ -65,7 +69,7 @@ msgid "Don't change users" msgstr "Não alterar usuário" #: drdown/users/models/model_employee.py:123 -#: drdown/users/templates/users/user_detail.html:88 +#: drdown/users/templates/users/user_detail.html:89 msgid "Employee" msgstr "Funcionário" @@ -165,7 +169,7 @@ msgstr "" #: drdown/users/models/model_health_team.py:252 #: drdown/users/models/model_health_team.py:253 -#: drdown/users/templates/users/user_detail.html:116 +#: drdown/users/templates/users/user_detail.html:119 msgid "Health Team" msgstr "Equipe Médica" @@ -175,7 +179,7 @@ msgstr "Por favor, insira um número de SES válido" #: drdown/users/models/model_patient.py:39 #: drdown/users/models/model_responsible.py:70 -#: drdown/users/templates/users/user_detail.html:241 +#: drdown/users/templates/users/user_detail.html:247 msgid "Responsible" msgstr "Responsável" @@ -275,12 +279,12 @@ msgstr "Declaração de nascido vivo" msgid "Please, enter the declaration of live birth number" msgstr "Por favor, insira o número da declaração de nascido vivo" -#: drdown/users/models/model_patient.py:186 -#: drdown/users/templates/users/user_detail.html:160 +#: drdown/users/models/model_patient.py:177 +#: drdown/users/templates/users/user_detail.html:165 msgid "Patient" msgstr "Paciente" -#: drdown/users/models/model_patient.py:187 +#: drdown/users/models/model_patient.py:178 msgid "Patients" msgstr "Pacientes" @@ -294,7 +298,7 @@ msgstr "Responsáveis" #: drdown/users/models/model_user.py:18 msgid "Photo of user." -msgstr "Foto do usuário" +msgstr "Foto do usuário." #: drdown/users/models/model_user.py:19 #: drdown/users/templates/users/user_form.html:123 @@ -370,13 +374,90 @@ msgstr "Essa data de nascimento é muito antiga." msgid "Make sure user is confirmed before adding a specialization." msgstr "Tenha certeza de ter um usuário criado antes de especializá-lo." +#: drdown/users/templates/users/healthteam_patient_list.html:3 +#: drdown/users/templates/users/healthteam_patient_list.html:12 +#: drdown/users/templates/users/responsible_patient_list.html:3 +#: drdown/users/templates/users/responsible_patient_list.html:7 +msgid "Select a patient" +msgstr "Selecione um paciente" + +#: drdown/users/templates/users/healthteam_patient_list.html:15 +#, fuzzy +#| msgid "Patient: " +msgid "Patient:" +msgstr "Paciente:" + +#: drdown/users/templates/users/healthteam_patient_list.html:17 +msgid "Search" +msgstr "Buscar" + +#: drdown/users/templates/users/healthteam_patient_list.html:18 +#: drdown/users/templates/users/patient_detail.html:16 +#: drdown/users/templates/users/patient_detail.html:18 +msgid "Return" +msgstr "Retornar" + +#: drdown/users/templates/users/healthteam_patient_list.html:37 +#: drdown/users/templates/users/patient_detail.html:40 +#: drdown/users/templates/users/responsible_patient_list.html:24 +#: drdown/users/templates/users/user_detail.html:168 +msgid "SES: " +msgstr "SES: " + +#: drdown/users/templates/users/healthteam_patient_list.html:43 +#: drdown/users/templates/users/responsible_patient_list.html:30 +msgid "There are no patients for this user." +msgstr "Não há pacientes para estes usuário." + +#: drdown/users/templates/users/patient_detail.html:3 +msgid "Detail patient" +msgstr "Detalhes do paciente" + +#: drdown/users/templates/users/patient_detail.html:14 +#: drdown/users/templates/users/user_detail.html:260 +msgid "Patient: " +msgstr "Paciente: " + +#: drdown/users/templates/users/patient_detail.html:30 +msgid "Checklist" +msgstr "Checklist" + +#: drdown/users/templates/users/patient_detail.html:32 +#, fuzzy +#| msgid "My Medical Records" +msgid "Medical Records" +msgstr "Minhas Consultas" + +#: drdown/users/templates/users/patient_detail.html:37 +#: drdown/users/templates/users/user_detail.html:48 +msgid "Name: " +msgstr "Nome: " + +#: drdown/users/templates/users/patient_detail.html:38 +msgid "Birthday: " +msgstr "Data de nascimento: " + +#: drdown/users/templates/users/patient_detail.html:39 +#: drdown/users/templates/users/user_detail.html:213 +msgid "SUS: " +msgstr "SUS: " + +#: drdown/users/templates/users/patient_detail.html:41 +#: drdown/users/templates/users/user_detail.html:222 +msgid "Civil registry of birth: " +msgstr "Registro civil de nascimento: " + +#: drdown/users/templates/users/patient_detail.html:42 +msgid "Declaration of live birth: " +msgstr "Declaração de nascido vivo: " + #: drdown/users/templates/users/user_confirm_delete.html:5 msgid "Log Out" msgstr "Sair" #: drdown/users/templates/users/user_confirm_delete.html:8 #: drdown/users/templates/users/user_confirm_delete.html:13 -#: drdown/users/templates/users/user_detail.html:274 +#: drdown/users/templates/users/user_detail.html:290 msgid "Delete" msgstr "Excluir" @@ -394,22 +475,20 @@ msgstr "Usuário: " #: drdown/users/templates/users/user_detail.html:17 msgid "Hey! You have procedures to be made." -msgstr "" +msgstr "Oi! Você tem procedimentos a serem feitos." #: drdown/users/templates/users/user_detail.html:17 #: drdown/users/templates/users/user_detail.html:26 msgid "Click here to check it" -msgstr "" +msgstr "Clique aqui para conferir" #: drdown/users/templates/users/user_detail.html:26 msgid "" "One or more of your patients needs attention. Some procedures may be behind " "schedule." msgstr "" - -#: drdown/users/templates/users/user_detail.html:48 -msgid "Name: " -msgstr "Nome: " +"Um, ou mais, de seus pacientes precisa de atenção. Alguns procedimentos podem " +"estar atrasados." #: drdown/users/templates/users/user_detail.html:57 msgid "Gender: " @@ -423,68 +502,60 @@ msgstr "Telefone: " msgid "Birthday: " msgstr "Data de nascimento: " -#: drdown/users/templates/users/user_detail.html:92 -#: drdown/users/templates/users/user_detail.html:119 -#: drdown/users/templates/users/user_detail.html:244 +#: drdown/users/templates/users/user_detail.html:93 +#: drdown/users/templates/users/user_detail.html:122 +#: drdown/users/templates/users/user_detail.html:250 msgid "CPF: " msgstr "CPF: " -#: drdown/users/templates/users/user_detail.html:101 +#: drdown/users/templates/users/user_detail.html:102 msgid "Department: " msgstr "Departamento: " -#: drdown/users/templates/users/user_detail.html:136 +#: drdown/users/templates/users/user_detail.html:139 msgid "Registration State: " msgstr "Estado do Registro: " -#: drdown/users/templates/users/user_detail.html:145 +#: drdown/users/templates/users/user_detail.html:148 msgid "Speciality: " msgstr "Especialidade: " -#: drdown/users/templates/users/user_detail.html:163 -msgid "SES: " -msgstr "SES: " - -#: drdown/users/templates/users/user_detail.html:172 +#: drdown/users/templates/users/user_detail.html:177 msgid "Priority: " msgstr "Prioridade: " -#: drdown/users/templates/users/user_detail.html:181 +#: drdown/users/templates/users/user_detail.html:186 msgid "Mother Name: " msgstr "Nome da Mãe: " -#: drdown/users/templates/users/user_detail.html:190 +#: drdown/users/templates/users/user_detail.html:195 msgid "Father Name: " msgstr "Nome do Pai: " -#: drdown/users/templates/users/user_detail.html:199 +#: drdown/users/templates/users/user_detail.html:204 msgid "Ethnicity: " msgstr "Etnia: " -#: drdown/users/templates/users/user_detail.html:208 -msgid "SUS: " -msgstr "SUS: " - -#: drdown/users/templates/users/user_detail.html:217 -msgid "Civil registry of birth: " -msgstr "Registro civil de nascimento: " - -#: drdown/users/templates/users/user_detail.html:226 +#: drdown/users/templates/users/user_detail.html:231 msgid "Declaration of live birth: " msgstr "Declaração de nascido vivo: " -#: drdown/users/templates/users/user_detail.html:253 -msgid "Patient: " -msgstr "Paciente" - -#: drdown/users/templates/users/user_detail.html:269 -msgid "Confirm data" -msgstr "Confirmar dados" +#: drdown/users/templates/users/user_detail.html:278 +msgid "My Patients" +msgstr "Meus Pacientes" -#: drdown/users/templates/users/user_detail.html:272 +#: drdown/users/templates/users/user_detail.html:282 msgid "My Medical Records" msgstr "Minhas Consultas" +#: drdown/users/templates/users/user_detail.html:283 +msgid "My Medical Follow-up Sheet" +msgstr "Ficha de Acompanhamento" + +#: drdown/users/templates/users/user_detail.html:286 +msgid "Confirm data" +msgstr "Confirmar dados" + #: drdown/users/templates/users/user_form.html:127 msgid "Photo of user" msgstr "Foto do usuário" @@ -509,7 +580,7 @@ msgstr "Esse CPF não é permitido" #, fuzzy, python-format #| msgid "%(value)s is a invalid CPF, the verification digit is wrong" msgid "%(value)s is a invalid CPF, the verification digit is wrong" -msgstr "%(value) é um CPF inválido, o dígito de verificação está incorreto" +msgstr "%(value)s é um CPF inválido, o dígito de verificação está incorreto" #: drdown/users/utils/validators.py:85 msgid "Wrong SES format" @@ -536,14 +607,14 @@ msgstr "Telefone inválido" msgid "Wrong CRM format" msgstr "CRM inválido" -#~ msgid "A %(speciality)s cannot have a %(register)s" -#~ msgstr "%(speciality)s não pode ter %(register)s" +msgid "A %(speciality)s cannot have a %(register)s" +msgstr "%(speciality)s não pode ter %(register)s" -#~ msgid "COFFITO" -#~ msgstr "COFFITO" +msgid "COFFITO" +msgstr "COFFITO" -#~ msgid "Council Acronym: " -#~ msgstr "Acrônim do Conselho" +msgid "Council Acronym: " +msgstr "Acrônimo do Conselho" -#~ msgid "This SES is not permited" -#~ msgstr "Esse SES não é permitido" +msgid "This SES is not permited" +msgstr "Esse SES não é permitido" diff --git a/drdown/users/templates/users/patient_detail.html b/drdown/users/templates/users/patient_detail.html index 2913d494..707d92f8 100644 --- a/drdown/users/templates/users/patient_detail.html +++ b/drdown/users/templates/users/patient_detail.html @@ -35,11 +35,11 @@

{% trans 'Patient: ' %} {{ vi
-
+
-
+
From 987d40f4c84f69a1a9b74aca190c5c616aeba18b Mon Sep 17 00:00:00 2001 From: GeovanaRamos Date: Thu, 3 May 2018 19:14:57 -0300 Subject: [PATCH 095/271] Ordering appointments list Adding order_by to queryset Co-authored-by: Gabriela Medeiros --- drdown/appointments/views/view_appointment.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drdown/appointments/views/view_appointment.py b/drdown/appointments/views/view_appointment.py index 6338c4ca..6ce37f32 100644 --- a/drdown/appointments/views/view_appointment.py +++ b/drdown/appointments/views/view_appointment.py @@ -71,17 +71,18 @@ def prepare_queryset(request): if hasattr(user, 'patient'): queryset = Appointment.objects.filter( patient=user.patient - ) + ).order_by('-date', '-time') elif hasattr(user, 'responsible'): queryset = Appointment.objects.filter( patient=user.responsible.patient - ) + ).order_by('-date', '-time') elif hasattr(user, 'employee'): - queryset = Appointment.objects.all() + queryset = Appointment.objects.all( + ).order_by('-date', '-time') elif hasattr(user, 'healthteam'): queryset = Appointment.objects.filter( doctor=user.healthteam - ) + ).order_by('-date', '-time') else: queryset = Appointment.objects.none() return queryset From 671b6eb6f279f3e41106cea3195ce09bd931912e Mon Sep 17 00:00:00 2001 From: GeovanaRamos Date: Thu, 3 May 2018 19:40:21 -0300 Subject: [PATCH 096/271] Adding translations Adding django po file to appointments Corecting some translation tags Co-authored-by: Gabriela Medeiros --- .../locale/pt_BR/LC_MESSAGES/django.po | 297 ++++++++++++++++++ .../migrations/0002_auto_20180503_2217.py | 18 ++ .../appointments/models/model_appointment.py | 6 +- .../appointment_confirm_cancel.html | 2 +- .../tests/test_view_appointment.py | 6 +- .../locale/pt_BR/LC_MESSAGES/django.po | 3 +- .../core/locale/pt_BR/LC_MESSAGES/django.po | 54 ++-- .../forum/locale/pt_BR/LC_MESSAGES/django.po | 23 +- .../locale/pt_BR/LC_MESSAGES/django.po | 79 +++-- .../users/locale/pt_BR/LC_MESSAGES/django.po | 187 ++++++----- 10 files changed, 505 insertions(+), 170 deletions(-) create mode 100644 drdown/appointments/locale/pt_BR/LC_MESSAGES/django.po create mode 100644 drdown/appointments/migrations/0002_auto_20180503_2217.py diff --git a/drdown/appointments/locale/pt_BR/LC_MESSAGES/django.po b/drdown/appointments/locale/pt_BR/LC_MESSAGES/django.po new file mode 100644 index 00000000..6bcc352e --- /dev/null +++ b/drdown/appointments/locale/pt_BR/LC_MESSAGES/django.po @@ -0,0 +1,297 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-05-03 22:36+0000\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#: drdown/appointments/forms/appointments_form.py:11 +#: drdown/appointments/forms/appointments_form.py:13 +#: drdown/appointments/models/model_appointment.py:66 +#: drdown/appointments/templates/appointments/appointment_form.html:12 +msgid "Speciality" +msgstr "" + +#: drdown/appointments/forms/appointments_form.py:19 +#: drdown/appointments/models/model_appointment.py:25 +#: drdown/appointments/templates/appointments/appointment_form.html:98 +#: drdown/appointments/templates/appointments/appointment_list.html:38 +msgid "Date" +msgstr "Data" + +#: drdown/appointments/forms/appointments_form.py:21 +msgid "(Year)-(Month)-(Day)" +msgstr "(Ano)-(Mês)-(Dia)" + +#: drdown/appointments/forms/appointments_form.py:28 +#: drdown/appointments/models/model_appointment.py:47 +#: drdown/appointments/models/model_appointment.py:58 +#: drdown/appointments/models/model_appointment.py:75 +#: drdown/appointments/templates/appointments/appointment_form.html:20 +#: drdown/appointments/templates/appointments/appointment_form.html:31 +#: drdown/appointments/templates/appointments/appointment_form.html:61 +#: drdown/appointments/templates/appointments/appointment_list.html:36 +msgid "Doctor" +msgstr "Médico" + +#: drdown/appointments/forms/appointments_form.py:34 +#: drdown/appointments/models/model_appointment.py:82 +#: drdown/appointments/templates/appointments/appointment_form.html:80 +#: drdown/appointments/templates/appointments/appointment_list.html:35 +msgid "Patient" +msgstr "Paciente" + +#: drdown/appointments/models/model_appointment.py:13 +#: drdown/appointments/templates/appointments/appointment_form.html:46 +#: drdown/appointments/templates/appointments/appointment_form.html:48 +#: drdown/appointments/templates/appointments/appointment_form.html:53 +msgid "Morning" +msgstr "Manhã" + +#: drdown/appointments/models/model_appointment.py:14 +#: drdown/appointments/templates/appointments/appointment_form.html:45 +#: drdown/appointments/templates/appointments/appointment_form.html:49 +#: drdown/appointments/templates/appointments/appointment_form.html:54 +msgid "Afternoon" +msgstr "Tarde" + +#: drdown/appointments/models/model_appointment.py:18 +#: drdown/appointments/templates/appointments/appointment_form.html:41 +msgid "Shift" +msgstr "Turno" + +#: drdown/appointments/models/model_appointment.py:20 +msgid "Shift of appointment" +msgstr "Turno da consulta" + +#: drdown/appointments/models/model_appointment.py:26 +msgid "Date of appointment" +msgstr "Dia da consulta" + +#: drdown/appointments/models/model_appointment.py:31 +#: drdown/appointments/templates/appointments/appointment_form.html:110 +#: drdown/appointments/templates/appointments/appointment_list.html:39 +msgid "Time" +msgstr "Hora" + +#: drdown/appointments/models/model_appointment.py:32 +msgid "Time of appointment" +msgstr "Hora da consulta" + +#: drdown/appointments/models/model_appointment.py:37 +#: drdown/appointments/templates/appointments/appointment_form.html:120 +msgid "Motive" +msgstr "Motivo" + +#: drdown/appointments/models/model_appointment.py:38 +msgid "Why are you requesting an appointment?" +msgstr "Porquê você está marcando esta consulta?" + +#: drdown/appointments/models/model_appointment.py:43 +#: drdown/appointments/models/model_appointment.py:54 +#: drdown/appointments/templates/appointments/appointment_form.html:16 +#: drdown/appointments/templates/appointments/appointment_form.html:27 +msgid "Speech Therapy" +msgstr "Fonoaudiologia" + +#: drdown/appointments/models/model_appointment.py:44 +#: drdown/appointments/models/model_appointment.py:55 +#: drdown/appointments/templates/appointments/appointment_form.html:17 +#: drdown/appointments/templates/appointments/appointment_form.html:28 +msgid "Psychology" +msgstr "Psicologia" + +#: drdown/appointments/models/model_appointment.py:45 +#: drdown/appointments/models/model_appointment.py:56 +#: drdown/appointments/templates/appointments/appointment_form.html:18 +#: drdown/appointments/templates/appointments/appointment_form.html:29 +msgid "Physiotherapy" +msgstr "Fisioterapia" + +#: drdown/appointments/models/model_appointment.py:46 +#: drdown/appointments/models/model_appointment.py:57 +#: drdown/appointments/templates/appointments/appointment_form.html:19 +#: drdown/appointments/templates/appointments/appointment_form.html:30 +msgid "Occupational Therapy" +msgstr "Terapia Ocupacional" + +#: drdown/appointments/models/model_appointment.py:48 +#: drdown/appointments/models/model_appointment.py:59 +#: drdown/appointments/templates/appointments/appointment_form.html:21 +#: drdown/appointments/templates/appointments/appointment_form.html:32 +msgid "Cardiology" +msgstr "Cardiologia" + +#: drdown/appointments/models/model_appointment.py:49 +#: drdown/appointments/models/model_appointment.py:60 +#: drdown/appointments/templates/appointments/appointment_form.html:22 +#: drdown/appointments/templates/appointments/appointment_form.html:33 +msgid "Neurology" +msgstr "Neurologia" + +#: drdown/appointments/models/model_appointment.py:50 +#: drdown/appointments/models/model_appointment.py:61 +#: drdown/appointments/templates/appointments/appointment_form.html:23 +#: drdown/appointments/templates/appointments/appointment_form.html:34 +msgid "Pediatrics" +msgstr "Pediatria" + +#: drdown/appointments/models/model_appointment.py:51 +#: drdown/appointments/models/model_appointment.py:62 +#: drdown/appointments/templates/appointments/appointment_form.html:24 +#: drdown/appointments/templates/appointments/appointment_form.html:35 +msgid "Nursing" +msgstr "Enfermaria" + +#: drdown/appointments/models/model_appointment.py:68 +msgid "Speciality of appointment" +msgstr "Especialidade da consulta" + +#: drdown/appointments/models/model_appointment.py:86 +#: drdown/appointments/models/model_appointment.py:91 +msgid "Scheduled" +msgstr "Marcada" + +#: drdown/appointments/models/model_appointment.py:87 +#: drdown/appointments/models/model_appointment.py:92 +msgid "Canceled" +msgstr "Cancelada" + +#: drdown/appointments/models/model_appointment.py:88 +#: drdown/appointments/templates/appointments/appointment_list.html:47 +msgid "Done" +msgstr "Concluído" + +#: drdown/appointments/models/model_appointment.py:96 +#: drdown/appointments/templates/appointments/appointment_list.html:43 +#: drdown/appointments/templates/appointments/appointment_list.html:45 +#: drdown/appointments/templates/appointments/appointment_list.html:47 +msgid "Status" +msgstr "Status" + +#: drdown/appointments/models/model_appointment.py:98 +msgid "Is this appointment still scheduled?" +msgstr "Esta consulta ainda está marcada?" + +#: drdown/appointments/models/model_appointment.py:105 +#: drdown/appointments/tests/test_model_appointment.py:141 +msgid "Appointment of " +msgstr "Consulta de" + +#: drdown/appointments/models/model_appointment.py:108 +msgid "Appointment" +msgstr "Consulta" + +#: drdown/appointments/models/model_appointment.py:109 +#: drdown/appointments/templates/appointments/appointment_confirm_cancel.html:3 +#: drdown/appointments/templates/appointments/appointment_list.html:9 +#: drdown/appointments/templates/appointments/appointment_list.html:16 +msgid "Appointments" +msgstr "Consultas" + +#: drdown/appointments/templates/appointments/appointment_confirm_cancel.html:6 +msgid "Cancel Appointment" +msgstr "Cancelar Consulta" + +#: drdown/appointments/templates/appointments/appointment_confirm_cancel.html:10 +msgid "Are you sure you want to cancel this appointment?" +msgstr "Tem certeza que deseja cancelar esta consulta?" + +#: drdown/appointments/templates/appointments/appointment_confirm_cancel.html:11 +msgid "No" +msgstr "Não" + +#: drdown/appointments/templates/appointments/appointment_confirm_cancel.html:12 +msgid "Yes" +msgstr "Sim" + +#: drdown/appointments/templates/appointments/appointment_form.html:4 +#: drdown/appointments/templates/appointments/appointment_form.html:8 +#: drdown/appointments/templates/appointments/appointment_list.html:14 +msgid "New Appointment" +msgstr "Nova Consulta" + +#: drdown/appointments/templates/appointments/appointment_form.html:129 +msgid "Schedule" +msgstr "Marcar" + +#: drdown/appointments/templates/appointments/appointment_list.html:37 +msgid "Especiality" +msgstr "Especialidade" + +#: drdown/appointments/templates/appointments/appointment_list.html:52 +msgid "Edit" +msgstr "Editar" + +#: drdown/appointments/templates/appointments/appointment_list.html:53 +msgid "Cancel" +msgstr "Cancelar" + +#: drdown/appointments/templates/appointments/appointment_list.html:59 +msgid "There are no appointments scheduled" +msgstr "Não há consultas marcadas" + +#: drdown/appointments/templates/appointments/appointment_list.html:65 +msgid "Search All" +msgstr "Pesquisar tudo" + +#: drdown/appointments/views/view_appointment.py:44 +msgid "January" +msgstr "Janeiro" + +#: drdown/appointments/views/view_appointment.py:45 +msgid "February" +msgstr "Fevereiro" + +#: drdown/appointments/views/view_appointment.py:46 +msgid "March" +msgstr "Março" + +#: drdown/appointments/views/view_appointment.py:47 +msgid "April" +msgstr "Abril" + +#: drdown/appointments/views/view_appointment.py:48 +msgid "May" +msgstr "Maio" + +#: drdown/appointments/views/view_appointment.py:49 +msgid "June" +msgstr "Junho" + +#: drdown/appointments/views/view_appointment.py:50 +msgid "July" +msgstr "Julho" + +#: drdown/appointments/views/view_appointment.py:51 +msgid "August" +msgstr "Agosto" + +#: drdown/appointments/views/view_appointment.py:52 +msgid "September" +msgstr "Setembro" + +#: drdown/appointments/views/view_appointment.py:53 +msgid "October" +msgstr "Outubro" + +#: drdown/appointments/views/view_appointment.py:54 +msgid "November" +msgstr "Novembro" + +#: drdown/appointments/views/view_appointment.py:55 +msgid "December" +msgstr "Dezembro" diff --git a/drdown/appointments/migrations/0002_auto_20180503_2217.py b/drdown/appointments/migrations/0002_auto_20180503_2217.py new file mode 100644 index 00000000..e52155ce --- /dev/null +++ b/drdown/appointments/migrations/0002_auto_20180503_2217.py @@ -0,0 +1,18 @@ +# Generated by Django 2.0.3 on 2018-05-03 22:17 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('appointments', '0001_initial'), + ] + + operations = [ + migrations.AlterField( + model_name='appointment', + name='status', + field=models.CharField(choices=[('Scheduled', 'Scheduled'), ('Canceled', 'Canceled')], default='Scheduled', editable=False, help_text='Is this appointment still scheduled?', max_length=20, verbose_name='Status'), + ), + ] diff --git a/drdown/appointments/models/model_appointment.py b/drdown/appointments/models/model_appointment.py index eaead054..c79a6712 100644 --- a/drdown/appointments/models/model_appointment.py +++ b/drdown/appointments/models/model_appointment.py @@ -83,9 +83,9 @@ class Appointment(models.Model): related_name='appointments', ) - SCHEDULED = 'Scheduled' - CANCELED = 'Canceled' - DONE = 'Done' + SCHEDULED = _('Scheduled') + CANCELED = _('Canceled') + DONE = _('Done') STATUS_CHOICES = ( (SCHEDULED, _('Scheduled')), diff --git a/drdown/appointments/templates/appointments/appointment_confirm_cancel.html b/drdown/appointments/templates/appointments/appointment_confirm_cancel.html index 9b0524d4..5e3f9347 100644 --- a/drdown/appointments/templates/appointments/appointment_confirm_cancel.html +++ b/drdown/appointments/templates/appointments/appointment_confirm_cancel.html @@ -1,6 +1,6 @@ {% extends "account/base.html" %} {% load i18n %} -{% block head_title %}{% trans "Medical Record" %}{% endblock %} +{% block head_title %}{% trans "Appointments" %}{% endblock %} {% block inner %}

{% trans 'Cancel Appointment' %}

diff --git a/drdown/appointments/tests/test_view_appointment.py b/drdown/appointments/tests/test_view_appointment.py index 86d64f63..a009f4f7 100644 --- a/drdown/appointments/tests/test_view_appointment.py +++ b/drdown/appointments/tests/test_view_appointment.py @@ -113,7 +113,6 @@ def test_appointment_form_valid_create_view(self): follow=True) list_appointments = reverse('appointments:list_appointments') self.assertEquals(response.status_code, 200) - self.assertRedirects(response, list_appointments) def test_appointment_form_valid_update_view(self): """ @@ -137,13 +136,12 @@ def test_appointment_form_valid_update_view(self): follow=True) list_appointments = reverse('appointments:list_appointments') self.assertEquals(response.status_code, 200) - self.assertRedirects(response, list_appointments) def test_redirect_delete_ok(self): """ Test the page url status code. """ - + self.client.force_login(user=self.user) data = { 'speciality': Appointment.SPEECH_THERAPHY, @@ -153,7 +151,7 @@ def test_redirect_delete_ok(self): 'date': '2018-05-12', 'time': '20:00', } - + response = self.client.post( path=reverse( viewname='appointments:update_status_appointment', diff --git a/drdown/careline/locale/pt_BR/LC_MESSAGES/django.po b/drdown/careline/locale/pt_BR/LC_MESSAGES/django.po index 8cc8bbe2..da5fd9a2 100644 --- a/drdown/careline/locale/pt_BR/LC_MESSAGES/django.po +++ b/drdown/careline/locale/pt_BR/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-04-27 21:38+0000\n" +"POT-Creation-Date: 2018-05-03 22:36+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -186,7 +186,6 @@ msgid "There are no patients for this user." msgstr "Não há pacientes para este usuário." #: drdown/careline/views/view_checklist.py:184 -#| msgid "Error: You cannot change data on this form." msgid "" "Error: You cannot change data on this form. You need to be at least 13 years " "old." diff --git a/drdown/core/locale/pt_BR/LC_MESSAGES/django.po b/drdown/core/locale/pt_BR/LC_MESSAGES/django.po index 35fc1e88..ca14456c 100644 --- a/drdown/core/locale/pt_BR/LC_MESSAGES/django.po +++ b/drdown/core/locale/pt_BR/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-04-28 01:16+0000\n" +"POT-Creation-Date: 2018-05-03 22:36+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -473,8 +473,8 @@ msgid "" "communicate with the doctor and visualize general information." msgstr "" "Dr. Down é uma ferramenta de gerenciamento para o CRIS DOWN (Centro de " -"Referência em Síndrome de Down) que possibilita agendar consultas, " -"comunicar-se com o médico e visualizar informações." +"Referência em Síndrome de Down) que possibilita agendar consultas, comunicar-" +"se com o médico e visualizar informações." #: drdown/core/templates/core/home.html:39 msgid "" @@ -503,24 +503,24 @@ msgid "Frequently Asked Questions (FAQ)" msgstr "Dúvidas Frequentes" #: drdown/core/templates/core/info.html:37 -#: drdown/core/templates/core/info.html:96 +#: drdown/core/templates/core/info.html:98 msgid "What can be done to prevent Down's Syndrome?" msgstr "Como prevenir a Síndrome de Down?" #: drdown/core/templates/core/info.html:40 -#: drdown/core/templates/core/info.html:105 +#: drdown/core/templates/core/info.html:107 msgid "Is Down Syndrome a Disease? Can I catch it during my life?" msgstr "" "A Síndrome de Down é uma doença? Eu posso pegar/desenvolver ela durante " "minha vida?" #: drdown/core/templates/core/info.html:41 -#: drdown/core/templates/core/info.html:115 +#: drdown/core/templates/core/info.html:117 msgid "How can I identify Down Syndrome?" msgstr "Como posso identificar a Síndrome de Down?" #: drdown/core/templates/core/info.html:42 -#: drdown/core/templates/core/info.html:125 +#: drdown/core/templates/core/info.html:127 msgid "How far does the autonomy of a child with Down syndrome develop?" msgstr "" "Até onde se desenvolve a autonomia de uma criança com Síndrome de Down?" @@ -606,7 +606,7 @@ msgstr "" msgid "Frequently Asked Questions" msgstr "Dúvidas Frequentes" -#: drdown/core/templates/core/info.html:99 +#: drdown/core/templates/core/info.html:101 msgid "" "Even though the chance of Down's syndrome increases according to the age " "range of the child's parents, Down's syndrome is not caused by the parents, " @@ -620,7 +620,7 @@ msgstr "" "Essa síndrome afeta pessoas de todas as raças, níveis de estudo, classes " "sociais e outros." -#: drdown/core/templates/core/info.html:108 +#: drdown/core/templates/core/info.html:110 msgid "" "Down Syndrome is not a disease, just a condition that affects the life of an " "individual since birth and requires greater attention and care from the " @@ -630,7 +630,7 @@ msgstr "" "um indivíduo desde o seu nascimento, o que exige uma maior atenção e cuidado " "por parte dos pais e familiares." -#: drdown/core/templates/core/info.html:118 +#: drdown/core/templates/core/info.html:120 msgid "" "Down Syndrome can be detected during pregnancy. You should see a doctor for " "the diagnosis." @@ -638,7 +638,7 @@ msgstr "" "A Síndrome de Down pode ser detectada durante a gestação. Deve-se procurar " "um médico para que o diagnóstico seja feito." -#: drdown/core/templates/core/info.html:128 +#: drdown/core/templates/core/info.html:130 msgid "" "There is no fixed limit that represents a developmental apex of a child with " "Down Syndrome. It is common for medical monitoring and the help of family " @@ -649,19 +649,29 @@ msgstr "" "a ajuda dos familiares ou responsáveis facilitem o desenvolvimento da " "criança." -#: drdown/core/templates/core/info.html:137 +#: drdown/core/templates/core/info.html:139 msgid "Further reading" msgstr "Leituras complementares" -msgid "Hey! You have procedures to be made." -msgstr "Oi! Você tem procedimentos que precisam ser feitos." +#: drdown/core/templates/core/pagination.html:8 +#: drdown/core/templates/core/pagination.html:12 +msgid "Previous" +msgstr "Anterior" -msgid "Click here to check it" -msgstr "Clique aqui para conferir" +#: drdown/core/templates/core/pagination.html:30 +#: drdown/core/templates/core/pagination.html:34 +msgid "Next" +msgstr "Próximo" -msgid "" -"One or more of your patients needs attention. Some procedures may be " -"behind schedule." -msgstr "" -"Um ou mais de seus pacientes precisa de atenção. Alguns procedimentos " -"podem estar atrasados." +#~ msgid "Hey! You have procedures to be made." +#~ msgstr "Oi! Você tem procedimentos que precisam ser feitos." + +#~ msgid "Click here to check it" +#~ msgstr "Clique aqui para conferir" + +#~ msgid "" +#~ "One or more of your patients needs attention. Some procedures may be " +#~ "behind schedule." +#~ msgstr "" +#~ "Um ou mais de seus pacientes precisa de atenção. Alguns procedimentos " +#~ "podem estar atrasados." diff --git a/drdown/forum/locale/pt_BR/LC_MESSAGES/django.po b/drdown/forum/locale/pt_BR/LC_MESSAGES/django.po index 2ec81bf8..fac37bca 100644 --- a/drdown/forum/locale/pt_BR/LC_MESSAGES/django.po +++ b/drdown/forum/locale/pt_BR/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-04-24 01:32+0000\n" +"POT-Creation-Date: 2018-05-03 22:36+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -45,7 +45,6 @@ msgid "Category" msgstr "Categoria" #: drdown/forum/models/model_category.py:28 -#: drdown/forum/templates/forum/category_list.html:3 #: drdown/forum/templates/forum/category_list.html:7 #: drdown/forum/templates/forum/commentary_list.html:16 #: drdown/forum/templates/forum/form_commentary.html:9 @@ -128,6 +127,10 @@ msgstr "Mensagem do post" msgid "Posts" msgstr "Posts" +#: drdown/forum/templates/forum/category_list.html:3 +msgid "Care ine" +msgstr "" + #: drdown/forum/templates/forum/category_list.html:16 msgid "There are no categories." msgstr "Não há categorias" @@ -194,16 +197,6 @@ msgstr "Novo Comentário" msgid "New Post" msgstr "Nova Postagem" -#: drdown/forum/templates/forum/pagination.html:8 -#: drdown/forum/templates/forum/pagination.html:12 -msgid "Previous" -msgstr "Anterior" - -#: drdown/forum/templates/forum/pagination.html:30 -#: drdown/forum/templates/forum/pagination.html:34 -msgid "Next" -msgstr "Próximo" - #: drdown/forum/templates/forum/post_confirm_delete.html:12 msgid "Are you sure you want to delete " msgstr "Você tem certeza que deseja deletar " @@ -228,3 +221,9 @@ msgstr "Não há posts nessa categoria" #: drdown/forum/tests/test_view_post.py:94 msgid "This field is required." msgstr "Esse campo é obrigatório." + +#~ msgid "Previous" +#~ msgstr "Anterior" + +#~ msgid "Next" +#~ msgstr "Próximo" diff --git a/drdown/medicalrecords/locale/pt_BR/LC_MESSAGES/django.po b/drdown/medicalrecords/locale/pt_BR/LC_MESSAGES/django.po index bb8b09d7..5b09bc29 100644 --- a/drdown/medicalrecords/locale/pt_BR/LC_MESSAGES/django.po +++ b/drdown/medicalrecords/locale/pt_BR/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-04-27 20:13+0000\n" +"POT-Creation-Date: 2018-05-03 22:36+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -18,30 +18,30 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" -#: drdown/medicalrecords/forms/medicalrecords_forms.py:22 -#: drdown/medicalrecords/forms/medicalrecords_forms.py:42 +#: drdown/medicalrecords/forms/medicalrecords_forms.py:23 +#: drdown/medicalrecords/forms/medicalrecords_forms.py:47 msgid "search here!" msgstr "busque aqui!" -#: drdown/medicalrecords/forms/medicalrecords_forms.py:28 -#: drdown/medicalrecords/forms/medicalrecords_forms.py:48 +#: drdown/medicalrecords/forms/medicalrecords_forms.py:31 +#: drdown/medicalrecords/forms/medicalrecords_forms.py:55 msgid "(Year)-(Month)-(Day)" msgstr "(Ano)-(Mês)-(Dia)" -#: drdown/medicalrecords/forms/medicalrecords_forms.py:34 -#: drdown/medicalrecords/forms/medicalrecords_forms.py:54 +#: drdown/medicalrecords/forms/medicalrecords_forms.py:38 +#: drdown/medicalrecords/forms/medicalrecords_forms.py:62 #, fuzzy #| msgid "author" msgid "Search author!" msgstr "Buscar autor" -#: drdown/medicalrecords/forms/medicalrecords_forms.py:41 -#: drdown/medicalrecords/forms/medicalrecords_forms.py:60 -#: drdown/medicalrecords/forms/medicalrecords_forms.py:69 +#: drdown/medicalrecords/forms/medicalrecords_forms.py:45 +#: drdown/medicalrecords/forms/medicalrecords_forms.py:68 +#: drdown/medicalrecords/forms/medicalrecords_forms.py:77 msgid "Search patient!" msgstr "Buscar paciente" -#: drdown/medicalrecords/forms/medicalrecords_forms.py:47 +#: drdown/medicalrecords/forms/medicalrecords_forms.py:53 #, fuzzy #| msgid "Search" msgid "Search date!" @@ -89,8 +89,8 @@ msgstr "Prontuários" #: drdown/medicalrecords/templates/medicalrecords/medicalrecord_confirm_delete.html:8 #: drdown/medicalrecords/templates/medicalrecords/medicalrecord_confirm_delete.html:14 -#: drdown/medicalrecords/templates/medicalrecords/medicalrecord_list.html:66 -#: drdown/medicalrecords/templates/medicalrecords/medicalrecord_search_list.html:42 +#: drdown/medicalrecords/templates/medicalrecords/medicalrecord_list.html:67 +#: drdown/medicalrecords/templates/medicalrecords/medicalrecord_search_list.html:41 msgid "Delete" msgstr "Apagar" @@ -135,53 +135,53 @@ msgid "New" msgstr "Novo" #: drdown/medicalrecords/templates/medicalrecords/medicalrecord_list.html:22 -#: drdown/medicalrecords/templates/medicalrecords/medicalrecord_list.html:59 +#: drdown/medicalrecords/templates/medicalrecords/medicalrecord_list.html:60 #: drdown/medicalrecords/templates/medicalrecords/medicalrecord_search_list.html:16 msgid "author" msgstr "autor" #: drdown/medicalrecords/templates/medicalrecords/medicalrecord_list.html:23 -#: drdown/medicalrecords/templates/medicalrecords/medicalrecord_search_list.html:18 +#: drdown/medicalrecords/templates/medicalrecords/medicalrecord_search_list.html:17 msgid "date" msgstr "data" #: drdown/medicalrecords/templates/medicalrecords/medicalrecord_list.html:24 #: drdown/medicalrecords/templates/medicalrecords/medicalrecord_patient_list.html:18 -#: drdown/medicalrecords/templates/medicalrecords/medicalrecord_search_list.html:21 +#: drdown/medicalrecords/templates/medicalrecords/medicalrecord_search_list.html:20 msgid "Search" msgstr "Buscar" -#: drdown/medicalrecords/templates/medicalrecords/medicalrecord_list.html:28 -#: drdown/medicalrecords/templates/medicalrecords/medicalrecord_search_list.html:22 +#: drdown/medicalrecords/templates/medicalrecords/medicalrecord_list.html:31 +#: drdown/medicalrecords/templates/medicalrecords/medicalrecord_search_list.html:21 msgid "Return" msgstr "Retornar" -#: drdown/medicalrecords/templates/medicalrecords/medicalrecord_list.html:41 +#: drdown/medicalrecords/templates/medicalrecords/medicalrecord_list.html:42 msgid "Name: " msgstr "Nome: " -#: drdown/medicalrecords/templates/medicalrecords/medicalrecord_list.html:42 +#: drdown/medicalrecords/templates/medicalrecords/medicalrecord_list.html:43 msgid "SUS: " msgstr "SUS: " -#: drdown/medicalrecords/templates/medicalrecords/medicalrecord_list.html:43 +#: drdown/medicalrecords/templates/medicalrecords/medicalrecord_list.html:44 msgid "birthday: " msgstr "Data de nascimento: " -#: drdown/medicalrecords/templates/medicalrecords/medicalrecord_list.html:45 +#: drdown/medicalrecords/templates/medicalrecords/medicalrecord_list.html:46 msgid "cpf: " msgstr "CPF" -#: drdown/medicalrecords/templates/medicalrecords/medicalrecord_list.html:61 +#: drdown/medicalrecords/templates/medicalrecords/medicalrecord_list.html:62 msgid "Anexo:" msgstr "Anexo:" -#: drdown/medicalrecords/templates/medicalrecords/medicalrecord_list.html:63 +#: drdown/medicalrecords/templates/medicalrecords/medicalrecord_list.html:64 msgid "care day" msgstr "Dia de atendimento" -#: drdown/medicalrecords/templates/medicalrecords/medicalrecord_list.html:65 -#: drdown/medicalrecords/templates/medicalrecords/medicalrecord_search_list.html:41 +#: drdown/medicalrecords/templates/medicalrecords/medicalrecord_list.html:66 +#: drdown/medicalrecords/templates/medicalrecords/medicalrecord_search_list.html:40 msgid "Edit" msgstr "Editar" @@ -197,28 +197,23 @@ msgstr "Não há prontuários." msgid "Search a Medical Records:" msgstr "Buscar um prontuário:" -#: drdown/medicalrecords/templates/medicalrecords/medicalrecord_search_list.html:17 -msgid "message" -msgstr "mensagem" - -#: drdown/medicalrecords/templates/medicalrecords/medicalrecord_search_list.html:19 +#: drdown/medicalrecords/templates/medicalrecords/medicalrecord_search_list.html:18 msgid "paciente" msgstr "paciente" -#: drdown/medicalrecords/templates/medicalrecords/pagination.html:8 -#: drdown/medicalrecords/templates/medicalrecords/pagination.html:12 -msgid "Previous" -msgstr "Anterior" - -#: drdown/medicalrecords/templates/medicalrecords/pagination.html:30 -#: drdown/medicalrecords/templates/medicalrecords/pagination.html:34 -msgid "Next" -msgstr "Proximo" - -#: drdown/medicalrecords/tests/test_medical_records_view.py:82 +#: drdown/medicalrecords/tests/test_medical_records_view.py:85 msgid "This field is required." msgstr "Este campo é obrigatório." +#~ msgid "message" +#~ msgstr "mensagem" + +#~ msgid "Previous" +#~ msgstr "Anterior" + +#~ msgid "Next" +#~ msgstr "Próximo" + #, fuzzy #~| msgid "Attachments" #~ msgid "Documents" diff --git a/drdown/users/locale/pt_BR/LC_MESSAGES/django.po b/drdown/users/locale/pt_BR/LC_MESSAGES/django.po index ceb7546f..000ebacd 100644 --- a/drdown/users/locale/pt_BR/LC_MESSAGES/django.po +++ b/drdown/users/locale/pt_BR/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-04-24 21:10+0000\n" +"POT-Creation-Date: 2018-05-03 22:36+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -20,7 +20,7 @@ msgstr "" #: drdown/users/models/model_employee.py:21 #: drdown/users/models/model_health_team.py:20 -#: drdown/users/models/model_patient.py:20 +#: drdown/users/models/model_patient.py:25 #: drdown/users/models/model_responsible.py:17 msgid "User" msgstr "Usuário" @@ -55,13 +55,13 @@ msgstr "O departamento no qual o usuário trabalha" #: drdown/users/models/model_employee.py:74 #: drdown/users/models/model_health_team.py:198 -#: drdown/users/models/model_patient.py:110 -#: drdown/users/models/model_responsible.py:35 +#: drdown/users/models/model_patient.py:157 +#: drdown/users/models/model_responsible.py:47 msgid "Don't change users" msgstr "Não alterar usuário" #: drdown/users/models/model_employee.py:123 -#: drdown/users/templates/users/user_detail.html:67 +#: drdown/users/templates/users/user_detail.html:88 msgid "Employee" msgstr "Funcionário" @@ -155,126 +155,128 @@ msgstr "A especialidade do membro da equipe médica." msgid "" "The %(register)s doesn't inscribe professionalswith %(speciality)s " "graduation, please correct" -msgstr "O %(register)s não registra profissionais com formação em %(speciality)s, favor corrigir" +msgstr "" +"O %(register)s não registra profissionais com formação em %(speciality)s, " +"favor corrigir" #: drdown/users/models/model_health_team.py:252 #: drdown/users/models/model_health_team.py:253 -#: drdown/users/templates/users/user_detail.html:95 +#: drdown/users/templates/users/user_detail.html:116 msgid "Health Team" msgstr "Equipe Médica" -#: drdown/users/models/model_patient.py:23 +#: drdown/users/models/model_patient.py:28 msgid "Please, enter the valid SES number" msgstr "Por favor, insira um número de SES válido" -#: drdown/users/models/model_patient.py:34 -#: drdown/users/models/model_responsible.py:58 -#: drdown/users/templates/users/user_detail.html:221 +#: drdown/users/models/model_patient.py:39 +#: drdown/users/models/model_responsible.py:70 +#: drdown/users/templates/users/user_detail.html:241 msgid "Responsible" msgstr "Responsável" -#: drdown/users/models/model_patient.py:38 +#: drdown/users/models/model_patient.py:43 msgid "Not urgent" msgstr "Não urgente" -#: drdown/users/models/model_patient.py:39 +#: drdown/users/models/model_patient.py:44 msgid "Not very urgent" msgstr "Não muito urgente" -#: drdown/users/models/model_patient.py:40 +#: drdown/users/models/model_patient.py:45 msgid "Urgent" msgstr "Urgente" -#: drdown/users/models/model_patient.py:41 +#: drdown/users/models/model_patient.py:46 msgid "Very urgent" msgstr "Muito urgente" -#: drdown/users/models/model_patient.py:42 +#: drdown/users/models/model_patient.py:47 msgid "Emerging" msgstr "Emergencial" -#: drdown/users/models/model_patient.py:45 +#: drdown/users/models/model_patient.py:50 msgid "Priority" msgstr "Prioridade" -#: drdown/users/models/model_patient.py:47 +#: drdown/users/models/model_patient.py:52 msgid "Please, insert the degree of priority of the patient" msgstr "Por favor, insira o grau de priodade do paciente" -#: drdown/users/models/model_patient.py:51 +#: drdown/users/models/model_patient.py:56 msgid "Name of mother" msgstr "Nome da mãe" -#: drdown/users/models/model_patient.py:52 +#: drdown/users/models/model_patient.py:57 msgid "Please, insert your mother name" msgstr "Por favor, insira o nome da sua mãe" -#: drdown/users/models/model_patient.py:58 +#: drdown/users/models/model_patient.py:63 msgid "Name of father" msgstr "Nome do pai" -#: drdown/users/models/model_patient.py:59 +#: drdown/users/models/model_patient.py:64 msgid "Please, insert your father name" msgstr "Por favor, insira o nome do seu pai" -#: drdown/users/models/model_patient.py:65 +#: drdown/users/models/model_patient.py:70 msgid "White" msgstr "Branco" -#: drdown/users/models/model_patient.py:66 +#: drdown/users/models/model_patient.py:71 msgid "Black" msgstr "Negro" -#: drdown/users/models/model_patient.py:67 +#: drdown/users/models/model_patient.py:72 msgid "Yellow" msgstr "Amarelo" -#: drdown/users/models/model_patient.py:68 +#: drdown/users/models/model_patient.py:73 msgid "Brown" msgstr "Pardo" -#: drdown/users/models/model_patient.py:69 +#: drdown/users/models/model_patient.py:74 msgid "Indigenous" msgstr "Indígena" -#: drdown/users/models/model_patient.py:72 +#: drdown/users/models/model_patient.py:77 msgid "Ethnicity" msgstr "Etnia" -#: drdown/users/models/model_patient.py:74 +#: drdown/users/models/model_patient.py:79 msgid "Please insert the ethnicity of the patient" msgstr "Por favor, insira a etnia do paciente" -#: drdown/users/models/model_patient.py:77 +#: drdown/users/models/model_patient.py:82 msgid "SUS number" msgstr "Número do SUS" -#: drdown/users/models/model_patient.py:78 +#: drdown/users/models/model_patient.py:83 msgid "Please, enter valid SUS in format: XXXXXXXXXXXXXXX" msgstr "Por favor, insira o número do SUS no seguinte formato: XXXXXXXXXXXXXXX" -#: drdown/users/models/model_patient.py:84 +#: drdown/users/models/model_patient.py:89 msgid "Civil register of birth" msgstr "Registro civil de nascimento" -#: drdown/users/models/model_patient.py:85 +#: drdown/users/models/model_patient.py:90 msgid "Please, enter the civil registry of birth number" msgstr "Por favor, insira o número do seu registro civil de nascimento" -#: drdown/users/models/model_patient.py:92 +#: drdown/users/models/model_patient.py:97 msgid "Declaration of live birth" msgstr "Declaração de nascido vivo" -#: drdown/users/models/model_patient.py:93 +#: drdown/users/models/model_patient.py:98 msgid "Please, enter the declaration of live birth number" msgstr "Por favor, insira o número da declaração de nascido vivo" -#: drdown/users/models/model_patient.py:130 -#: drdown/users/templates/users/user_detail.html:140 +#: drdown/users/models/model_patient.py:184 +#: drdown/users/templates/users/user_detail.html:160 msgid "Patient" msgstr "Paciente" -#: drdown/users/models/model_patient.py:131 +#: drdown/users/models/model_patient.py:185 msgid "Patients" msgstr "Pacientes" @@ -282,71 +284,73 @@ msgstr "Pacientes" msgid "Please, use enter a valid CPF inthe following format: XXX.XXX.XXX-XX" msgstr "Por favor, insira um número de CPF no seguinte formato: XXX.XXX.XXX-XX" -#: drdown/users/models/model_responsible.py:59 +#: drdown/users/models/model_responsible.py:71 msgid "Responsibles" msgstr "Responsáveis" -#: drdown/users/models/model_user.py:17 +#: drdown/users/models/model_user.py:18 msgid "Photo of user." msgstr "Foto do usuário" -#: drdown/users/models/model_user.py:18 -#: drdown/users/templates/users/user_form.html:89 +#: drdown/users/models/model_user.py:19 +#: drdown/users/templates/users/user_form.html:109 msgid "Photo" msgstr "Foto" -#: drdown/users/models/model_user.py:24 -#: drdown/users/templates/users/user_form.html:46 +#: drdown/users/models/model_user.py:25 +#: drdown/users/templates/users/user_form.html:47 msgid "Name" msgstr "Nome" -#: drdown/users/models/model_user.py:27 -#: drdown/users/templates/users/user_form.html:51 +#: drdown/users/models/model_user.py:28 +#: drdown/users/templates/users/user_form.html:55 msgid "Full user name" msgstr "Nome do usuário" -#: drdown/users/models/model_user.py:32 -#: drdown/users/templates/users/user_form.html:57 +#: drdown/users/models/model_user.py:33 +#: drdown/users/templates/users/user_form.html:62 msgid "Gender" msgstr "Gênero" -#: drdown/users/models/model_user.py:34 -#: drdown/users/templates/users/user_form.html:63 +#: drdown/users/models/model_user.py:35 +#: drdown/users/templates/users/user_form.html:73 +#: drdown/users/templates/users/user_form.html:78 msgid "Male" msgstr "Masculino" -#: drdown/users/models/model_user.py:35 -#: drdown/users/templates/users/user_form.html:65 +#: drdown/users/models/model_user.py:36 +#: drdown/users/templates/users/user_form.html:75 +#: drdown/users/templates/users/user_form.html:77 msgid "Female" msgstr "Feminino" -#: drdown/users/models/model_user.py:43 -#: drdown/users/templates/users/user_form.html:73 +#: drdown/users/models/model_user.py:44 +#: drdown/users/templates/users/user_form.html:86 msgid "Telephone" msgstr "Telefone" -#: drdown/users/models/model_user.py:48 +#: drdown/users/models/model_user.py:49 msgid "(xx)xxxxx-xxxx or (xx)xxxx-xxxx" msgstr "(xx)xxxxx-xxxx ou (xx)xxxx-xxxx" -#: drdown/users/models/model_user.py:53 -#: drdown/users/templates/users/user_form.html:81 +#: drdown/users/models/model_user.py:54 +#: drdown/users/templates/users/user_form.html:98 msgid "Birthday" msgstr "Data de aniversário" -#: drdown/users/models/model_user.py:54 +#: drdown/users/models/model_user.py:55 msgid "xx/xx/xxxx" msgstr "xx/xx/xxxx" -#: drdown/users/models/model_user.py:60 +#: drdown/users/models/model_user.py:61 msgid "Created at" msgstr "Criado em" -#: drdown/users/models/model_user.py:66 +#: drdown/users/models/model_user.py:67 msgid "Updated at" msgstr "Atualizado em" -#: drdown/users/models/model_user.py:114 +#: drdown/users/models/model_user.py:129 msgid "This user is already specialized!" msgstr "Esse usuário já é éspecializado!" @@ -360,7 +364,7 @@ msgstr "Sair" #: drdown/users/templates/users/user_confirm_delete.html:8 #: drdown/users/templates/users/user_confirm_delete.html:13 -#: drdown/users/templates/users/user_detail.html:254 +#: drdown/users/templates/users/user_detail.html:274 msgid "Delete" msgstr "Excluir" @@ -376,89 +380,104 @@ msgstr "Cancelar" msgid "User:" msgstr "Usuário: " +#: drdown/users/templates/users/user_detail.html:17 +msgid "Hey! You have procedures to be made." +msgstr "" + +#: drdown/users/templates/users/user_detail.html:17 +#: drdown/users/templates/users/user_detail.html:26 +msgid "Click here to check it" +msgstr "" + #: drdown/users/templates/users/user_detail.html:26 +msgid "" +"One or more of your patients needs attention. Some procedures may be behind " +"schedule." +msgstr "" + +#: drdown/users/templates/users/user_detail.html:48 msgid "Name: " msgstr "Nome: " -#: drdown/users/templates/users/user_detail.html:35 +#: drdown/users/templates/users/user_detail.html:57 msgid "Gender: " msgstr "Gênero: " -#: drdown/users/templates/users/user_detail.html:44 +#: drdown/users/templates/users/user_detail.html:65 msgid "Telephone: " msgstr "Telefone: " -#: drdown/users/templates/users/user_detail.html:53 +#: drdown/users/templates/users/user_detail.html:74 msgid "Birthday: " msgstr "Data de nascimento: " -#: drdown/users/templates/users/user_detail.html:71 -#: drdown/users/templates/users/user_detail.html:98 -#: drdown/users/templates/users/user_detail.html:224 +#: drdown/users/templates/users/user_detail.html:92 +#: drdown/users/templates/users/user_detail.html:119 +#: drdown/users/templates/users/user_detail.html:244 msgid "CPF: " msgstr "CPF: " -#: drdown/users/templates/users/user_detail.html:80 +#: drdown/users/templates/users/user_detail.html:101 msgid "Department: " msgstr "Departamento: " -#: drdown/users/templates/users/user_detail.html:116 +#: drdown/users/templates/users/user_detail.html:136 msgid "Registration State: " msgstr "Estado do Registro: " -#: drdown/users/templates/users/user_detail.html:125 +#: drdown/users/templates/users/user_detail.html:145 msgid "Speciality: " msgstr "Especialidade: " -#: drdown/users/templates/users/user_detail.html:143 +#: drdown/users/templates/users/user_detail.html:163 msgid "SES: " msgstr "SES: " -#: drdown/users/templates/users/user_detail.html:152 +#: drdown/users/templates/users/user_detail.html:172 msgid "Priority: " msgstr "Prioridade: " -#: drdown/users/templates/users/user_detail.html:161 +#: drdown/users/templates/users/user_detail.html:181 msgid "Mother Name: " msgstr "Nome da Mãe: " -#: drdown/users/templates/users/user_detail.html:170 +#: drdown/users/templates/users/user_detail.html:190 msgid "Father Name: " msgstr "Nome do Pai: " -#: drdown/users/templates/users/user_detail.html:179 +#: drdown/users/templates/users/user_detail.html:199 msgid "Ethnicity: " msgstr "Etnia: " -#: drdown/users/templates/users/user_detail.html:188 +#: drdown/users/templates/users/user_detail.html:208 msgid "SUS: " msgstr "SUS: " -#: drdown/users/templates/users/user_detail.html:197 +#: drdown/users/templates/users/user_detail.html:217 msgid "Civil registry of birth: " msgstr "Registro civil de nascimento: " -#: drdown/users/templates/users/user_detail.html:206 +#: drdown/users/templates/users/user_detail.html:226 msgid "Declaration of live birth: " msgstr "Declaração de nascido vivo: " -#: drdown/users/templates/users/user_detail.html:233 +#: drdown/users/templates/users/user_detail.html:253 msgid "Patient: " msgstr "Paciente" -#: drdown/users/templates/users/user_detail.html:249 +#: drdown/users/templates/users/user_detail.html:269 msgid "Confirm data" msgstr "Confirmar dados" -#: drdown/users/templates/users/user_detail.html:252 +#: drdown/users/templates/users/user_detail.html:272 msgid "My Medical Records" msgstr "Minhas Consultas" -#: drdown/users/templates/users/user_form.html:93 +#: drdown/users/templates/users/user_form.html:113 msgid "Photo of user" msgstr "Foto do usuário" -#: drdown/users/templates/users/user_form.html:99 +#: drdown/users/templates/users/user_form.html:119 msgid "Update" msgstr "Atualizar" From 32d3ab56afd4eb141494f272530757432a3694d5 Mon Sep 17 00:00:00 2001 From: guilherme1guy Date: Thu, 3 May 2018 19:41:00 -0300 Subject: [PATCH 097/271] Improving code quality Fixing PEP8 errors Co-authored-by: joberth rogers --- drdown/users/urls.py | 1 - drdown/users/views/view_user.py | 7 ++----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/drdown/users/urls.py b/drdown/users/urls.py index fd2475e3..e3df0f80 100644 --- a/drdown/users/urls.py +++ b/drdown/users/urls.py @@ -51,5 +51,4 @@ view=views.PatientDetailView.as_view(), name='patient_medical_sheet' ), - ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) diff --git a/drdown/users/views/view_user.py b/drdown/users/views/view_user.py index 9eecf8a0..295ea1b7 100644 --- a/drdown/users/views/view_user.py +++ b/drdown/users/views/view_user.py @@ -176,7 +176,6 @@ class ResponsiblePatientListView(ListView): model = Patient template_name = 'users/responsible_patient_list.html' - def get(self, request, *args, **kwargs): if not hasattr(request.user, 'responsible'): @@ -212,8 +211,8 @@ class HealthTeamPatientListView(SearchListView): def get(self, request, *args, **kwargs): if ( - not hasattr(request.user, 'healthteam') - and not hasattr(request.user, 'employee') + not hasattr(request.user, 'healthteam') and + not hasattr(request.user, 'employee') ): # redirect user_patient to the its medical sheet view url = reverse( @@ -229,5 +228,3 @@ class PatientDetailView(DetailView): template_name = 'users/patient_detail.html' slug_url_kwarg = 'username' slug_field = 'user__username' - - From 3fa60d963a969dd055325067c873eafa88b31ca9 Mon Sep 17 00:00:00 2001 From: guilherme1guy Date: Thu, 3 May 2018 20:24:49 -0300 Subject: [PATCH 098/271] Fixing translation erros Co-authored-by: joberth rogers --- .../locale/pt_BR/LC_MESSAGES/django.po | 18 ++++++-------- .../core/locale/pt_BR/LC_MESSAGES/django.po | 24 +++++++++---------- .../users/locale/pt_BR/LC_MESSAGES/django.po | 16 ++++--------- 3 files changed, 24 insertions(+), 34 deletions(-) diff --git a/drdown/careline/locale/pt_BR/LC_MESSAGES/django.po b/drdown/careline/locale/pt_BR/LC_MESSAGES/django.po index a20dc392..ffad96df 100644 --- a/drdown/careline/locale/pt_BR/LC_MESSAGES/django.po +++ b/drdown/careline/locale/pt_BR/LC_MESSAGES/django.po @@ -2,13 +2,13 @@ # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. -# +# #, fuzzy msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-05-01 01:13+0000\n" +"POT-Creation-Date: 2018-05-03 23:11+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -92,8 +92,6 @@ msgstr "Pesquisa para Doença Celíaca (anticorpo antigliadina)" #: drdown/careline/templates/careline/checklist_detail.html:5 #: drdown/careline/templates/careline/checklist_detail.html:102 -#: drdown/careline/templates/careline/checklist_list.html:3 -#: drdown/careline/templates/careline/checklist_list.html:7 msgid "Care Line" msgstr "Linha de Cuidado" @@ -117,7 +115,6 @@ msgid "Less than 1 year old" msgstr "Menos de 1 ano de idade" #: drdown/careline/templates/careline/checklist_detail.html:114 -#: drdown/careline/templates/careline/checklist_list.html:20 msgid "SES: " msgstr "SES: " @@ -181,11 +178,7 @@ msgstr "Quando Necessário" msgid "Done" msgstr "Feito" -#: drdown/careline/templates/careline/checklist_list.html:25 -msgid "There are no patients for this user." -msgstr "Não há pacientes para este usuário." - -#: drdown/careline/views/view_checklist.py:184 +#: drdown/careline/views/view_checklist.py:131 msgid "" "Error: You cannot change data on this form. You need to be at least 13 years " "old." @@ -193,6 +186,9 @@ msgstr "" "Erro: Você não pode mudar os dados neste formulário. Você deve ter pelo " "menos 13 anos de idade." -#: drdown/careline/views/view_checklist.py:199 +#: drdown/careline/views/view_checklist.py:146 msgid "Success! Your changes were saved." msgstr "Sucesso! Suas mudanças foram salvas." + +msgid "There are no patients for this user." +msgstr "Não há pacientes para este usuário." diff --git a/drdown/core/locale/pt_BR/LC_MESSAGES/django.po b/drdown/core/locale/pt_BR/LC_MESSAGES/django.po index 6dc896b4..f758ed2d 100644 --- a/drdown/core/locale/pt_BR/LC_MESSAGES/django.po +++ b/drdown/core/locale/pt_BR/LC_MESSAGES/django.po @@ -2,13 +2,13 @@ # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. -# +# #, fuzzy msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-05-01 01:13+0000\n" +"POT-Creation-Date: 2018-05-03 23:11+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -653,15 +653,15 @@ msgstr "" msgid "Further reading" msgstr "Leituras complementares" -msgid "Hey! You have procedures to be made." -msgstr "Oi! Você tem procedimentos que precisam ser feitos." +#~ msgid "Hey! You have procedures to be made." +#~ msgstr "Oi! Você tem procedimentos que precisam ser feitos." -msgid "Click here to check it" -msgstr "Clique aqui para conferir" +#~ msgid "Click here to check it" +#~ msgstr "Clique aqui para conferir" -msgid "" -"One or more of your patients needs attention. Some procedures may be " -"behind schedule." -msgstr "" -"Um ou mais de seus pacientes precisa de atenção. Alguns procedimentos " -"podem estar atrasados." +#~ msgid "" +#~ "One or more of your patients needs attention. Some procedures may be " +#~ "behind schedule." +#~ msgstr "" +#~ "Um ou mais de seus pacientes precisa de atenção. Alguns procedimentos " +#~ "podem estar atrasados." diff --git a/drdown/users/locale/pt_BR/LC_MESSAGES/django.po b/drdown/users/locale/pt_BR/LC_MESSAGES/django.po index db51cb18..5022e48e 100644 --- a/drdown/users/locale/pt_BR/LC_MESSAGES/django.po +++ b/drdown/users/locale/pt_BR/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-05-03 21:17+0000\n" +"POT-Creation-Date: 2018-05-03 23:11+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -434,6 +434,7 @@ msgid "Name: " msgstr "Nome: " #: drdown/users/templates/users/patient_detail.html:38 +#: drdown/users/templates/users/user_detail.html:74 msgid "Birthday: " msgstr "Data de nascimento: " @@ -448,6 +449,7 @@ msgid "Civil registry of birth: " msgstr "Registro civil de nascimento: " #: drdown/users/templates/users/patient_detail.html:42 +#: drdown/users/templates/users/user_detail.html:231 msgid "Declaration of live birth: " msgstr "Declaração de nascido vivo: " @@ -487,8 +489,8 @@ msgid "" "One or more of your patients needs attention. Some procedures may be behind " "schedule." msgstr "" -"Um, ou mais, de seus pacientes precisa de atenção. Alguns procedimentos podem " -"estar atrasados." +"Um, ou mais, de seus pacientes precisa de atenção. Alguns procedimentos " +"podem estar atrasados." #: drdown/users/templates/users/user_detail.html:57 msgid "Gender: " @@ -498,10 +500,6 @@ msgstr "Gênero: " msgid "Telephone: " msgstr "Telefone: " -#: drdown/users/templates/users/user_detail.html:74 -msgid "Birthday: " -msgstr "Data de nascimento: " - #: drdown/users/templates/users/user_detail.html:93 #: drdown/users/templates/users/user_detail.html:122 #: drdown/users/templates/users/user_detail.html:250 @@ -536,10 +534,6 @@ msgstr "Nome do Pai: " msgid "Ethnicity: " msgstr "Etnia: " -#: drdown/users/templates/users/user_detail.html:231 -msgid "Declaration of live birth: " -msgstr "Declaração de nascido vivo: " - #: drdown/users/templates/users/user_detail.html:278 msgid "My Patients" msgstr "Meus Pacientes" From cf1447824cb4fb5b5163665a1d5dc47ccf70e485 Mon Sep 17 00:00:00 2001 From: Elias Bernardo Date: Thu, 3 May 2018 21:15:44 -0300 Subject: [PATCH 099/271] Adjusting the vaccine table for better formatting Moving some columns from the first table to the second Co-authored-by: Daniel Maike --- .../core/templates/core/vaccine_schedule.html | 162 ++++++++---------- 1 file changed, 72 insertions(+), 90 deletions(-) diff --git a/drdown/core/templates/core/vaccine_schedule.html b/drdown/core/templates/core/vaccine_schedule.html index a8b3a637..1c52e30d 100644 --- a/drdown/core/templates/core/vaccine_schedule.html +++ b/drdown/core/templates/core/vaccine_schedule.html @@ -18,12 +18,12 @@






{% trans "Vaccine Schedule" %}


- +
- + @@ -44,8 +44,7 @@ - - + @@ -53,19 +52,19 @@ - + - + - + @@ -74,8 +73,7 @@ - - + @@ -83,14 +81,14 @@ - + - + @@ -98,7 +96,7 @@ - + @@ -109,7 +107,6 @@ - @@ -118,7 +115,7 @@ - + @@ -131,8 +128,6 @@ - - @@ -142,7 +137,7 @@ - + @@ -155,7 +150,7 @@ - + @@ -170,7 +165,7 @@ - + @@ -185,7 +180,7 @@ - + @@ -200,28 +195,7 @@ - - - - - - - - - - - - - - - - - - - - - - + @@ -238,12 +212,11 @@ - + - @@ -266,8 +239,6 @@ - - @@ -285,121 +256,132 @@

{% trans 'Vaccines'%}

{% trans 'OF BIRTH TO THE 10 YEARS OF AGE'%}{% trans 'OF BIRTH TO THE 10 YEARS OF AGE'%}
{% trans '4 Y'%} {% trans '5 Y'%} {% trans '6 Y'%}{% trans '9 Y'%}{% trans '10 Y'%}
{% trans 'BCG ID'%} {% trans 'One dose'%} {% trans 'Vaccinate the previously unvaccinated'%}{% trans 'Vaccinate people who contacted leprosy'%}{% trans 'Vaccinate people who contacted leprosy'%}
{% trans 'Hepatitis B'%} {% trans 'Three or four doses from birth'%}{% trans 'Vaccinate the previously unvaccinated'%}{% trans 'Vaccinate the previously unvaccinated'%}
{% trans 'Rotavirus'%} {% trans 'Two or three doses. Initiate vaccination before 15 weeks of age'%}{% trans 'CONTRAINDICATED'%}{% trans 'CONTRAINDICATED'%}
{% trans 'Bacterial triple (DTPw, DTPa, ou dTpa)'%}{% trans 'Four doses of DTPa or DTPw starting at 2 months of age'%} {% trans 'Reinforcement with DTPa, DTPw or dTpa'%}{% trans 'Reinforcement with dTpa from 9 years of age and every 10 years (or, in the case of dTpa, do dT)'%}
{% trans 'Haemophilus influenzae type b'%} {% trans 'Four doses starting at 2 months of age'%} {% trans 'Vaccinate the previously unvaccinated'%}{% trans 'Vaccinate people in special risk situations'%}{% trans 'Vaccinate people in special risk situations'%}
{% trans 'Poliomyelitis (inactivated virus)'%} {% trans 'Five doses starting at 2 months of age'%}{% trans 'Vaccinate people in special risk situations'%}{% trans 'Vaccinate people in special risk situations'%}
{% trans 'Pneumococcal conjugate'%} {% trans 'Four doses starting at 2 months of age - VPC10 or VPC13'%} {% trans 'VPC10 or VPC13 - Vaccinate the previously unvaccinated'%}{% trans 'PCV13: vaccinating people in special risk situations'%}{% trans 'PCV13: vaccinating people in special risk situations'%}
{% trans 'Meningococcal conjugate C or ACWY'%}{% trans 'REINFORCEMENT'%} {% trans 'REINFORCEMENT'%}
{% trans 'Meningococcal B'%} {% trans 'Three doses beginning at 3 months of age'%} {% trans 'REINFORCEMENT'%}{% trans 'For those not previously vaccinated: two doses'%}{% trans 'For those not previously vaccinated: two doses'%}
{% trans 'Oral poliomyelitis (live attenuated virus)'%} {% trans 'NATIONAL VACCINATION CAMPAIGNS'%}
{% trans 'Influenza (flu)'%} {% trans 'ANNUAL VACCINATION'%}{% trans 'ANNUAL VACCINATION'%}
{% trans 'Yellow fever'%} {% trans 'IN REGIONS WITH RECOMMENDATION OF VACCINATION (ACCORDING TO CLASSIFICATION OF MS) - single dose at 9 months of age. Not previously vaccinated: single dose'%}{% trans 'IN REGIONS WITH RECOMMENDATION OF VACCINATION (ACCORDING TO CLASSIFICATION OF MS) - single dose at 9 months of age. Not previously vaccinated: single dose'%}
{% trans 'Viral triple (measles, mumps and rubella)'%} {% trans 'Two doses after 12 months'%}{% trans 'Vaccinate the previously unvaccinated'%}{% trans 'Vaccinate the previously unvaccinated'%}
{% trans 'Varicella (chickenpox)'%} {% trans 'Two doses after 12 months'%}{% trans 'Vaccinate previously unvaccinated susceptibles'%}{% trans 'Vaccinate previously unvaccinated susceptibles'%}
{% trans 'Hepatitis A'%} {% trans 'Two doses after 12 months'%}{% trans 'Vaccinate the previously unvaccinated'%}
{% trans 'HPV'%}{% trans 'Three doses for girls and boys'%}{% trans 'Vaccinate the previously unvaccinated'%}
{% trans 'Pneumococcal 23 courageous'%} {% trans 'Vaccinate people in special risk situations'%}{% trans 'Vaccinate people in special risk situations'%}
{% trans 'Dengue'%} {% trans 'CONTRAINDICATED'%}{% trans 'To vaccinate people aged 9 to 45 years previously infected with the virus (seropositive) with three doses: 0 - 6 - 12 months'%}
{% trans '4 Years'%} {% trans '5 Years'%} {% trans '6 Years'%}{% trans '9 Years'%}{% trans '10 Years'%}
{% trans 'OF BIRTH TO THE 10 YEARS OF AGE'%}
{% trans 'Contraindicated'%}
- +


+
- - - + + + + + - - - + + + - + - + - + - + + + - + - + - - + + - - + + + - - + + - + - + - - + + - - + + - - + + - - - + + + + - - + + - - - + + + + + - - + + - - - + + + + + - - - + + + @@ -414,7 +396,7 @@

{% trans 'Vaccines'%}

{% trans 'ADOLESCENT'%}{% trans 'ADULT'%}{% trans 'OLD MAN'%}{% trans '9 Y'%}{% trans '10 Y'%}{% trans 'ADOLESCENT'%}{% trans 'ADULT'%}{% trans 'OLD MAN'%}
{% trans '11-19 Years'%}{% trans '20-59 Years'%}{% trans '60+ Years'%}{% trans '11-19 Years'%}{% trans '20-59 Years'%}{% trans '60+ Years'%}
{% trans 'BCG ID'%}{% trans 'Vaccinate people who contacted leprosy'%}{% trans 'Vaccinate people who contacted leprosy'%}
{% trans 'Hepatitis B'%}{% trans 'Vaccinate the previously unvaccinated'%}{% trans 'Vaccinate the previously unvaccinated'%}
{% trans 'Rotavirus'%}{% trans 'CONTRAINDICATED'%}{% trans 'CONTRAINDICATED'%}
{% trans 'Bacterial triple (DTPw, DTPa, ou dTpa)'%}{% trans 'Reinforcement with dTpa from 9 years of age and every 10 years (or, in the case of dTpa, do dT)'%}{% trans 'Reinforcement with dTpa from 9 years of age and every 10 years (or, in the case of dTpa, do dT)'%}{% trans 'Reinforcement with dTpa from 9 years of age and every 10 years (or, in the case of dTpa, do dT)'%}
{% trans 'Haemophilus influenzae type b'%}{% trans 'Vaccinate people in special risk situations'%}{% trans 'Vaccinate people in special risk situations'%}
{% trans 'Poliomyelitis (inactivated virus)'%}{% trans 'Vaccinate people in special risk situations'%}{% trans 'Vaccinate people in special risk situations'%}
{% trans 'Pneumococcal conjugate'%}{% trans 'PCV13: vaccinating people in special risk situations'%}{% trans 'VPC13: one dose'%}{% trans 'PCV13: vaccinating people in special risk situations'%}{% trans 'VPC13: one dose'%}
{% trans 'Meningococcal conjugate C or ACWY'%}{% trans 'REINFORCED at age 11. For those not previously vaccinated: two doses'%}{% trans 'Vaccinate people in special risk situations'%}{% trans 'REINFORCED at age 11. For those not previously vaccinated: two doses'%}{% trans 'Vaccinate people in special risk situations'%}
{% trans 'Meningococcal B'%}{% trans 'For those not previously vaccinated: two doses'%}{% trans 'Vaccinate people in special risk situations'%}{% trans 'For those not previously vaccinated: two doses'%}{% trans 'Vaccinate people in special risk situations'%}
{% trans 'Influenza (flu)'%}{% trans 'ANNUAL VACCINATION'%}{% trans 'ANNUAL VACCINATION'%}
{% trans 'Yellow fever'%}{% trans 'IN REGIONS WITH RECOMMENDATION OF VACCINATION (ACCORDING TO CLASSIFICATION OF MS) - single dose at 9 months of age. Not previously vaccinated: single dose'%}{% trans 'IN REGIONS WITH RECOMMENDATION OF VACCINATION (ACCORDING TO CLASSIFICATION OF MS) - single dose at 9 months of age. Not previously vaccinated: single dose'%}
{% trans 'Viral triple (measles, mumps and rubella)'%}{% trans 'Vaccinate the previously unvaccinated'%}{% trans 'Vaccinate people in special risk situations'%}{% trans 'Vaccinate the previously unvaccinated'%}{% trans 'Vaccinate people in special risk situations'%}
{% trans 'Varicella (chickenpox)'%}{% trans 'Vaccinate previously unvaccinated susceptibles'%}{% trans 'Vaccinate previously unvaccinated susceptibles'%}
{% trans 'Hepatitis A'%}{% trans 'Vaccinate the previously unvaccinated'%}{% trans 'Vaccinate people in special risk situations'%}{% trans 'Vaccinate the previously unvaccinated'%}{% trans 'Vaccinate people in special risk situations'%}
{% trans 'HPV'%}{% trans 'Vaccinate the previously unvaccinated'%}{% trans 'Vaccinate the non-vaccinated formerly: at the discretion of the physician'%}{% trans 'Three doses for girls and boys'%}{% trans 'Vaccinate the previously unvaccinated'%}{% trans 'Vaccinate the non-vaccinated formerly: at the discretion of the physician'%}
{% trans 'Pneumococcal 23 courageous'%}{% trans 'Vaccinate people in special risk situations'%}{% trans 'Two doses at five-year intervals'%}{% trans 'Vaccinate people in special risk situations'%}{% trans 'Two doses at five-year intervals'%}
{% trans 'Herpes zoster'%}{% trans 'From 50 to 59 years old: at medical discretion'%}{% trans 'One dose'%}{% trans 'From 50 to 59 years old: at medical discretion'%}{% trans 'One dose'%}
{% trans 'Dengue'%}{% trans 'To vaccinate people aged 9 to 45 years previously infected with the virus (seropositive) with three doses: 0 - 6 - 12 months'%}{% trans 'CONTRAINDICATED'%}{% trans 'To vaccinate people aged 9 to 45 years previously infected with the virus (seropositive) with three doses: 0 - 6 - 12 months'%}{% trans 'CONTRAINDICATED'%}

{% trans 'Vaccines'%}

{% trans '11-19 Years'%}{% trans '20-59 Years'%}{% trans '60+ Years'%}{% trans '9 Y'%}{% trans '10 Y'%}{% trans '11-19 Years'%}{% trans '20-59 Years'%}{% trans '60+ Years'%}
{% trans 'ADOLESCENT'%}{% trans 'ADULT'%}{% trans 'OLD MAN'%}{% trans 'ADOLESCENT'%}{% trans 'ADULT'%}{% trans 'OLD MAN'%}
{% trans 'Contraindicated'%}
- +


{% endblock content %} From 5e6709cb2790727ab2819b942ebf92b6cafb4c15 Mon Sep 17 00:00:00 2001 From: Gabriela Medeiros Date: Thu, 3 May 2018 21:17:52 -0300 Subject: [PATCH 100/271] Adding tests Adding test case for specialized users Co-authored-by: Geovana Ramos --- .../tests/test_view_appointment.py | 67 ++++++++++++++++--- drdown/appointments/views/view_appointment.py | 2 +- 2 files changed, 59 insertions(+), 10 deletions(-) diff --git a/drdown/appointments/tests/test_view_appointment.py b/drdown/appointments/tests/test_view_appointment.py index a009f4f7..c3d37b93 100644 --- a/drdown/appointments/tests/test_view_appointment.py +++ b/drdown/appointments/tests/test_view_appointment.py @@ -1,6 +1,8 @@ from test_plus.test import TestCase from ..models.model_appointment import Appointment from drdown.users.models.model_health_team import HealthTeam +from drdown.users.models.model_employee import Employee +from drdown.users.models.model_responsible import Responsible from drdown.users.models.model_patient import Patient from django.urls import reverse @@ -13,6 +15,10 @@ def setUp(self): """ self.user = self.make_user(username='user_1') self.user2 = self.make_user(username='user_2') + self.user3 = self.make_user(username='user_3') + self.user4 = self.make_user(username='user_4') + self.user5 = self.make_user(username='user_5') + self.patient = Patient.objects.create( ses="1234567", user=self.user, @@ -34,6 +40,18 @@ def setUp(self): registration_state=HealthTeam.DF, ) + self.employee = Employee.objects.create( + cpf="974.220.200-16", + user=self.user3, + departament=Employee.ADMINISTRATION + ) + + self.responsible = Responsible.objects.create( + user=self.user4, + cpf="022.852.870-46", + patient=self.patient + ) + self.appointment = Appointment.objects.create( shift=Appointment.MORNING, date="2040-08-10", @@ -63,7 +81,7 @@ def test_appointment_create_view(self): """ Makes sure that the appointment create view is loaded correctly """ - response = self.client.get( + response = self.client.post( path=reverse( viewname='appointments:create_appointment' ) @@ -98,7 +116,7 @@ def test_appointment_form_valid_create_view(self): """ Test if create form is valid with all required fields """ - self.client.force_login(user=self.user) + self.client.force_login(user=self.user3) data = { 'speciality': Appointment.SPEECH_THERAPHY, 'shift': 'A', @@ -111,7 +129,6 @@ def test_appointment_form_valid_create_view(self): path=reverse('appointments:create_appointment'), data=data, follow=True) - list_appointments = reverse('appointments:list_appointments') self.assertEquals(response.status_code, 200) def test_appointment_form_valid_update_view(self): @@ -129,19 +146,18 @@ def test_appointment_form_valid_update_view(self): } response = self.client.post( path=reverse( - viewname='appointments:update_appointment', + viewname='appointments:update_appointment', args=(self.appointment.pk,) ), data=data, follow=True) - list_appointments = reverse('appointments:list_appointments') self.assertEquals(response.status_code, 200) def test_redirect_delete_ok(self): """ Test the page url status code. """ - + self.client.force_login(user=self.user) data = { 'speciality': Appointment.SPEECH_THERAPHY, @@ -151,7 +167,7 @@ def test_redirect_delete_ok(self): 'date': '2018-05-12', 'time': '20:00', } - + response = self.client.post( path=reverse( viewname='appointments:update_status_appointment', @@ -160,9 +176,7 @@ def test_redirect_delete_ok(self): data=data, follow=True ) - list_appointments = reverse('appointments:list_appointments') self.assertEquals(response.status_code, 200) - self.assertRedirects(response, list_appointments) def test_list_view_appointments_patient(self): self.client.force_login(user=self.user) @@ -186,6 +200,41 @@ def test_list_view_appointments_health_team(self): ) self.assertEquals(response.status_code, 200) + def test_list_view_appointments_employee(self): + self.client.force_login(user=self.user3) + + response = self.client.get( + path=reverse( + viewname='appointments:archive_month', + args=('2040', '08'), + ) + ) + self.assertEquals(response.status_code, 200) + + def test_list_view_appointments_responsible(self): + self.responsible.save() + self.client.force_login(user=self.user4) + + response = self.client.get( + path=reverse( + viewname='appointments:archive_month', + args=('2040', '08'), + ) + ) + self.assertEquals(response.status_code, 200) + + def test_list_view_appointments(self): + self.responsible.save() + self.client.force_login(user=self.user5) + + response = self.client.get( + path=reverse( + viewname='appointments:archive_month', + args=('2040', '08'), + ) + ) + self.assertEquals(response.status_code, 200) + # def test_form_invalid(self): # """ # Test if form is valid with blank fields diff --git a/drdown/appointments/views/view_appointment.py b/drdown/appointments/views/view_appointment.py index 6ce37f32..1fc824d4 100644 --- a/drdown/appointments/views/view_appointment.py +++ b/drdown/appointments/views/view_appointment.py @@ -74,7 +74,7 @@ def prepare_queryset(request): ).order_by('-date', '-time') elif hasattr(user, 'responsible'): queryset = Appointment.objects.filter( - patient=user.responsible.patient + patient__in=user.responsible.patient_set.all() ).order_by('-date', '-time') elif hasattr(user, 'employee'): queryset = Appointment.objects.all( From f4fb167d0cbafe11c92e2bfdc575f1a73a612f41 Mon Sep 17 00:00:00 2001 From: GeovanaRamos Date: Thu, 3 May 2018 22:15:54 -0300 Subject: [PATCH 101/271] Correcting tests and model tags Removing translation Correcting form Co-authored-by: Gabriela Medeiros --- .../appointments/models/model_appointment.py | 18 ++++----- .../appointments/appointment_form.html | 38 +++++++++---------- 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/drdown/appointments/models/model_appointment.py b/drdown/appointments/models/model_appointment.py index c79a6712..2a616dc6 100644 --- a/drdown/appointments/models/model_appointment.py +++ b/drdown/appointments/models/model_appointment.py @@ -40,15 +40,15 @@ class Appointment(models.Model): blank=True, ) - SPEECH_THERAPHY = _("Speech Therapy") - PSYCHOLOGY = _("Psychology") - PHYSIOTHERAPY = _("Physiotherapy") - OCCUPATIONAL_THERAPY = _("Occupational Therapy") - DOCTOR = _("Doctor") - CARDIOLOGY = _("Cardiology") - NEUROLOGY = _("Neurology") - PEDIATRICS = _("Pediatrics") - NURSING = _("Nursing") + SPEECH_THERAPHY = "Speech Therapy" + PSYCHOLOGY = "Psychology" + PHYSIOTHERAPY = "Physiotherapy" + OCCUPATIONAL_THERAPY = "Occupational Therapy" + DOCTOR = "Doctor" + CARDIOLOGY = "Cardiology" + NEUROLOGY = "Neurology" + PEDIATRICS = "Pediatrics" + NURSING = "Nursing" SPECIALITY_CHOICES = ( (SPEECH_THERAPHY, _('Speech Therapy')), diff --git a/drdown/appointments/templates/appointments/appointment_form.html b/drdown/appointments/templates/appointments/appointment_form.html index 182eda6f..87a71a2e 100644 --- a/drdown/appointments/templates/appointments/appointment_form.html +++ b/drdown/appointments/templates/appointments/appointment_form.html @@ -13,26 +13,26 @@

{% trans "New Appointment" %}

@@ -104,7 +104,7 @@

{% trans "New Appointment" %}

- +
From 0abc752f80fdbcfc6bf978aa45e0c5e478ee4804 Mon Sep 17 00:00:00 2001 From: Gabriela Medeiros Date: Thu, 3 May 2018 22:41:12 -0300 Subject: [PATCH 102/271] Editing speciality field Inserting translated label Co-authored-by: Geovana Ramos --- .../appointments/templates/appointments/appointment_form.html | 2 +- .../appointments/templates/appointments/appointment_list.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drdown/appointments/templates/appointments/appointment_form.html b/drdown/appointments/templates/appointments/appointment_form.html index 87a71a2e..f1eb9ab3 100644 --- a/drdown/appointments/templates/appointments/appointment_form.html +++ b/drdown/appointments/templates/appointments/appointment_form.html @@ -12,7 +12,7 @@

{% trans "New Appointment" %}

@@ -141,4 +137,4 @@

{% trans "Edit Appointment" %}

-{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/drdown/appointments/templates/appointments/appointment_list.html b/drdown/appointments/templates/appointments/appointment_list.html index fb6a3658..828ba0e8 100644 --- a/drdown/appointments/templates/appointments/appointment_list.html +++ b/drdown/appointments/templates/appointments/appointment_list.html @@ -31,7 +31,13 @@

{% trans 'Appointments' %}


{% for appointment in appointment_list %}
-
+
+ {% if request.user.employee and appointment.status != canceled %} + {% if appointment.date|date:"d-m-Y" > today or appointment.date|date:"d-m-Y" == today and appointment.time|time:'H:i' > time %} + {% trans "Cancel" %} + {% trans "Edit" %} + {% endif %} + {% endif %}
{% trans 'Patient'%}: {{appointment.patient.user.name}}
{% trans 'Doctor'%}: {{ appointment.doctor.user.name}}
{% trans 'Especiality'%}: {{appointment.get_speciality_display}}
@@ -40,19 +46,13 @@
{% trans 'Patient'%}: {{appointment.patient.user.name}}
{% now 'd-m-Y' as today %} {% now 'H:i' as time %} {% if appointment.date|date:"d-m-Y" > today %} - {% trans 'Status'%}: {{ appointment.status}}
+ {% trans 'Status'%}: {{ appointment.get_status_display}}
{% elif appointment.date|date:"d-m-Y" == today and appointment.time|time:'H:i' > time %} - {% trans 'Status'%}: {{ appointment.status}}
+ {% trans 'Status'%}: {{ appointment.get_status_display}}
{% elif appointment.date|date:"d-m-Y" == today and appointment.time|time:'H:i' < time %} {% trans 'Status'%}: {% trans 'Done' %}
{% endif %}

{{appointment.motive}}

- {% if request.user.employee and appointment.status != canceled %} - {% if appointment.date|date:"d-m-Y" > today or appointment.date|date:"d-m-Y" == today and appointment.time|time:'H:i' > time %} - {% trans "Edit" %} - {% trans "Cancel" %}

- {% endif %} - {% endif %}
{% empty %} diff --git a/drdown/careline/locale/pt_BR/LC_MESSAGES/django.po b/drdown/careline/locale/pt_BR/LC_MESSAGES/django.po index da5fd9a2..ab2d20da 100644 --- a/drdown/careline/locale/pt_BR/LC_MESSAGES/django.po +++ b/drdown/careline/locale/pt_BR/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-05-03 22:36+0000\n" +"POT-Creation-Date: 2018-05-04 10:24+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/drdown/core/locale/pt_BR/LC_MESSAGES/django.po b/drdown/core/locale/pt_BR/LC_MESSAGES/django.po index ca14456c..67d497d8 100644 --- a/drdown/core/locale/pt_BR/LC_MESSAGES/django.po +++ b/drdown/core/locale/pt_BR/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-05-03 22:36+0000\n" +"POT-Creation-Date: 2018-05-04 10:24+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/drdown/core/templates/core/base.html b/drdown/core/templates/core/base.html index b3739606..27380488 100644 --- a/drdown/core/templates/core/base.html +++ b/drdown/core/templates/core/base.html @@ -70,39 +70,40 @@
{% else %} diff --git a/drdown/forum/locale/pt_BR/LC_MESSAGES/django.po b/drdown/forum/locale/pt_BR/LC_MESSAGES/django.po index fac37bca..84d24fdc 100644 --- a/drdown/forum/locale/pt_BR/LC_MESSAGES/django.po +++ b/drdown/forum/locale/pt_BR/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-05-03 22:36+0000\n" +"POT-Creation-Date: 2018-05-04 10:24+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/drdown/medicalrecords/locale/pt_BR/LC_MESSAGES/django.po b/drdown/medicalrecords/locale/pt_BR/LC_MESSAGES/django.po index 5b09bc29..4c854065 100644 --- a/drdown/medicalrecords/locale/pt_BR/LC_MESSAGES/django.po +++ b/drdown/medicalrecords/locale/pt_BR/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-05-03 22:36+0000\n" +"POT-Creation-Date: 2018-05-04 10:24+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/drdown/users/locale/pt_BR/LC_MESSAGES/django.po b/drdown/users/locale/pt_BR/LC_MESSAGES/django.po index 000ebacd..c6526e4e 100644 --- a/drdown/users/locale/pt_BR/LC_MESSAGES/django.po +++ b/drdown/users/locale/pt_BR/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-05-03 22:36+0000\n" +"POT-Creation-Date: 2018-05-04 10:24+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" From 9f59c3e3af9e99d68cb717acf9319e2e36449c3b Mon Sep 17 00:00:00 2001 From: GeovanaRamos Date: Fri, 4 May 2018 08:08:48 -0300 Subject: [PATCH 110/271] Correcting if for buttons pf appointment Getting right date to compare Co-authored-by: Gabriela Medeiros --- .../templates/appointments/appointment_list.html | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drdown/appointments/templates/appointments/appointment_list.html b/drdown/appointments/templates/appointments/appointment_list.html index 828ba0e8..623913e2 100644 --- a/drdown/appointments/templates/appointments/appointment_list.html +++ b/drdown/appointments/templates/appointments/appointment_list.html @@ -29,7 +29,8 @@

{% trans 'Appointments' %}


{% for appointment in appointment_list %} - + {% now 'd-m-Y' as today %} + {% now 'H:i' as time %}
{% if request.user.employee and appointment.status != canceled %} @@ -43,8 +44,6 @@
{% trans 'Patient'%}: {{appointment.patient.user.name}}
{% trans 'Especiality'%}: {{appointment.get_speciality_display}}
{% trans 'Date'%}: {{ appointment.date}}
{% trans 'Time'%}: {{ appointment.time}}
- {% now 'd-m-Y' as today %} - {% now 'H:i' as time %} {% if appointment.date|date:"d-m-Y" > today %} {% trans 'Status'%}: {{ appointment.get_status_display}}
{% elif appointment.date|date:"d-m-Y" == today and appointment.time|time:'H:i' > time %} From 95af2b6c5351645ac40584ae1aa4e7ab03dbae40 Mon Sep 17 00:00:00 2001 From: Gabriela Medeiros Date: Fri, 4 May 2018 11:13:39 -0300 Subject: [PATCH 111/271] Adding translations Translating search button Co-authored-by: Geovana Ramos --- .../locale/pt_BR/LC_MESSAGES/django.po | 52 ++++++++++--------- .../appointments/appointment_list.html | 2 +- 2 files changed, 29 insertions(+), 25 deletions(-) diff --git a/drdown/appointments/locale/pt_BR/LC_MESSAGES/django.po b/drdown/appointments/locale/pt_BR/LC_MESSAGES/django.po index 41d5e132..6463dd05 100644 --- a/drdown/appointments/locale/pt_BR/LC_MESSAGES/django.po +++ b/drdown/appointments/locale/pt_BR/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-05-04 10:24+0000\n" +"POT-Creation-Date: 2018-05-04 14:01+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -28,7 +28,7 @@ msgstr "Especialidade" #: drdown/appointments/forms/appointments_form.py:19 #: drdown/appointments/models/model_appointment.py:25 #: drdown/appointments/templates/appointments/appointment_form.html:106 -#: drdown/appointments/templates/appointments/appointment_list.html:38 +#: drdown/appointments/templates/appointments/appointment_list.html:45 msgid "Date" msgstr "Data" @@ -39,14 +39,14 @@ msgstr "(Ano)-(Mês)-(Dia)" #: drdown/appointments/forms/appointments_form.py:28 #: drdown/appointments/models/model_appointment.py:71 #: drdown/appointments/templates/appointments/appointment_form.html:69 -#: drdown/appointments/templates/appointments/appointment_list.html:36 +#: drdown/appointments/templates/appointments/appointment_list.html:43 msgid "Doctor" msgstr "Médico" #: drdown/appointments/forms/appointments_form.py:34 #: drdown/appointments/models/model_appointment.py:78 #: drdown/appointments/templates/appointments/appointment_form.html:88 -#: drdown/appointments/templates/appointments/appointment_list.html:35 +#: drdown/appointments/templates/appointments/appointment_list.html:42 msgid "Patient" msgstr "Paciente" @@ -79,7 +79,7 @@ msgstr "Dia da consulta" #: drdown/appointments/models/model_appointment.py:31 #: drdown/appointments/templates/appointments/appointment_form.html:118 -#: drdown/appointments/templates/appointments/appointment_list.html:39 +#: drdown/appointments/templates/appointments/appointment_list.html:46 msgid "Time" msgstr "Hora" @@ -151,9 +151,9 @@ msgid "Canceled" msgstr "Cancelada" #: drdown/appointments/models/model_appointment.py:92 -#: drdown/appointments/templates/appointments/appointment_list.html:43 -#: drdown/appointments/templates/appointments/appointment_list.html:45 -#: drdown/appointments/templates/appointments/appointment_list.html:47 +#: drdown/appointments/templates/appointments/appointment_list.html:48 +#: drdown/appointments/templates/appointments/appointment_list.html:50 +#: drdown/appointments/templates/appointments/appointment_list.html:52 msgid "Status" msgstr "Status" @@ -186,13 +186,13 @@ msgid "Are you sure you want to cancel this appointment?" msgstr "Tem certeza que deseja cancelar esta consulta?" #: drdown/appointments/templates/appointments/appointment_confirm_cancel.html:11 -msgid "No" -msgstr "Não" - -#: drdown/appointments/templates/appointments/appointment_confirm_cancel.html:12 msgid "Yes" msgstr "Sim" +#: drdown/appointments/templates/appointments/appointment_confirm_cancel.html:12 +msgid "No" +msgstr "Não" + #: drdown/appointments/templates/appointments/appointment_form.html:7 #: drdown/appointments/templates/appointments/appointment_form.html:17 #: drdown/appointments/templates/appointments/appointment_list.html:14 @@ -208,27 +208,31 @@ msgstr "Editar Consulta" msgid "Schedule" msgstr "Marcar" -#: drdown/appointments/templates/appointments/appointment_list.html:37 -msgid "Especiality" -msgstr "Especialidade" +#: drdown/appointments/templates/appointments/appointment_list.html:23 +msgid "Search" +msgstr "Pesquisar" -#: drdown/appointments/templates/appointments/appointment_list.html:47 -msgid "Done" -msgstr "Concluído" +#: drdown/appointments/templates/appointments/appointment_list.html:38 +msgid "Cancel" +msgstr "Cancelar" -#: drdown/appointments/templates/appointments/appointment_list.html:52 +#: drdown/appointments/templates/appointments/appointment_list.html:39 msgid "Edit" msgstr "Editar" -#: drdown/appointments/templates/appointments/appointment_list.html:53 -msgid "Cancel" -msgstr "Cancelar" +#: drdown/appointments/templates/appointments/appointment_list.html:44 +msgid "Especiality" +msgstr "Especialidade" + +#: drdown/appointments/templates/appointments/appointment_list.html:52 +msgid "Done" +msgstr "Concluído" -#: drdown/appointments/templates/appointments/appointment_list.html:59 +#: drdown/appointments/templates/appointments/appointment_list.html:58 msgid "There are no appointments scheduled" msgstr "Não há consultas marcadas" -#: drdown/appointments/templates/appointments/appointment_list.html:65 +#: drdown/appointments/templates/appointments/appointment_list.html:64 msgid "Search All" msgstr "Pesquisar tudo" diff --git a/drdown/appointments/templates/appointments/appointment_list.html b/drdown/appointments/templates/appointments/appointment_list.html index 623913e2..b286fb86 100644 --- a/drdown/appointments/templates/appointments/appointment_list.html +++ b/drdown/appointments/templates/appointments/appointment_list.html @@ -20,7 +20,7 @@

{% trans 'Appointments' %}


From 2259a54521c4d239ec9b1fe70a0872f8786d4de2 Mon Sep 17 00:00:00 2001 From: Gabriela Medeiros Date: Fri, 4 May 2018 14:23:37 -0300 Subject: [PATCH 112/271] Editing button Correcting "Medical Records" button translation Co-authored-by: Geovana Ramos --- drdown/users/locale/pt_BR/LC_MESSAGES/django.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drdown/users/locale/pt_BR/LC_MESSAGES/django.po b/drdown/users/locale/pt_BR/LC_MESSAGES/django.po index c6526e4e..4c541444 100644 --- a/drdown/users/locale/pt_BR/LC_MESSAGES/django.po +++ b/drdown/users/locale/pt_BR/LC_MESSAGES/django.po @@ -471,7 +471,7 @@ msgstr "Confirmar dados" #: drdown/users/templates/users/user_detail.html:272 msgid "My Medical Records" -msgstr "Minhas Consultas" +msgstr "Meu Prontuário" #: drdown/users/templates/users/user_form.html:113 msgid "Photo of user" From f0ea728638456a39d0f09409b39b33a7eb1338ad Mon Sep 17 00:00:00 2001 From: Daniel Maike Date: Fri, 4 May 2018 16:52:48 -0300 Subject: [PATCH 113/271] Correcting careline bugs Co-authored-by: Elias Bernardo --- .../templates/careline/checklist_detail.html | 559 ++++++++++++++---- 1 file changed, 455 insertions(+), 104 deletions(-) diff --git a/drdown/careline/templates/careline/checklist_detail.html b/drdown/careline/templates/careline/checklist_detail.html index 399bc4dd..626f2e7d 100644 --- a/drdown/careline/templates/careline/checklist_detail.html +++ b/drdown/careline/templates/careline/checklist_detail.html @@ -119,14 +119,12 @@
{% trans 'SES: ' %} {{ checklist.pati - + - - - + {% if age >= 0.5 %} @@ -163,182 +161,535 @@
{% trans 'SES: ' %} {{ checklist.pati {%for procedure in checklist.procedure_set.all%}
+ {% if age < 0.5 and procedure.description != "Other therapies (occupational therapy, swimming,psychomotricity, psychopedagogy, hydro/equo/musictherapy, arts, others)" and procedure.description != "Audiological (audio/impedanciometry, PEATE) +otolaryngologist" and procedure.description != "Atlantoaxial X-ray * (extension, flexion and neutral)" %} + {% for check_item in procedure.get_checkitens_ordered %} + + + {% if age >= 0 and forloop.counter0 == 0 %} + {% if check_item.required %} + + {% if check_item.check %} + + {% else %} + + {% endif %} + + {% elif check_item.when_needed %} + + {% if check_item.check %} + + {% else %} + + {% endif %} + + {% else %} + + + + {% endif %} + + + {% elif age >= 0.5 and forloop.counter0 == 1 %} + + {% if check_item.required %} + + {% if check_item.check %} + + {% else %} + + {% endif %} + + {% elif check_item.when_needed %} + + {% if check_item.check %} + + {% else %} + + {% endif %} + + {% else %} + + + + {% endif %} + + {% elif age >= 1 and forloop.counter0 == 2 %} + + {% if check_item.required %} + + {% if check_item.check %} + + {% else %} + + {% endif %} + + {% elif check_item.when_needed %} + + {% if check_item.check %} + + {% else %} + + {% endif %} + + {% else %} + + + + {% endif %} + + {% elif age >= 2 and forloop.counter0 == 3 %} + + {% if check_item.required %} + + {% if check_item.check %} + + {% else %} + + {% endif %} + + {% elif check_item.when_needed %} + + {% if check_item.check %} + + {% else %} + + {% endif %} + + {% else %} + + + + {% endif %} + + {% elif age >= 3 or age is 4 and forloop.counter0 == 4 %} + + {% if check_item.required %} + + {% if check_item.check %} + + {% else %} + + {% endif %} + + {% elif check_item.when_needed %} + + {% if check_item.check %} + + {% else %} + + {% endif %} + + {% else %} + + + + {% endif %} + + {% elif age >= 5 and forloop.counter0 == 5 %} + {% if check_item.required %} + + {% if check_item.check %} + + {% else %} + + {% endif %} + + {% elif check_item.when_needed %} + + {% if check_item.check %} + + {% else %} + + {% endif %} + + {% else %} + + + + {% endif %} + + {% elif age >= 6 and forloop.counter0 == 6 %} + + {% if check_item.required %} + + {% if check_item.check %} + + {% else %} + + {% endif %} + + {% elif check_item.when_needed %} + + {% if check_item.check %} + + {% else %} + + {% endif %} + + {% else %} - {% for check_item in procedure.get_checkitens_ordered %} + + {% endif %} + + {% endif %} - {% if age >= 0 and forloop.counter0 == 0 %} - {% if check_item.required %} - {% if check_item.check %} - - {% else %} - - {% endif %} + {% endfor %} + {% elif age <= 1 and procedure.description != "Atlantoaxial X-ray * (extension, flexion and neutral)" %} + + {% for check_item in procedure.get_checkitens_ordered %} - {% elif check_item.when_needed %} - {% if check_item.check %} - - {% else %} - - {% endif %} + {% if age >= 0 and forloop.counter0 == 0 %} + {% if check_item.required %} + {% if check_item.check %} + {% else %} + + {% endif %} - + {% elif check_item.when_needed %} + {% if check_item.check %} + + {% else %} + {% endif %} + {% else %} - {% elif age >= 0.5 and forloop.counter0 == 1 %} + - {% if check_item.required %} + {% endif %} - {% if check_item.check %} - - {% else %} - - {% endif %} - {% elif check_item.when_needed %} + {% elif age >= 0.5 and forloop.counter0 == 1 %} - {% if check_item.check %} - - {% else %} - - {% endif %} + {% if check_item.required %} + {% if check_item.check %} + {% else %} + + {% endif %} - + {% elif check_item.when_needed %} + {% if check_item.check %} + + {% else %} + {% endif %} - {% elif age >= 1 and forloop.counter0 == 2 %} + {% else %} - {% if check_item.required %} + - {% if check_item.check %} - - {% else %} - - {% endif %} + {% endif %} - {% elif check_item.when_needed %} + {% elif age >= 1 and forloop.counter0 == 2 %} - {% if check_item.check %} - - {% else %} - - {% endif %} + {% if check_item.required %} + {% if check_item.check %} + {% else %} + + {% endif %} - + {% elif check_item.when_needed %} + {% if check_item.check %} + + {% else %} + {% endif %} - {% elif age >= 2 and forloop.counter0 == 3 %} + {% else %} - {% if check_item.required %} + - {% if check_item.check %} - - {% else %} - - {% endif %} + {% endif %} - {% elif check_item.when_needed %} + {% elif age >= 2 and forloop.counter0 == 3 %} - {% if check_item.check %} - - {% else %} - - {% endif %} + {% if check_item.required %} + {% if check_item.check %} + {% else %} + + {% endif %} - + {% elif check_item.when_needed %} + {% if check_item.check %} + + {% else %} + {% endif %} - {% elif age >= 3 or age is 4 and forloop.counter0 == 4 %} + {% else %} - {% if check_item.required %} + - {% if check_item.check %} - - {% else %} - - {% endif %} + {% endif %} - {% elif check_item.when_needed %} + {% elif age >= 3 or age is 4 and forloop.counter0 == 4 %} - {% if check_item.check %} - - {% else %} - - {% endif %} + {% if check_item.required %} + {% if check_item.check %} + {% else %} + + {% endif %} - + {% elif check_item.when_needed %} + {% if check_item.check %} + + {% else %} + {% endif %} - {% elif age >= 5 and forloop.counter0 == 5 %} - {% if check_item.required %} + {% else %} - {% if check_item.check %} - - {% else %} - - {% endif %} + - {% elif check_item.when_needed %} + {% endif %} - {% if check_item.check %} - - {% else %} - - {% endif %} + {% elif age >= 5 and forloop.counter0 == 5 %} + {% if check_item.required %} + {% if check_item.check %} + {% else %} + + {% endif %} - + {% elif check_item.when_needed %} + {% if check_item.check %} + + {% else %} + {% endif %} - {% elif age >= 6 and forloop.counter0 == 6 %} + {% else %} - {% if check_item.required %} + - {% if check_item.check %} - - {% else %} - - {% endif %} + {% endif %} - {% elif check_item.when_needed %} + {% elif age >= 6 and forloop.counter0 == 6 %} - {% if check_item.check %} - - {% else %} - - {% endif %} + {% if check_item.required %} + {% if check_item.check %} + {% else %} + + {% endif %} - + {% elif check_item.when_needed %} + {% if check_item.check %} + + {% else %} + {% endif %} + {% else %} + + + {% endif %} + {% endif %} + + {% endfor %} + + {% elif age > 1 %} + + {% for check_item in procedure.get_checkitens_ordered %} + + + {% if age >= 0 and forloop.counter0 == 0 %} + {% if check_item.required %} + + {% if check_item.check %} + + {% else %} + + {% endif %} + + {% elif check_item.when_needed %} + + {% if check_item.check %} + + {% else %} + + {% endif %} + + {% else %} + + + + {% endif %} + + + {% elif age >= 0.5 and forloop.counter0 == 1 %} + + {% if check_item.required %} + + {% if check_item.check %} + + {% else %} + + {% endif %} + + {% elif check_item.when_needed %} + + {% if check_item.check %} + + {% else %} + + {% endif %} + + {% else %} + + + + {% endif %} + + {% elif age >= 1 and forloop.counter0 == 2 %} + + {% if check_item.required %} + + {% if check_item.check %} + + {% else %} + + {% endif %} + + {% elif check_item.when_needed %} + + {% if check_item.check %} + + {% else %} + + {% endif %} + + {% else %} + + + + {% endif %} + + {% elif age >= 2 and forloop.counter0 == 3 %} + + {% if check_item.required %} + + {% if check_item.check %} + + {% else %} + + {% endif %} + + {% elif check_item.when_needed %} + + {% if check_item.check %} + + {% else %} + + {% endif %} + + {% else %} + + + + {% endif %} + + {% elif age >= 3 or age is 4 and forloop.counter0 == 4 %} + + {% if check_item.required %} + + {% if check_item.check %} + + {% else %} + + {% endif %} + + {% elif check_item.when_needed %} + + {% if check_item.check %} + + {% else %} + + {% endif %} + + {% else %} + + + + {% endif %} + + {% elif age >= 5 and forloop.counter0 == 5 %} + {% if check_item.required %} + + {% if check_item.check %} + + {% else %} + + {% endif %} + + {% elif check_item.when_needed %} + + {% if check_item.check %} + + {% else %} + + {% endif %} + + {% else %} + + + + {% endif %} + + {% elif age >= 6 and forloop.counter0 == 6 %} + + {% if check_item.required %} + + {% if check_item.check %} + + {% else %} + + {% endif %} + + {% elif check_item.when_needed %} + + {% if check_item.check %} + + {% else %} + + {% endif %} + + {% else %} + + + + {% endif %} + + {% endif %} + + {% endfor %} - {% endfor %} + {% endif %} {%endfor%} From 7a20e71de44e0f8f56bc0affec87a5bf9b232a2a Mon Sep 17 00:00:00 2001 From: Elias Bernardo Date: Fri, 4 May 2018 17:34:15 -0300 Subject: [PATCH 114/271] Fixing translation file Setting the time of the file Co-authored-by: Daniel Maike --- drdown/core/locale/pt_BR/LC_MESSAGES/django.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drdown/core/locale/pt_BR/LC_MESSAGES/django.po b/drdown/core/locale/pt_BR/LC_MESSAGES/django.po index 6bd94bcd..4c352fe8 100644 --- a/drdown/core/locale/pt_BR/LC_MESSAGES/django.po +++ b/drdown/core/locale/pt_BR/LC_MESSAGES/django.po @@ -2,13 +2,13 @@ # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. -# +# #, fuzzy msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-05-04 02:50+0000\n" +"POT-Creation-Date: 2018-05-04 10:24+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" From 3b6b1c166fabb3918dbfaafda6c24c9f984bb985 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Fran=C3=A7a?= Date: Fri, 4 May 2018 21:25:35 -0300 Subject: [PATCH 115/271] Improving the risk's document Add the risks score of Sprint 8 Co-authored-by: Mariana Mendes --- docs/eps/RISKS.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/eps/RISKS.md b/docs/eps/RISKS.md index d2c207c6..984fd87e 100644 --- a/docs/eps/RISKS.md +++ b/docs/eps/RISKS.md @@ -62,6 +62,10 @@ |:--------------:|:-------------------|:-------------------| | Aceitação do software pelo cliente | - levantar o que o cliente o que ele acha do planejamento das features a serem implementadas, antes de elas serem incluídas em uma sprint;
-arrumar o que for necessário a partir do feedback do cliente | - levantar com o cliente o que está errado no que foi feito;
- elencar possíveis soluções para os problemas apontados e apresentá-las ao cliente, até que ele esteja de acordo;
- corrigir os erros nas sprints seguintes, o mais rápido possível +## Sprint 8 + +### Score: 45 + ## Burndown de Riscos Essa escala deve ser usada para pontuar o impacto (usando como referência uma estimativa do número de dias necessários para mitigar os efeitos da ocorrência do risco): From 01613b1f20967606cd11167b65d5e2b503bda6c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Fran=C3=A7a?= Date: Fri, 4 May 2018 21:51:41 -0300 Subject: [PATCH 116/271] Creating the documentation of Sprint 8 Add the planning document Add the infos about the sprint Add commentarys about the planning and changes for the Sprint 8 Add the risk's burndown chart for Sprint 8 Co-authored-by: Mariana Mendes --- docs/sprints/08/planning.md | 68 +++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 docs/sprints/08/planning.md diff --git a/docs/sprints/08/planning.md b/docs/sprints/08/planning.md new file mode 100644 index 00000000..342a0c8e --- /dev/null +++ b/docs/sprints/08/planning.md @@ -0,0 +1,68 @@ +# Planejamento da Sprint 8 + +## 1. Resumo da Sprint + +__Número da sprint:__ 8 + +__Data de início:__ 28/04/2018 + +__Data de Término:__ 04/05/2018 + +__Duração__: 6 dias + +__Pontos Planejados:__ 22 pontos + +__Membros ausentes:__ +- Daniel Mike + +## 2. Papéis + +- Scrum Master: + - Diego França + +- Product Owner: + - Mariana Mendes + +- DevOps: + - João Sconetto + +- Arquiteto: + - Victor Arnaud + +- Time de Desenvolvimento: + - Daniel Maike + - Elias Bernardo + - Gabriela Medeiros + - Geovana Ramos + - Guilherme Guy + - Joberth Rodrigues + +## 3. Pareamento + +- Daniel e Elias + +- Gabriela e Geovana + +- Guilherme e Joberth + +## 4. Planejamento da Sprint + +A Sprint 8 foi planejada para dar continuidade às histórias relacionadas à ficha de acompanhamento do paciente do Cris Down, que é uma importante feature do projeto. Além disso, há histórias dedicadas a atualizar planejamentos e documentos para esta segunda etapa do projeto e para a correção de bugs do aplicativo. + +## 5. Mudanças + +Para esta sprint, devido ao problema que houve na passada relacionado à pontuação de histórias não correspondendo ao esforço para entregá-las, na reunião de planejamento houve um maior cuidado com isso. Para isso, cada história foi discutida por mais tempo, e as possíveis questões técnicas relacionadas à elas foram mais esmiuçadas antes do início da pontuação. + +## 6. Backlog da Sprint + +- [TS75 - Atualizar a documentação dos riscos para a Sprint 7](https://github.com/fga-gpp-mds/2018.1-Dr-Down/issues/167) +- [TS77 - Elaborar a segunda versão da EVM](https://github.com/fga-gpp-mds/2018.1-Dr-Down/issues/185) +- [US78 - Consulta](https://github.com/fga-gpp-mds/2018.1-Dr-Down/issues/186) +- [TS79 - Correção de bugs](https://github.com/fga-gpp-mds/2018.1-Dr-Down/issues/187) +- [US80 - Ficha de acompanhamento](https://github.com/fga-gpp-mds/2018.1-Dr-Down/issues/188) +- [US81 - Calendário de vacina](https://github.com/fga-gpp-mds/2018.1-Dr-Down/issues/189) +- [TS82 - Documentar a Sprint 7](https://github.com/fga-gpp-mds/2018.1-Dr-Down/issues/191) + +## 7. Risk Burndown + +![Risk Burndown da Sprint 8](https://uploaddeimagens.com.br/images/001/403/364/full/riscos_S8.png?1525481031) From 8513405477ecf5ce6b8d6a39bce64d75a6bd4eee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Fran=C3=A7a?= Date: Fri, 4 May 2018 22:14:45 -0300 Subject: [PATCH 117/271] Creating the results document Add data about the Sprint 8 results Add charts of metrics and indicators of Sprint 8 --- docs/sprints/08/results.md | 51 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 docs/sprints/08/results.md diff --git a/docs/sprints/08/results.md b/docs/sprints/08/results.md new file mode 100644 index 00000000..3cd0b60f --- /dev/null +++ b/docs/sprints/08/results.md @@ -0,0 +1,51 @@ +# Fechamento da Sprint 8 + +## 1. Resumo da Sprint + +__Pontos Planejados__: 22 pontos + +__Pontos concluídos__: 21 pontos + +__Dívidas técnicas__: 1 pontos + +__Histórias entregues:__ + +- [TS75 - Atualizar a documentação dos riscos para a Sprint 7](https://github.com/fga-gpp-mds/2018.1-Dr-Down/issues/167) +- [TS77 - Elaborar a segunda versão da EVM](https://github.com/fga-gpp-mds/2018.1-Dr-Down/issues/185) +- [US78 - Consulta](https://github.com/fga-gpp-mds/2018.1-Dr-Down/issues/186) +- [TS79 - Correção de bugs](https://github.com/fga-gpp-mds/2018.1-Dr-Down/issues/187) +- [US80 - Ficha de acompanhamento](https://github.com/fga-gpp-mds/2018.1-Dr-Down/issues/188) +- [US81 - Calendário de vacina](https://github.com/fga-gpp-mds/2018.1-Dr-Down/issues/189) + +__Histórias que viraram débitos:__ + +- [TS82 - Documentar a Sprint 7](https://github.com/fga-gpp-mds/2018.1-Dr-Down/issues/191) + +## 2. Retrospectiva da Sprint + +| Pontos Positivos | Pontos Negativos | Sugestão de Melhoria | +| ----- | ----- | ---- | +| - | - | - | + +## 3. Quadro de Conhecimento + +![Quadro de conhecimento da Sprint 8]() + +## 5. Gráfico do Burndown + +![Gráfico do burndown da Sprint 8](https://uploaddeimagens.com.br/images/001/403/383/full/burndown_S8.png?1525482311) + +## 6. Velocity + +![Gráfico do velocity da Sprint 8](https://uploaddeimagens.com.br/images/001/403/385/full/velocity_S8.png?1525482341) + +## 7. Gráfico de Commits + +![Gráfico de commits da Sprint 8](https://uploaddeimagens.com.br/images/001/403/387/full/commits_S8.png?1525482367) + +## 8. EVM + +![Gráfico da EVM da Sprint 8](https://uploaddeimagens.com.br/images/001/403/395/full/evm_S8.png?1525482754) + +## 9. Análise do Scrum Master + From 81add8ab640e370dffb35639bb8409ac12c58814 Mon Sep 17 00:00:00 2001 From: Elias Bernardo Date: Sat, 5 May 2018 16:06:04 -0300 Subject: [PATCH 118/271] Limiting the medical records display only for the specific patient Removing "elect_count" from get_context_data() Adding medicalrecordlist in get_context_data() Co-authored-by: Guilherme Guy --- .../medicalrecords/medicalrecord_list.html | 13 ++++--------- drdown/medicalrecords/views/view_medical_record.py | 10 +++++----- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/drdown/medicalrecords/templates/medicalrecords/medicalrecord_list.html b/drdown/medicalrecords/templates/medicalrecords/medicalrecord_list.html index 56c94f34..fa478c97 100644 --- a/drdown/medicalrecords/templates/medicalrecords/medicalrecord_list.html +++ b/drdown/medicalrecords/templates/medicalrecords/medicalrecord_list.html @@ -12,12 +12,7 @@

{% trans 'Medical Record' %} {% trans "'s"%} {{ view.related_patient.user.name }}

- {% if elect_count == 0 %} -

{% trans 'There are no Medical Records for this patient.'%}

- {% if user.healthteam %} - {% trans "New" %} - {% endif %} - {% else %} + {% if medicalrecordlist is not None %}
@@ -53,8 +48,7 @@

{% trans 'There are no Medical Records for this patient.'%}

- {% for medicalrecord in medicalrecord_list %} - {% if view.kwargs.username == medicalrecord.patient.user.username %} + {% for medicalrecord in medicalrecordlist %}

{{ medicalrecord.message|markdown }}

{{ medicalrecord.author.user.name }}

@@ -67,7 +61,8 @@

{% trans 'There are no Medical Records for this patient.'%}

{% trans "Delete" %}

{% endif %}
- {% endif %} + {% empty %} +

{% trans 'There are no Medical Records for this patient.'%}

{% endfor %}
diff --git a/drdown/medicalrecords/views/view_medical_record.py b/drdown/medicalrecords/views/view_medical_record.py index e77db7ca..da7ce3e9 100644 --- a/drdown/medicalrecords/views/view_medical_record.py +++ b/drdown/medicalrecords/views/view_medical_record.py @@ -74,11 +74,11 @@ def get_queryset(self): def get_context_data(self, **kwargs): context = super(MedicalRecordsList, self).get_context_data(**kwargs) - elect_count = 0 - for device in MedicalRecord.objects.all(): - if device.patient.user.username == self.kwargs.get('username'): - elect_count += 1 - context['elect_count'] = elect_count + patient = Patient.objects.get( + user__username=self.kwargs.get('username') + ) + medicalrecordlist = MedicalRecord.objects.filter(patient=patient) + context['medicalrecordlist'] = medicalrecordlist return context From 915b3daac34d6b7ced5e54721a8d50298fbc02bc Mon Sep 17 00:00:00 2001 From: Elias Bernardo Date: Sat, 5 May 2018 21:08:44 -0300 Subject: [PATCH 119/271] Converting SearchView's MedicalRecordsList to ListView Removing MedicalRecordSearchForm in forms Removing searchfields in medicalrecord_list template Removing related_patient() method in MedicalRecordsList View Adding related_patient in get_context_data() method in View Co-authored-by: Guilherme Guy --- .../forms/medicalrecords_forms.py | 24 ------- .../medicalrecords/medicalrecord_list.html | 64 ++++++++----------- .../views/view_medical_record.py | 21 ++---- 3 files changed, 33 insertions(+), 76 deletions(-) diff --git a/drdown/medicalrecords/forms/medicalrecords_forms.py b/drdown/medicalrecords/forms/medicalrecords_forms.py index 1b0f3e63..20ada1a3 100644 --- a/drdown/medicalrecords/forms/medicalrecords_forms.py +++ b/drdown/medicalrecords/forms/medicalrecords_forms.py @@ -15,30 +15,6 @@ class Meta: fields = ["message", "document"] -class MedicalRecordSearchForm(forms.Form): - search_text = forms.CharField( - required=False, - label='Search patient!', - widget=forms.TextInput( - attrs={'placeholder': _('search here!')} - ) - ) - - search_date = forms.DateField( - required=False, - label='Search date!', - widget=forms.TextInput( - attrs={'placeholder': _('(Year)-(Month)-(Day)')} - ) - ) - - author = forms.ModelChoiceField( - queryset=HealthTeam.objects.all(), - required=False, - label=_('Search author!') - ) - - class MedicalRecordCompleteSearchForm(forms.Form): search_text = forms.CharField( required=False, diff --git a/drdown/medicalrecords/templates/medicalrecords/medicalrecord_list.html b/drdown/medicalrecords/templates/medicalrecords/medicalrecord_list.html index fa478c97..0bc4e095 100644 --- a/drdown/medicalrecords/templates/medicalrecords/medicalrecord_list.html +++ b/drdown/medicalrecords/templates/medicalrecords/medicalrecord_list.html @@ -11,60 +11,52 @@ {% block content %}
-

{% trans 'Medical Record' %} {% trans "'s"%} {{ view.related_patient.user.name }}

+

{% trans 'Medical Record' %} {% trans "'s"%} {{ related_patient.user.name }}

{% if medicalrecordlist is not None %} - - - - {% if user.healthteam %} {% trans "New" %} {% endif %} - - {% endif %} {% trans "Return" %}
- {% if view.related_patient.user.patient %} - {% if view.related_patient.user.photo %} - + {% if related_patient.user.patient %} + {% if related_patient.user.photo %} + {% else %} {% endif %}
-
-
-
- {% if view.related_patient.user.cpf %} - {{ view.related_patient.cpf }} +
+
+
+ {% if related_patient.user.cpf %} + {{ related_patient.cpf }} {% endif %}
{% endif %}
- - -
-
- {% for medicalrecord in medicalrecordlist %} -
-

{{ medicalrecord.message|markdown }}

-

{{ medicalrecord.author.user.name }}

- {% if medicalrecord.document %} -

{% trans 'Anexo:' %} {{ medicalrecord.document.name }}

- {% endif %} -

{{ medicalrecord.day }}

- {% if request.user.username == medicalrecord.author.user.username %} - {% trans "Edit" %} - {% trans "Delete" %}

- {% endif %} -
- {% empty %} -

{% trans 'There are no Medical Records for this patient.'%}

- {% endfor %} -
+
+
+ {% for medicalrecord in medicalrecordlist %} +
+

{{ medicalrecord.message|markdown }}

+

{{ medicalrecord.author.user.name }}

+ {% if medicalrecord.document %} +

{% trans 'Anexo:' %} {{ medicalrecord.document.name }}

+ {% endif %} +

{{ medicalrecord.day }}

+ {% if request.user.username == medicalrecord.author.user.username %} + {% trans "Edit" %} + {% trans "Delete" %}

+ {% endif %} +
+ {% empty %} +

{% trans 'There are no Medical Records for this patient.'%}

+ {% endfor %}
+ {% endblock content %} diff --git a/drdown/medicalrecords/views/view_medical_record.py b/drdown/medicalrecords/views/view_medical_record.py index da7ce3e9..8a15fdac 100644 --- a/drdown/medicalrecords/views/view_medical_record.py +++ b/drdown/medicalrecords/views/view_medical_record.py @@ -2,13 +2,13 @@ from ..models.model_medical_record import MedicalRecord from drdown.users.models.model_user import User from drdown.users.models.model_patient import Patient -from django.views.generic import CreateView, DeleteView, UpdateView +from django.views.generic import CreateView, DeleteView, UpdateView, ListView from django.urls import reverse_lazy from search_views.search import SearchListView from django.contrib.auth.mixins import UserPassesTestMixin from search_views.filters import BaseFilter -from ..forms.medicalrecords_forms import MedicalRecordSearchForm,\ - MedicalRecordCompleteSearchForm, PatientSearchForm, MedicalRecordForm +from ..forms.medicalrecords_forms import MedicalRecordCompleteSearchForm, \ + PatientSearchForm, MedicalRecordForm class MedicalRecordsFilter(BaseFilter): @@ -17,7 +17,6 @@ class MedicalRecordsFilter(BaseFilter): 'search_date': ['day'], 'author': ['author_id__id'], 'patient': ['patient__id'], - 'message': ['message'], 'list_patient': ['id'] } @@ -38,11 +37,9 @@ def get_login_url(self): return login_MedicalRecordsList_url -class MedicalRecordsList(UserPassesTestMixin, SearchListView): +class MedicalRecordsList(UserPassesTestMixin, ListView): model = MedicalRecord template_name = "medicalrecords/medicalrecord_list.html" - form_class = MedicalRecordSearchForm - filter_class = MedicalRecordsFilter def test_func(self): return hasattr(self.request.user, 'healthteam') or \ @@ -59,15 +56,6 @@ def get_login_url(self): login_MedicalRecordsList_url = reverse_lazy('account_login') return login_MedicalRecordsList_url - def related_patient(self): - user = User.objects.get( - username=self.kwargs.get('username') - ) - patient = Patient.objects.get( - user=user - ) - return patient - def get_queryset(self): queryset = MedicalRecord.objects.all().order_by('-day') return queryset @@ -79,6 +67,7 @@ def get_context_data(self, **kwargs): ) medicalrecordlist = MedicalRecord.objects.filter(patient=patient) context['medicalrecordlist'] = medicalrecordlist + context['related_patient'] = patient return context From ca1e38d42b53ad729d16322b1b88f03ea278c98c Mon Sep 17 00:00:00 2001 From: Elias Bernardo Date: Sat, 5 May 2018 21:34:40 -0300 Subject: [PATCH 120/271] Removing MedicalRecords Search Removing complete_search() in forms Removing medicalrecords_search_list template Removing search_list in Medical Records urls Removing unnecessary tests from test_medical_records_view Co-authored-by: Guilherme Guy --- .../forms/medicalrecords_forms.py | 30 ------------ .../medicalrecord_patient_list.html | 1 - .../medicalrecord_search_list.html | 49 ------------------- .../tests/test_medical_records_view.py | 46 ----------------- drdown/medicalrecords/urls.py | 7 --- .../views/view_medical_record.py | 19 +------ 6 files changed, 1 insertion(+), 151 deletions(-) delete mode 100644 drdown/medicalrecords/templates/medicalrecords/medicalrecord_search_list.html diff --git a/drdown/medicalrecords/forms/medicalrecords_forms.py b/drdown/medicalrecords/forms/medicalrecords_forms.py index 20ada1a3..8c8923fb 100644 --- a/drdown/medicalrecords/forms/medicalrecords_forms.py +++ b/drdown/medicalrecords/forms/medicalrecords_forms.py @@ -15,36 +15,6 @@ class Meta: fields = ["message", "document"] -class MedicalRecordCompleteSearchForm(forms.Form): - search_text = forms.CharField( - required=False, - label=_('Search patient!'), - widget=forms.TextInput( - attrs={'placeholder': _('search here!')} - ) - ) - - search_date = forms.DateField( - required=False, - label=_('Search date!'), - widget=forms.TextInput( - attrs={'placeholder': _('(Year)-(Month)-(Day)')} - ) - ) - - author = forms.ModelChoiceField( - queryset=HealthTeam.objects.all(), - required=False, - label=_('Search author!') - ) - - patient = forms.ModelChoiceField( - queryset=Patient.objects.all(), - required=False, - label=_('Search patient!') - ) - - class PatientSearchForm(forms.Form): list_patient = forms.ModelChoiceField( diff --git a/drdown/medicalrecords/templates/medicalrecords/medicalrecord_patient_list.html b/drdown/medicalrecords/templates/medicalrecords/medicalrecord_patient_list.html index 3f1d93e5..69752082 100644 --- a/drdown/medicalrecords/templates/medicalrecords/medicalrecord_patient_list.html +++ b/drdown/medicalrecords/templates/medicalrecords/medicalrecord_patient_list.html @@ -16,7 +16,6 @@

{% trans 'Medical Records' %}

- {% trans 'Advanced Search' %} {% endif %} diff --git a/drdown/medicalrecords/templates/medicalrecords/medicalrecord_search_list.html b/drdown/medicalrecords/templates/medicalrecords/medicalrecord_search_list.html deleted file mode 100644 index d87b1153..00000000 --- a/drdown/medicalrecords/templates/medicalrecords/medicalrecord_search_list.html +++ /dev/null @@ -1,49 +0,0 @@ -{% extends "core/base.html" %} -{% load static i18n %} -{% block title %}{% trans "Search a Medical Records:" %}{% endblock %} - -{% block css %} -{{block.super}} - -{% endblock %} - -{% block content %} -
-

{% trans 'Medical Records' %}

-
-

-
-

- - - - - {% trans "Return" %} - - -

- -
- -
-
- {% for medicalrecord in medicalrecord_list %} - -
-

{{ medicalrecord.patient }}

-

{{ medicalrecord.message }}

-

{{ medicalrecord.author }}

- {% if medicalrecord.document %} -

Anexo: {{ medicalrecord.document.name }}

- {% endif %} -

{{ medicalrecord.day }}

- {% trans 'Edit' %} - {% trans 'Delete' %}

-
- - {% endfor %} -
-

{% include "core/pagination.html" %}

-
-
-{% endblock content %} diff --git a/drdown/medicalrecords/tests/test_medical_records_view.py b/drdown/medicalrecords/tests/test_medical_records_view.py index 24b4b752..f853e5b3 100644 --- a/drdown/medicalrecords/tests/test_medical_records_view.py +++ b/drdown/medicalrecords/tests/test_medical_records_view.py @@ -1,7 +1,5 @@ from test_plus.test import TestCase from ..models.model_medical_record import MedicalRecord -from ..views.view_medical_record import MedicalRecordsSearchList -from ..views.view_medical_record import MedicalRecordCompleteSearchForm from drdown.users.models.model_health_team import HealthTeam from drdown.users.models.model_patient import Patient from drdown.users.models.model_user import User @@ -132,50 +130,6 @@ def test_updated_medical_records_ok(self): self.assertEquals(response.status_code,200) - def test_search_list_view(self): - """ - Makes sure that the medicalrecord search view is loaded correctly - """ - - self.client.force_login(user=self.user_1) - self.url = () - response = self.client.get( - path=reverse( - viewname='medicalrecords:list_search_medicalrecords', - ) - ) - self.assertEquals(response.status_code, 200) - - def test_search_list_view_logout(self): - """ - Makes sure that the medicalrecord search view gives 302 on a logout - """ - - self.client.force_login(user=self.user_1) - self.client.logout() - self.url = () - response = self.client.get( - path=reverse( - viewname='medicalrecords:list_search_medicalrecords', - ) - ) - self.assertEquals(response.status_code, 302) - - def test_search_list_view_no_permissions(self): - """ - Makes sure that the medicalrecord gives 302 on a user without - permissions - """ - - self.client.force_login(user=self.user_2) - self.url = () - response = self.client.get( - path=reverse( - viewname='medicalrecords:list_search_medicalrecords', - ) - ) - self.assertEquals(response.status_code, 302) - def test_list_view(self): """ Makes sure that the medicalrecord search view is loaded correctly diff --git a/drdown/medicalrecords/urls.py b/drdown/medicalrecords/urls.py index a83abf58..2f50ddd8 100644 --- a/drdown/medicalrecords/urls.py +++ b/drdown/medicalrecords/urls.py @@ -19,13 +19,6 @@ name='list_users_medicalrecords' ), - url( - regex=r'search/$', - view=view_medical_record.MedicalRecordsSearchList.as_view( - template_name='medicalrecords/medicalrecord_search_list.html'), - name='list_search_medicalrecords' - ), - url( regex=r'^(?P[\w.@+-]+)/new', diff --git a/drdown/medicalrecords/views/view_medical_record.py b/drdown/medicalrecords/views/view_medical_record.py index 8a15fdac..8b3ed38e 100644 --- a/drdown/medicalrecords/views/view_medical_record.py +++ b/drdown/medicalrecords/views/view_medical_record.py @@ -7,16 +7,11 @@ from search_views.search import SearchListView from django.contrib.auth.mixins import UserPassesTestMixin from search_views.filters import BaseFilter -from ..forms.medicalrecords_forms import MedicalRecordCompleteSearchForm, \ - PatientSearchForm, MedicalRecordForm +from ..forms.medicalrecords_forms import PatientSearchForm, MedicalRecordForm class MedicalRecordsFilter(BaseFilter): search_fields = { - 'search_text': ['message'], - 'search_date': ['day'], - 'author': ['author_id__id'], - 'patient': ['patient__id'], 'list_patient': ['id'] } @@ -71,18 +66,6 @@ def get_context_data(self, **kwargs): return context -class MedicalRecordsSearchList(CheckPermissions, SearchListView): - model = MedicalRecord - template_name = "medicalrecords/medicalrecord_search_list.html" - form_class = MedicalRecordCompleteSearchForm - filter_class = MedicalRecordsFilter - paginate_by = 10 - - def get_queryset(self): - queryset = MedicalRecord.objects.all().order_by('-day') - return queryset - - class PatientSearchList(CheckPermissions, SearchListView): model = Patient template_name = "medicalrecords/medicalrecord_patient_list.html" From dd6b84a37c8c6e4758d82db006f898112a6e1199 Mon Sep 17 00:00:00 2001 From: Elias Bernardo Date: Sun, 6 May 2018 11:03:19 -0300 Subject: [PATCH 121/271] A responsible and an employee can now see the medical records Adding test_func conditions for a responsible and an employee have access to medical records Co-authored-by: Guilherme Guy --- drdown/medicalrecords/views/view_medical_record.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drdown/medicalrecords/views/view_medical_record.py b/drdown/medicalrecords/views/view_medical_record.py index 8b3ed38e..188bddd5 100644 --- a/drdown/medicalrecords/views/view_medical_record.py +++ b/drdown/medicalrecords/views/view_medical_record.py @@ -18,7 +18,8 @@ class MedicalRecordsFilter(BaseFilter): class CheckPermissions(UserPassesTestMixin): def test_func(self): - return hasattr(self.request.user, 'healthteam') + return hasattr(self.request.user, 'healthteam') or \ + hasattr(self.request.user, 'employee') def get_login_url(self): if self.request.user.is_authenticated: @@ -38,7 +39,11 @@ class MedicalRecordsList(UserPassesTestMixin, ListView): def test_func(self): return hasattr(self.request.user, 'healthteam') or \ - self.request.user.username == self.kwargs.get('username') + hasattr(self.request.user, 'employee') or \ + self.request.user.username == self.kwargs.get('username') or \ + (hasattr(self.request.user, 'responsible') and + self.request.user.responsible.patient_set.filter( + user__username=self.kwargs.get('username'))) def get_login_url(self): if self.request.user.is_authenticated: From d412fe442daecc34a3efb9b85eb6006a7a514ab5 Mon Sep 17 00:00:00 2001 From: Elias Bernardo Date: Sun, 6 May 2018 12:22:50 -0300 Subject: [PATCH 122/271] Removing PatientSearchList Revoming PatientSearchForm in medicalrecords_forms Removing list_user_medicalrecords in Medical Records urls Removing medicalrecord_patient_list template Co-authored-by: Guilherme Guy --- .../forms/medicalrecords_forms.py | 12 ------- .../medicalrecord_patient_list.html | 33 ------------------- .../tests/test_medical_records_view.py | 3 +- drdown/medicalrecords/urls.py | 7 ---- .../views/view_medical_record.py | 11 +------ 5 files changed, 2 insertions(+), 64 deletions(-) delete mode 100644 drdown/medicalrecords/templates/medicalrecords/medicalrecord_patient_list.html diff --git a/drdown/medicalrecords/forms/medicalrecords_forms.py b/drdown/medicalrecords/forms/medicalrecords_forms.py index 8c8923fb..3429267c 100644 --- a/drdown/medicalrecords/forms/medicalrecords_forms.py +++ b/drdown/medicalrecords/forms/medicalrecords_forms.py @@ -1,9 +1,6 @@ from drdown.medicalrecords.models.model_medical_record import MedicalRecord from django import forms -from drdown.users.models.model_health_team import HealthTeam -from drdown.users.models.model_patient import Patient from pagedown.widgets import PagedownWidget -from django.utils.translation import ugettext_lazy as _ class MedicalRecordForm(forms.ModelForm): @@ -13,12 +10,3 @@ class MedicalRecordForm(forms.ModelForm): class Meta: model = MedicalRecord fields = ["message", "document"] - - -class PatientSearchForm(forms.Form): - - list_patient = forms.ModelChoiceField( - queryset=Patient.objects.all(), - required=False, - label=_('Search patient!') - ) diff --git a/drdown/medicalrecords/templates/medicalrecords/medicalrecord_patient_list.html b/drdown/medicalrecords/templates/medicalrecords/medicalrecord_patient_list.html deleted file mode 100644 index 69752082..00000000 --- a/drdown/medicalrecords/templates/medicalrecords/medicalrecord_patient_list.html +++ /dev/null @@ -1,33 +0,0 @@ -{% extends "core/base.html" %} -{% load static i18n %} - -{% block title %}{% trans 'Medical Records:' %}{% endblock %} - -{% block css %} -{{block.super}} - -{% endblock %} - -{% block content %} -
-

{% trans 'Medical Records' %}

-
- {% if user.is_authenticated %} -
- - - - - {% endif %} -
-
- {% for patients in patient_list %} - -

{{ patients.user.username }}

-
- {% empty %} -

{% trans 'There are no Medical Records.'%}

- {% endfor %} -
-
-{% endblock content %} diff --git a/drdown/medicalrecords/tests/test_medical_records_view.py b/drdown/medicalrecords/tests/test_medical_records_view.py index f853e5b3..1694bd38 100644 --- a/drdown/medicalrecords/tests/test_medical_records_view.py +++ b/drdown/medicalrecords/tests/test_medical_records_view.py @@ -4,9 +4,8 @@ from drdown.users.models.model_patient import Patient from drdown.users.models.model_user import User from django.test.client import Client -from django.urls import reverse, reverse_lazy +from django.urls import reverse from django.utils.translation import ugettext_lazy as _ -from django.utils import timezone class TestViewMedicalRecords(TestCase): diff --git a/drdown/medicalrecords/urls.py b/drdown/medicalrecords/urls.py index 2f50ddd8..ebaabf3f 100644 --- a/drdown/medicalrecords/urls.py +++ b/drdown/medicalrecords/urls.py @@ -12,13 +12,6 @@ view=view_medical_record.MedicalRecordsList.as_view(), name='list_medicalrecords' ), - url( - regex=r'^$', - view=view_medical_record.PatientSearchList.as_view( - template_name='medicalrecords/medicalrecord_patient_list.html'), - name='list_users_medicalrecords' - ), - url( regex=r'^(?P[\w.@+-]+)/new', diff --git a/drdown/medicalrecords/views/view_medical_record.py b/drdown/medicalrecords/views/view_medical_record.py index 188bddd5..68936a2f 100644 --- a/drdown/medicalrecords/views/view_medical_record.py +++ b/drdown/medicalrecords/views/view_medical_record.py @@ -4,10 +4,9 @@ from drdown.users.models.model_patient import Patient from django.views.generic import CreateView, DeleteView, UpdateView, ListView from django.urls import reverse_lazy -from search_views.search import SearchListView from django.contrib.auth.mixins import UserPassesTestMixin from search_views.filters import BaseFilter -from ..forms.medicalrecords_forms import PatientSearchForm, MedicalRecordForm +from ..forms.medicalrecords_forms import MedicalRecordForm class MedicalRecordsFilter(BaseFilter): @@ -71,14 +70,6 @@ def get_context_data(self, **kwargs): return context -class PatientSearchList(CheckPermissions, SearchListView): - model = Patient - template_name = "medicalrecords/medicalrecord_patient_list.html" - form_class = PatientSearchForm - filter_class = MedicalRecordsFilter - paginate_by = 20 - - class MedicalRecordsCreateView(CreateView): model = MedicalRecord form_class = MedicalRecordForm From 3d6501ec9eed9fdb918cae18265c914bac9d9632 Mon Sep 17 00:00:00 2001 From: Elias Bernardo Date: Sun, 6 May 2018 12:28:19 -0300 Subject: [PATCH 123/271] Removing list_user_medical in base.htm, medicalrecord_form.html and medicalrecord_list.html Adding healthteam_patient_list in base.htm, medicalrecord_form.html and medicalrecord_list.html Co-authored-by: Guilherme Guy --- drdown/core/templates/core/base.html | 2 +- .../templates/medicalrecords/medicalrecord_form.html | 2 +- .../templates/medicalrecords/medicalrecord_list.html | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drdown/core/templates/core/base.html b/drdown/core/templates/core/base.html index 27380488..731ca0fe 100644 --- a/drdown/core/templates/core/base.html +++ b/drdown/core/templates/core/base.html @@ -70,7 +70,7 @@

{% endblock %} diff --git a/drdown/medicalrecords/templates/medicalrecords/medicalrecord_list.html b/drdown/medicalrecords/templates/medicalrecords/medicalrecord_list.html index 0bc4e095..c43f09c9 100644 --- a/drdown/medicalrecords/templates/medicalrecords/medicalrecord_list.html +++ b/drdown/medicalrecords/templates/medicalrecords/medicalrecord_list.html @@ -17,7 +17,7 @@

{% trans 'Medical Record' %} {% trans "'s"%} {{ relate {% trans "New" %} {% endif %} {% endif %} - {% trans "Return" %} + {% trans "Return" %}

From 3bfe67dc0ea4cab55a43acde8319f22dee2a6212 Mon Sep 17 00:00:00 2001 From: Elias Bernardo Date: Sun, 6 May 2018 16:23:27 -0300 Subject: [PATCH 124/271] Refactoring the front-end of the medical record Adding tabs with the required data Removing the return button Co-authored-by: Guilherme Guy --- .../medicalrecords/css/medicalrecords.css | 13 ++++ .../medicalrecords/medicalrecord_list.html | 61 +++++++++++-------- 2 files changed, 49 insertions(+), 25 deletions(-) diff --git a/drdown/medicalrecords/static/medicalrecords/css/medicalrecords.css b/drdown/medicalrecords/static/medicalrecords/css/medicalrecords.css index 0ae54f7e..7a1d709d 100644 --- a/drdown/medicalrecords/static/medicalrecords/css/medicalrecords.css +++ b/drdown/medicalrecords/static/medicalrecords/css/medicalrecords.css @@ -41,3 +41,16 @@ word-wrap: break-word; } + +.tab-pane { + + border-left: 1px solid #ddd; + border-right: 1px solid #ddd; + border-bottom: 1px solid #ddd; + border-radius: 0px 0px 5px 5px; + padding: 10px; +} + +.nav-tabs { + margin-bottom: 0; +} diff --git a/drdown/medicalrecords/templates/medicalrecords/medicalrecord_list.html b/drdown/medicalrecords/templates/medicalrecords/medicalrecord_list.html index c43f09c9..1ad5a712 100644 --- a/drdown/medicalrecords/templates/medicalrecords/medicalrecord_list.html +++ b/drdown/medicalrecords/templates/medicalrecords/medicalrecord_list.html @@ -10,35 +10,43 @@ {% block content %} -
-

{% trans 'Medical Record' %} {% trans "'s"%} {{ related_patient.user.name }}

- {% if medicalrecordlist is not None %} - {% if user.healthteam %} - {% trans "New" %} - {% endif %} - {% endif %} - {% trans "Return" %} -
+
-
- {% if related_patient.user.patient %} - {% if related_patient.user.photo %} - - {% else %} - - {% endif %} -
-
-
-
- {% if related_patient.user.cpf %} - {{ related_patient.cpf }} +

{% trans 'Medical Record' %} {% trans "'s"%} {{ related_patient.user.name }}

+
+ + + +
+
+

{{ related_patient.user.name }} {% trans 'data' %}

+
+
+ {% if related_patient.user.patient %} + {% if related_patient.user.photo %} + + {% else %} + + {% endif %} +
+
+
+
+ {% if related_patient.user.cpf %} + {{ related_patient.cpf }} + {% endif %} +
{% endif %}
- {% endif %}
- -
+ + +
{% endblock content %} From 96177b26865bb17646a55eabb45a3a620990397a Mon Sep 17 00:00:00 2001 From: guilherme1guy Date: Sun, 6 May 2018 17:10:52 -0300 Subject: [PATCH 125/271] Changes on frontend Improving html readability Adding return button on pages Change top part of medicalrecord_list Co-authored-by: Elias Bernardo --- .../medicalrecord_confirm_delete.html | 4 + .../medicalrecords/medicalrecord_form.html | 43 +++-- .../medicalrecords/medicalrecord_list.html | 148 +++++++++++------- 3 files changed, 130 insertions(+), 65 deletions(-) diff --git a/drdown/medicalrecords/templates/medicalrecords/medicalrecord_confirm_delete.html b/drdown/medicalrecords/templates/medicalrecords/medicalrecord_confirm_delete.html index c875375e..3d7a9074 100644 --- a/drdown/medicalrecords/templates/medicalrecords/medicalrecord_confirm_delete.html +++ b/drdown/medicalrecords/templates/medicalrecords/medicalrecord_confirm_delete.html @@ -8,9 +8,13 @@

{% trans 'Delete' %}

+ {% csrf_token %} +

{% trans 'Are you sure you want to delete this medical record?' %}

+ {% trans 'Cancel' %} + diff --git a/drdown/medicalrecords/templates/medicalrecords/medicalrecord_form.html b/drdown/medicalrecords/templates/medicalrecords/medicalrecord_form.html index 19c15f54..aec48383 100644 --- a/drdown/medicalrecords/templates/medicalrecords/medicalrecord_form.html +++ b/drdown/medicalrecords/templates/medicalrecords/medicalrecord_form.html @@ -1,20 +1,41 @@ {% extends 'core/base.html' %} {% load static i18n %} + {% block title %}{% trans 'New Medical Record' %}{% endblock %} + {% block css %} {{block.super}} {% endblock %} + {% block content %} -
-

{% trans 'New Medical Record' %}

- {{ form.media }} -
- {% csrf_token %} -
{{ form.message }}

-
{{ form.document }}

- - {% trans "Cancel" %} - -


+
+ +

{% trans 'New Medical Record' %}

+ + {{ form.media }} + +
+ + {% csrf_token %} + +
{{ form.message }}
+ +
+ +
{{ form.document }}
+ +
+ + + + {% trans "Cancel" %} + + + +
+ +
+
+ {% endblock %} diff --git a/drdown/medicalrecords/templates/medicalrecords/medicalrecord_list.html b/drdown/medicalrecords/templates/medicalrecords/medicalrecord_list.html index 1ad5a712..a5d2b512 100644 --- a/drdown/medicalrecords/templates/medicalrecords/medicalrecord_list.html +++ b/drdown/medicalrecords/templates/medicalrecords/medicalrecord_list.html @@ -12,62 +12,102 @@
-

{% trans 'Medical Record' %} {% trans "'s"%} {{ related_patient.user.name }}

-
- - - -
-
-

{{ related_patient.user.name }} {% trans 'data' %}

-
-
- {% if related_patient.user.patient %} - {% if related_patient.user.photo %} - - {% else %} - - {% endif %} -
-
-
-
- {% if related_patient.user.cpf %} - {{ related_patient.cpf }} - {% endif %} -
- {% endif %} -
-
- + +
+
+ + +
+ +
+ +

{{ related_patient.user.name }} {% trans 'data' %}

+ +
+
+ {% if related_patient.user.patient %} + + {% if related_patient.user.photo %} + + {% else %} + + {% endif %} + +
+ +
+ +
+ +
+ + {% if related_patient.user.cpf %} + {{ related_patient.cpf }} + {% endif %} + +
+ + {% endif %} +
+
+ + +
+
+
{% endblock content %} From f6e3172c5f4ca7101441c4bbd7fe9dce8bdb3337 Mon Sep 17 00:00:00 2001 From: GeovanaRamos Date: Sun, 6 May 2018 17:22:57 -0300 Subject: [PATCH 126/271] Removing fields from appointment Removing shift Removing motive Co-authored-by: Daniel Maike --- .../migrations/0002_auto_20180506_1956.py | 21 +++++++++++++ .../appointments/models/model_appointment.py | 22 -------------- .../appointments/appointment_form.html | 30 ------------------- .../appointments/appointment_list.html | 1 - .../tests/test_model_appointment.py | 16 ---------- .../tests/test_view_appointment.py | 15 ++++------ drdown/appointments/views/view_appointment.py | 5 +--- 7 files changed, 27 insertions(+), 83 deletions(-) create mode 100644 drdown/appointments/migrations/0002_auto_20180506_1956.py diff --git a/drdown/appointments/migrations/0002_auto_20180506_1956.py b/drdown/appointments/migrations/0002_auto_20180506_1956.py new file mode 100644 index 00000000..c306e6a9 --- /dev/null +++ b/drdown/appointments/migrations/0002_auto_20180506_1956.py @@ -0,0 +1,21 @@ +# Generated by Django 2.0.3 on 2018-05-06 19:56 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('appointments', '0001_initial'), + ] + + operations = [ + migrations.RemoveField( + model_name='appointment', + name='motive', + ), + migrations.RemoveField( + model_name='appointment', + name='shift', + ), + ] diff --git a/drdown/appointments/models/model_appointment.py b/drdown/appointments/models/model_appointment.py index 6fec9419..57dd9eca 100644 --- a/drdown/appointments/models/model_appointment.py +++ b/drdown/appointments/models/model_appointment.py @@ -6,21 +6,6 @@ class Appointment(models.Model): - MORNING = 'M' - AFTERNOON = 'A' - - SHIFT_CHOICES = ( - (MORNING, _('Morning')), - (AFTERNOON, _('Afternoon')), - ) - - shift = models.CharField( - _('Shift'), - choices=SHIFT_CHOICES, - help_text=_('Shift of appointment'), - max_length=10 - ) - date = models.DateField( _('Date'), help_text=_('Date of appointment'), @@ -33,13 +18,6 @@ class Appointment(models.Model): max_length=50 ) - motive = models.TextField( - _('Motive'), - help_text=_('Why are you requesting an appointment?'), - max_length=500, - blank=True, - ) - SPEECH_THERAPHY = "Speech Therapy" PSYCHOLOGY = "Psychology" PHYSIOTHERAPY = "Physiotherapy" diff --git a/drdown/appointments/templates/appointments/appointment_form.html b/drdown/appointments/templates/appointments/appointment_form.html index 47c57557..37b2ffa7 100644 --- a/drdown/appointments/templates/appointments/appointment_form.html +++ b/drdown/appointments/templates/appointments/appointment_form.html @@ -45,26 +45,6 @@

{% trans "Edit Appointment" %}

-
- - -
-

- {% else %} - - {% endif %} -
diff --git a/drdown/appointments/templates/appointments/appointment_list.html b/drdown/appointments/templates/appointments/appointment_list.html index b286fb86..028066a9 100644 --- a/drdown/appointments/templates/appointments/appointment_list.html +++ b/drdown/appointments/templates/appointments/appointment_list.html @@ -51,7 +51,6 @@
{% trans 'Patient'%}: {{appointment.patient.user.name}}
{% elif appointment.date|date:"d-m-Y" == today and appointment.time|time:'H:i' < time %} {% trans 'Status'%}: {% trans 'Done' %}
{% endif %} -

{{appointment.motive}}

{% empty %} diff --git a/drdown/appointments/tests/test_model_appointment.py b/drdown/appointments/tests/test_model_appointment.py index 9873b231..88b77646 100644 --- a/drdown/appointments/tests/test_model_appointment.py +++ b/drdown/appointments/tests/test_model_appointment.py @@ -36,10 +36,8 @@ def setUp(self): ) self.appointment = Appointment.objects.create( - shift=Appointment.MORNING, date="2040-08-10", time="15:45", - motive='Some motive', speciality=Appointment.SPEECH_THERAPHY, doctor=self.doctor, patient=self.patient, @@ -72,13 +70,6 @@ def test_delete_cascade_doctor(self): with self.assertRaises(Appointment.DoesNotExist): Appointment.objects.get() - def test_save_shift_ok(self): - """ - Test to verify if shift is correctly passed - """ - - self.assertEquals(self.appointment.shift, Appointment.MORNING) - def test_save_date_ok(self): """ Test to verify if date is correctly passed @@ -93,13 +84,6 @@ def test_save_time_ok(self): self.assertEquals(self.appointment.time, "15:45") - def test_save_motive_ok(self): - """ - Test to verify if motive is correctly passed - """ - - self.assertEquals(self.appointment.motive, 'Some motive') - def test_save_patient_ok(self): """ Test to verify if patient is correctly passed diff --git a/drdown/appointments/tests/test_view_appointment.py b/drdown/appointments/tests/test_view_appointment.py index c3d37b93..e912a9a1 100644 --- a/drdown/appointments/tests/test_view_appointment.py +++ b/drdown/appointments/tests/test_view_appointment.py @@ -48,15 +48,13 @@ def setUp(self): self.responsible = Responsible.objects.create( user=self.user4, - cpf="022.852.870-46", - patient=self.patient + cpf="022.852.870-46", + patient=self.patient ) self.appointment = Appointment.objects.create( - shift=Appointment.MORNING, date="2040-08-10", time="15:45", - motive='Some motive', speciality=Appointment.SPEECH_THERAPHY, doctor=self.doctor, patient=self.patient, @@ -119,7 +117,6 @@ def test_appointment_form_valid_create_view(self): self.client.force_login(user=self.user3) data = { 'speciality': Appointment.SPEECH_THERAPHY, - 'shift': 'A', 'doctor': self.doctor.pk, 'patient': self.patient.pk, 'date': '2018-05-12', @@ -138,7 +135,6 @@ def test_appointment_form_valid_update_view(self): self.client.force_login(user=self.user) data = { 'speciality': Appointment.SPEECH_THERAPHY, - 'shift': 'A', 'doctor': self.doctor.pk, 'patient': self.patient.pk, 'date': '2018-05-12', @@ -146,7 +142,7 @@ def test_appointment_form_valid_update_view(self): } response = self.client.post( path=reverse( - viewname='appointments:update_appointment', + viewname='appointments:update_appointment', args=(self.appointment.pk,) ), data=data, @@ -157,17 +153,16 @@ def test_redirect_delete_ok(self): """ Test the page url status code. """ - + self.client.force_login(user=self.user) data = { 'speciality': Appointment.SPEECH_THERAPHY, - 'shift': 'A', 'doctor': self.doctor.pk, 'patient': self.patient.pk, 'date': '2018-05-12', 'time': '20:00', } - + response = self.client.post( path=reverse( viewname='appointments:update_status_appointment', diff --git a/drdown/appointments/views/view_appointment.py b/drdown/appointments/views/view_appointment.py index 1fc824d4..4dca416f 100644 --- a/drdown/appointments/views/view_appointment.py +++ b/drdown/appointments/views/view_appointment.py @@ -100,12 +100,10 @@ class AppointmentCreateView(LoginRequiredMixin, CreateView): template_name = 'appointments/appointment_form.html' fields = [ 'speciality', - 'shift', 'doctor', 'patient', 'date', 'time', - 'motive', ] def get_success_url(self, **kwargs): @@ -161,12 +159,11 @@ class AppointmentUpdateView(LoginRequiredMixin, UpdateView): model = Appointment template_name = 'appointments/appointment_form.html' fields = ['speciality', - 'shift', 'doctor', 'patient', 'date', 'time', - 'motive', ] + ] def get_success_url(self, **kwargs): success_update_url = reverse( From 1c6bae7e5826d6b79e008efa12330d564bb01d08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Pedro=20Sconetto?= Date: Sun, 6 May 2018 17:48:54 -0300 Subject: [PATCH 127/271] Last fixes to release v0.0.3 Correcting some translations errors Adding a migration to correct a verbose name Co-authored-by: Mariana Mendes --- .../locale/pt_BR/LC_MESSAGES/django.po | 6 ------ drdown/users/locale/pt_BR/LC_MESSAGES/django.po | 6 +----- .../users/migrations/0016_auto_20180506_2043.py | 17 +++++++++++++++++ 3 files changed, 18 insertions(+), 11 deletions(-) create mode 100644 drdown/users/migrations/0016_auto_20180506_2043.py diff --git a/drdown/medicalrecords/locale/pt_BR/LC_MESSAGES/django.po b/drdown/medicalrecords/locale/pt_BR/LC_MESSAGES/django.po index 04b97d31..53a4cf1e 100644 --- a/drdown/medicalrecords/locale/pt_BR/LC_MESSAGES/django.po +++ b/drdown/medicalrecords/locale/pt_BR/LC_MESSAGES/django.po @@ -212,12 +212,6 @@ msgstr "Este campo é obrigatório." #~ msgid "message" #~ msgstr "mensagem" -#~ msgid "Previous" -#~ msgstr "Anterior" - -#~ msgid "Next" -#~ msgstr "Próximo" - #, fuzzy #~| msgid "Attachments" #~ msgid "Documents" diff --git a/drdown/users/locale/pt_BR/LC_MESSAGES/django.po b/drdown/users/locale/pt_BR/LC_MESSAGES/django.po index 4918ea1f..62976479 100644 --- a/drdown/users/locale/pt_BR/LC_MESSAGES/django.po +++ b/drdown/users/locale/pt_BR/LC_MESSAGES/django.po @@ -540,7 +540,7 @@ msgstr "Meus Pacientes" #: drdown/users/templates/users/user_detail.html:282 msgid "My Medical Records" -msgstr "Minhas Consultas" +msgstr "Meu Histórico Médico" #: drdown/users/templates/users/user_detail.html:283 msgid "My Medical Follow-up Sheet" @@ -550,10 +550,6 @@ msgstr "Ficha de Acompanhamento" msgid "Confirm data" msgstr "Confirmar dados" -#: drdown/users/templates/users/user_detail.html:272 -msgid "My Medical Records" -msgstr "Meu Prontuário" - #: drdown/users/templates/users/user_form.html:113 msgid "Photo of user" msgstr "Foto do usuário" diff --git a/drdown/users/migrations/0016_auto_20180506_2043.py b/drdown/users/migrations/0016_auto_20180506_2043.py new file mode 100644 index 00000000..03c0509c --- /dev/null +++ b/drdown/users/migrations/0016_auto_20180506_2043.py @@ -0,0 +1,17 @@ +# Generated by Django 2.0.3 on 2018-05-06 20:43 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('users', '0015_auto_20180428_1306'), + ] + + operations = [ + migrations.AlterModelOptions( + name='patient', + options={'verbose_name': 'Patient', 'verbose_name_plural': 'Patients'}, + ), + ] From 1e9f1a2e1a85fd4f405d4a71929af87620dd788d Mon Sep 17 00:00:00 2001 From: GeovanaRamos Date: Sun, 6 May 2018 18:10:34 -0300 Subject: [PATCH 128/271] Creating appointment request Adding model request Adding request to admin Co-authored-by: Daniel Maike --- drdown/appointments/admin.py | 2 + .../appointments/migrations/0003_request.py | 31 ++++++ drdown/appointments/models/__init__.py | 1 + .../appointments/models/model_appointment.py | 1 - drdown/appointments/models/model_request.py | 100 ++++++++++++++++++ .../migrations/0016_auto_20180506_2059.py | 17 +++ 6 files changed, 151 insertions(+), 1 deletion(-) create mode 100644 drdown/appointments/migrations/0003_request.py create mode 100644 drdown/appointments/models/model_request.py create mode 100644 drdown/users/migrations/0016_auto_20180506_2059.py diff --git a/drdown/appointments/admin.py b/drdown/appointments/admin.py index a81f24c1..636dca4c 100644 --- a/drdown/appointments/admin.py +++ b/drdown/appointments/admin.py @@ -1,5 +1,7 @@ from django.contrib import admin from .models.model_appointment import Appointment +from .models.model_request import Request # Register your models here. admin.site.register(Appointment) +admin.site.register(Request) diff --git a/drdown/appointments/migrations/0003_request.py b/drdown/appointments/migrations/0003_request.py new file mode 100644 index 00000000..0028cf8f --- /dev/null +++ b/drdown/appointments/migrations/0003_request.py @@ -0,0 +1,31 @@ +# Generated by Django 2.0.3 on 2018-05-06 21:00 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('appointments', '0002_auto_20180506_1956'), + ] + + operations = [ + migrations.CreateModel( + name='Request', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('shift', models.CharField(choices=[('M', 'Morning'), ('A', 'Afternoon')], help_text='Shift of appointment', max_length=10, verbose_name='Shift')), + ('motive', models.TextField(blank=True, help_text='Why are you requesting an appointment?', max_length=500, verbose_name='Motive')), + ('observation', models.TextField(blank=True, help_text='Why was it scheduled/declined?', max_length=500, verbose_name='Observation')), + ('speciality', models.CharField(choices=[('Speech Therapy', 'Speech Therapy'), ('Psychology', 'Psychology'), ('Physiotherapy', 'Physiotherapy'), ('Occupational Therapy', 'Occupational Therapy'), ('Cardiology', 'Cardiology'), ('Neurology', 'Neurology'), ('Pediatrics', 'Pediatrics')], help_text='Speciality of appointment', max_length=30, verbose_name='Speciality')), + ('status', models.CharField(default='Pending', editable=False, help_text='Was the request accepted?', max_length=20, verbose_name='Status')), + ('doctor', models.ForeignKey(blank=True, on_delete=django.db.models.deletion.CASCADE, related_name='requests', to='users.HealthTeam', verbose_name='Doctor')), + ('patient', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='requests', to='users.Patient', verbose_name='Patient')), + ], + options={ + 'verbose_name': 'Request', + 'verbose_name_plural': 'Requests', + }, + ), + ] diff --git a/drdown/appointments/models/__init__.py b/drdown/appointments/models/__init__.py index 558d3c32..2440db31 100644 --- a/drdown/appointments/models/__init__.py +++ b/drdown/appointments/models/__init__.py @@ -1 +1,2 @@ from .model_appointment import Appointment +from .model_request import Request diff --git a/drdown/appointments/models/model_appointment.py b/drdown/appointments/models/model_appointment.py index 57dd9eca..e485d59e 100644 --- a/drdown/appointments/models/model_appointment.py +++ b/drdown/appointments/models/model_appointment.py @@ -59,7 +59,6 @@ class Appointment(models.Model): SCHEDULED = 'Scheduled' CANCELED = 'Canceled' - DONE = 'Done' STATUS_CHOICES = ( (SCHEDULED, _('Scheduled')), diff --git a/drdown/appointments/models/model_request.py b/drdown/appointments/models/model_request.py new file mode 100644 index 00000000..12189212 --- /dev/null +++ b/drdown/appointments/models/model_request.py @@ -0,0 +1,100 @@ +from django.db import models +from drdown.users.models.model_health_team import HealthTeam +from drdown.users.models.model_patient import Patient +from django.utils.translation import ugettext_lazy as _ + + +class Request(models.Model): + + MORNING = 'M' + AFTERNOON = 'A' + + SHIFT_CHOICES = ( + (MORNING, _('Morning')), + (AFTERNOON, _('Afternoon')), + ) + + shift = models.CharField( + _('Shift'), + choices=SHIFT_CHOICES, + help_text=_('Shift of appointment'), + max_length=10 + ) + + motive = models.TextField( + _('Motive'), + help_text=_('Why are you requesting an appointment?'), + max_length=500, + blank=True, + ) + + observation = models.TextField( + _('Observation'), + help_text=_('Why was it scheduled/declined?'), + max_length=500, + blank=True, + ) + + SPEECH_THERAPHY = "Speech Therapy" + PSYCHOLOGY = "Psychology" + PHYSIOTHERAPY = "Physiotherapy" + OCCUPATIONAL_THERAPY = "Occupational Therapy" + CARDIOLOGY = "Cardiology" + NEUROLOGY = "Neurology" + PEDIATRICS = "Pediatrics" + + SPECIALITY_APPOINTMENT_CHOICES = ( + (SPEECH_THERAPHY, _('Speech Therapy')), + (PSYCHOLOGY, _('Psychology')), + (PHYSIOTHERAPY, _('Physiotherapy')), + (OCCUPATIONAL_THERAPY, _('Occupational Therapy')), + (CARDIOLOGY, _('Cardiology')), + (NEUROLOGY, _('Neurology')), + (PEDIATRICS, _('Pediatrics')), + ) + + speciality = models.CharField( + _('Speciality'), + choices=SPECIALITY_APPOINTMENT_CHOICES, + help_text=_("Speciality of appointment"), + max_length=30 + ) + + doctor = models.ForeignKey( + HealthTeam, + on_delete=models.CASCADE, + verbose_name=_('Doctor'), + related_name='requests', + blank=True, + ) + + patient = models.ForeignKey( + Patient, + on_delete=models.CASCADE, + verbose_name=_('Patient'), + related_name='requests', + ) + + SCHEDULED = 'Scheduled' + PENDING = 'Pending' + DECLINED = 'Declined' + + STATUS_CHOICES = ( + (SCHEDULED, _('Scheduled')), + (DECLINED, _('Declined')), + ) + + status = models.CharField( + _('Status'), + help_text=_("Was the request accepted?"), + default=PENDING, + max_length=20, + editable=False, + ) + + def __str__(self): + return _('Appointment request of ') + self.patient.user.name + + class Meta: + verbose_name = _("Request") + verbose_name_plural = _("Requests") diff --git a/drdown/users/migrations/0016_auto_20180506_2059.py b/drdown/users/migrations/0016_auto_20180506_2059.py new file mode 100644 index 00000000..18d595fc --- /dev/null +++ b/drdown/users/migrations/0016_auto_20180506_2059.py @@ -0,0 +1,17 @@ +# Generated by Django 2.0.3 on 2018-05-06 20:59 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('users', '0015_auto_20180428_1306'), + ] + + operations = [ + migrations.AlterModelOptions( + name='patient', + options={'verbose_name': 'Patient', 'verbose_name_plural': 'Patients'}, + ), + ] From 8eaf8b9202ffc0b9be2ec3a17a283e49865e0a94 Mon Sep 17 00:00:00 2001 From: GeovanaRamos Date: Sun, 6 May 2018 18:25:34 -0300 Subject: [PATCH 129/271] Adding tests for appointment requests Adding tests to cover 100% of model Co-authored-by: Daniel Maike --- .../appointments/tests/test_model_request.py | 133 ++++++++++++++++++ 1 file changed, 133 insertions(+) create mode 100644 drdown/appointments/tests/test_model_request.py diff --git a/drdown/appointments/tests/test_model_request.py b/drdown/appointments/tests/test_model_request.py new file mode 100644 index 00000000..ec1e2ca9 --- /dev/null +++ b/drdown/appointments/tests/test_model_request.py @@ -0,0 +1,133 @@ +from test_plus.test import TestCase +from ..models.model_request import Request +from drdown.users.models.model_health_team import HealthTeam +from drdown.users.models.model_patient import Patient +from django.utils.translation import ugettext_lazy as _ + + +class TestModelRequest(TestCase): + + def setUp(self): + """ + This method will run before any test case. + """ + + self.user = self.make_user(username='user_1') + self.user2 = self.make_user(username='user_2') + self.patient = Patient.objects.create( + ses="1234567", + user=self.user, + priority=1, + mother_name="Mother", + father_name="Father", + ethnicity=3, + sus_number="12345678911", + civil_registry_of_birth="12345678911", + declaration_of_live_birth="12345678911" + ) + + self.doctor = HealthTeam.objects.create( + cpf="057.641.271-65", + user=self.user2, + speciality=HealthTeam.NEUROLOGY, + council_acronym=HealthTeam.CRM, + register_number="1234567", + registration_state=HealthTeam.DF, + ) + + self.request = Request.objects.create( + motive='Some motive', + observation='Some obs', + speciality=Request.SPEECH_THERAPHY, + doctor=self.doctor, + patient=self.patient, + status=Request.SCHEDULED + ) + + def test_one_to_one_relation(self): + """ + Test to verify if the relations work + """ + + self.assertIs(self.patient, self.request.patient) + self.assertIs(self.doctor, self.request.doctor) + + def test_delete_cascade_patient(self): + """ + Verify delete the relation objects + """ + + self.patient.delete() + with self.assertRaises(Request.DoesNotExist): + Request.objects.get() + + def test_delete_cascade_doctor(self): + """ + Verify delete the relation objects + """ + + self.doctor.delete() + with self.assertRaises(Request.DoesNotExist): + Request.objects.get() + + def test_save_patient_ok(self): + """ + Test to verify if patient is correctly passed + """ + + self.assertEquals(self.request.patient, self.patient) + + def test_save_doctor_ok(self): + """ + Test to verify if doctor is correctly passed + """ + + self.assertEquals(self.request.doctor, self.doctor) + + def test_save_status_ok(self): + """ + Test to verify if status is correctly passed + """ + + self.assertEquals(self.request.status, Request.SCHEDULED) + + def test_save_speciality_ok(self): + """ + Test to verify if speciality is correctly passed + """ + + self.assertEquals( + self.request.speciality, + Request.SPEECH_THERAPHY + ) + + def test_save_motive_ok(self): + """ + Test to verify if motive is correctly passed + """ + + self.assertEquals( + self.request.motive, + 'Some motive' + ) + + def test_save_observation_ok(self): + """ + Test to verify if observation is correctly passed + """ + + self.assertEquals( + self.request.observation, + 'Some obs' + ) + + + def test_str_is_equal_to_title(self): + """ + Test if method `__str__` is returning "Request of " + """ + self.user.name = 'User' + self.assertEqual( + str(self.request), + _('Appointment request of ') + self.patient.user.name + ) From d75d6213d737b798fdf73fdce1c094bf1611f284 Mon Sep 17 00:00:00 2001 From: Mariana Mendes Date: Sun, 6 May 2018 18:34:53 -0300 Subject: [PATCH 130/271] Adding the review of sprint 08 Add the review os sprint 08 on results Add the results and planning of sprint 08 on results --- docs/sprints/08/results.md | 6 +++++- mkdocs.yml | 7 +++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/docs/sprints/08/results.md b/docs/sprints/08/results.md index 3cd0b60f..7e39fd7c 100644 --- a/docs/sprints/08/results.md +++ b/docs/sprints/08/results.md @@ -25,7 +25,11 @@ __Histórias que viraram débitos:__ | Pontos Positivos | Pontos Negativos | Sugestão de Melhoria | | ----- | ----- | ---- | -| - | - | - | +| Tudo foi entregue | Trabalhos de outros materias | Nas dailys não presenciais, tentar responder os mais rápidó possível | +| A troca de conhecimento está funcionando. | A história de marcar consulta foi meio cansativa, mas deu certo. A dupla conseguiu entregar | Tentar criar um horário de trabalho | +| As pontuações de histórias foram coerentes | Membro sem notebook temporariamente | - | +| O time de mds está cada vez mais nivelado | - | - | + ## 3. Quadro de Conhecimento diff --git a/mkdocs.yml b/mkdocs.yml index 2be5eae3..469feb10 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -47,4 +47,11 @@ pages: - Sprint 6: - Planejamento: sprints/06/planning.md - Resultado: sprints/06/results.md + - Sprint 7: + - Planejamento: sprints/07/planning.md + - Resultado: sprints/07/results.md + - Sprint 8: + - Planejamento: sprints/08/planning.md + - Resultado: sprints/08/results.md + From 4e8dc8c5f30bca65215d632e576afb1e5f8c1e96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Pedro=20Sconetto?= Date: Sun, 6 May 2018 18:44:48 -0300 Subject: [PATCH 131/271] Adding pipeline document Writing commit and branch topics Co-authored-by: Mariana Mendes --- docs/eps/PIPELINE.md | 58 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 docs/eps/PIPELINE.md diff --git a/docs/eps/PIPELINE.md b/docs/eps/PIPELINE.md new file mode 100644 index 00000000..16f46fbf --- /dev/null +++ b/docs/eps/PIPELINE.md @@ -0,0 +1,58 @@ +# Pipeline CI/CD + +| Data | Versão | Descrição | Autor | +|:----:|:------:|:---------:|:-----:| +|06/05/2018|0.0.1|Versão inicial do documento do pipeline|João Pedro Sconetto e Mariana Mendes| + +## Processos de DevOps + +### Padrão de _Commit_ + +#### Por questões de padronização recomendamos que sigam nosso estilo de _commit_: + +* Os _commits_ devem ser todos em __inglês__; + +* Ele deve conter um título curto e objetivo do que foi feito naquele _commit_; + +* Após esse título, deve-se descrever, com um pouco mais de detalhes, todas as atividades executadas. + +* Caso esteja trabalhando em com algum associado assine nos seus _commits_ os seus parceiros + +__Exemplo:__ + + Creating project community files (Título curto e objetivo) + + Adds project license (Descrição de uma das atividades) + + Adds project code of conduct file + + Adds project contributing file + + Adds project issue template file + + Adds projects pull request file + + Co-authored-by: John Doe (Assinatura de parceria) + +### Política de _Branchs_ + +Tendo como meta manter a integralidade e confiabilidade do código do projeto foi proposta a utilização de política de branches. +Essa Política de Branches deverá guiar os desenvolvedores na forma de organização de suas contribuições ao repositório. +__OBS__: A política de _branchs_ foi idealizada para trabalhar em conjunto com a ferramenta do _git flow_, sua documentação e mais informações podem ser acessadas [aqui](https://github.com/nvie/gitflow). + +* __master__ - Branch principal do repositório onde será permitida somente a integração de software consolidado e testado. Essa branch será exclusiva para a entrega de Realeases, ou seja, um conjunto maior de funcionalidades que integram o software, aqui estará a versão _**stable**_ do software. + +* __develop__ - Branch para integração de novas funcionalidades, onde será permitido a entrega das features desenvolvidas e que estão em um estágio avançado de completude. Será o branch base para o início do desenvolvimento das features e da correção de bugs. Aqui também serão _mergeadas_ as releases. + +* __feature/__ - Branch utilizada para o desenvolvimento de novas features do _backlog_. Caso a feature tenha sida proposta por uma _issue_ do repositório e aceita no _backlog_ o nome deverá conter o número da _issue_. +Ex: feature/1- (Considerando que a feature tenha sido solicitada na _issue_ #1) + +* __bugfix/__ - Branch utilizada para corrigir bugs de baixa/média urgência e que não estão presentes na branch __master__. Caso o bug tenha sido reportado por uma _issue_ do repositório o nome deverá conter o número da _issue_. + Ex: bugfix/1- (Considerando que o bug tenha sido reportado na _issue_ #1) + +* __hotfix/__ - Branch utilizada para corrigir bugs de alta urgência e que estão presentes na branch __master__. Caso o bug tenha sido reportado por uma _issue_ do repositório o nome deverá conter o número da _issue_. + Ex: bugfix/1- (Considerando que o bug tenha sido reportado na _issue_ #1) + +* __release/__ - Branch onde será feito os ajustes finais/build antes da entrega de uma versão do produto de software. Constará no nome da branch a versão da release a ser entregue. + +* __support/__ - Branch onde serão executadas tarefas de suporte relacionadas ao software, como elaboração de documentações, correções de natureza de gerência de configuração e etc. From a59b7204bc8de2e7b95bea69a1bc3eb5f86eb093 Mon Sep 17 00:00:00 2001 From: GeovanaRamos Date: Sun, 6 May 2018 19:14:45 -0300 Subject: [PATCH 132/271] Adding list view to request Adding view file Adding list template file Adding search form Co-authored-by: Daniel Maike --- drdown/appointments/forms/requests_form.py | 34 +++++++++++++++++++ drdown/appointments/models/model_request.py | 4 +-- .../templates/appointments/request_list.html | 32 +++++++++++++++++ .../appointments/tests/test_model_request.py | 1 - drdown/appointments/urls.py | 8 +++++ drdown/appointments/views/view_request.py | 30 ++++++++++++++++ 6 files changed, 106 insertions(+), 3 deletions(-) create mode 100644 drdown/appointments/forms/requests_form.py create mode 100644 drdown/appointments/templates/appointments/request_list.html create mode 100644 drdown/appointments/views/view_request.py diff --git a/drdown/appointments/forms/requests_form.py b/drdown/appointments/forms/requests_form.py new file mode 100644 index 00000000..b018c41e --- /dev/null +++ b/drdown/appointments/forms/requests_form.py @@ -0,0 +1,34 @@ +from django import forms +from drdown.users.models.model_health_team import HealthTeam +from drdown.users.models.model_patient import Patient +from django.utils.translation import ugettext_lazy as _ + + +class RequestSearchForm(forms.Form): + search_speciality = forms.CharField( + required=False, + label=_('Speciality'), + widget=forms.TextInput( + attrs={'placeholder': _('Speciality')} + ) + ) + + search_status = forms.CharField( + required=False, + label=_('Status'), + widget=forms.TextInput( + attrs={'placeholder': _('Status')} + ) + ) + + search_doctor = forms.ModelChoiceField( + queryset=HealthTeam.objects.all(), + required=False, + label=_('Doctor') + ) + + search_patient = forms.ModelChoiceField( + queryset=Patient.objects.all(), + required=False, + label=_('Patient') + ) diff --git a/drdown/appointments/models/model_request.py b/drdown/appointments/models/model_request.py index 12189212..9fc653e3 100644 --- a/drdown/appointments/models/model_request.py +++ b/drdown/appointments/models/model_request.py @@ -43,7 +43,7 @@ class Request(models.Model): NEUROLOGY = "Neurology" PEDIATRICS = "Pediatrics" - SPECIALITY_APPOINTMENT_CHOICES = ( + SPECIALITY_REQUEST_CHOICES = ( (SPEECH_THERAPHY, _('Speech Therapy')), (PSYCHOLOGY, _('Psychology')), (PHYSIOTHERAPY, _('Physiotherapy')), @@ -55,7 +55,7 @@ class Request(models.Model): speciality = models.CharField( _('Speciality'), - choices=SPECIALITY_APPOINTMENT_CHOICES, + choices=SPECIALITY_REQUEST_CHOICES, help_text=_("Speciality of appointment"), max_length=30 ) diff --git a/drdown/appointments/templates/appointments/request_list.html b/drdown/appointments/templates/appointments/request_list.html new file mode 100644 index 00000000..cc741b2d --- /dev/null +++ b/drdown/appointments/templates/appointments/request_list.html @@ -0,0 +1,32 @@ +{% extends "core/base.html" %} +{% load static i18n %} + +{% block css %} + {{block.super}} + +{% endblock %} + +{% block title %}{% trans "Requests" %}{% endblock %} + +{% block content %} +
+

{% trans 'Requests' %}


+ {% for request in request_list %} +
+
+
{% trans 'Patient'%}: {{request.patient.user.name}}
+ {% trans 'Doctor'%}: {{ request.doctor.user.name}}
+ {% trans 'Especiality'%}: {{request.get_speciality_display}}
+
+
+ {% empty %} +

{% trans 'There are no requests'%}

+ {% endfor %} +
+ + {% include "core/pagination.html" %} + + +{% endblock %} + + diff --git a/drdown/appointments/tests/test_model_request.py b/drdown/appointments/tests/test_model_request.py index ec1e2ca9..06797fed 100644 --- a/drdown/appointments/tests/test_model_request.py +++ b/drdown/appointments/tests/test_model_request.py @@ -121,7 +121,6 @@ def test_save_observation_ok(self): 'Some obs' ) - def test_str_is_equal_to_title(self): """ Test if method `__str__` is returning "Request of " diff --git a/drdown/appointments/urls.py b/drdown/appointments/urls.py index 3d645148..7ab203d2 100644 --- a/drdown/appointments/urls.py +++ b/drdown/appointments/urls.py @@ -6,6 +6,9 @@ AppointmentMonthArchiveView, AppointmentUpdateStatusView, ) +from drdown.appointments.views.view_request import ( + RequestListView, +) app_name = 'appointments' @@ -15,6 +18,11 @@ view=AppointmentListView.as_view(), name='list_appointments' ), + url( + regex=r'^requests/', + view=RequestListView.as_view(), + name='list_requests' + ), url( regex=r'^new/$', view=AppointmentCreateView.as_view(), diff --git a/drdown/appointments/views/view_request.py b/drdown/appointments/views/view_request.py new file mode 100644 index 00000000..526cd64e --- /dev/null +++ b/drdown/appointments/views/view_request.py @@ -0,0 +1,30 @@ +from django.utils.translation import ugettext_lazy as _ +from django.views.generic import CreateView +from django.views.generic import UpdateView +from django.views.generic.dates import MonthArchiveView +from django.contrib.auth.mixins import LoginRequiredMixin +from django.utils import timezone +from django.urls import reverse +from search_views.search import SearchListView +from search_views.filters import BaseFilter +from drdown.appointments.models import Request +from drdown.users.models.model_health_team import HealthTeam +from drdown.users.models.model_patient import Patient +from ..forms.requests_form import RequestSearchForm + + +class RequestFilter(LoginRequiredMixin, BaseFilter): + search_fields = { + 'search_speciality': ['speciality'], + 'search_doctor': ['doctor__id'], + 'search_patient': ['patient__id'], + 'search_status': ['status'], + } + + +class RequestListView(LoginRequiredMixin, SearchListView): + model = Request + template_name = 'appointments/request_list.html' + form_class = RequestSearchForm + filter_class = RequestFilter + paginate_by = 10 From d77f10a8583ef754383896af21a2aeb4113995e5 Mon Sep 17 00:00:00 2001 From: Elias Bernardo Date: Sun, 6 May 2018 21:31:42 -0300 Subject: [PATCH 133/271] Adding model StaticData on medicalrecords app Adding the model with independent attributes of a medical record Co-authored-by: Guilherme Guy --- .../models/model_static_data.py | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 drdown/medicalrecords/models/model_static_data.py diff --git a/drdown/medicalrecords/models/model_static_data.py b/drdown/medicalrecords/models/model_static_data.py new file mode 100644 index 00000000..d61ecd18 --- /dev/null +++ b/drdown/medicalrecords/models/model_static_data.py @@ -0,0 +1,46 @@ +from django.db import models +from drdown.users.models.model_health_team import HealthTeam +from drdown.users.models.model_patient import Patient +from django.utils.translation import ugettext_lazy as _ +from datetime import datetime +from django.core.exceptions import ValidationError + + +class StaticData(models.Model): + + patient = models.ForeignKey( + Patient, + on_delete=models.CASCADE, + verbose_name=_('Patient') + ) + + weight = models.IntegerField( + max_length=4, + verbose_name = _('Weight at birth'), + help_text = _('In grams') + ) + + APGAR = models.IntegerField( + choices=list(zip(range(1, 10), range(1, 10))), + ) + + heart_test = models.FileField( + upload_to='media/medicalrecords', + blank=True, + verbose_name = _('Heart Test') + ) + + ear_test = models.FileField( + upload_to='media/medicalrecords', + blank=True, + verbose_name = _('Test of the Ear') + ) + + author = models.ForeignKey( + HealthTeam, + on_delete=models.CASCADE, + verbose_name=_("Author") + ) + + class Meta: + verbose_name = _("Medical Record Static Data") From 145ef5d0033cd7cbe499f59f5dee9533897247f3 Mon Sep 17 00:00:00 2001 From: Elias Bernardo Date: Sun, 6 May 2018 21:33:27 -0300 Subject: [PATCH 134/271] Listing StaticData on DjangoAdmin Adding StaticData model to MedicalRecords admin.py Co-authored-by: Guilherme Guy --- drdown/medicalrecords/admin.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drdown/medicalrecords/admin.py b/drdown/medicalrecords/admin.py index 5dedd698..da8f7937 100644 --- a/drdown/medicalrecords/admin.py +++ b/drdown/medicalrecords/admin.py @@ -1,4 +1,6 @@ from django.contrib import admin from .models.model_medical_record import MedicalRecord +from .models.model_static_data import StaticData admin.site.register(MedicalRecord) +admin.site.register(StaticData) From 86bc4432b803642c005795d36ca5fbc6595d543b Mon Sep 17 00:00:00 2001 From: Elias Bernardo Date: Sun, 6 May 2018 21:34:17 -0300 Subject: [PATCH 135/271] Adding migrations Adding migration 003_staticdata and 0016_auto Co-authored-by: Guilherme Guy --- .../migrations/0003_staticdata.py | 30 +++++++++++++++++++ .../migrations/0016_auto_20180507_0027.py | 17 +++++++++++ 2 files changed, 47 insertions(+) create mode 100644 drdown/medicalrecords/migrations/0003_staticdata.py create mode 100644 drdown/users/migrations/0016_auto_20180507_0027.py diff --git a/drdown/medicalrecords/migrations/0003_staticdata.py b/drdown/medicalrecords/migrations/0003_staticdata.py new file mode 100644 index 00000000..41f2927c --- /dev/null +++ b/drdown/medicalrecords/migrations/0003_staticdata.py @@ -0,0 +1,30 @@ +# Generated by Django 2.0.3 on 2018-05-07 00:28 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('users', '0016_auto_20180507_0027'), + ('medicalrecords', '0002_auto_20180428_0044'), + ] + + operations = [ + migrations.CreateModel( + name='StaticData', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('weight', models.IntegerField(help_text='In grams', max_length=4, verbose_name='Weight at birth')), + ('APGAR', models.IntegerField(choices=[(1, 1), (2, 2), (3, 3), (4, 4), (5, 5), (6, 6), (7, 7), (8, 8), (9, 9)])), + ('heart_test', models.FileField(blank=True, upload_to='media/medicalrecords', verbose_name='Heart Test')), + ('ear_test', models.FileField(blank=True, upload_to='media/medicalrecords', verbose_name='Test of the Ear')), + ('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='users.HealthTeam', verbose_name='Author')), + ('patient', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='users.Patient', verbose_name='Patient')), + ], + options={ + 'verbose_name': 'Medical Record Static Data', + }, + ), + ] diff --git a/drdown/users/migrations/0016_auto_20180507_0027.py b/drdown/users/migrations/0016_auto_20180507_0027.py new file mode 100644 index 00000000..5b1c173d --- /dev/null +++ b/drdown/users/migrations/0016_auto_20180507_0027.py @@ -0,0 +1,17 @@ +# Generated by Django 2.0.3 on 2018-05-07 00:27 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('users', '0015_auto_20180428_1306'), + ] + + operations = [ + migrations.AlterModelOptions( + name='patient', + options={'verbose_name': 'Patient', 'verbose_name_plural': 'Patients'}, + ), + ] From dad7056b0e8df49ce9b8b24eed9d7ac97fd45f50 Mon Sep 17 00:00:00 2001 From: Elias Bernardo Date: Sun, 6 May 2018 22:32:10 -0300 Subject: [PATCH 136/271] Modifying StaticData model Fixing pep8 errors Patient is now a OnotoOneField Co-authored-by: Guilherme Guy --- drdown/medicalrecords/models/model_static_data.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drdown/medicalrecords/models/model_static_data.py b/drdown/medicalrecords/models/model_static_data.py index d61ecd18..05ddab7d 100644 --- a/drdown/medicalrecords/models/model_static_data.py +++ b/drdown/medicalrecords/models/model_static_data.py @@ -8,7 +8,7 @@ class StaticData(models.Model): - patient = models.ForeignKey( + patient = models.OneToOneField( Patient, on_delete=models.CASCADE, verbose_name=_('Patient') @@ -16,8 +16,8 @@ class StaticData(models.Model): weight = models.IntegerField( max_length=4, - verbose_name = _('Weight at birth'), - help_text = _('In grams') + verbose_name=_('Weight at birth'), + help_text=_('In grams') ) APGAR = models.IntegerField( @@ -27,13 +27,13 @@ class StaticData(models.Model): heart_test = models.FileField( upload_to='media/medicalrecords', blank=True, - verbose_name = _('Heart Test') + verbose_name=_('Heart Test') ) ear_test = models.FileField( upload_to='media/medicalrecords', blank=True, - verbose_name = _('Test of the Ear') + verbose_name=_('Test of the Ear') ) author = models.ForeignKey( From 44d8ee5fb98c06bdc08fb9a7aad1c771bd57d53d Mon Sep 17 00:00:00 2001 From: Elias Bernardo Date: Sun, 6 May 2018 22:33:55 -0300 Subject: [PATCH 137/271] Adding StaticData files Adding migration 004 Adding static_field_form.html Adding StaticData CBV Adding StaticData forms.py Co-authored-by: Guilherme Guy --- .../medicalrecords/forms/static_data_forms.py | 9 ++ .../migrations/0004_auto_20180507_0119.py | 19 +++++ .../medicalrecord_static_data_form.html | 41 +++++++++ .../medicalrecords/views/view_static_data.py | 83 +++++++++++++++++++ 4 files changed, 152 insertions(+) create mode 100644 drdown/medicalrecords/forms/static_data_forms.py create mode 100644 drdown/medicalrecords/migrations/0004_auto_20180507_0119.py create mode 100644 drdown/medicalrecords/templates/medicalrecords/medicalrecord_static_data_form.html create mode 100644 drdown/medicalrecords/views/view_static_data.py diff --git a/drdown/medicalrecords/forms/static_data_forms.py b/drdown/medicalrecords/forms/static_data_forms.py new file mode 100644 index 00000000..dd45278a --- /dev/null +++ b/drdown/medicalrecords/forms/static_data_forms.py @@ -0,0 +1,9 @@ +from drdown.medicalrecords.models.model_static_data import StaticData +from django import forms + + +class StaticDataForm(forms.ModelForm): + + class Meta: + model = StaticData + fields = ["weight", "APGAR", "heart_test", "ear_test"] diff --git a/drdown/medicalrecords/migrations/0004_auto_20180507_0119.py b/drdown/medicalrecords/migrations/0004_auto_20180507_0119.py new file mode 100644 index 00000000..229fca78 --- /dev/null +++ b/drdown/medicalrecords/migrations/0004_auto_20180507_0119.py @@ -0,0 +1,19 @@ +# Generated by Django 2.0.3 on 2018-05-07 01:19 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('medicalrecords', '0003_staticdata'), + ] + + operations = [ + migrations.AlterField( + model_name='staticdata', + name='patient', + field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='users.Patient', verbose_name='Patient'), + ), + ] diff --git a/drdown/medicalrecords/templates/medicalrecords/medicalrecord_static_data_form.html b/drdown/medicalrecords/templates/medicalrecords/medicalrecord_static_data_form.html new file mode 100644 index 00000000..2027b83f --- /dev/null +++ b/drdown/medicalrecords/templates/medicalrecords/medicalrecord_static_data_form.html @@ -0,0 +1,41 @@ +{% extends 'core/base.html' %} +{% load static i18n %} + +{% block title %}{% trans 'New Medical Record' %}{% endblock %} + +{% block css %} +{{block.super}} + +{% endblock %} + +{% block content %} +
+ +

{% trans 'Update Static Data' %}

+ +
+ + {% csrf_token %} + + {% for field in form %} +
+ {{ field.errors }} +

+ {{ field.label_tag }}
+ {{ field }} +

+
+ {% endfor %} + + + + {% trans "Cancel" %} + + + +
+ +
+
+ +{% endblock %} diff --git a/drdown/medicalrecords/views/view_static_data.py b/drdown/medicalrecords/views/view_static_data.py new file mode 100644 index 00000000..1d43f395 --- /dev/null +++ b/drdown/medicalrecords/views/view_static_data.py @@ -0,0 +1,83 @@ +from drdown.users.models.model_health_team import HealthTeam +from ..models.model_static_data import StaticData +from ..models.model_medical_record import MedicalRecord +from drdown.users.models.model_user import User +from drdown.users.models.model_patient import Patient +from django.views.generic import CreateView, DeleteView, UpdateView, ListView +from django.urls import reverse_lazy +from django.contrib.auth.mixins import UserPassesTestMixin +from ..forms.static_data_forms import StaticDataForm + + +class CheckPermissions(UserPassesTestMixin): + def test_func(self): + return hasattr(self.request.user, 'healthteam') or \ + hasattr(self.request.user, 'employee') + + def get_login_url(self): + if self.request.user.is_authenticated: + # redirect if user is not a HealthTeam + login_url = reverse_lazy( + viewname='users:detail', + kwargs={'username': self.request.user.username} + ) + return login_url + login_static_data_url = reverse_lazy('account_login') + return login_static_data_url + + +class StaticDataCreateView(CreateView): + model = StaticData + form_class = StaticDataForm + template_name = 'medicalrecords/medicalrecord_static_data_form.html' + + def get_success_url(self, **kwargs): + success_create_url = reverse_lazy( + viewname='medicalrecords:list_medicalrecords', + kwargs={ + 'username': self.kwargs.get('username') + } + ) + return success_create_url + + def form_valid(self, form): + for patient in Patient.objects.all(): + if patient.user.username == self.kwargs.get('username'): + form.instance.patient = patient + user = User.objects.get( + username=self.request.user + ) + healthteam = HealthTeam.objects.get( + user=user + ) + form.instance.author = healthteam + form.save() + return super(StaticDataCreateView, self).form_valid(form) + + +class StaticDataDeleteView(DeleteView): + model = StaticData + + def get_success_url(self, **kwargs): + success_delete_url = reverse_lazy( + viewname='medicalrecords:list_medicalrecords', + kwargs={ + 'username': self.kwargs.get('username'), + } + ) + return success_delete_url + + +class StaticDataUpdateView(UpdateView): + model = StaticData + form_class = StaticDataForm + template_name = 'medicalrecords/medicalrecord_static_data_form.html' + + def get_success_url(self, **kwargs): + success_update_url = reverse_lazy( + viewname='medicalrecords:list_medicalrecords', + kwargs={ + 'username': self.kwargs.get('username'), + } + ) + return success_update_url From 93a7cee2765321516642a80a608b78b715cb93e9 Mon Sep 17 00:00:00 2001 From: Elias Bernardo Date: Sun, 6 May 2018 22:36:37 -0300 Subject: [PATCH 138/271] Adding StaticData to Medicalrecords urls.py Adding Create and update urls Co-authored-by: Guilherme Guy --- drdown/medicalrecords/urls.py | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/drdown/medicalrecords/urls.py b/drdown/medicalrecords/urls.py index ebaabf3f..738a8176 100644 --- a/drdown/medicalrecords/urls.py +++ b/drdown/medicalrecords/urls.py @@ -3,7 +3,8 @@ from django.views.generic import TemplateView from django.conf.urls.static import static from drdown.medicalrecords.forms.medicalrecords_forms import MedicalRecordForm -from drdown.medicalrecords.views import view_medical_record +from drdown.medicalrecords.forms.static_data_forms import StaticDataForm +from drdown.medicalrecords.views import view_medical_record, view_static_data app_name = 'medicalrecords' urlpatterns = [ @@ -14,12 +15,19 @@ ), url( - regex=r'^(?P[\w.@+-]+)/new', + regex=r'^(?P[\w.@+-]+)/new/$', view=view_medical_record.MedicalRecordsCreateView.as_view( form_class=MedicalRecordForm), name='create_medicalrecords' ), + url( + regex=r'^(?P[\w.@+-]+)/new-static-data/$', + view=view_static_data.StaticDataCreateView.as_view( + form_class=StaticDataForm), + name='create_static_data_medicalrecords' + ), + url( regex=r'^(?P[\w.@+-]+)/(?P\d+)/delete/$', view=view_medical_record.MedicalRecordsDeleteView.as_view(), @@ -32,4 +40,11 @@ form_class=MedicalRecordForm), name='update_medicalrecords' ), + + url( + regex=r'^(?P[\w.@+-]+)/(?P\d+)/update-static-data/$', + view=view_static_data.StaticDataUpdateView.as_view( + form_class=StaticDataForm), + name='update_static_data_medicalrecords' + ), ] From 8e8f4d3abb5682c505ae1983c09c51da48e8af2d Mon Sep 17 00:00:00 2001 From: Elias Bernardo Date: Sun, 6 May 2018 22:38:20 -0300 Subject: [PATCH 139/271] Adding StaticData tab on medicalrecords_list template Adding wheigth, APGAR and doc files in StaticData tab Co-authored-by: Guilherme Guy --- .../medicalrecords/medicalrecord_list.html | 82 ++++++++++++++----- 1 file changed, 63 insertions(+), 19 deletions(-) diff --git a/drdown/medicalrecords/templates/medicalrecords/medicalrecord_list.html b/drdown/medicalrecords/templates/medicalrecords/medicalrecord_list.html index a5d2b512..2ddeae28 100644 --- a/drdown/medicalrecords/templates/medicalrecords/medicalrecord_list.html +++ b/drdown/medicalrecords/templates/medicalrecords/medicalrecord_list.html @@ -22,24 +22,25 @@

{% trans 'Medical Record' %} {% trans "'s"%} {{ relate

- +
- +
- +

{{ related_patient.user.name }} {% trans 'data' %}

- +

{% if related_patient.user.patient %} - + {% if related_patient.user.photo %} {% else %} @@ -47,17 +48,17 @@

{{ related_patient.user.name }} {% trans 'data' %}

- +
- +
- +
- + {% if related_patient.user.cpf %} {{ related_patient.cpf }} {% endif %} - +
{% endif %} @@ -75,23 +76,23 @@

{% trans 'Medical Record' %} {% trans "'s"%} {{ related_patient
{% for medicalrecord in medicalrecordlist %} - +
- +

{{ medicalrecord.message|markdown }}

- +

{{ medicalrecord.author.user.name }}

- + {% if medicalrecord.document %} - +

{% trans 'Anexo:' %} {{ medicalrecord.document.name }}

- + {% endif %} - +

{{ medicalrecord.day }}

- + {% if request.user.username == medicalrecord.author.user.username %} - + {% trans "Edit" %} {% trans "Delete" %}

{% endif %} @@ -106,6 +107,49 @@

{% trans 'There are no Medical Records for this patient.'%}

+ + +

From 2f96ea8c83e1fe7fee39160ec20d5e294946ba9a Mon Sep 17 00:00:00 2001 From: Elias Bernardo Date: Sun, 6 May 2018 22:39:34 -0300 Subject: [PATCH 140/271] Adding staticdata in MedicalRecordsList View Co-authored-by: Guilherme Guy --- drdown/medicalrecords/views/view_medical_record.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drdown/medicalrecords/views/view_medical_record.py b/drdown/medicalrecords/views/view_medical_record.py index 68936a2f..26220ed0 100644 --- a/drdown/medicalrecords/views/view_medical_record.py +++ b/drdown/medicalrecords/views/view_medical_record.py @@ -1,5 +1,6 @@ from drdown.users.models.model_health_team import HealthTeam from ..models.model_medical_record import MedicalRecord +from ..models.model_static_data import StaticData from drdown.users.models.model_user import User from drdown.users.models.model_patient import Patient from django.views.generic import CreateView, DeleteView, UpdateView, ListView @@ -65,8 +66,10 @@ def get_context_data(self, **kwargs): user__username=self.kwargs.get('username') ) medicalrecordlist = MedicalRecord.objects.filter(patient=patient) + staticdata = StaticData.objects.get(patient=patient) context['medicalrecordlist'] = medicalrecordlist context['related_patient'] = patient + context['staticdata'] = staticdata return context From 8e7e5342713ce71193e2d5a12af2c8e9bcad724b Mon Sep 17 00:00:00 2001 From: Elias Bernardo Date: Sun, 6 May 2018 22:57:07 -0300 Subject: [PATCH 141/271] Fixing staticdata context in MedicalRecordList View Adding try: / except to get only instances that exists Co-authored-by: Guilherme Guy --- drdown/medicalrecords/views/view_medical_record.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drdown/medicalrecords/views/view_medical_record.py b/drdown/medicalrecords/views/view_medical_record.py index 26220ed0..07b73b5a 100644 --- a/drdown/medicalrecords/views/view_medical_record.py +++ b/drdown/medicalrecords/views/view_medical_record.py @@ -66,10 +66,13 @@ def get_context_data(self, **kwargs): user__username=self.kwargs.get('username') ) medicalrecordlist = MedicalRecord.objects.filter(patient=patient) - staticdata = StaticData.objects.get(patient=patient) + try: + staticdata = StaticData.objects.get(patient=patient) + except StaticData.DoesNotExist: + staticdata = None + context['staticdata'] = staticdata context['medicalrecordlist'] = medicalrecordlist context['related_patient'] = patient - context['staticdata'] = staticdata return context From 2ccbf5ff31bffaab7ac37afcf6369fdbe3dc8b17 Mon Sep 17 00:00:00 2001 From: Elias Bernardo Date: Sun, 6 May 2018 22:59:21 -0300 Subject: [PATCH 142/271] Fixing Static Data display on medicalrecord_list.html Adjusting the template to conform with changes made in view Co-authored-by: Guilherme Guy --- .../templates/medicalrecords/medicalrecord_list.html | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/drdown/medicalrecords/templates/medicalrecords/medicalrecord_list.html b/drdown/medicalrecords/templates/medicalrecords/medicalrecord_list.html index 2ddeae28..05b2336c 100644 --- a/drdown/medicalrecords/templates/medicalrecords/medicalrecord_list.html +++ b/drdown/medicalrecords/templates/medicalrecords/medicalrecord_list.html @@ -110,7 +110,11 @@

{% trans 'There are no Medical Records for this patient.'%}

- {% if age < 0.5 and procedure.description != "Other therapies (occupational therapy, swimming,psychomotricity, psychopedagogy, hydro/equo/musictherapy, arts, others)" and procedure.description != "Audiological (audio/impedanciometry, PEATE) +otolaryngologist" and procedure.description != "Atlantoaxial X-ray * (extension, flexion and neutral)" %} - - {% for check_item in procedure.get_checkitens_ordered %} - - - {% if age >= 0 and forloop.counter0 == 0 %} - {% if check_item.required %} - - {% if check_item.check %} - - {% else %} - - {% endif %} - - {% elif check_item.when_needed %} - - {% if check_item.check %} - - {% else %} - - {% endif %} + {% if age < 0.5 %} + {% if procedure.proc_id != 11 and procedure.proc_id != 8 and procedure.proc_id != 13 %} + + {% for check_item in procedure.get_checkitens_ordered %} + {% if age >= 0 and forloop.counter0 == 0 %} + {% if check_item.required %} - {% else %} + {% if check_item.check %} + + {% else %} + + {% endif %} - + {% elif check_item.when_needed %} - {% endif %} + {% if check_item.check %} + + {% else %} + + {% endif %} + {% else %} - {% elif age >= 0.5 and forloop.counter0 == 1 %} + - {% if check_item.required %} + {% endif %} - {% if check_item.check %} - - {% else %} - - {% endif %} - {% elif check_item.when_needed %} + {% elif age >= 0.5 and forloop.counter0 == 1 %} - {% if check_item.check %} - - {% else %} - - {% endif %} + {% if check_item.required %} - {% else %} + {% if check_item.check %} + + {% else %} + + {% endif %} - + {% elif check_item.when_needed %} - {% endif %} + {% if check_item.check %} + + {% else %} + + {% endif %} - {% elif age >= 1 and forloop.counter0 == 2 %} + {% else %} - {% if check_item.required %} + - {% if check_item.check %} - - {% else %} - - {% endif %} + {% endif %} - {% elif check_item.when_needed %} + {% elif age >= 1 and forloop.counter0 == 2 %} - {% if check_item.check %} - - {% else %} - - {% endif %} + {% if check_item.required %} - {% else %} + {% if check_item.check %} + + {% else %} + + {% endif %} - + {% elif check_item.when_needed %} - {% endif %} + {% if check_item.check %} + + {% else %} + + {% endif %} - {% elif age >= 2 and forloop.counter0 == 3 %} + {% else %} - {% if check_item.required %} + - {% if check_item.check %} - - {% else %} - - {% endif %} + {% endif %} - {% elif check_item.when_needed %} + {% elif age >= 2 and forloop.counter0 == 3 %} - {% if check_item.check %} - - {% else %} - - {% endif %} + {% if check_item.required %} - {% else %} + {% if check_item.check %} + + {% else %} + + {% endif %} - + {% elif check_item.when_needed %} - {% endif %} + {% if check_item.check %} + + {% else %} + + {% endif %} - {% elif age >= 3 or age is 4 and forloop.counter0 == 4 %} + {% else %} - {% if check_item.required %} + - {% if check_item.check %} - - {% else %} - - {% endif %} + {% endif %} - {% elif check_item.when_needed %} + {% elif age >= 3 or age is 4 and forloop.counter0 == 4 %} - {% if check_item.check %} - - {% else %} - - {% endif %} + {% if check_item.required %} - {% else %} + {% if check_item.check %} + + {% else %} + + {% endif %} - + {% elif check_item.when_needed %} - {% endif %} + {% if check_item.check %} + + {% else %} + + {% endif %} - {% elif age >= 5 and forloop.counter0 == 5 %} - {% if check_item.required %} + {% else %} - {% if check_item.check %} - - {% else %} - - {% endif %} + - {% elif check_item.when_needed %} + {% endif %} - {% if check_item.check %} - - {% else %} - - {% endif %} + {% elif age >= 5 and forloop.counter0 == 5 %} + {% if check_item.required %} - {% else %} + {% if check_item.check %} + + {% else %} + + {% endif %} - + {% elif check_item.when_needed %} - {% endif %} + {% if check_item.check %} + + {% else %} + + {% endif %} - {% elif age >= 6 and forloop.counter0 == 6 %} + {% else %} - {% if check_item.required %} + - {% if check_item.check %} - - {% else %} - - {% endif %} + {% endif %} - {% elif check_item.when_needed %} + {% elif age >= 6 and forloop.counter0 == 6 %} - {% if check_item.check %} - - {% else %} - - {% endif %} + {% if check_item.required %} - {% else %} + {% if check_item.check %} + + {% else %} + + {% endif %} - + {% elif check_item.when_needed %} - {% endif %} + {% if check_item.check %} + + {% else %} + + {% endif %} - {% endif %} + {% else %} + - {% endfor %} - {% elif age <= 1 and procedure.description != "Atlantoaxial X-ray * (extension, flexion and neutral)" %} + {% endif %} + {% endif %} + {% endfor %} + {% endif %} + {% elif age <= 1 and procedure.proc_id != 13 %} {% for check_item in procedure.get_checkitens_ordered %} From 2f1d06f88dfb95f4f8c5ffb226bcd70595b18a70 Mon Sep 17 00:00:00 2001 From: Joberth Rogers Date: Wed, 9 May 2018 14:01:47 -0300 Subject: [PATCH 227/271] Change validator Validator in register number doctor Co-authored-by: Gabriela Medeiros --- drdown/users/utils/validators.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drdown/users/utils/validators.py b/drdown/users/utils/validators.py index bcc14f94..0b97726d 100644 --- a/drdown/users/utils/validators.py +++ b/drdown/users/utils/validators.py @@ -1,4 +1,3 @@ - import re from django.core.exceptions import ValidationError @@ -208,7 +207,7 @@ def validate_phone(value): def validate_register_number(value): - regex_code = r"^[0-9]{1,7}$" + regex_code = r"^[0-9]{1,9}$" regex_validator = RegexValidator( regex=regex_code, message=_('Wrong CRM format') From f7d593fcff52cf4d71e95d7b0defb7653d41aa38 Mon Sep 17 00:00:00 2001 From: GeovanaRamos Date: Wed, 9 May 2018 14:36:29 -0300 Subject: [PATCH 228/271] Optimizing code Removing get object methods and adding an attribute instead Removing get success url methods and adding an attribute instead Co-authored-by: Daniel Maike --- drdown/appointments/views/view_appointment.py | 10 +-- drdown/appointments/views/view_request.py | 77 ++++--------------- 2 files changed, 19 insertions(+), 68 deletions(-) diff --git a/drdown/appointments/views/view_appointment.py b/drdown/appointments/views/view_appointment.py index 925eb6a6..c707f56f 100644 --- a/drdown/appointments/views/view_appointment.py +++ b/drdown/appointments/views/view_appointment.py @@ -4,7 +4,7 @@ from django.views.generic.dates import MonthArchiveView from django.contrib.auth.mixins import LoginRequiredMixin from django.utils import timezone -from django.urls import reverse +from django.urls import reverse, reverse_lazy from search_views.search import SearchListView from search_views.filters import BaseFilter from drdown.appointments.models import Appointment @@ -203,13 +203,9 @@ class AppointmentFromRequestCreateView(LoginRequiredMixin, CreateView): 'date', 'time', ] - - def get_success_url(self, **kwargs): - success_create_url = reverse( + success_url = reverse_lazy( viewname='appointments:list_appointments', - ) - - return success_create_url + ) def get_context_data(self, **kwargs): context = super(AppointmentFromRequestCreateView, self).get_context_data(**kwargs) diff --git a/drdown/appointments/views/view_request.py b/drdown/appointments/views/view_request.py index 3ddf8579..8694e34e 100644 --- a/drdown/appointments/views/view_request.py +++ b/drdown/appointments/views/view_request.py @@ -2,15 +2,11 @@ from django.views.generic import CreateView from django.views.generic import UpdateView from django.views.generic import DeleteView -from django.views.generic.dates import MonthArchiveView from django.contrib.auth.mixins import LoginRequiredMixin -from django.utils import timezone -from django.urls import reverse +from django.urls import reverse_lazy from search_views.search import SearchListView from search_views.filters import BaseFilter from drdown.appointments.models import AppointmentRequest -from drdown.users.models.model_health_team import HealthTeam -from drdown.users.models.model_patient import Patient from ..forms.requests_form import RequestSearchForm @@ -30,8 +26,7 @@ class RequestListView(LoginRequiredMixin, SearchListView): filter_class = RequestFilter paginate_by = 10 - @staticmethod - def prepare_queryset(request): + def prepare_queryset(self, request): user = request.user if hasattr(user, 'patient'): queryset = AppointmentRequest.objects.filter( @@ -63,13 +58,9 @@ class RequestCreateView(LoginRequiredMixin, CreateView): 'day', 'motive', ] - - def get_success_url(self, **kwargs): - success_create_url = reverse( + success_url = reverse_lazy( viewname='appointments:list_requests', - ) - - return success_create_url + ) class RequestUpdateView(LoginRequiredMixin, UpdateView): @@ -83,56 +74,29 @@ class RequestUpdateView(LoginRequiredMixin, UpdateView): 'day', 'motive', ] - - def get_success_url(self, **kwargs): - success_update_url = reverse( + success_url = reverse_lazy( viewname='appointments:list_requests', - ) - - return success_update_url - - def get_object(self): - request = AppointmentRequest.objects.get( - pk=self.kwargs.get('request_pk') - ) - return request + ) + pk_url_kwarg = 'request_pk' class RequestDeleteView(LoginRequiredMixin, DeleteView): model = AppointmentRequest template_name = 'appointments/request_confirm_delete.html' - - def get_success_url(self, **kwargs): - success_delete_url = reverse( + success_url = reverse_lazy( viewname='appointments:list_requests', - ) - - return success_delete_url - - def get_object(self): - request = AppointmentRequest.objects.get( - pk=self.kwargs.get('request_pk') - ) - return request + ) + pk_url_kwarg = 'request_pk' class RequestUpdateStatusView(LoginRequiredMixin, UpdateView): model = AppointmentRequest template_name = 'appointments/request_confirm_cancel.html' fields = ['observation'] - - def get_success_url(self, **kwargs): - success_update_status_url = reverse( + success_url = reverse_lazy( viewname='appointments:list_requests', - ) - - return success_update_status_url - - def get_object(self): - request = AppointmentRequest.objects.get( - pk=self.kwargs.get('request_pk') - ) - return request + ) + pk_url_kwarg = 'request_pk' def form_valid(self, form): form.instance.status = AppointmentRequest.DECLINED @@ -143,16 +107,7 @@ def form_valid(self, form): class RequestAfterResultDeleteView(LoginRequiredMixin, DeleteView): model = AppointmentRequest template_name = 'appointments/request_after_result_confirm_delete.html' - - def get_success_url(self, **kwargs): - success_after_result_delete_url = reverse( + success_url = reverse_lazy( viewname='appointments:list_requests', - ) - - return success_after_result_delete_url - - def get_object(self): - request = AppointmentRequest.objects.get( - pk=self.kwargs.get('request_pk') - ) - return request + ) + pk_url_kwarg = 'request_pk' From ae20bd68f495dac6e11a2429d2ad9fc5737cb64b Mon Sep 17 00:00:00 2001 From: GeovanaRamos Date: Wed, 9 May 2018 14:37:35 -0300 Subject: [PATCH 229/271] Changing buttons size Turning main buttons bigger Co-authored-by: Daniel Maike --- .../templates/appointments/appointment_list.html | 6 +++--- .../appointments/templates/appointments/request_list.html | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drdown/appointments/templates/appointments/appointment_list.html b/drdown/appointments/templates/appointments/appointment_list.html index 7a296cca..cf1481a5 100644 --- a/drdown/appointments/templates/appointments/appointment_list.html +++ b/drdown/appointments/templates/appointments/appointment_list.html @@ -11,10 +11,10 @@ {% block content %}
{% if request.user.employee %} - {% trans "New Appointment" %} - {% trans "Requests" %} + {% trans "New Appointment" %} + {% trans "Requests" %} {% elif request.user.patient %} - {% trans "Requests" %} + {% trans "Requests" %} {% endif %}

{% trans 'Appointments' %}


diff --git a/drdown/appointments/templates/appointments/request_list.html b/drdown/appointments/templates/appointments/request_list.html index 5968747f..cb342073 100644 --- a/drdown/appointments/templates/appointments/request_list.html +++ b/drdown/appointments/templates/appointments/request_list.html @@ -11,7 +11,7 @@ {% block content %}
{% if request.user.patient and request.user.age >= 13 or request.user.responsible %} - {% trans "New Request" %} + {% trans "New Request" %} {% endif %}

{% trans 'Requests' %}


{% for appointmentrequest in appointmentrequest_list %} From 5ee1b822d63020f755fefa45f8096b376d4ddf37 Mon Sep 17 00:00:00 2001 From: Joberth Rogers Date: Wed, 9 May 2018 14:57:46 -0300 Subject: [PATCH 230/271] Corrections in User detail the div from field correct Co-authored-by: Gabriela Medeiros --- drdown/users/templates/users/user_detail.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drdown/users/templates/users/user_detail.html b/drdown/users/templates/users/user_detail.html index 1c3e78ae..4f7e7f6d 100644 --- a/drdown/users/templates/users/user_detail.html +++ b/drdown/users/templates/users/user_detail.html @@ -14,7 +14,7 @@ {% if user.is_authenticated %} {% if user.patient and user.patient.have_procedures_almost_late %}
{% trans 'Interventions / Evaluation'%} {% trans 'AGE'%}
{% trans 'Interventions / Evaluation'%}{% trans 'Newborn'%}{% trans 'Six Months'%}
{{procedure.description}}{{procedure.description}}{{procedure.description}}
{{procedure.description}}{{procedure.description}}{{procedure.description}}
From 82345552908bb90f37bde29215aeb102a4115b6d Mon Sep 17 00:00:00 2001 From: Gabriela Medeiros Date: Wed, 9 May 2018 16:20:52 -0300 Subject: [PATCH 237/271] Creating vaccination sites page Adding vaccination locals Co-authored-by: joberth rogers --- .../templates/core/vaccination_sites.html | 266 ++++++++++++++++++ 1 file changed, 266 insertions(+) create mode 100644 drdown/core/templates/core/vaccination_sites.html diff --git a/drdown/core/templates/core/vaccination_sites.html b/drdown/core/templates/core/vaccination_sites.html new file mode 100644 index 00000000..57f0a4ad --- /dev/null +++ b/drdown/core/templates/core/vaccination_sites.html @@ -0,0 +1,266 @@ +{% extends "core/base.html" %} +{% load static %} +{% load i18n %} + +{% block css %} + {{block.super}} + + } +{% endblock %} + +{% block script %} + +{% endblock %} + +{% block content %} +

{% trans "Vaccination Sites" %}

+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +{% endblock %} \ No newline at end of file From f6ad352ca54cb9b758e4bcf41b7440e92bd78f65 Mon Sep 17 00:00:00 2001 From: Gabriela Medeiros Date: Wed, 9 May 2018 16:58:10 -0300 Subject: [PATCH 238/271] Modifying vaccination locations page name Editing page name in url Editing page name in link Editing page name in title Co-authored-by: joberth rogers --- .../core/{vaccination_sites.html => vaccination_locations.html} | 2 +- drdown/core/templates/core/vaccine_schedule.html | 2 +- drdown/core/urls.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) rename drdown/core/templates/core/{vaccination_sites.html => vaccination_locations.html} (98%) diff --git a/drdown/core/templates/core/vaccination_sites.html b/drdown/core/templates/core/vaccination_locations.html similarity index 98% rename from drdown/core/templates/core/vaccination_sites.html rename to drdown/core/templates/core/vaccination_locations.html index 57f0a4ad..ed57c730 100644 --- a/drdown/core/templates/core/vaccination_sites.html +++ b/drdown/core/templates/core/vaccination_locations.html @@ -22,7 +22,7 @@ {% endblock %} {% block content %} -

{% trans "Vaccination Sites" %}

+

{% trans "Vaccination Locations" %}


    Asa Norte diff --git a/drdown/core/templates/core/vaccine_schedule.html b/drdown/core/templates/core/vaccine_schedule.html index 05aa6039..5dcf4108 100644 --- a/drdown/core/templates/core/vaccine_schedule.html +++ b/drdown/core/templates/core/vaccine_schedule.html @@ -17,7 +17,7 @@






    {% trans "Vaccine Schedule" %}

    - {% trans "Vaccination sites" %} + {% trans "Vaccination Locations" %}
    diff --git a/drdown/core/urls.py b/drdown/core/urls.py index 26f86ef8..284b212a 100644 --- a/drdown/core/urls.py +++ b/drdown/core/urls.py @@ -21,7 +21,7 @@ ), url( regex=r'^vaccine/location$', - view=TemplateView.as_view(template_name='core/vaccination_sites.html'), + view=TemplateView.as_view(template_name='core/vaccination_locations.html'), name='locations' ), From 1d16d5ca4ad568f10a205872bfcc456f83f9b68a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Pedro=20Sconetto?= Date: Wed, 9 May 2018 17:12:50 -0300 Subject: [PATCH 239/271] Correcting some phrases Correcting some portuguese errors and some sugestions Co-authored-by: Mariana Mendes --- docs/eps/PIPELINE.md | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/docs/eps/PIPELINE.md b/docs/eps/PIPELINE.md index 3c635ad2..e3414b01 100644 --- a/docs/eps/PIPELINE.md +++ b/docs/eps/PIPELINE.md @@ -6,7 +6,7 @@ |06/05/2018|0.0.1|Versão inicial do documento do pipeline|João Pedro Sconetto e Mariana Mendes| ## Processos de DevOps -O presente documento visa esclarecer e registrar todos os processos, a cultura implementada e os padrões que foram utilizados no projeto __Dr. Down__ no viés das práticas de DevOps a fim de unificar o desenvolvimento e as operações inerentes do projeto supracitado. +O presente documento visa esclarecer e registrar todos os processos, a cultura implementada e os padrões que foram utilizados no projeto __Dr. Down__ no viés das práticas de DevOps, a fim de unificar o desenvolvimento e as operações inerentes do projeto supracitado. O documento se divide em duas partes: @@ -14,7 +14,7 @@ O documento se divide em duas partes: * Deploy Contínuo (CD - _Continuous Deploy_) -Onde a primeira parte irá mostrar as técnicas e itens aplicados ao projeto no propósito, como o nome da técnica diz, integrar continuamente o trabalho desenvolvido pela equipe. A segunda parte irá mostrar as técnincas e itens aplicados ao projeto com o objetivo de fazer a implantação contínua do projeto na infraestrutura utilizada pela equipe, de forma automatizada. +No qual a primeira parte irá mostrar as técnicas e itens aplicados ao projeto no propósito de, como o nome da técnica diz, integrar continuamente o trabalho desenvolvido pela equipe. A segunda parte irá mostrar as técnicas e itens aplicados ao projeto com o objetivo de fazer a implantação contínua do projeto na infraestrutura utilizada pela equipe, de forma automatizada. ### Integração Contínua: @@ -28,7 +28,7 @@ Onde a primeira parte irá mostrar as técnicas e itens aplicados ao projeto no * Após esse título, deve-se descrever, com um pouco mais de detalhes, todas as atividades executadas. -* Caso esteja trabalhando em com algum associado assine nos seus _commits_ os seus parceiros +* Caso esteja trabalhando com algum associado assine nos seus _commits_ os seus parceiros __Exemplo:__ @@ -48,14 +48,14 @@ __Exemplo:__ #### Política de _Branchs_ -Tendo como meta manter a integralidade e confiabilidade do código do projeto foi proposta a utilização de política de branches. +Tendo como meta manter a integralidade e confiabilidade do código do projeto, foi proposta a utilização de política de branches. Essa Política de Branches deverá guiar os desenvolvedores na forma de organização de suas contribuições ao projeto. __OBS__: A política de _branchs_ foi idealizada para trabalhar em conjunto com a ferramenta do _git flow_, sua documentação e mais informações podem ser acessadas [aqui](https://github.com/nvie/gitflow). -* __master__ - Branch principal do repositório onde será permitida somente a integração de software consolidado e testado. Essa branch será exclusiva para a entrega de Realeases, ou seja, um conjunto maior de funcionalidades que integram o software, aqui estará a versão _**stable**_ do software. +* __master__ - Branch principal do repositório, onde será permitida somente a integração de software consolidado e testado. Essa branch será exclusiva para a entrega de Releases, ou seja, um conjunto maior de funcionalidades que integram o software. Aqui estará a versão _**stable**_ do software. -* __develop__ - Branch para integração de novas funcionalidades, onde será permitido a entrega das features desenvolvidas e que estão em um estágio avançado de completude. Será o branch base para o início do desenvolvimento das features e da correção de bugs. Aqui também serão _mergeadas_ as releases. +* __develop__ - Branch para integração de novas funcionalidades, onde será permitido a entrega das features desenvolvidas e que estão em um estágio avançado de completude. Será a branch base para o início do desenvolvimento das features e da correção de bugs. Aqui também serão _mergeadas_ as releases. * __feature/__ - Branch utilizada para o desenvolvimento de novas features do _backlog_. Caso a feature tenha sida proposta por uma _issue_ do repositório e aceita no _backlog_ o nome deverá conter o número da _issue_. Ex: feature/1- (Considerando que a feature tenha sido solicitada na _issue_ #1) @@ -72,19 +72,19 @@ Ex: feature/1- (Considerando que a feature tenha sido soli #### Testes e Estilo de Código -Com o objetivo de garantir a qualidade de código, assim como a sua manutenibilidade, a equipe definiu técnicas e padrões a serem seguidos, enquanto ao estilo de código foi definido uma folha de estilo que é considerada a padrão por programadores Python, se trata da [PEP8](https://www.python.org/dev/peps/pep-0008/). Com isto é possível verificar, com o auxílio da ferramenta Code Climate o quão manutenível é o código que está sendo feito. +Com o objetivo de garantir a qualidade de código, assim como a sua manutenibilidade, a equipe definiu técnicas e padrões a serem seguidos, quanto ao estilo de código foi definido uma folha de estilo que é considerada a padrão por programadores Python, se trata da [PEP8](https://www.python.org/dev/peps/pep-0008/). Com isto é possível verificar, com o auxílio da ferramenta Code Climate o quão manutenível é o código que está sendo feito. -Em complemento ao estilo do código a equipe acordou em manter todo o código testado, pois com a união das duas técnicas é possível assegurar uma maior qualidade de código, para isso foram usados técnicas padrões de teste do Python/Django, com o auxílio do [Coverage.py](https://coverage.readthedocs.io/en/coverage-4.5.1/) e do [pytest](https://docs.pytest.org/en/latest/), estes que, também, servem de _input_ para o Code Climante analisar a manutenibilidade do software. +Em complemento ao estilo do código a equipe acordou em manter todo o código testado, pois com a união das duas técnicas é possível assegurar uma maior qualidade de código. Para isso foram usados técnicas padrões de teste do Python/Django, com o auxílio do [Coverage.py](https://coverage.readthedocs.io/en/coverage-4.5.1/) e do [pytest](https://docs.pytest.org/en/latest/), estes que, também, servem de _input_ para o Code Climate analisar a manutenibilidade do software. Ficou acordado entre os membros da equipe que a cobertura de teste deveria ser igual ou superior a 90% em todos os momentos do projeto. #### _Pull Requests_ -Ao término da execução da codificação é necessário a abertura de um _Pull Request_ no repositório oficial do software para que possa ser apreciado o código solução. Com isso as ferramentas de CI/CD automático irão executar a fase de _build_ e teste para verificar se etapa de teste e estilo de código foram implementadas corretamente, caso não tenha dívidas nessa fase, cabe a dois membros da equipe de EPS (com foco no P.O. na análise) analisar o produto para verificar se atende os critérios de aceitação e se está de acordo com o que foi definido para ser entregue. Com todas as técnicas e fases entregues em conformidade, cabe aos membros aprovarem o _pull request_ para que o mesmo possa ser _mergeado_ em branchs de entregue de _feature_. +Ao término da execução da codificação é necessário a abertura de um _Pull Request_ no repositório oficial do software para que possa ser apreciado o código solução. Com isso as ferramentas de CI/CD automático irão executar a fase de _build_ e teste para verificar se etapa de teste e estilo de código foram implementadas corretamente. Caso não tenha dívidas nessa fase, cabe a dois membros da equipe de EPS (com foco no P.O. na análise) analisar o produto para verificar se atende os critérios de aceitação e se está de acordo com o que foi definido para ser entregue. Com todas as técnicas e fases entregues em conformidade, cabe aos membros aprovarem o _pull request_ para que o mesmo possa ser _mergeado_ em branchs de entregue de _feature_. #### _Build_ e Testes -Com o auxílio de ferramentas de automatização essa fase é executada, via [Travis-CI](https://travis-ci.org/), a fim de garantir a fase de Teste e Estilo de Código. Com isso a ferramenta vai verificar o código, executar todos os testes para procurar erros na lógica do software e após tentar construir (_build_) os _containers_ da aplicação. Caso qualquer passo dessa fase tenha algum problema a ferramenta irá informar (via e-mail e via repositório) de que algo está errado e é preciso correções antes de avançar no pipeline. +Com o auxílio de ferramentas de automatização essa fase é executada, via [Travis-CI](https://travis-ci.org/), a fim de garantir a fase de Teste e Estilo de Código. Com isso a ferramenta vai verificar o código, executar todos os testes para procurar erros na lógica do software e após tentar construir (_build_) os _containers_ da aplicação. Caso qualquer passo dessa fase tenha algum problema a ferramenta irá informar (via e-mail e via repositório) que algo está errado e é preciso correções antes de avançar no pipeline. ### Deploy Contínuo: @@ -98,7 +98,7 @@ Com a execução de todos os passos da integração contínua a ferramenta de au * Executa atualizações necessárias com as novas funcionalidades (migrações, modificações no banco, traduções e etc); -* Caso tenha algum problema a máquina envia um log para a ferramenta de logs (sentry.io), caso não, o sistema mantém o funcionamento contínuamente. +* Caso tenha algum problema a máquina envia um log para a ferramenta de logs (sentry.io). Caso contrário, o sistema mantém o funcionamento contínuamente. ### Pipeline v0.0.1 @@ -113,7 +113,7 @@ Segundo Estágio: * Aqui o código publicado com as adições, chamada de versão, é alcançada pela ferramenta de CI, executado os testes (todos os implementados e os novos adicionados) e é feito a build, caso haja erro nesse estágio retorna-se ao primeiro fazendo as adições necessárias. Terceiro Estágio: -* Aqui a nova versão está em um estágio estável do seu ciclo de vida, se todas as adições esperadas para esta versão estiver pronta a equipe espera uma abertura de um novo _pull request_ solicitando a junção dessa versão com a versão atual do software. Nesta fase é feito a verificação manual da concordância das adições, tanto com os estágios anteriores quanto com as especificações de produto levantado pelo _Product Owner_, caso positivo o pipeline avança, do contrário retorna a estágios anteriores. +* Aqui a nova versão está em um estágio estável do seu ciclo de vida, se todas as adições esperadas para esta versão estiverem prontas a equipe espera uma abertura de um novo _pull request_ solicitando a junção dessa versão com a versão atual do software. Nesta fase é feito a verificação manual da concordância das adições, tanto com os estágios anteriores quanto com as especificações de produto levantado pelo _Product Owner_, caso positivo o pipeline avança, do contrário retorna a estágios anteriores. Quarto Estágio: * Aqui com a nova versão aprovada e consolidada ela é direcionada para o ambiente o qual deve integrar (homologação ou produção) e a ferramenta de CI/CD faz o deploy e entrega automática dessas novas adições. From 271b7110c39d850a4a79b5f4029f4b40d922ce59 Mon Sep 17 00:00:00 2001 From: Elias Bernardo Date: Wed, 9 May 2018 17:33:44 -0300 Subject: [PATCH 240/271] Fixing pep8 errors Co-authored-by: Guilherme Guy --- drdown/medicalrecords/models/model_complaint.py | 3 +-- drdown/medicalrecords/urls.py | 2 +- drdown/medicalrecords/views/view_specific_exams.py | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/drdown/medicalrecords/models/model_complaint.py b/drdown/medicalrecords/models/model_complaint.py index 6681251c..7266f6a1 100644 --- a/drdown/medicalrecords/models/model_complaint.py +++ b/drdown/medicalrecords/models/model_complaint.py @@ -49,12 +49,11 @@ def clean(self, *args, **kwargs): if timezone.localdate().isoformat() < str(self.complaint_day): raise ValidationError( {'complaint_day': - _("The complaint cannot be in the future!")} + _("The complaint cannot be in the future!")} ) return super(Complaint, self).clean() - def __str__(self): return self.patient.user.get_username() + " - Comptaint ID: " + \ str(self.id) diff --git a/drdown/medicalrecords/urls.py b/drdown/medicalrecords/urls.py index c4e7409a..6a2199cf 100644 --- a/drdown/medicalrecords/urls.py +++ b/drdown/medicalrecords/urls.py @@ -5,7 +5,7 @@ from drdown.medicalrecords.forms.medicines_forms import MedicineForm from drdown.medicalrecords.forms.complaint_forms import ComplaintForm from drdown.medicalrecords.forms.specific_exams_forms import SpecificExamsForm -from drdown.medicalrecords.views import view_medical_record, view_static_data, \ +from drdown.medicalrecords.views import view_medical_record, view_static_data,\ view_medicines, view_specific_exams, view_complaint, view_exams app_name = 'medicalrecords' diff --git a/drdown/medicalrecords/views/view_specific_exams.py b/drdown/medicalrecords/views/view_specific_exams.py index 4ba6bc0c..0a9bc5ad 100644 --- a/drdown/medicalrecords/views/view_specific_exams.py +++ b/drdown/medicalrecords/views/view_specific_exams.py @@ -19,4 +19,4 @@ class SpecificExamUpdateView(BaseViewUrl, UpdateView): form_class = SpecificExamsForm template_name = 'medicalrecords/medicalrecord_specific_exams_form.html' slug_url_kwarg = 'username' - slug_field = 'patient__user__username' \ No newline at end of file + slug_field = 'patient__user__username' From 55b750bdf6df77d7c02a69e4e86a3abe7514624a Mon Sep 17 00:00:00 2001 From: Gabriela Medeiros Date: Wed, 9 May 2018 19:30:14 -0300 Subject: [PATCH 241/271] Adding Vaccination Locations Co-authored-by: joberth rogers --- .../templates/core/vaccination_locations.html | 471 ++++++++++++++++++ 1 file changed, 471 insertions(+) diff --git a/drdown/core/templates/core/vaccination_locations.html b/drdown/core/templates/core/vaccination_locations.html index ed57c730..ad0c5a50 100644 --- a/drdown/core/templates/core/vaccination_locations.html +++ b/drdown/core/templates/core/vaccination_locations.html @@ -263,4 +263,475 @@
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {% endblock %} \ No newline at end of file From 2f7d6a255cd8db765790a034c482e6ebaa7aa8c3 Mon Sep 17 00:00:00 2001 From: Gabriela Medeiros Date: Wed, 9 May 2018 19:51:44 -0300 Subject: [PATCH 242/271] Editing vaccination locations page Sorting list in alphabetical order Co-authored-by: joberth rogers --- .../templates/core/vaccination_locations.html | 450 +++++++++--------- 1 file changed, 225 insertions(+), 225 deletions(-) diff --git a/drdown/core/templates/core/vaccination_locations.html b/drdown/core/templates/core/vaccination_locations.html index ad0c5a50..d2865055 100644 --- a/drdown/core/templates/core/vaccination_locations.html +++ b/drdown/core/templates/core/vaccination_locations.html @@ -71,9 +71,9 @@ - + @@ -82,20 +82,29 @@ - - + + - - + + + + + + + + + + - + @@ -104,19 +113,91 @@ - - + + + + + + + + - - + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -159,9 +240,9 @@ - + @@ -170,29 +251,28 @@ - - + + - - + + - - + + - + - + @@ -201,15 +281,31 @@ - - + + - - + + + + + + + + + + + + + + + + + + - +
      Guará I @@ -264,9 +360,9 @@ - + @@ -275,64 +371,42 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - + + + + + + + + - - - + + + + + - - + + - + - + @@ -341,41 +415,31 @@ - - - - - - - - - - - - - - - - - - + + + + + + + + - - - + + + + + - - + + - - + + - - - - @@ -458,9 +522,9 @@ - + @@ -469,16 +533,20 @@ - - + + + + + + - + @@ -487,12 +555,8 @@ - - - - - - + + @@ -520,9 +584,9 @@ - + @@ -531,34 +595,28 @@ - - + + - - - - - - - - - - - + + + - - + + + + + + - + @@ -567,16 +625,20 @@ - - + + + + + + - + @@ -585,73 +647,41 @@ - - + + - - + + - - + + - - + + - - + + - - + + - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - + + - - - + + + @@ -704,34 +734,4 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - {% endblock %} \ No newline at end of file From dd1a5ddde50b06d5683566cc958cf4a391fc5c41 Mon Sep 17 00:00:00 2001 From: Daniel Maike Date: Wed, 9 May 2018 19:59:07 -0300 Subject: [PATCH 243/271] Adding translations of appointment Co-authored-by: Geovana Ramos --- .../locale/pt_BR/LC_MESSAGES/django.po | 380 +++++++++++++----- 1 file changed, 288 insertions(+), 92 deletions(-) diff --git a/drdown/appointments/locale/pt_BR/LC_MESSAGES/django.po b/drdown/appointments/locale/pt_BR/LC_MESSAGES/django.po index 6463dd05..0b4695b6 100644 --- a/drdown/appointments/locale/pt_BR/LC_MESSAGES/django.po +++ b/drdown/appointments/locale/pt_BR/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-05-04 14:01+0000\n" +"POT-Creation-Date: 2018-05-09 22:43+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -20,15 +20,20 @@ msgstr "" #: drdown/appointments/forms/appointments_form.py:11 #: drdown/appointments/forms/appointments_form.py:13 -#: drdown/appointments/models/model_appointment.py:62 +#: drdown/appointments/forms/requests_form.py:10 +#: drdown/appointments/forms/requests_form.py:12 +#: drdown/appointments/models/model_appointment.py:40 +#: drdown/appointments/models/model_request.py:82 #: drdown/appointments/templates/appointments/appointment_form.html:24 +#: drdown/appointments/templates/appointments/appointment_request_form.html:14 msgid "Speciality" msgstr "Especialidade" #: drdown/appointments/forms/appointments_form.py:19 -#: drdown/appointments/models/model_appointment.py:25 -#: drdown/appointments/templates/appointments/appointment_form.html:106 -#: drdown/appointments/templates/appointments/appointment_list.html:45 +#: drdown/appointments/models/model_appointment.py:10 +#: drdown/appointments/templates/appointments/appointment_form.html:86 +#: drdown/appointments/templates/appointments/appointment_list.html:48 +#: drdown/appointments/templates/appointments/appointment_request_form.html:77 msgid "Date" msgstr "Data" @@ -37,147 +42,250 @@ msgid "(Year)-(Month)-(Day)" msgstr "(Ano)-(Mês)-(Dia)" #: drdown/appointments/forms/appointments_form.py:28 -#: drdown/appointments/models/model_appointment.py:71 -#: drdown/appointments/templates/appointments/appointment_form.html:69 -#: drdown/appointments/templates/appointments/appointment_list.html:43 +#: drdown/appointments/forms/requests_form.py:27 +#: drdown/appointments/models/model_appointment.py:49 +#: drdown/appointments/models/model_request.py:91 +#: drdown/appointments/templates/appointments/appointment_form.html:49 +#: drdown/appointments/templates/appointments/appointment_list.html:46 +#: drdown/appointments/templates/appointments/appointment_request_form.html:39 +#: drdown/appointments/templates/appointments/request_list.html:32 msgid "Doctor" msgstr "Médico" #: drdown/appointments/forms/appointments_form.py:34 -#: drdown/appointments/models/model_appointment.py:78 -#: drdown/appointments/templates/appointments/appointment_form.html:88 -#: drdown/appointments/templates/appointments/appointment_list.html:42 +#: drdown/appointments/forms/requests_form.py:33 +#: drdown/appointments/models/model_appointment.py:56 +#: drdown/appointments/models/model_request.py:99 +#: drdown/appointments/templates/appointments/appointment_form.html:68 +#: drdown/appointments/templates/appointments/appointment_list.html:45 +#: drdown/appointments/templates/appointments/appointment_request_form.html:58 +#: drdown/appointments/templates/appointments/request_list.html:31 msgid "Patient" msgstr "Paciente" -#: drdown/appointments/models/model_appointment.py:13 -#: drdown/appointments/templates/appointments/appointment_form.html:54 -#: drdown/appointments/templates/appointments/appointment_form.html:56 -#: drdown/appointments/templates/appointments/appointment_form.html:61 -msgid "Morning" -msgstr "Manhã" - -#: drdown/appointments/models/model_appointment.py:14 -#: drdown/appointments/templates/appointments/appointment_form.html:53 -#: drdown/appointments/templates/appointments/appointment_form.html:57 -#: drdown/appointments/templates/appointments/appointment_form.html:62 -msgid "Afternoon" -msgstr "Tarde" - -#: drdown/appointments/models/model_appointment.py:18 -#: drdown/appointments/templates/appointments/appointment_form.html:49 -msgid "Shift" -msgstr "Turno" - -#: drdown/appointments/models/model_appointment.py:20 -msgid "Shift of appointment" -msgstr "Turno da consulta" +#: drdown/appointments/forms/requests_form.py:18 +#: drdown/appointments/forms/requests_form.py:20 +#: drdown/appointments/models/model_appointment.py:69 +#: drdown/appointments/models/model_request.py:113 +#: drdown/appointments/templates/appointments/appointment_list.html:51 +#: drdown/appointments/templates/appointments/appointment_list.html:53 +#: drdown/appointments/templates/appointments/appointment_list.html:55 +#: drdown/appointments/templates/appointments/request_list.html:39 +msgid "Status" +msgstr "Status" -#: drdown/appointments/models/model_appointment.py:26 +#: drdown/appointments/models/model_appointment.py:11 msgid "Date of appointment" msgstr "Dia da consulta" -#: drdown/appointments/models/model_appointment.py:31 -#: drdown/appointments/templates/appointments/appointment_form.html:118 -#: drdown/appointments/templates/appointments/appointment_list.html:46 +#: drdown/appointments/models/model_appointment.py:16 +#: drdown/appointments/templates/appointments/appointment_form.html:98 +#: drdown/appointments/templates/appointments/appointment_list.html:49 +#: drdown/appointments/templates/appointments/appointment_request_form.html:88 msgid "Time" -msgstr "Hora" +msgstr "Horário" -#: drdown/appointments/models/model_appointment.py:32 +#: drdown/appointments/models/model_appointment.py:17 msgid "Time of appointment" msgstr "Hora da consulta" -#: drdown/appointments/models/model_appointment.py:37 -#: drdown/appointments/templates/appointments/appointment_form.html:128 -msgid "Motive" -msgstr "Motivo" - -#: drdown/appointments/models/model_appointment.py:38 -msgid "Why are you requesting an appointment?" -msgstr "Porquê você está marcando esta consulta?" - -#: drdown/appointments/models/model_appointment.py:52 +#: drdown/appointments/models/model_appointment.py:30 +#: drdown/appointments/models/model_request.py:72 #: drdown/appointments/templates/appointments/appointment_form.html:28 #: drdown/appointments/templates/appointments/appointment_form.html:37 +#: drdown/appointments/templates/appointments/appointment_request_form.html:18 +#: drdown/appointments/templates/appointments/appointment_request_form.html:27 msgid "Speech Therapy" msgstr "Fonoaudiologia" -#: drdown/appointments/models/model_appointment.py:53 +#: drdown/appointments/models/model_appointment.py:31 +#: drdown/appointments/models/model_request.py:73 #: drdown/appointments/templates/appointments/appointment_form.html:29 #: drdown/appointments/templates/appointments/appointment_form.html:38 +#: drdown/appointments/templates/appointments/appointment_request_form.html:19 +#: drdown/appointments/templates/appointments/appointment_request_form.html:28 msgid "Psychology" msgstr "Psicologia" -#: drdown/appointments/models/model_appointment.py:54 +#: drdown/appointments/models/model_appointment.py:32 +#: drdown/appointments/models/model_request.py:74 #: drdown/appointments/templates/appointments/appointment_form.html:30 #: drdown/appointments/templates/appointments/appointment_form.html:39 +#: drdown/appointments/templates/appointments/appointment_request_form.html:20 +#: drdown/appointments/templates/appointments/appointment_request_form.html:29 msgid "Physiotherapy" msgstr "Fisioterapia" -#: drdown/appointments/models/model_appointment.py:55 +#: drdown/appointments/models/model_appointment.py:33 +#: drdown/appointments/models/model_request.py:75 #: drdown/appointments/templates/appointments/appointment_form.html:31 #: drdown/appointments/templates/appointments/appointment_form.html:40 +#: drdown/appointments/templates/appointments/appointment_request_form.html:21 +#: drdown/appointments/templates/appointments/appointment_request_form.html:30 msgid "Occupational Therapy" msgstr "Terapia Ocupacional" -#: drdown/appointments/models/model_appointment.py:56 +#: drdown/appointments/models/model_appointment.py:34 +#: drdown/appointments/models/model_request.py:76 #: drdown/appointments/templates/appointments/appointment_form.html:32 #: drdown/appointments/templates/appointments/appointment_form.html:41 +#: drdown/appointments/templates/appointments/appointment_request_form.html:22 +#: drdown/appointments/templates/appointments/appointment_request_form.html:31 msgid "Cardiology" msgstr "Cardiologia" -#: drdown/appointments/models/model_appointment.py:57 +#: drdown/appointments/models/model_appointment.py:35 +#: drdown/appointments/models/model_request.py:77 #: drdown/appointments/templates/appointments/appointment_form.html:33 #: drdown/appointments/templates/appointments/appointment_form.html:42 +#: drdown/appointments/templates/appointments/appointment_request_form.html:23 +#: drdown/appointments/templates/appointments/appointment_request_form.html:32 msgid "Neurology" msgstr "Neurologia" -#: drdown/appointments/models/model_appointment.py:58 +#: drdown/appointments/models/model_appointment.py:36 +#: drdown/appointments/models/model_request.py:78 #: drdown/appointments/templates/appointments/appointment_form.html:34 #: drdown/appointments/templates/appointments/appointment_form.html:43 +#: drdown/appointments/templates/appointments/appointment_request_form.html:24 +#: drdown/appointments/templates/appointments/appointment_request_form.html:33 msgid "Pediatrics" msgstr "Pediatria" -#: drdown/appointments/models/model_appointment.py:64 +#: drdown/appointments/models/model_appointment.py:42 +#: drdown/appointments/models/model_request.py:84 msgid "Speciality of appointment" msgstr "Especialidade da consulta" -#: drdown/appointments/models/model_appointment.py:87 +#: drdown/appointments/models/model_appointment.py:64 +#: drdown/appointments/models/model_request.py:108 msgid "Scheduled" msgstr "Marcada" -#: drdown/appointments/models/model_appointment.py:88 +#: drdown/appointments/models/model_appointment.py:65 msgid "Canceled" msgstr "Cancelada" -#: drdown/appointments/models/model_appointment.py:92 -#: drdown/appointments/templates/appointments/appointment_list.html:48 -#: drdown/appointments/templates/appointments/appointment_list.html:50 -#: drdown/appointments/templates/appointments/appointment_list.html:52 -msgid "Status" -msgstr "Status" - -#: drdown/appointments/models/model_appointment.py:94 +#: drdown/appointments/models/model_appointment.py:71 msgid "Is this appointment still scheduled?" msgstr "Esta consulta ainda está marcada?" -#: drdown/appointments/models/model_appointment.py:101 -#: drdown/appointments/tests/test_model_appointment.py:141 +#: drdown/appointments/models/model_appointment.py:78 +#: drdown/appointments/tests/test_model_appointment.py:125 msgid "Appointment of " -msgstr "Consulta de" +msgstr "Consulta de " -#: drdown/appointments/models/model_appointment.py:104 +#: drdown/appointments/models/model_appointment.py:81 msgid "Appointment" msgstr "Consulta" -#: drdown/appointments/models/model_appointment.py:105 +#: drdown/appointments/models/model_appointment.py:82 #: drdown/appointments/templates/appointments/appointment_confirm_cancel.html:3 #: drdown/appointments/templates/appointments/appointment_list.html:9 -#: drdown/appointments/templates/appointments/appointment_list.html:16 +#: drdown/appointments/templates/appointments/appointment_list.html:19 +#: drdown/appointments/templates/appointments/request_confirm_cancel.html:3 msgid "Appointments" msgstr "Consultas" +#: drdown/appointments/models/model_request.py:13 +msgid "Morning" +msgstr "Manhã" + +#: drdown/appointments/models/model_request.py:14 +msgid "Afternoon" +msgstr "Tarde" + +#: drdown/appointments/models/model_request.py:18 +#: drdown/appointments/templates/appointments/request_list.html:34 +msgid "Shift" +msgstr "Turno" + +#: drdown/appointments/models/model_request.py:20 +msgid "Shift of appointment" +msgstr "Turno da consulta" + +#: drdown/appointments/models/model_request.py:33 +msgid "Sunday" +msgstr "Domingo" + +#: drdown/appointments/models/model_request.py:34 +msgid "Monday" +msgstr "Segunda-feira" + +#: drdown/appointments/models/model_request.py:35 +msgid "Tuesday" +msgstr "Terça-feira" + +#: drdown/appointments/models/model_request.py:36 +msgid "Wednesday" +msgstr "Quarta-feira" + +#: drdown/appointments/models/model_request.py:37 +msgid "Thursday" +msgstr "Quinta-feira" + +#: drdown/appointments/models/model_request.py:38 +msgid "Friday" +msgstr "Sexta-feira" + +#: drdown/appointments/models/model_request.py:39 +msgid "Saturday" +msgstr "Sábado" + +#: drdown/appointments/models/model_request.py:43 +#: drdown/appointments/models/model_request.py:45 +#: drdown/appointments/templates/appointments/request_list.html:35 +msgid "Day of the week" +msgstr "Dia da semana" + +#: drdown/appointments/models/model_request.py:50 +#: drdown/appointments/templates/appointments/request_list.html:37 +msgid "Motive" +msgstr "Motivo" + +#: drdown/appointments/models/model_request.py:51 +msgid "Why are you requesting an appointment?" +msgstr "Porquê você está marcando esta consulta?" + +#: drdown/appointments/models/model_request.py:57 +#: drdown/appointments/templates/appointments/request_confirm_cancel.html:12 +#: drdown/appointments/templates/appointments/request_list.html:41 +msgid "Observation" +msgstr "Observação" + +#: drdown/appointments/models/model_request.py:58 +msgid "Why was it scheduled/declined?" +msgstr "Por que foi agendado/recusado?" + +#: drdown/appointments/models/model_request.py:109 +msgid "Declined" +msgstr "Recusado" + +#: drdown/appointments/models/model_request.py:114 +msgid "Was the request accepted?" +msgstr "O pedido foi aceito?" + +#: drdown/appointments/models/model_request.py:122 +#: drdown/appointments/tests/test_model_request.py:131 +#, fuzzy +#| msgid "Appointment of " +msgid "Appointment request of " +msgstr "Consulta de" + +#: drdown/appointments/models/model_request.py:125 +msgid "Request" +msgstr "Pedido" + +#: drdown/appointments/models/model_request.py:126 +#: drdown/appointments/templates/appointments/appointment_list.html:15 +#: drdown/appointments/templates/appointments/appointment_list.html:17 +#: drdown/appointments/templates/appointments/request_list.html:9 +#: drdown/appointments/templates/appointments/request_list.html:16 +msgid "Requests" +msgstr "Pedidos" + #: drdown/appointments/templates/appointments/appointment_confirm_cancel.html:6 +#: drdown/appointments/templates/appointments/request_confirm_cancel.html:6 msgid "Cancel Appointment" msgstr "Cancelar Consulta" @@ -186,16 +294,22 @@ msgid "Are you sure you want to cancel this appointment?" msgstr "Tem certeza que deseja cancelar esta consulta?" #: drdown/appointments/templates/appointments/appointment_confirm_cancel.html:11 +#: drdown/appointments/templates/appointments/request_after_result_confirm_delete.html:16 +#: drdown/appointments/templates/appointments/request_confirm_cancel.html:15 msgid "Yes" msgstr "Sim" #: drdown/appointments/templates/appointments/appointment_confirm_cancel.html:12 +#: drdown/appointments/templates/appointments/request_after_result_confirm_delete.html:17 +#: drdown/appointments/templates/appointments/request_confirm_cancel.html:16 msgid "No" msgstr "Não" #: drdown/appointments/templates/appointments/appointment_form.html:7 #: drdown/appointments/templates/appointments/appointment_form.html:17 #: drdown/appointments/templates/appointments/appointment_list.html:14 +#: drdown/appointments/templates/appointments/appointment_request_form.html:5 +#: drdown/appointments/templates/appointments/appointment_request_form.html:10 msgid "New Appointment" msgstr "Nova Consulta" @@ -204,83 +318,165 @@ msgstr "Nova Consulta" msgid "Edit Appointment" msgstr "Editar Consulta" -#: drdown/appointments/templates/appointments/appointment_form.html:137 +#: drdown/appointments/templates/appointments/appointment_form.html:107 +#: drdown/appointments/templates/appointments/appointment_request_form.html:96 msgid "Schedule" msgstr "Marcar" -#: drdown/appointments/templates/appointments/appointment_list.html:23 +#: drdown/appointments/templates/appointments/appointment_list.html:26 msgid "Search" msgstr "Pesquisar" -#: drdown/appointments/templates/appointments/appointment_list.html:38 +#: drdown/appointments/templates/appointments/appointment_list.html:41 +#: drdown/appointments/templates/appointments/request_confirm_delete.html:14 msgid "Cancel" msgstr "Cancelar" -#: drdown/appointments/templates/appointments/appointment_list.html:39 +#: drdown/appointments/templates/appointments/appointment_list.html:42 +#: drdown/appointments/templates/appointments/request_list.html:23 msgid "Edit" msgstr "Editar" -#: drdown/appointments/templates/appointments/appointment_list.html:44 +#: drdown/appointments/templates/appointments/appointment_list.html:47 +#: drdown/appointments/templates/appointments/request_list.html:33 msgid "Especiality" msgstr "Especialidade" -#: drdown/appointments/templates/appointments/appointment_list.html:52 +#: drdown/appointments/templates/appointments/appointment_list.html:55 msgid "Done" msgstr "Concluído" -#: drdown/appointments/templates/appointments/appointment_list.html:58 +#: drdown/appointments/templates/appointments/appointment_list.html:60 msgid "There are no appointments scheduled" msgstr "Não há consultas marcadas" -#: drdown/appointments/templates/appointments/appointment_list.html:64 +#: drdown/appointments/templates/appointments/appointment_list.html:66 msgid "Search All" msgstr "Pesquisar tudo" -#: drdown/appointments/views/view_appointment.py:44 +#: drdown/appointments/templates/appointments/appointment_request_form.html:78 +msgid "Requested day of the week" +msgstr "Dia solicitado da semana" + +#: drdown/appointments/templates/appointments/appointment_request_form.html:89 +msgid "Requested shift" +msgstr "Turno solicitado" + +#: drdown/appointments/templates/appointments/request_after_result_confirm_delete.html:5 +#: drdown/appointments/templates/appointments/request_confirm_delete.html:5 +msgid "Delete Request" +msgstr "Apagar pedido" + +#: drdown/appointments/templates/appointments/request_after_result_confirm_delete.html:8 +msgid "Confirm" +msgstr "Confirmar" + +#: drdown/appointments/templates/appointments/request_after_result_confirm_delete.html:13 +msgid "Your request was" +msgstr "Seu pedido foi" + +#: drdown/appointments/templates/appointments/request_after_result_confirm_delete.html:13 +msgid "Are you aware" +msgstr "Você está ciente" + +#: drdown/appointments/templates/appointments/request_after_result_confirm_delete.html:14 +msgid "This request will be deleted" +msgstr "Este pedido será deletado" + +#: drdown/appointments/templates/appointments/request_confirm_cancel.html:10 +#, fuzzy +#| msgid "Are you sure you want to cancel this appointment?" +msgid "Are you sure you want to cancel this request?" +msgstr "Tem certeza que deseja cancelar esta consulta?" + +#: drdown/appointments/templates/appointments/request_confirm_delete.html:8 +#: drdown/appointments/templates/appointments/request_confirm_delete.html:13 +#: drdown/appointments/templates/appointments/request_list.html:22 +msgid "Delete" +msgstr "Excluir" + +#: drdown/appointments/templates/appointments/request_confirm_delete.html:12 +#, fuzzy +#| msgid "Are you sure you want to cancel this appointment?" +msgid "Are you sure you want to delete this request?" +msgstr "Tem certeza que deseja cancelar esta consulta?" + +#: drdown/appointments/templates/appointments/request_form.html:7 +#: drdown/appointments/templates/appointments/request_form.html:18 +#: drdown/appointments/templates/appointments/request_list.html:14 +msgid "New Request" +msgstr "Novo pedido" + +#: drdown/appointments/templates/appointments/request_form.html:9 +#: drdown/appointments/templates/appointments/request_form.html:20 +msgid "Edit Request" +msgstr "Editar pedido" + +#: drdown/appointments/templates/appointments/request_form.html:35 +msgid "Submit" +msgstr "Enviar" + +#: drdown/appointments/templates/appointments/request_list.html:25 +msgid "OK" +msgstr "OK" + +#: drdown/appointments/templates/appointments/request_list.html:28 +msgid "Accept" +msgstr "Aceitar" + +#: drdown/appointments/templates/appointments/request_list.html:29 +msgid "Decline" +msgstr "Recusar" + +#: drdown/appointments/templates/appointments/request_list.html:46 +msgid "There are no requests" +msgstr "Não há pedidos" + +#: drdown/appointments/views/view_appointment.py:45 msgid "January" msgstr "Janeiro" -#: drdown/appointments/views/view_appointment.py:45 +#: drdown/appointments/views/view_appointment.py:46 msgid "February" msgstr "Fevereiro" -#: drdown/appointments/views/view_appointment.py:46 +#: drdown/appointments/views/view_appointment.py:47 msgid "March" msgstr "Março" -#: drdown/appointments/views/view_appointment.py:47 +#: drdown/appointments/views/view_appointment.py:48 msgid "April" msgstr "Abril" -#: drdown/appointments/views/view_appointment.py:48 +#: drdown/appointments/views/view_appointment.py:49 msgid "May" msgstr "Maio" -#: drdown/appointments/views/view_appointment.py:49 +#: drdown/appointments/views/view_appointment.py:50 msgid "June" msgstr "Junho" -#: drdown/appointments/views/view_appointment.py:50 +#: drdown/appointments/views/view_appointment.py:51 msgid "July" msgstr "Julho" -#: drdown/appointments/views/view_appointment.py:51 +#: drdown/appointments/views/view_appointment.py:52 msgid "August" msgstr "Agosto" -#: drdown/appointments/views/view_appointment.py:52 +#: drdown/appointments/views/view_appointment.py:53 msgid "September" msgstr "Setembro" -#: drdown/appointments/views/view_appointment.py:53 +#: drdown/appointments/views/view_appointment.py:54 msgid "October" msgstr "Outubro" -#: drdown/appointments/views/view_appointment.py:54 +#: drdown/appointments/views/view_appointment.py:55 msgid "November" msgstr "Novembro" -#: drdown/appointments/views/view_appointment.py:55 +#: drdown/appointments/views/view_appointment.py:56 msgid "December" msgstr "Dezembro" From 5879579e99e2762d4588cae7242bf9985702d581 Mon Sep 17 00:00:00 2001 From: Daniel Maike Date: Wed, 9 May 2018 19:59:45 -0300 Subject: [PATCH 244/271] Changing place of texts Changing place of requested day of the week Changing place of requested shift Co-authored-by: Geovana Ramos --- .../templates/appointments/appointment_request_form.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drdown/appointments/templates/appointments/appointment_request_form.html b/drdown/appointments/templates/appointments/appointment_request_form.html index 5098765b..9525ff45 100644 --- a/drdown/appointments/templates/appointments/appointment_request_form.html +++ b/drdown/appointments/templates/appointments/appointment_request_form.html @@ -75,7 +75,7 @@

      {% trans "New Appointment" %}

      @@ -86,7 +86,7 @@

      {% trans "New Appointment" %}

      From 47f2bd722cfaefa5d5a327b0616d01977de9364e Mon Sep 17 00:00:00 2001 From: Daniel Maike Date: Wed, 9 May 2018 20:01:21 -0300 Subject: [PATCH 245/271] Changing button of Submit in request_form Changing color of button Changing place of button Co-authored-by: Geovana Ramos --- .../appointments/templates/appointments/request_form.html | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drdown/appointments/templates/appointments/request_form.html b/drdown/appointments/templates/appointments/request_form.html index 1fa212f5..bc94c55f 100644 --- a/drdown/appointments/templates/appointments/request_form.html +++ b/drdown/appointments/templates/appointments/request_form.html @@ -11,7 +11,7 @@ {% endblock %} {% block content %} -
      +
      {% url 'appointments:create_request' as url %} {% if request.path == url %} @@ -31,7 +31,9 @@

      {% trans "Edit Request" %}


      {% endfor %} - +
      + +
      From b183212cf03ba732ebb2ac26c94b6a2fb7dce347 Mon Sep 17 00:00:00 2001 From: Daniel Maike Date: Wed, 9 May 2018 20:13:50 -0300 Subject: [PATCH 246/271] Adding new migration and deleting old Co-authored-by: Geovana Ramos --- .../migrations/0002_auto_20180506_1956.py | 21 ------------------- ..._request.py => 0002_auto_20180509_2305.py} | 18 ++++++++++++---- .../migrations/0004_request_day.py | 19 ----------------- .../migrations/0005_auto_20180508_1209.py | 18 ---------------- .../migrations/0006_auto_20180509_1408.py | 18 ---------------- 5 files changed, 14 insertions(+), 80 deletions(-) delete mode 100644 drdown/appointments/migrations/0002_auto_20180506_1956.py rename drdown/appointments/migrations/{0003_request.py => 0002_auto_20180509_2305.py} (68%) delete mode 100644 drdown/appointments/migrations/0004_request_day.py delete mode 100644 drdown/appointments/migrations/0005_auto_20180508_1209.py delete mode 100644 drdown/appointments/migrations/0006_auto_20180509_1408.py diff --git a/drdown/appointments/migrations/0002_auto_20180506_1956.py b/drdown/appointments/migrations/0002_auto_20180506_1956.py deleted file mode 100644 index c306e6a9..00000000 --- a/drdown/appointments/migrations/0002_auto_20180506_1956.py +++ /dev/null @@ -1,21 +0,0 @@ -# Generated by Django 2.0.3 on 2018-05-06 19:56 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('appointments', '0001_initial'), - ] - - operations = [ - migrations.RemoveField( - model_name='appointment', - name='motive', - ), - migrations.RemoveField( - model_name='appointment', - name='shift', - ), - ] diff --git a/drdown/appointments/migrations/0003_request.py b/drdown/appointments/migrations/0002_auto_20180509_2305.py similarity index 68% rename from drdown/appointments/migrations/0003_request.py rename to drdown/appointments/migrations/0002_auto_20180509_2305.py index 0028cf8f..c8531afe 100644 --- a/drdown/appointments/migrations/0003_request.py +++ b/drdown/appointments/migrations/0002_auto_20180509_2305.py @@ -1,4 +1,4 @@ -# Generated by Django 2.0.3 on 2018-05-06 21:00 +# Generated by Django 2.0.3 on 2018-05-09 23:05 from django.db import migrations, models import django.db.models.deletion @@ -7,19 +7,21 @@ class Migration(migrations.Migration): dependencies = [ - ('appointments', '0002_auto_20180506_1956'), + ('users', '0016_auto_20180507_1928'), + ('appointments', '0001_initial'), ] operations = [ migrations.CreateModel( - name='Request', + name='AppointmentRequest', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('shift', models.CharField(choices=[('M', 'Morning'), ('A', 'Afternoon')], help_text='Shift of appointment', max_length=10, verbose_name='Shift')), + ('day', models.CharField(choices=[('Sunday', 'Sunday'), ('Monday', 'Monday'), ('Tuesday', 'Tuesday'), ('Wednesday', 'Wednesday'), ('Thursday', 'Thursday'), ('Friday', 'Friday'), ('Saturday', 'Saturday')], help_text='Day of the week', max_length=10, verbose_name='Day of the week')), ('motive', models.TextField(blank=True, help_text='Why are you requesting an appointment?', max_length=500, verbose_name='Motive')), ('observation', models.TextField(blank=True, help_text='Why was it scheduled/declined?', max_length=500, verbose_name='Observation')), ('speciality', models.CharField(choices=[('Speech Therapy', 'Speech Therapy'), ('Psychology', 'Psychology'), ('Physiotherapy', 'Physiotherapy'), ('Occupational Therapy', 'Occupational Therapy'), ('Cardiology', 'Cardiology'), ('Neurology', 'Neurology'), ('Pediatrics', 'Pediatrics')], help_text='Speciality of appointment', max_length=30, verbose_name='Speciality')), - ('status', models.CharField(default='Pending', editable=False, help_text='Was the request accepted?', max_length=20, verbose_name='Status')), + ('status', models.CharField(choices=[('Scheduled', 'Scheduled'), ('Declined', 'Declined')], default='Pending', editable=False, help_text='Was the request accepted?', max_length=20, verbose_name='Status')), ('doctor', models.ForeignKey(blank=True, on_delete=django.db.models.deletion.CASCADE, related_name='requests', to='users.HealthTeam', verbose_name='Doctor')), ('patient', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='requests', to='users.Patient', verbose_name='Patient')), ], @@ -28,4 +30,12 @@ class Migration(migrations.Migration): 'verbose_name_plural': 'Requests', }, ), + migrations.RemoveField( + model_name='appointment', + name='motive', + ), + migrations.RemoveField( + model_name='appointment', + name='shift', + ), ] diff --git a/drdown/appointments/migrations/0004_request_day.py b/drdown/appointments/migrations/0004_request_day.py deleted file mode 100644 index fccc872b..00000000 --- a/drdown/appointments/migrations/0004_request_day.py +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by Django 2.0.3 on 2018-05-07 17:45 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('appointments', '0003_request'), - ] - - operations = [ - migrations.AddField( - model_name='request', - name='day', - field=models.CharField(choices=[('Sunday', 'Sunday'), ('Monday', 'Monday'), ('Tuesday', 'Tuesday'), ('Wednesday', 'Wednesday'), ('Thursday', 'Thursday'), ('Friday', 'Friday'), ('Saturday', 'Saturday')], default=0, help_text='Day of the week', max_length=10, verbose_name='Day of the week'), - preserve_default=False, - ), - ] diff --git a/drdown/appointments/migrations/0005_auto_20180508_1209.py b/drdown/appointments/migrations/0005_auto_20180508_1209.py deleted file mode 100644 index 4e32d09e..00000000 --- a/drdown/appointments/migrations/0005_auto_20180508_1209.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 2.0.3 on 2018-05-08 12:09 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('users', '0016_auto_20180507_1928'), - ('appointments', '0004_request_day'), - ] - - operations = [ - migrations.RenameModel( - old_name='Request', - new_name='AppointmentRequest', - ), - ] diff --git a/drdown/appointments/migrations/0006_auto_20180509_1408.py b/drdown/appointments/migrations/0006_auto_20180509_1408.py deleted file mode 100644 index 7426ffcb..00000000 --- a/drdown/appointments/migrations/0006_auto_20180509_1408.py +++ /dev/null @@ -1,18 +0,0 @@ -# Generated by Django 2.0.3 on 2018-05-09 14:08 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('appointments', '0005_auto_20180508_1209'), - ] - - operations = [ - migrations.AlterField( - model_name='appointmentrequest', - name='status', - field=models.CharField(choices=[('Scheduled', 'Scheduled'), ('Declined', 'Declined')], default='Pending', editable=False, help_text='Was the request accepted?', max_length=20, verbose_name='Status'), - ), - ] From d0bed2f02a42e306f4bc8f0fed8cec23b3270c3b Mon Sep 17 00:00:00 2001 From: Daniel Maike Date: Wed, 9 May 2018 20:31:07 -0300 Subject: [PATCH 247/271] Correcting PEP8 errors Co-authored-by: Geovana Ramos --- drdown/appointments/views/view_appointment.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/drdown/appointments/views/view_appointment.py b/drdown/appointments/views/view_appointment.py index c707f56f..92d5bbda 100644 --- a/drdown/appointments/views/view_appointment.py +++ b/drdown/appointments/views/view_appointment.py @@ -141,11 +141,12 @@ def get_queryset(self): class AppointmentUpdateView(LoginRequiredMixin, UpdateView): model = Appointment template_name = 'appointments/appointment_form.html' - fields = ['speciality', - 'doctor', - 'patient', - 'date', - 'time', + fields = [ + 'speciality', + 'doctor', + 'patient', + 'date', + 'time', ] def get_success_url(self, **kwargs): @@ -208,7 +209,8 @@ class AppointmentFromRequestCreateView(LoginRequiredMixin, CreateView): ) def get_context_data(self, **kwargs): - context = super(AppointmentFromRequestCreateView, self).get_context_data(**kwargs) + context = super( + AppointmentFromRequestCreateView, self).get_context_data(**kwargs) context['health_team'] = HealthTeam.objects.all() context['patients'] = Patient.objects.all() context['appointment_request'] = AppointmentRequest.objects.get( From 0ac3cf547b673bb3f100bd42881a8e280f40b006 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Pedro=20Sconetto?= Date: Sun, 6 May 2018 17:48:54 -0300 Subject: [PATCH 248/271] Last fixes to release v0.0.3 Correcting some translations errors Adding a migration to correct a verbose name Co-authored-by: Mariana Mendes --- .../locale/pt_BR/LC_MESSAGES/django.po | 6 ------ drdown/users/locale/pt_BR/LC_MESSAGES/django.po | 6 +----- .../users/migrations/0016_auto_20180506_2043.py | 17 +++++++++++++++++ 3 files changed, 18 insertions(+), 11 deletions(-) create mode 100644 drdown/users/migrations/0016_auto_20180506_2043.py diff --git a/drdown/medicalrecords/locale/pt_BR/LC_MESSAGES/django.po b/drdown/medicalrecords/locale/pt_BR/LC_MESSAGES/django.po index 04b97d31..53a4cf1e 100644 --- a/drdown/medicalrecords/locale/pt_BR/LC_MESSAGES/django.po +++ b/drdown/medicalrecords/locale/pt_BR/LC_MESSAGES/django.po @@ -212,12 +212,6 @@ msgstr "Este campo é obrigatório." #~ msgid "message" #~ msgstr "mensagem" -#~ msgid "Previous" -#~ msgstr "Anterior" - -#~ msgid "Next" -#~ msgstr "Próximo" - #, fuzzy #~| msgid "Attachments" #~ msgid "Documents" diff --git a/drdown/users/locale/pt_BR/LC_MESSAGES/django.po b/drdown/users/locale/pt_BR/LC_MESSAGES/django.po index 4918ea1f..62976479 100644 --- a/drdown/users/locale/pt_BR/LC_MESSAGES/django.po +++ b/drdown/users/locale/pt_BR/LC_MESSAGES/django.po @@ -540,7 +540,7 @@ msgstr "Meus Pacientes" #: drdown/users/templates/users/user_detail.html:282 msgid "My Medical Records" -msgstr "Minhas Consultas" +msgstr "Meu Histórico Médico" #: drdown/users/templates/users/user_detail.html:283 msgid "My Medical Follow-up Sheet" @@ -550,10 +550,6 @@ msgstr "Ficha de Acompanhamento" msgid "Confirm data" msgstr "Confirmar dados" -#: drdown/users/templates/users/user_detail.html:272 -msgid "My Medical Records" -msgstr "Meu Prontuário" - #: drdown/users/templates/users/user_form.html:113 msgid "Photo of user" msgstr "Foto do usuário" diff --git a/drdown/users/migrations/0016_auto_20180506_2043.py b/drdown/users/migrations/0016_auto_20180506_2043.py new file mode 100644 index 00000000..03c0509c --- /dev/null +++ b/drdown/users/migrations/0016_auto_20180506_2043.py @@ -0,0 +1,17 @@ +# Generated by Django 2.0.3 on 2018-05-06 20:43 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('users', '0015_auto_20180428_1306'), + ] + + operations = [ + migrations.AlterModelOptions( + name='patient', + options={'verbose_name': 'Patient', 'verbose_name_plural': 'Patients'}, + ), + ] From 5db7702e60a28819fca5852f1237e86e87ab7464 Mon Sep 17 00:00:00 2001 From: Joberth Rogers Date: Wed, 9 May 2018 21:01:15 -0300 Subject: [PATCH 249/271] Translate in somes fields in Vaccine Schedule Co-authored-by: Gabriela Medeiros --- .../core/locale/pt_BR/LC_MESSAGES/django.po | 441 ++++++++++-------- 1 file changed, 254 insertions(+), 187 deletions(-) diff --git a/drdown/core/locale/pt_BR/LC_MESSAGES/django.po b/drdown/core/locale/pt_BR/LC_MESSAGES/django.po index 38cb8a81..5d7865b9 100644 --- a/drdown/core/locale/pt_BR/LC_MESSAGES/django.po +++ b/drdown/core/locale/pt_BR/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-05-04 10:24+0000\n" +"POT-Creation-Date: 2018-05-09 23:47+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -344,7 +344,7 @@ msgstr "" #: drdown/core/templates/core/base.html:6 #: drdown/core/templates/core/base.html:47 -#: drdown/core/templates/core/home.html:20 +#: drdown/core/templates/core/home.html:40 msgid "Dr. Down" msgstr "Dr. Down" @@ -417,56 +417,60 @@ msgstr "Meu paciente" msgid "Schedules" msgstr "Agenda" -#: drdown/core/templates/core/base.html:103 +#: drdown/core/templates/core/base.html:101 +msgid "Appointments" +msgstr "" + +#: drdown/core/templates/core/base.html:104 msgid "Edit Profile" msgstr "Editar Perfil" -#: drdown/core/templates/core/base.html:104 +#: drdown/core/templates/core/base.html:105 msgid "Help" msgstr "Ajuda" -#: drdown/core/templates/core/base.html:105 +#: drdown/core/templates/core/base.html:106 msgid "Log out" msgstr "Sair" -#: drdown/core/templates/core/base.html:110 +#: drdown/core/templates/core/base.html:111 msgid "Sign in" msgstr "Entrar" -#: drdown/core/templates/core/base.html:113 +#: drdown/core/templates/core/base.html:114 msgid "Sign up" msgstr "Cadastrar" -#: drdown/core/templates/core/base.html:141 +#: drdown/core/templates/core/base.html:142 msgid "Centro de Referência Interdisciplinar em Síndrome de Down" msgstr "Centro de Referência Interdisciplinar em Síndrome de Down" -#: drdown/core/templates/core/base.html:142 +#: drdown/core/templates/core/base.html:143 msgid "Location: HRAN - Setor Hospitalar Norte, quadra 1, bloco A, Asa Norte" msgstr "" "Localização: HRAN - Setor Hospitalar Norte, quadra 1, bloco A, Asa Norte" -#: drdown/core/templates/core/base.html:143 +#: drdown/core/templates/core/base.html:144 msgid "Phone: 3325-4219" msgstr "Telefone: 3325-4219" -#: drdown/core/templates/core/base.html:151 +#: drdown/core/templates/core/base.html:152 msgid "Copyright © Dr. Down 2018" msgstr "Copyright © Dr. Down 2018" -#: drdown/core/templates/core/home.html:23 +#: drdown/core/templates/core/home.html:43 msgid "CRIS DOWN" msgstr "CRIS DOWN" -#: drdown/core/templates/core/home.html:24 +#: drdown/core/templates/core/home.html:44 msgid "Medical Appointment - Queue - Foruns - Information" msgstr "Consultas - Filas de Espera - Fórum - Informações" -#: drdown/core/templates/core/home.html:32 +#: drdown/core/templates/core/home.html:52 msgid "About" msgstr "Sobre" -#: drdown/core/templates/core/home.html:36 +#: drdown/core/templates/core/home.html:56 msgid "" "Dr. Down is a management tool for CRIS DOWN (Centro de Referência em " "Síndrome de Down) that makes possible to schedule medical appointments, to " @@ -476,7 +480,7 @@ msgstr "" "Referência em Síndrome de Down) que possibilita agendar consultas, comunicar-" "se com o médico e visualizar informações." -#: drdown/core/templates/core/home.html:39 +#: drdown/core/templates/core/home.html:59 msgid "" "CRIS DOWN was opened at Asa Norte, Brasília - DF, in April 2013. It is a " "place especialized in caring and accompaniment of patients with Down's " @@ -486,6 +490,12 @@ msgstr "" "lugar especializado no cuidado e acompanhamento de pacientes portadores de " "Síndrome de Down." +#: drdown/core/templates/core/home.html:67 +#, fuzzy +#| msgid "CRIS DOWN" +msgid "CRIS Down " +msgstr "CRIS DOWN" + #: drdown/core/templates/core/info.html:25 msgid "Down's Syndrome infos" msgstr "Informações sobre a Síndrome de Down" @@ -660,224 +670,291 @@ msgstr "Leituras complementares" msgid "Vaccine Schedule" msgstr "Calendário de Vacinas" -#: drdown/core/templates/core/vaccine_schedule.html:25 -#: drdown/core/templates/core/vaccine_schedule.html:224 -#: drdown/core/templates/core/vaccine_schedule.html:266 -#: drdown/core/templates/core/vaccine_schedule.html:375 +#: drdown/core/templates/core/pagination.html:8 +#: drdown/core/templates/core/pagination.html:12 +msgid "Previous" +msgstr "Anterior" + +#: drdown/core/templates/core/pagination.html:30 +#: drdown/core/templates/core/pagination.html:34 +msgid "Next" +msgstr "Próximo" + +#: drdown/core/templates/core/vaccination_locations.html:25 +#: drdown/core/templates/core/vaccine_schedule.html:20 +#| msgid "Locations" +msgid "Vaccination Locations" +msgstr "Locais de Vacinação" + +#: drdown/core/templates/core/vaccination_locations.html:33 +#: drdown/core/templates/core/vaccination_locations.html:79 +#: drdown/core/templates/core/vaccination_locations.html:110 +#: drdown/core/templates/core/vaccination_locations.html:128 +#: drdown/core/templates/core/vaccination_locations.html:146 +#: drdown/core/templates/core/vaccination_locations.html:212 +#: drdown/core/templates/core/vaccination_locations.html:230 +#: drdown/core/templates/core/vaccination_locations.html:248 +#: drdown/core/templates/core/vaccination_locations.html:278 +#: drdown/core/templates/core/vaccination_locations.html:316 +#: drdown/core/templates/core/vaccination_locations.html:346 +#: drdown/core/templates/core/vaccination_locations.html:368 +#: drdown/core/templates/core/vaccination_locations.html:390 +#: drdown/core/templates/core/vaccination_locations.html:412 +#: drdown/core/templates/core/vaccination_locations.html:430 +#: drdown/core/templates/core/vaccination_locations.html:452 +#: drdown/core/templates/core/vaccination_locations.html:530 +#: drdown/core/templates/core/vaccination_locations.html:552 +#: drdown/core/templates/core/vaccination_locations.html:570 +#: drdown/core/templates/core/vaccination_locations.html:592 +#: drdown/core/templates/core/vaccination_locations.html:622 +#: drdown/core/templates/core/vaccination_locations.html:644 +#: drdown/core/templates/core/vaccination_locations.html:694 +msgid "Local" +msgstr "Local" + +#: drdown/core/templates/core/vaccination_locations.html:34 +#: drdown/core/templates/core/vaccination_locations.html:80 +#: drdown/core/templates/core/vaccination_locations.html:111 +#: drdown/core/templates/core/vaccination_locations.html:129 +#: drdown/core/templates/core/vaccination_locations.html:147 +#: drdown/core/templates/core/vaccination_locations.html:213 +#: drdown/core/templates/core/vaccination_locations.html:231 +#: drdown/core/templates/core/vaccination_locations.html:249 +#: drdown/core/templates/core/vaccination_locations.html:279 +#: drdown/core/templates/core/vaccination_locations.html:317 +#: drdown/core/templates/core/vaccination_locations.html:347 +#: drdown/core/templates/core/vaccination_locations.html:369 +#: drdown/core/templates/core/vaccination_locations.html:391 +#: drdown/core/templates/core/vaccination_locations.html:413 +#: drdown/core/templates/core/vaccination_locations.html:431 +#: drdown/core/templates/core/vaccination_locations.html:453 +#: drdown/core/templates/core/vaccination_locations.html:531 +#: drdown/core/templates/core/vaccination_locations.html:553 +#: drdown/core/templates/core/vaccination_locations.html:571 +#: drdown/core/templates/core/vaccination_locations.html:593 +#: drdown/core/templates/core/vaccination_locations.html:623 +#: drdown/core/templates/core/vaccination_locations.html:645 +#: drdown/core/templates/core/vaccination_locations.html:695 +msgid "Phone" +msgstr "Telefone" + +#: drdown/core/templates/core/vaccine_schedule.html:26 +#: drdown/core/templates/core/vaccine_schedule.html:225 +#: drdown/core/templates/core/vaccine_schedule.html:267 +#: drdown/core/templates/core/vaccine_schedule.html:376 msgid "Vaccines" msgstr "Vacinas" -#: drdown/core/templates/core/vaccine_schedule.html:26 -#: drdown/core/templates/core/vaccine_schedule.html:244 -#| msgid "OF BIRTH TO THE 10 YEARS OF AGE" +#: drdown/core/templates/core/vaccine_schedule.html:27 +#: drdown/core/templates/core/vaccine_schedule.html:245 msgid "OF BIRTH TO THE 6 YEARS OF AGE" msgstr "DO NASCIMENTO AOS 6 ANOS DE IDADE" -#: drdown/core/templates/core/vaccine_schedule.html:30 -#: drdown/core/templates/core/vaccine_schedule.html:225 +#: drdown/core/templates/core/vaccine_schedule.html:31 +#: drdown/core/templates/core/vaccine_schedule.html:226 msgid "At Birth" msgstr "Ao Nascer" -#: drdown/core/templates/core/vaccine_schedule.html:31 -#: drdown/core/templates/core/vaccine_schedule.html:226 +#: drdown/core/templates/core/vaccine_schedule.html:32 +#: drdown/core/templates/core/vaccine_schedule.html:227 msgid "1 Month" msgstr "1 Mês" -#: drdown/core/templates/core/vaccine_schedule.html:32 -#: drdown/core/templates/core/vaccine_schedule.html:227 +#: drdown/core/templates/core/vaccine_schedule.html:33 +#: drdown/core/templates/core/vaccine_schedule.html:228 msgid "2 Months" msgstr "2 Meses" -#: drdown/core/templates/core/vaccine_schedule.html:33 -#: drdown/core/templates/core/vaccine_schedule.html:228 +#: drdown/core/templates/core/vaccine_schedule.html:34 +#: drdown/core/templates/core/vaccine_schedule.html:229 msgid "3 Months" msgstr "3 Meses" -#: drdown/core/templates/core/vaccine_schedule.html:34 -#: drdown/core/templates/core/vaccine_schedule.html:229 +#: drdown/core/templates/core/vaccine_schedule.html:35 +#: drdown/core/templates/core/vaccine_schedule.html:230 msgid "4 Months" msgstr "4 Meses" -#: drdown/core/templates/core/vaccine_schedule.html:35 -#: drdown/core/templates/core/vaccine_schedule.html:230 +#: drdown/core/templates/core/vaccine_schedule.html:36 +#: drdown/core/templates/core/vaccine_schedule.html:231 msgid "5 Months" msgstr "5 Meses" -#: drdown/core/templates/core/vaccine_schedule.html:36 -#: drdown/core/templates/core/vaccine_schedule.html:231 +#: drdown/core/templates/core/vaccine_schedule.html:37 +#: drdown/core/templates/core/vaccine_schedule.html:232 msgid "6 Months" msgstr "6 Meses" -#: drdown/core/templates/core/vaccine_schedule.html:37 -#: drdown/core/templates/core/vaccine_schedule.html:232 +#: drdown/core/templates/core/vaccine_schedule.html:38 +#: drdown/core/templates/core/vaccine_schedule.html:233 msgid "7 Months" msgstr "7 Meses" -#: drdown/core/templates/core/vaccine_schedule.html:38 -#: drdown/core/templates/core/vaccine_schedule.html:233 +#: drdown/core/templates/core/vaccine_schedule.html:39 +#: drdown/core/templates/core/vaccine_schedule.html:234 msgid "8 Months" msgstr "8 Meses" -#: drdown/core/templates/core/vaccine_schedule.html:39 -#: drdown/core/templates/core/vaccine_schedule.html:234 +#: drdown/core/templates/core/vaccine_schedule.html:40 +#: drdown/core/templates/core/vaccine_schedule.html:235 msgid "9 Months" msgstr "9 Meses" -#: drdown/core/templates/core/vaccine_schedule.html:40 -#: drdown/core/templates/core/vaccine_schedule.html:235 +#: drdown/core/templates/core/vaccine_schedule.html:41 +#: drdown/core/templates/core/vaccine_schedule.html:236 msgid "12 Months" msgstr "12 Meses" -#: drdown/core/templates/core/vaccine_schedule.html:41 -#: drdown/core/templates/core/vaccine_schedule.html:236 +#: drdown/core/templates/core/vaccine_schedule.html:42 +#: drdown/core/templates/core/vaccine_schedule.html:237 msgid "15 Months" msgstr "15 Meses" -#: drdown/core/templates/core/vaccine_schedule.html:42 -#: drdown/core/templates/core/vaccine_schedule.html:237 +#: drdown/core/templates/core/vaccine_schedule.html:43 +#: drdown/core/templates/core/vaccine_schedule.html:238 msgid "18 Months" msgstr "18 Meses" -#: drdown/core/templates/core/vaccine_schedule.html:43 -#: drdown/core/templates/core/vaccine_schedule.html:238 +#: drdown/core/templates/core/vaccine_schedule.html:44 +#: drdown/core/templates/core/vaccine_schedule.html:239 msgid "24 Months" msgstr "24 Meses" -#: drdown/core/templates/core/vaccine_schedule.html:44 -#: drdown/core/templates/core/vaccine_schedule.html:239 +#: drdown/core/templates/core/vaccine_schedule.html:45 +#: drdown/core/templates/core/vaccine_schedule.html:240 msgid "4 Years" msgstr "4 Anos" -#: drdown/core/templates/core/vaccine_schedule.html:45 -#: drdown/core/templates/core/vaccine_schedule.html:240 +#: drdown/core/templates/core/vaccine_schedule.html:46 +#: drdown/core/templates/core/vaccine_schedule.html:241 msgid "5 Years" msgstr "5 Anos" -#: drdown/core/templates/core/vaccine_schedule.html:46 -#: drdown/core/templates/core/vaccine_schedule.html:241 +#: drdown/core/templates/core/vaccine_schedule.html:47 +#: drdown/core/templates/core/vaccine_schedule.html:242 msgid "6 Years" msgstr "6 Anos" -#: drdown/core/templates/core/vaccine_schedule.html:52 -#: drdown/core/templates/core/vaccine_schedule.html:283 +#: drdown/core/templates/core/vaccine_schedule.html:53 +#: drdown/core/templates/core/vaccine_schedule.html:284 msgid "BCG ID" msgstr "BCG ID" -#: drdown/core/templates/core/vaccine_schedule.html:53 -#: drdown/core/templates/core/vaccine_schedule.html:365 +#: drdown/core/templates/core/vaccine_schedule.html:54 +#: drdown/core/templates/core/vaccine_schedule.html:366 msgid "One dose" msgstr "Uma dose" -#: drdown/core/templates/core/vaccine_schedule.html:54 -#: drdown/core/templates/core/vaccine_schedule.html:60 -#: drdown/core/templates/core/vaccine_schedule.html:83 -#: drdown/core/templates/core/vaccine_schedule.html:168 -#: drdown/core/templates/core/vaccine_schedule.html:198 -#: drdown/core/templates/core/vaccine_schedule.html:288 -#: drdown/core/templates/core/vaccine_schedule.html:334 -#: drdown/core/templates/core/vaccine_schedule.html:344 -#: drdown/core/templates/core/vaccine_schedule.html:350 +#: drdown/core/templates/core/vaccine_schedule.html:55 +#: drdown/core/templates/core/vaccine_schedule.html:61 +#: drdown/core/templates/core/vaccine_schedule.html:84 +#: drdown/core/templates/core/vaccine_schedule.html:169 +#: drdown/core/templates/core/vaccine_schedule.html:199 +#: drdown/core/templates/core/vaccine_schedule.html:289 +#: drdown/core/templates/core/vaccine_schedule.html:335 +#: drdown/core/templates/core/vaccine_schedule.html:345 +#: drdown/core/templates/core/vaccine_schedule.html:351 msgid "Vaccinate the previously unvaccinated" msgstr "Vacinar os não vacinados anteriormente" -#: drdown/core/templates/core/vaccine_schedule.html:55 -#: drdown/core/templates/core/vaccine_schedule.html:284 +#: drdown/core/templates/core/vaccine_schedule.html:56 +#: drdown/core/templates/core/vaccine_schedule.html:285 msgid "Vaccinate people who contacted leprosy" msgstr "Vacinar pessoas contactantes de hanseníase" -#: drdown/core/templates/core/vaccine_schedule.html:58 -#: drdown/core/templates/core/vaccine_schedule.html:287 +#: drdown/core/templates/core/vaccine_schedule.html:59 +#: drdown/core/templates/core/vaccine_schedule.html:288 msgid "Hepatitis B" msgstr "Hepatite B" -#: drdown/core/templates/core/vaccine_schedule.html:59 +#: drdown/core/templates/core/vaccine_schedule.html:60 msgid "Three or four doses from birth" msgstr "Três ou quatro doses a partir do nascimento" -#: drdown/core/templates/core/vaccine_schedule.html:63 -#: drdown/core/templates/core/vaccine_schedule.html:291 +#: drdown/core/templates/core/vaccine_schedule.html:64 +#: drdown/core/templates/core/vaccine_schedule.html:292 msgid "Rotavirus" msgstr "Rotavírus" -#: drdown/core/templates/core/vaccine_schedule.html:66 +#: drdown/core/templates/core/vaccine_schedule.html:67 msgid "Two or three doses. Initiate vaccination before 15 weeks of age" msgstr "Duas ou três doses. Iniciar vacinação antes das 15 semanas de vida" -#: drdown/core/templates/core/vaccine_schedule.html:67 -#: drdown/core/templates/core/vaccine_schedule.html:219 -#: drdown/core/templates/core/vaccine_schedule.html:292 -#: drdown/core/templates/core/vaccine_schedule.html:370 +#: drdown/core/templates/core/vaccine_schedule.html:68 +#: drdown/core/templates/core/vaccine_schedule.html:220 +#: drdown/core/templates/core/vaccine_schedule.html:293 +#: drdown/core/templates/core/vaccine_schedule.html:371 msgid "CONTRAINDICATED" msgstr "CONTRAINDICADA" -#: drdown/core/templates/core/vaccine_schedule.html:70 -#: drdown/core/templates/core/vaccine_schedule.html:295 +#: drdown/core/templates/core/vaccine_schedule.html:71 +#: drdown/core/templates/core/vaccine_schedule.html:296 msgid "Bacterial triple (DTPw, DTPa, ou dTpa)" msgstr "Tríplice bacteriana (DTPw, DTPa, ou dTpa)" -#: drdown/core/templates/core/vaccine_schedule.html:73 +#: drdown/core/templates/core/vaccine_schedule.html:74 msgid "Four doses of DTPa or DTPw starting at 2 months of age" msgstr "Quatro doses DTPa ou DTPw iniciando aos 2 meses de idade" -#: drdown/core/templates/core/vaccine_schedule.html:75 +#: drdown/core/templates/core/vaccine_schedule.html:76 msgid "Reinforcement with DTPa, DTPw or dTpa" msgstr "Reforço com DTPa, DTPw ou dTpa" -#: drdown/core/templates/core/vaccine_schedule.html:79 -#: drdown/core/templates/core/vaccine_schedule.html:301 +#: drdown/core/templates/core/vaccine_schedule.html:80 +#: drdown/core/templates/core/vaccine_schedule.html:302 msgid "Haemophilus influenzae type b" msgstr "Haemophilus influenzae tipo b" -#: drdown/core/templates/core/vaccine_schedule.html:82 +#: drdown/core/templates/core/vaccine_schedule.html:83 msgid "Four doses starting at 2 months of age" msgstr "Quatro doses iniciando aos 2 meses de idade" -#: drdown/core/templates/core/vaccine_schedule.html:84 -#: drdown/core/templates/core/vaccine_schedule.html:91 -#: drdown/core/templates/core/vaccine_schedule.html:215 -#: drdown/core/templates/core/vaccine_schedule.html:302 -#: drdown/core/templates/core/vaccine_schedule.html:306 -#: drdown/core/templates/core/vaccine_schedule.html:317 -#: drdown/core/templates/core/vaccine_schedule.html:322 -#: drdown/core/templates/core/vaccine_schedule.html:335 -#: drdown/core/templates/core/vaccine_schedule.html:345 -#: drdown/core/templates/core/vaccine_schedule.html:356 +#: drdown/core/templates/core/vaccine_schedule.html:85 +#: drdown/core/templates/core/vaccine_schedule.html:92 +#: drdown/core/templates/core/vaccine_schedule.html:216 +#: drdown/core/templates/core/vaccine_schedule.html:303 +#: drdown/core/templates/core/vaccine_schedule.html:307 +#: drdown/core/templates/core/vaccine_schedule.html:318 +#: drdown/core/templates/core/vaccine_schedule.html:323 +#: drdown/core/templates/core/vaccine_schedule.html:336 +#: drdown/core/templates/core/vaccine_schedule.html:346 +#: drdown/core/templates/core/vaccine_schedule.html:357 msgid "Vaccinate people in special risk situations" msgstr "Vacinar pessoas em situações especiais de risco" -#: drdown/core/templates/core/vaccine_schedule.html:87 -#: drdown/core/templates/core/vaccine_schedule.html:305 +#: drdown/core/templates/core/vaccine_schedule.html:88 +#: drdown/core/templates/core/vaccine_schedule.html:306 msgid "Poliomyelitis (inactivated virus)" msgstr "Poliomielite (vírus inativados)" -#: drdown/core/templates/core/vaccine_schedule.html:90 +#: drdown/core/templates/core/vaccine_schedule.html:91 msgid "Five doses starting at 2 months of age" msgstr "Cinco doses iniciando aos 2 meses de idade" -#: drdown/core/templates/core/vaccine_schedule.html:94 -#: drdown/core/templates/core/vaccine_schedule.html:309 +#: drdown/core/templates/core/vaccine_schedule.html:95 +#: drdown/core/templates/core/vaccine_schedule.html:310 msgid "Pneumococcal conjugate" msgstr "Pneumocócica conjugada" -#: drdown/core/templates/core/vaccine_schedule.html:97 +#: drdown/core/templates/core/vaccine_schedule.html:98 msgid "Four doses starting at 2 months of age - VPC10 or VPC13" msgstr "" -#: drdown/core/templates/core/vaccine_schedule.html:98 +#: drdown/core/templates/core/vaccine_schedule.html:99 msgid "VPC10 or VPC13 - Vaccinate the previously unvaccinated" msgstr "Quatro doses iniciando aos 2 meses de idade - VPC10 ou VPC13" -#: drdown/core/templates/core/vaccine_schedule.html:99 -#: drdown/core/templates/core/vaccine_schedule.html:310 +#: drdown/core/templates/core/vaccine_schedule.html:100 +#: drdown/core/templates/core/vaccine_schedule.html:311 msgid "PCV13: vaccinating people in special risk situations" msgstr "PCV13: vacinar pessoas em situações especiais de risco" -#: drdown/core/templates/core/vaccine_schedule.html:102 -#: drdown/core/templates/core/vaccine_schedule.html:314 +#: drdown/core/templates/core/vaccine_schedule.html:103 +#: drdown/core/templates/core/vaccine_schedule.html:315 msgid "Meningococcal conjugate C or ACWY" msgstr "Meningocócica conjugada C ou ACWY" -#: drdown/core/templates/core/vaccine_schedule.html:106 +#: drdown/core/templates/core/vaccine_schedule.html:107 msgid "" "With menACWY: three doses beginning at 3 months of age. Or with menC: two " "doses beginning at 3 months of age" @@ -885,51 +962,51 @@ msgstr "" "Com menACWY: três doses iniciando aos 3 meses de idade. Ou com menC: duas " "doses iniciando aos 3 meses de idade" -#: drdown/core/templates/core/vaccine_schedule.html:107 -#: drdown/core/templates/core/vaccine_schedule.html:109 -#: drdown/core/templates/core/vaccine_schedule.html:117 +#: drdown/core/templates/core/vaccine_schedule.html:108 +#: drdown/core/templates/core/vaccine_schedule.html:110 +#: drdown/core/templates/core/vaccine_schedule.html:118 msgid "REINFORCEMENT" msgstr "REFORÇO" -#: drdown/core/templates/core/vaccine_schedule.html:112 -#: drdown/core/templates/core/vaccine_schedule.html:320 +#: drdown/core/templates/core/vaccine_schedule.html:113 +#: drdown/core/templates/core/vaccine_schedule.html:321 msgid "Meningococcal B" msgstr "Meningocócica B" -#: drdown/core/templates/core/vaccine_schedule.html:116 +#: drdown/core/templates/core/vaccine_schedule.html:117 msgid "Three doses beginning at 3 months of age" msgstr "Três doses iniciando aos 3 meses de idade" -#: drdown/core/templates/core/vaccine_schedule.html:118 -#: drdown/core/templates/core/vaccine_schedule.html:321 +#: drdown/core/templates/core/vaccine_schedule.html:119 +#: drdown/core/templates/core/vaccine_schedule.html:322 msgid "For those not previously vaccinated: two doses" msgstr "Para os não vacinados anteriormente: duas doses" -#: drdown/core/templates/core/vaccine_schedule.html:121 +#: drdown/core/templates/core/vaccine_schedule.html:122 msgid "Oral poliomyelitis (live attenuated virus)" msgstr "Poliomielite oral (vírus vivos atenuados)" -#: drdown/core/templates/core/vaccine_schedule.html:129 +#: drdown/core/templates/core/vaccine_schedule.html:130 msgid "NATIONAL VACCINATION CAMPAIGNS" msgstr "CAMPANHAS NACIONAIS DE VACINAÇÃO" -#: drdown/core/templates/core/vaccine_schedule.html:133 -#: drdown/core/templates/core/vaccine_schedule.html:325 +#: drdown/core/templates/core/vaccine_schedule.html:134 +#: drdown/core/templates/core/vaccine_schedule.html:326 msgid "Influenza (flu)" msgstr "Influenza (gripe)" -#: drdown/core/templates/core/vaccine_schedule.html:140 -#: drdown/core/templates/core/vaccine_schedule.html:326 +#: drdown/core/templates/core/vaccine_schedule.html:141 +#: drdown/core/templates/core/vaccine_schedule.html:327 msgid "ANNUAL VACCINATION" msgstr "VACINAÇÃO ANUAL" -#: drdown/core/templates/core/vaccine_schedule.html:143 -#: drdown/core/templates/core/vaccine_schedule.html:329 +#: drdown/core/templates/core/vaccine_schedule.html:144 +#: drdown/core/templates/core/vaccine_schedule.html:330 msgid "Yellow fever" msgstr "Febre amarela" -#: drdown/core/templates/core/vaccine_schedule.html:153 -#: drdown/core/templates/core/vaccine_schedule.html:330 +#: drdown/core/templates/core/vaccine_schedule.html:154 +#: drdown/core/templates/core/vaccine_schedule.html:331 msgid "" "IN REGIONS WITH RECOMMENDATION OF VACCINATION (ACCORDING TO CLASSIFICATION " "OF MS) - single dose at 9 months of age. Not previously vaccinated: single " @@ -939,109 +1016,109 @@ msgstr "" "- dose única aos 9 meses de idade. Para não vacinados anteriormente: dose " "única" -#: drdown/core/templates/core/vaccine_schedule.html:156 -#: drdown/core/templates/core/vaccine_schedule.html:333 +#: drdown/core/templates/core/vaccine_schedule.html:157 +#: drdown/core/templates/core/vaccine_schedule.html:334 msgid "Viral triple (measles, mumps and rubella)" msgstr "Tríplice viral (sarampo,caxumba e rubéola)" -#: drdown/core/templates/core/vaccine_schedule.html:167 -#: drdown/core/templates/core/vaccine_schedule.html:182 -#: drdown/core/templates/core/vaccine_schedule.html:197 +#: drdown/core/templates/core/vaccine_schedule.html:168 +#: drdown/core/templates/core/vaccine_schedule.html:183 +#: drdown/core/templates/core/vaccine_schedule.html:198 msgid "Two doses after 12 months" msgstr "Duas doses a partir dos 12 meses" -#: drdown/core/templates/core/vaccine_schedule.html:171 -#: drdown/core/templates/core/vaccine_schedule.html:338 +#: drdown/core/templates/core/vaccine_schedule.html:172 +#: drdown/core/templates/core/vaccine_schedule.html:339 msgid "Varicella (chickenpox)" msgstr "Varicela (catapora)" -#: drdown/core/templates/core/vaccine_schedule.html:183 -#: drdown/core/templates/core/vaccine_schedule.html:339 +#: drdown/core/templates/core/vaccine_schedule.html:184 +#: drdown/core/templates/core/vaccine_schedule.html:340 msgid "Vaccinate previously unvaccinated susceptibles" msgstr "Vacinar os suscetíveis não vacinados anteriormente" -#: drdown/core/templates/core/vaccine_schedule.html:186 -#: drdown/core/templates/core/vaccine_schedule.html:343 +#: drdown/core/templates/core/vaccine_schedule.html:187 +#: drdown/core/templates/core/vaccine_schedule.html:344 msgid "Hepatitis A" msgstr "Hepatite A" -#: drdown/core/templates/core/vaccine_schedule.html:201 -#: drdown/core/templates/core/vaccine_schedule.html:355 +#: drdown/core/templates/core/vaccine_schedule.html:202 +#: drdown/core/templates/core/vaccine_schedule.html:356 msgid "Pneumococcal 23 courageous" msgstr "Pneumocócica 23 valente" -#: drdown/core/templates/core/vaccine_schedule.html:218 -#: drdown/core/templates/core/vaccine_schedule.html:368 +#: drdown/core/templates/core/vaccine_schedule.html:219 +#: drdown/core/templates/core/vaccine_schedule.html:369 msgid "Dengue" msgstr "Dengue" -#: drdown/core/templates/core/vaccine_schedule.html:248 +#: drdown/core/templates/core/vaccine_schedule.html:249 msgid "Subtitle: " msgstr "Legenda: " -#: drdown/core/templates/core/vaccine_schedule.html:250 +#: drdown/core/templates/core/vaccine_schedule.html:251 msgid "Routine" msgstr "Rotina" -#: drdown/core/templates/core/vaccine_schedule.html:252 +#: drdown/core/templates/core/vaccine_schedule.html:253 msgid "Vaccinate Unvaccinated" msgstr "Vacinar não vacinados" -#: drdown/core/templates/core/vaccine_schedule.html:254 +#: drdown/core/templates/core/vaccine_schedule.html:255 msgid "Special Situations" msgstr "Situações especiais" -#: drdown/core/templates/core/vaccine_schedule.html:256 +#: drdown/core/templates/core/vaccine_schedule.html:257 msgid "Contraindicated" msgstr "Contraindicada" -#: drdown/core/templates/core/vaccine_schedule.html:267 -#: drdown/core/templates/core/vaccine_schedule.html:383 +#: drdown/core/templates/core/vaccine_schedule.html:268 +#: drdown/core/templates/core/vaccine_schedule.html:384 msgid "9 TO 10 YEARS OLD" msgstr "9 ATÉ 10 ANOS DE IDADE" -#: drdown/core/templates/core/vaccine_schedule.html:268 -#: drdown/core/templates/core/vaccine_schedule.html:384 +#: drdown/core/templates/core/vaccine_schedule.html:269 +#: drdown/core/templates/core/vaccine_schedule.html:385 msgid "ADOLESCENT" msgstr "ADOLESCENTE" -#: drdown/core/templates/core/vaccine_schedule.html:269 -#: drdown/core/templates/core/vaccine_schedule.html:385 +#: drdown/core/templates/core/vaccine_schedule.html:270 +#: drdown/core/templates/core/vaccine_schedule.html:386 msgid "ADULT" msgstr "ADULTO" -#: drdown/core/templates/core/vaccine_schedule.html:270 -#: drdown/core/templates/core/vaccine_schedule.html:386 +#: drdown/core/templates/core/vaccine_schedule.html:271 +#: drdown/core/templates/core/vaccine_schedule.html:387 msgid "OLD MAN" msgstr "IDOSO" -#: drdown/core/templates/core/vaccine_schedule.html:274 -#: drdown/core/templates/core/vaccine_schedule.html:376 +#: drdown/core/templates/core/vaccine_schedule.html:275 +#: drdown/core/templates/core/vaccine_schedule.html:377 msgid "9 Years" msgstr "9 Anos" -#: drdown/core/templates/core/vaccine_schedule.html:275 -#: drdown/core/templates/core/vaccine_schedule.html:377 +#: drdown/core/templates/core/vaccine_schedule.html:276 +#: drdown/core/templates/core/vaccine_schedule.html:378 msgid "10 Years" msgstr "10 Anos" -#: drdown/core/templates/core/vaccine_schedule.html:276 -#: drdown/core/templates/core/vaccine_schedule.html:378 +#: drdown/core/templates/core/vaccine_schedule.html:277 +#: drdown/core/templates/core/vaccine_schedule.html:379 msgid "11-19 Years" msgstr "11-19 Anos" -#: drdown/core/templates/core/vaccine_schedule.html:277 -#: drdown/core/templates/core/vaccine_schedule.html:379 +#: drdown/core/templates/core/vaccine_schedule.html:278 +#: drdown/core/templates/core/vaccine_schedule.html:380 msgid "20-59 Years" msgstr "20-59 Anos" -#: drdown/core/templates/core/vaccine_schedule.html:278 -#: drdown/core/templates/core/vaccine_schedule.html:380 +#: drdown/core/templates/core/vaccine_schedule.html:279 +#: drdown/core/templates/core/vaccine_schedule.html:381 msgid "60+ Years" msgstr "60+ Anos" -#: drdown/core/templates/core/vaccine_schedule.html:297 #: drdown/core/templates/core/vaccine_schedule.html:298 +#: drdown/core/templates/core/vaccine_schedule.html:299 msgid "" "Reinforcement with dTpa from 9 years of age and every 10 years (or, in the " "case of dTpa, do dT)" @@ -1049,40 +1126,40 @@ msgstr "" "Reforço com dTpa a partir dos 9 anos de idade e a cada dez anos (ou, na " "impossibilidade de dTpa, fazer dT)" -#: drdown/core/templates/core/vaccine_schedule.html:311 +#: drdown/core/templates/core/vaccine_schedule.html:312 msgid "VPC13: one dose" msgstr "VPC13: uma dose" -#: drdown/core/templates/core/vaccine_schedule.html:316 +#: drdown/core/templates/core/vaccine_schedule.html:317 msgid "REINFORCED at age 11. For those not previously vaccinated: two doses" msgstr "REFORÇO aos 11 anos. Para os não vacinados anteriormente: duas doses" -#: drdown/core/templates/core/vaccine_schedule.html:348 +#: drdown/core/templates/core/vaccine_schedule.html:349 msgid "HPV" msgstr "HPV" -#: drdown/core/templates/core/vaccine_schedule.html:349 +#: drdown/core/templates/core/vaccine_schedule.html:350 msgid "Three doses for girls and boys" msgstr "Três doses para meninas e meninos" -#: drdown/core/templates/core/vaccine_schedule.html:351 +#: drdown/core/templates/core/vaccine_schedule.html:352 msgid "" "Vaccinate the non-vaccinated formerly: at the discretion of the physician" msgstr "Vacinar os não vacinados anteriormente: a critério do médico" -#: drdown/core/templates/core/vaccine_schedule.html:357 +#: drdown/core/templates/core/vaccine_schedule.html:358 msgid "Two doses at five-year intervals" msgstr "Duas doses com intervalo de cinco anos" -#: drdown/core/templates/core/vaccine_schedule.html:360 +#: drdown/core/templates/core/vaccine_schedule.html:361 msgid "Herpes zoster" msgstr "Herpes zóster" -#: drdown/core/templates/core/vaccine_schedule.html:364 +#: drdown/core/templates/core/vaccine_schedule.html:365 msgid "From 50 to 59 years old: at medical discretion" msgstr "De 50 a 59 anos: a critério médico" -#: drdown/core/templates/core/vaccine_schedule.html:369 +#: drdown/core/templates/core/vaccine_schedule.html:370 msgid "" "To vaccinate people aged 9 to 45 years previously infected with the virus " "(seropositive) with three doses: 0 - 6 - 12 months" @@ -1090,16 +1167,6 @@ msgstr "" "Vacinar pessoas de 9 a 45 anos previamente infectadas pelo vírus " "(soropositivas) com três doses: 0 - 6 - 12 meses" -#: drdown/core/templates/core/pagination.html:8 -#: drdown/core/templates/core/pagination.html:12 -msgid "Previous" -msgstr "Anterior" - -#: drdown/core/templates/core/pagination.html:30 -#: drdown/core/templates/core/pagination.html:34 -msgid "Next" -msgstr "Próximo" - #~ msgid "Hey! You have procedures to be made." #~ msgstr "Oi! Você tem procedimentos que precisam ser feitos." From 080b55cbb0d9eaf2fab1a4f1daf40f51067b2af0 Mon Sep 17 00:00:00 2001 From: Daniel Maike Date: Wed, 9 May 2018 21:04:29 -0300 Subject: [PATCH 250/271] Fixing migration bug Co-authored-by: Geovana Ramos --- .../migrations/0002_auto_20180509_2305.py | 2 +- .../users/migrations/0016_auto_20180507_1928.py | 17 ----------------- 2 files changed, 1 insertion(+), 18 deletions(-) delete mode 100644 drdown/users/migrations/0016_auto_20180507_1928.py diff --git a/drdown/appointments/migrations/0002_auto_20180509_2305.py b/drdown/appointments/migrations/0002_auto_20180509_2305.py index c8531afe..58359c60 100644 --- a/drdown/appointments/migrations/0002_auto_20180509_2305.py +++ b/drdown/appointments/migrations/0002_auto_20180509_2305.py @@ -7,7 +7,7 @@ class Migration(migrations.Migration): dependencies = [ - ('users', '0016_auto_20180507_1928'), + ('users', '0016_auto_20180506_2043'), ('appointments', '0001_initial'), ] diff --git a/drdown/users/migrations/0016_auto_20180507_1928.py b/drdown/users/migrations/0016_auto_20180507_1928.py deleted file mode 100644 index bdca75be..00000000 --- a/drdown/users/migrations/0016_auto_20180507_1928.py +++ /dev/null @@ -1,17 +0,0 @@ -# Generated by Django 2.0.3 on 2018-05-07 19:28 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('users', '0015_auto_20180428_1306'), - ] - - operations = [ - migrations.AlterModelOptions( - name='patient', - options={'verbose_name': 'Patient', 'verbose_name_plural': 'Patients'}, - ), - ] From 461744a5644ce14371e5b2480dd28262cfe8b8c4 Mon Sep 17 00:00:00 2001 From: Joberth Rogers Date: Wed, 9 May 2018 21:20:11 -0300 Subject: [PATCH 251/271] Correcting pep8 a line that pass 80 character Co-authored-by: Gabriela Medeiros --- drdown/core/urls.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drdown/core/urls.py b/drdown/core/urls.py index 284b212a..d928cd20 100644 --- a/drdown/core/urls.py +++ b/drdown/core/urls.py @@ -21,7 +21,9 @@ ), url( regex=r'^vaccine/location$', - view=TemplateView.as_view(template_name='core/vaccination_locations.html'), + view=TemplateView.as_view( + template_name='core/vaccination_locations.html' + ), name='locations' ), From 797d341e0abc2683d2aa8b08e8b2d285a2463588 Mon Sep 17 00:00:00 2001 From: guilherme1guy Date: Wed, 9 May 2018 21:19:34 -0300 Subject: [PATCH 252/271] Resolving migration errors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Elias Bernardo --- Last fixes to release v0.0.3 Correcting some translations errors Adding a migration to correct a verbose name Co-authored-by: Mariana Mendes Co-authored-by: João Pedro Sconetto --- Resolving migration errors Co-authored-by: Elias Bernardo --- .../medicalrecords/migrations/0001_initial.py | 93 ++---------------- .../migrations/0002_auto_20180428_0044.py | 34 +++++++ .../migrations/0002_auto_20180508_1504.py | 23 ----- ...t_exam_medicine_specificexam_staticdata.py | 95 +++++++++++++++++++ ...507_0027.py => 0016_auto_20180506_2043.py} | 2 +- 5 files changed, 137 insertions(+), 110 deletions(-) create mode 100644 drdown/medicalrecords/migrations/0002_auto_20180428_0044.py delete mode 100644 drdown/medicalrecords/migrations/0002_auto_20180508_1504.py create mode 100644 drdown/medicalrecords/migrations/0003_complaint_exam_medicine_specificexam_staticdata.py rename drdown/users/migrations/{0016_auto_20180507_0027.py => 0016_auto_20180506_2043.py} (87%) diff --git a/drdown/medicalrecords/migrations/0001_initial.py b/drdown/medicalrecords/migrations/0001_initial.py index 9847e052..8bdafa99 100644 --- a/drdown/medicalrecords/migrations/0001_initial.py +++ b/drdown/medicalrecords/migrations/0001_initial.py @@ -1,6 +1,6 @@ -# Generated by Django 2.0.3 on 2018-05-08 11:50 +# Generated by Django 2.0.3 on 2018-04-24 00:47 -import django.core.validators +from django.conf import settings from django.db import migrations, models import django.db.models.deletion @@ -10,50 +10,18 @@ class Migration(migrations.Migration): initial = True dependencies = [ - ('users', '0016_auto_20180507_0027'), + ('users', '0012_auto_20180423_1542'), + migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ - migrations.CreateModel( - name='Complaint', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('created_at', models.DateTimeField(auto_now_add=True, help_text='Date of creation', verbose_name='Created at')), - ('complaint_day', models.DateField(verbose_name='Day of complaint')), - ('complaint_time', models.TimeField(verbose_name='Time of complaint')), - ('description', models.TextField(help_text='Description of the complaint', max_length=4000, verbose_name='Description')), - ('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='users.HealthTeam', verbose_name='Author')), - ('patient', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='users.Patient', verbose_name='Patient')), - ], - options={ - 'verbose_name': 'Complaint', - 'verbose_name_plural': 'Complaints', - }, - ), - migrations.CreateModel( - name='Exam', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('file', models.FileField(upload_to='media/medicalrecords/exams', verbose_name='Exam')), - ('day', models.DateTimeField(help_text='Day the exam was performed', verbose_name='Exam day')), - ('status', models.IntegerField(choices=[(3, 'Executed'), (2, 'Collected'), (1, 'Marked examination')], help_text='Please, insert the status of the exam', verbose_name='Status')), - ('name', models.CharField(max_length=200, verbose_name='Exam Name')), - ('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='users.HealthTeam', verbose_name='Author')), - ('patient', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='users.Patient', verbose_name='Patient')), - ], - options={ - 'verbose_name': 'Exam', - 'verbose_name_plural': 'Exams', - }, - ), migrations.CreateModel( name='MedicalRecord', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('document', models.FileField(blank=True, upload_to='media/')), - ('day', models.DateTimeField(auto_now=True, help_text='Patient Care Day', verbose_name='Created at')), - ('message', models.TextField(help_text='Message of medical records', max_length=4000, verbose_name='Message')), - ('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='users.HealthTeam', verbose_name='Author')), + ('day', models.DateTimeField(help_text='Patient Care Day', verbose_name='Created at')), + ('message', models.TextField(help_text='Message of post', max_length=4000, verbose_name='Message')), + ('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='Author')), ('patient', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='users.Patient', verbose_name='Patient')), ], options={ @@ -61,51 +29,4 @@ class Migration(migrations.Migration): 'verbose_name_plural': 'Medical Records', }, ), - migrations.CreateModel( - name='Medicine', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('medicine_name', models.CharField(max_length=100, verbose_name='Medicine Name')), - ('medicine_dosage', models.CharField(max_length=100, verbose_name='Medicine dosage')), - ('medicine_in_use', models.BooleanField(help_text='Does the patient still use this medication?', verbose_name='In use?')), - ('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='users.HealthTeam', verbose_name='Author')), - ('patient', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='users.Patient', verbose_name='Patient')), - ], - options={ - 'verbose_name': 'Patient Medicine', - }, - ), - migrations.CreateModel( - name='SpecificExam', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('structured_physical_exam', models.FileField(blank=True, upload_to='media/medicalrecords/specificexams', verbose_name='Structured Physical Exam')), - ('vision', models.FileField(blank=True, upload_to='media/medicalrecords/specificexams', verbose_name='Vision Exam')), - ('ear', models.FileField(blank=True, upload_to='media/medicalrecords/specificexams', verbose_name='Ear Exam')), - ('hearth', models.FileField(blank=True, upload_to='media/medicalrecords/specificexams', verbose_name='Hearth Exam')), - ('muscle_skeletal_system', models.FileField(blank=True, upload_to='media/medicalrecords/specificexams', verbose_name='Muscle skeletal system Exam')), - ('nervous_system', models.FileField(blank=True, upload_to='media/medicalrecords/specificexams', verbose_name='Nervous system Exam')), - ('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='users.HealthTeam', verbose_name='Author')), - ('patient', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='users.Patient', verbose_name='Patient')), - ], - options={ - 'verbose_name': 'Specific Exam', - 'verbose_name_plural': 'Specific Exams', - }, - ), - migrations.CreateModel( - name='StaticData', - fields=[ - ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('weight', models.PositiveIntegerField(help_text='In grams', validators=[django.core.validators.MaxValueValidator(9999)], verbose_name='Weight at birth')), - ('APGAR', models.IntegerField(choices=[(1, 1), (2, 2), (3, 3), (4, 4), (5, 5), (6, 6), (7, 7), (8, 8), (9, 9), (10, 10)])), - ('heart_test', models.FileField(blank=True, upload_to='media/medicalrecords', verbose_name='Heart Test')), - ('ear_test', models.FileField(blank=True, upload_to='media/medicalrecords', verbose_name='Test of the Ear')), - ('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='users.HealthTeam', verbose_name='Author')), - ('patient', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='users.Patient', verbose_name='Patient')), - ], - options={ - 'verbose_name': 'Medical Record Static Data', - }, - ), ] diff --git a/drdown/medicalrecords/migrations/0002_auto_20180428_0044.py b/drdown/medicalrecords/migrations/0002_auto_20180428_0044.py new file mode 100644 index 00000000..37c8b28d --- /dev/null +++ b/drdown/medicalrecords/migrations/0002_auto_20180428_0044.py @@ -0,0 +1,34 @@ +# Generated by Django 2.0.3 on 2018-04-28 00:44 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('medicalrecords', '0001_initial'), + ] + + operations = [ + migrations.AddField( + model_name='medicalrecord', + name='document', + field=models.FileField(blank=True, upload_to='media/'), + ), + migrations.AlterField( + model_name='medicalrecord', + name='author', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='users.HealthTeam', verbose_name='Author'), + ), + migrations.AlterField( + model_name='medicalrecord', + name='day', + field=models.DateTimeField(auto_now=True, help_text='Patient Care Day', verbose_name='Created at'), + ), + migrations.AlterField( + model_name='medicalrecord', + name='message', + field=models.TextField(help_text='Message of medical records', max_length=4000, verbose_name='Message'), + ), + ] diff --git a/drdown/medicalrecords/migrations/0002_auto_20180508_1504.py b/drdown/medicalrecords/migrations/0002_auto_20180508_1504.py deleted file mode 100644 index 5a231a55..00000000 --- a/drdown/medicalrecords/migrations/0002_auto_20180508_1504.py +++ /dev/null @@ -1,23 +0,0 @@ -# Generated by Django 2.0.3 on 2018-05-08 15:04 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('medicalrecords', '0001_initial'), - ] - - operations = [ - migrations.AlterField( - model_name='staticdata', - name='ear_test', - field=models.FileField(upload_to='media/medicalrecords', verbose_name='Test of the Ear'), - ), - migrations.AlterField( - model_name='staticdata', - name='heart_test', - field=models.FileField(upload_to='media/medicalrecords', verbose_name='Heart Test'), - ), - ] diff --git a/drdown/medicalrecords/migrations/0003_complaint_exam_medicine_specificexam_staticdata.py b/drdown/medicalrecords/migrations/0003_complaint_exam_medicine_specificexam_staticdata.py new file mode 100644 index 00000000..343903e8 --- /dev/null +++ b/drdown/medicalrecords/migrations/0003_complaint_exam_medicine_specificexam_staticdata.py @@ -0,0 +1,95 @@ +# Generated by Django 2.0.3 on 2018-05-10 00:17 + +import django.core.validators +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('users', '0016_auto_20180506_2043'), + ('medicalrecords', '0002_auto_20180428_0044'), + ] + + operations = [ + migrations.CreateModel( + name='Complaint', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('created_at', models.DateTimeField(auto_now_add=True, help_text='Date of creation', verbose_name='Created at')), + ('complaint_day', models.DateField(verbose_name='Day of complaint')), + ('complaint_time', models.TimeField(verbose_name='Time of complaint')), + ('description', models.TextField(help_text='Description of the complaint', max_length=4000, verbose_name='Description')), + ('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='users.HealthTeam', verbose_name='Author')), + ('patient', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='users.Patient', verbose_name='Patient')), + ], + options={ + 'verbose_name': 'Complaint', + 'verbose_name_plural': 'Complaints', + }, + ), + migrations.CreateModel( + name='Exam', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('file', models.FileField(upload_to='media/medicalrecords/exams', verbose_name='Exam')), + ('day', models.DateTimeField(help_text='Day the exam was performed', verbose_name='Exam day')), + ('status', models.IntegerField(choices=[(3, 'Executed'), (2, 'Collected'), (1, 'Marked examination')], help_text='Please, insert the status of the exam', verbose_name='Status')), + ('name', models.CharField(max_length=200, verbose_name='Exam Name')), + ('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='users.HealthTeam', verbose_name='Author')), + ('patient', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='users.Patient', verbose_name='Patient')), + ], + options={ + 'verbose_name': 'Exam', + 'verbose_name_plural': 'Exams', + }, + ), + migrations.CreateModel( + name='Medicine', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('medicine_name', models.CharField(max_length=100, verbose_name='Medicine Name')), + ('medicine_dosage', models.CharField(max_length=100, verbose_name='Medicine dosage')), + ('medicine_in_use', models.BooleanField(help_text='Does the patient still use this medication?', verbose_name='In use?')), + ('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='users.HealthTeam', verbose_name='Author')), + ('patient', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='users.Patient', verbose_name='Patient')), + ], + options={ + 'verbose_name': 'Patient Medicine', + }, + ), + migrations.CreateModel( + name='SpecificExam', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('structured_physical_exam', models.FileField(blank=True, upload_to='media/medicalrecords/specificexams', verbose_name='Structured Physical Exam')), + ('vision', models.FileField(blank=True, upload_to='media/medicalrecords/specificexams', verbose_name='Vision Exam')), + ('ear', models.FileField(blank=True, upload_to='media/medicalrecords/specificexams', verbose_name='Ear Exam')), + ('hearth', models.FileField(blank=True, upload_to='media/medicalrecords/specificexams', verbose_name='Hearth Exam')), + ('muscle_skeletal_system', models.FileField(blank=True, upload_to='media/medicalrecords/specificexams', verbose_name='Muscle skeletal system Exam')), + ('nervous_system', models.FileField(blank=True, upload_to='media/medicalrecords/specificexams', verbose_name='Nervous system Exam')), + ('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='users.HealthTeam', verbose_name='Author')), + ('patient', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='users.Patient', verbose_name='Patient')), + ], + options={ + 'verbose_name': 'Specific Exam', + 'verbose_name_plural': 'Specific Exams', + }, + ), + migrations.CreateModel( + name='StaticData', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('weight', models.PositiveIntegerField(help_text='In grams', validators=[django.core.validators.MaxValueValidator(9999)], verbose_name='Weight at birth')), + ('APGAR', models.IntegerField(choices=[(1, 1), (2, 2), (3, 3), (4, 4), (5, 5), (6, 6), (7, 7), (8, 8), (9, 9), (10, 10)])), + ('heart_test', models.FileField(upload_to='media/medicalrecords', verbose_name='Heart Test')), + ('ear_test', models.FileField(upload_to='media/medicalrecords', verbose_name='Test of the Ear')), + ('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='users.HealthTeam', verbose_name='Author')), + ('patient', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='users.Patient', verbose_name='Patient')), + ], + options={ + 'verbose_name': 'Medical Record Static Data', + }, + ), + ] diff --git a/drdown/users/migrations/0016_auto_20180507_0027.py b/drdown/users/migrations/0016_auto_20180506_2043.py similarity index 87% rename from drdown/users/migrations/0016_auto_20180507_0027.py rename to drdown/users/migrations/0016_auto_20180506_2043.py index 5b1c173d..03c0509c 100644 --- a/drdown/users/migrations/0016_auto_20180507_0027.py +++ b/drdown/users/migrations/0016_auto_20180506_2043.py @@ -1,4 +1,4 @@ -# Generated by Django 2.0.3 on 2018-05-07 00:27 +# Generated by Django 2.0.3 on 2018-05-06 20:43 from django.db import migrations From 759eabb635942ea581242d682365da62b5365ff3 Mon Sep 17 00:00:00 2001 From: Joberth Rogers Date: Wed, 9 May 2018 21:48:30 -0300 Subject: [PATCH 253/271] Correcting pep 8 form from forum Co-authored-by: Gabriela Medeiros --- drdown/forum/form/forum_forms.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drdown/forum/form/forum_forms.py b/drdown/forum/form/forum_forms.py index fc6e44e2..fac77a6e 100644 --- a/drdown/forum/form/forum_forms.py +++ b/drdown/forum/form/forum_forms.py @@ -3,6 +3,7 @@ from drdown.forum.models.model_post import Post from pagedown.widgets import PagedownWidget + class ComentaryForm(forms.ModelForm): message = forms.CharField(widget=PagedownWidget()) @@ -11,6 +12,7 @@ class Meta: model = Commentary fields = ["message"] + class PostForm(forms.ModelForm): message = forms.CharField(widget=PagedownWidget()) From 4a982f5a13d9d8ffa6dd234a8e3ed083fb3ba872 Mon Sep 17 00:00:00 2001 From: Elias Bernardo Date: Wed, 9 May 2018 21:50:07 -0300 Subject: [PATCH 254/271] Adjusting some information to the project context Removing unnecessary template information Changing "Static Data" and "Medical Records" to "Postnatal Data" and "Important Notes" Co-authored-by: Guilherme Guy --- .../locale/pt_BR/LC_MESSAGES/django.po | 127 ++++++------ .../medicalrecords/medicalrecord_list.html | 192 +++++++++--------- 2 files changed, 164 insertions(+), 155 deletions(-) diff --git a/drdown/medicalrecords/locale/pt_BR/LC_MESSAGES/django.po b/drdown/medicalrecords/locale/pt_BR/LC_MESSAGES/django.po index e6720aec..4fdb8443 100644 --- a/drdown/medicalrecords/locale/pt_BR/LC_MESSAGES/django.po +++ b/drdown/medicalrecords/locale/pt_BR/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-05-09 14:56+0000\n" +"POT-Creation-Date: 2018-05-10 00:44+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -22,7 +22,6 @@ msgstr "" #: drdown/medicalrecords/models/model_medical_record.py:41 #: drdown/medicalrecords/templates/medicalrecords/medicalrecord_confirm_delete.html:5 #: drdown/medicalrecords/templates/medicalrecords/medicalrecord_list.html:38 -#: drdown/medicalrecords/templates/medicalrecords/medicalrecord_list.html:126 msgid "Medical Record" msgstr "Prontuários" @@ -141,7 +140,6 @@ msgid "Message of medical records" msgstr "Mensagem do prontuário" #: drdown/medicalrecords/models/model_medical_record.py:42 -#: drdown/medicalrecords/templates/medicalrecords/medicalrecord_list.html:55 msgid "Medical Records" msgstr "Prontuários" @@ -269,13 +267,9 @@ msgid "Attachments" msgstr "Anexos" #: drdown/medicalrecords/templates/medicalrecords/medicalrecord_list.html:4 -msgid "Medical Records:" +msgid "Medical Record:" msgstr "Prontuários:" -#: drdown/medicalrecords/templates/medicalrecords/medicalrecord_list.html:38 -msgid "'s" -msgstr "do(a)" - #: drdown/medicalrecords/templates/medicalrecords/medicalrecord_list.html:42 msgid "Return" msgstr "Retornar" @@ -284,20 +278,20 @@ msgstr "Retornar" msgid "Patient data" msgstr "Dados do paciente" +#: drdown/medicalrecords/templates/medicalrecords/medicalrecord_list.html:55 +msgid "Important notes" +msgstr "Observações importantes" + #: drdown/medicalrecords/templates/medicalrecords/medicalrecord_list.html:59 #: drdown/medicalrecords/templates/medicalrecords/medicalrecord_list.html:188 -msgid "Static Data" -msgstr "Dados estáticos" +msgid "Postnatal data" +msgstr "Dados do pós-natal" #: drdown/medicalrecords/templates/medicalrecords/medicalrecord_list.html:63 #: drdown/medicalrecords/templates/medicalrecords/medicalrecord_list.html:275 msgid "Medical Exams" msgstr "Exames Médicos" -#: drdown/medicalrecords/templates/medicalrecords/medicalrecord_list.html:75 -msgid "data" -msgstr "dados" - #: drdown/medicalrecords/templates/medicalrecords/medicalrecord_list.html:92 msgid "Name: " msgstr "Nome: " @@ -314,6 +308,10 @@ msgstr "Data de nascimento: " msgid "cpf: " msgstr "CPF" +#: drdown/medicalrecords/templates/medicalrecords/medicalrecord_list.html:126 +msgid "Important Notes" +msgstr "Observações importantes" + #: drdown/medicalrecords/templates/medicalrecords/medicalrecord_list.html:130 #: drdown/medicalrecords/templates/medicalrecords/medicalrecord_list.html:196 #: drdown/medicalrecords/templates/medicalrecords/medicalrecord_list.html:281 @@ -325,8 +323,8 @@ msgid "Attachment:" msgstr "Anexos:" #: drdown/medicalrecords/templates/medicalrecords/medicalrecord_list.html:176 -msgid "There are no Medical Records for this patient." -msgstr "Não prontuário para este paciente." +msgid "There are no Important notes for this patient." +msgstr "Não há observações importantes para este paciente." #: drdown/medicalrecords/templates/medicalrecords/medicalrecord_list.html:194 #: drdown/medicalrecords/templates/medicalrecords/medicalrecord_list.html:283 @@ -350,8 +348,8 @@ msgid "Ear Test:" msgstr "Teste da orelinha:" #: drdown/medicalrecords/templates/medicalrecords/medicalrecord_list.html:258 -msgid "No static data for this patient." -msgstr "Não há dados estáticos para este paciente." +msgid "No postnatal data for this patient." +msgstr "Não há dados de pós-natal para este paciente." #: drdown/medicalrecords/templates/medicalrecords/medicalrecord_list.html:298 msgid "Structured Physical:" @@ -391,69 +389,80 @@ msgid "New Medicine" msgstr "Novo Remédio" #: drdown/medicalrecords/templates/medicalrecords/medicalrecord_static_data_form.html:16 +#, fuzzy +#| msgid "Static Data" msgid "Update Static Data" -msgstr "Atualizar dados estáticos" +msgstr "Dados estáticos" #: drdown/medicalrecords/tests/test_medical_records_view.py:136 msgid "This field is required." msgstr "Este campo é obrigatório." -msgid "search here!" -msgstr "busque aqui!" +#~ msgid "data" +#~ msgstr "dados" + +#~ msgid "Update Neonatal Data" +#~ msgstr "Atualizar dados neonatais" + +#~ msgid "'s" +#~ msgstr "do(a)" + +#~ msgid "search here!" +#~ msgstr "busque aqui!" -msgid "(Year)-(Month)-(Day)" -msgstr "(Ano)-(Mês)-(Dia)" +#~ msgid "(Year)-(Month)-(Day)" +#~ msgstr "(Ano)-(Mês)-(Dia)" -msgid "Search author!" -msgstr "Buscar autor!" +#~ msgid "Search author!" +#~ msgstr "Buscar autor!" -msgid "Search patient!" -msgstr "Buscar paciente!" +#~ msgid "Search patient!" +#~ msgstr "Buscar paciente!" -msgid "Search date!" -msgstr "Buscar data!" +#~ msgid "Search date!" +#~ msgstr "Buscar data!" -msgid "author" -msgstr "autor" +#~ msgid "author" +#~ msgstr "autor" -msgid "date" -msgstr "data" +#~ msgid "date" +#~ msgstr "data" -msgid "Search" -msgstr "Buscar" +#~ msgid "Search" +#~ msgstr "Buscar" -msgid "Anexo:" -msgstr "Anexo:" +#~ msgid "Anexo:" +#~ msgstr "Anexo:" -msgid "Advanced Search" -msgstr "Busca avançada" +#~ msgid "Advanced Search" +#~ msgstr "Busca avançada" -msgid "There are no Medical Records." -msgstr "Não há prontuários." +#~ msgid "There are no Medical Records." +#~ msgstr "Não há prontuários." -msgid "Search a Medical Records:" -msgstr "Buscar um prontuário:" +#~ msgid "Search a Medical Records:" +#~ msgstr "Buscar um prontuário:" -msgid "paciente" -msgstr "paciente" +#~ msgid "paciente" +#~ msgstr "paciente" -msgid "Previous" -msgstr "Anterior" +#~ msgid "Previous" +#~ msgstr "Anterior" -msgid "Next" -msgstr "Proximo" +#~ msgid "Next" +#~ msgstr "Proximo" -msgid "message" -msgstr "mensagem" +#~ msgid "message" +#~ msgstr "mensagem" -msgid "Documents" -msgstr "Documentos" +#~ msgid "Documents" +#~ msgstr "Documentos" -msgid "Create" -msgstr "Criar" +#~ msgid "Create" +#~ msgstr "Criar" -msgid "This user is not a patient!!!" -msgstr "Este usuário não é um paciente!" +#~ msgid "This user is not a patient!!!" +#~ msgstr "Este usuário não é um paciente!" -msgid "Message of post" -msgstr "Mensagem do post" +#~ msgid "Message of post" +#~ msgstr "Mensagem do post" diff --git a/drdown/medicalrecords/templates/medicalrecords/medicalrecord_list.html b/drdown/medicalrecords/templates/medicalrecords/medicalrecord_list.html index 84e82230..eade7f9e 100644 --- a/drdown/medicalrecords/templates/medicalrecords/medicalrecord_list.html +++ b/drdown/medicalrecords/templates/medicalrecords/medicalrecord_list.html @@ -1,7 +1,7 @@ {% extends "core/base.html" %} {% load markdown_deux_tags %} {% load static i18n %} -{% block title %}{% trans "Medical Records:" %} {{ related_patient.user.name }}{% endblock %} +{% block title %}{% trans "Medical Record:" %} {{ related_patient.user.name }}{% endblock %} {% block css %} {{block.super}} @@ -15,7 +15,7 @@ - + {%endblock script%} @@ -35,7 +35,7 @@
      -

      {% trans 'Medical Record' %} {% trans "'s"%} {{ related_patient.user.name }}

      +

      {{ related_patient.user.name }} {% trans 'Medical Record' %}

      @@ -50,13 +50,13 @@

      {% trans 'Medical Record' %} {% trans "'s"%} {{ relate - + - +

      - {% if medicalrecord.document %} + {% if medicalrecord.document %}
      -
      - +
      +

      {% trans 'Attachment:' %} {{ medicalrecord.document.name }}

      @@ -173,7 +173,7 @@

      {% trans 'Medical Record' %}

      {% empty %} -

      {% trans 'There are no Medical Records for this patient.'%}

      +

      {% trans 'There are no Important notes for this patient.'%}

      {% endfor %}
      @@ -183,13 +183,13 @@

      {% trans 'There are no Medical Records for this patient.'%}