-
Notifications
You must be signed in to change notification settings - Fork 0
2 #14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
2 #14
Conversation
Organized sections and added more file patterns to ignore.
Implementa cliente desktop para Windows com interface de automação médica, reconhecimento de voz e navegação por categorias.
Implement Medical Automation Server with SQLite and HTTP API
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: alebmorais <196795598+alebmorais@users.noreply.github.com>
Summary of ChangesHello @alebmorais, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces significant enhancements to the medical automation system, primarily by modernizing the Windows desktop client's user interface through Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces a significant improvement by integrating pywebview to render the web UI directly in the Windows client, with a fallback to the legacy Tkinter UI. The server code is also refactored for better robustness, including automatic database discovery and creation. The documentation and .gitignore have been updated accordingly.
My review has identified a critical syntax error in the new ClienteWindows2.py file that will prevent it from running. Additionally, there are some data consistency and style issues in the SQL_2 file that should be addressed to ensure predictable behavior and maintainability. Overall, these are great changes that modernize the application.
| except Exception as e: | ||
| except Exception as e: | ||
| print(f"Erro inesperado ao iniciar cliente: {type(e).__name__} - {e}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file has a duplicated except Exception as e: clause, which is a Python syntax error and will cause the script to fail at startup. Please remove the redundant line and fix the block.
| except Exception as e: | |
| except Exception as e: | |
| print(f"Erro inesperado ao iniciar cliente: {type(e).__name__} - {e}") | |
| except Exception as e: | |
| print(f"Erro inesperado ao iniciar cliente: {type(e).__name__} - {e}") |
| ('Questionário cefaleia', 'Por favor responder os seguintes questionamentos:\n\n- quando iniciou a cefaleia?\n- no inicio da dor, em quanto tempo ela atingiu o pico maximo?\n- se caracteriza por ser latejante? em aperto? choque? facada?\n- a dor de cabeça é inedita? mudou o padrão?\n- tem irradiação?\n- qual intensidade de 0 a 10?\n- tem fatores desencadeantes?\n- piora com luz?barulho? aos esforços?\n- tem nausea ou vomito associado?\n- tem sintomas visais ou dormencias asociados?\n- teve febre ou outro sintoma sistemico?\n- sofreu tce recente?\n- tem comorbidades?\n-tem história de cefaleia prévia?', 'Atendimento Gerais', 'Cefaleia', 3), | ||
| ('Exame neurológico', 'Como é o exame neurológico básico?\n- glasgow\n- alteração de linguagem?\n- confusão mental?\n- pupilas?\n- desvio ocular ou estrabismo novo?\n- nistagmo?\n- desvio de rima labial?\n- assimetria de força em algum lado do corpo? Se sim qual e em qual grau?\n-Sensibilidade para dor e toque?\n-Sensibilidade profunda? (posicional, palestésica)\n-reflexos?\n-Romberg?\n- ataxia?\n-está deambulando, mesmo que com ajuda ? Como é a marcha?\n- sinais de irritação meníngea?', 'Atendimento Gerais', 'Cefaleia', 4), | ||
| ('Exame imagem', 'Por favor, paciente já realizou exame de imagem? Se sim, qual resultado?', 'Atendimento Gerais', 'Cefaleia', 5), | ||
| ('Sinais de alarme', 'Sintomas sistêmicos, incluindo febre\nHistória de Neoplasia \nDéficit ou disfunção neurológica (incluindo diminuição da consciência)\nO início da dor de cabeça é repentino ou abrupto\nIdade avançada (após 50 anos)\nMudança de padrão ou início recente de dor de cabeça\nDor de cabeça posicional\nPrecipitado por espirros, tosse ou exercício\nPapiledema\nCefaleia progressiva e apresentações atípicas\nGravidez ou puerpério\nDor ocular com características autônomicas\nInício pós-traumático da dor de cabeça\nPatologia do sistema imunológico, como HIV\nUso excessivo de analgésico ou novo medicamento no início da dor de cabeça', 'Atendimentos Gerais', 'Cefaleia', 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are a couple of data consistency issues with this new entry:
- The category is specified as
'Atendimentos Gerais'(plural), while other entries for the same theme use'Atendimento Gerais'(singular). This will result in a new, separate category being created, which is likely not the intention. Please change it to'Atendimento Gerais'. - The
ordemis set to1, which conflicts with the existing 'Analgesia feita' entry in the same subcategory ('Cefaleia'). Having duplicateordemvalues can lead to non-deterministic ordering of items in the UI. Please assign a uniqueordemvalue for this new entry within its subcategory (e.g.,6).
| ('TeleAVC dados projeto', 'Por gentileza, essas informações são importantes para a coleta de dados do projeto. Quando possível, após a tomada de conduta de emergência, compartilhar, pode ser escrito, por áudio ou ligação:\n-Número do CPF ou RG do paciente:\n-Origem do paciente (demanda espontânea, SAMU, UPA…):\n-Nome do contato de emergência/familiar responsável:\n-Telefone do contato de emergência/familiar responsável:\n-O paciente ou responsável legal consentiu no compartilhamento de seus dados pessoais e telefone para contato em 90 dias após esse atendimento, pela equipe do Projeto TeleAVC?\n-Data e horário da chegada do paciente no hospital satélite:\n-Data e horário do início do atendimento médico no hospital satélite:\n-Desfecho do caso (por exemplo, horário do bolus do trombolítico, se indicado)', 'Atendimentos TeleAVC', 'Atendimento Inicial', 2), | ||
| ('TeleAVC validação final', 'Pessoal, abaixo deixo alguns dados que, como mencionei com vocês, serão importantes para validação do atendimento e projeto, quando possível, me envie por gentileza.Pode ser escrito, por áudio ou ligação: Obrigada e estou a disposição!\n-Número do CPF ou RG do paciente:\n-Origem do paciente (demanda espontânea, SAMU, UPA…):\n-Nome do contato de emergência/familiar responsável:\n-Telefone do contato de emergência/familiar responsável:\n-O paciente ou responsável legal consentiu no compartilhamento de seus dados pessoais e telefone para contato em 90 dias após esse atendimento, pela equipe do Projeto TeleAVC?\n-Data e horário da chegada do paciente no hospital satélite:\n-Data e horário do início do atendimento médico no hospital satélite:\n-Desfecho do caso: Internação e manejo de AVCi conservador', 'Atendimentos TeleAVC', 'Atendimento Inicial', 3); | ||
|
|
||
| INSERT INTO frases (nome, conteudo, categoria_principal, subcategoria, ordem) VALUES |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For consistency with the existing data and for minor performance benefits, it's better to use a single INSERT statement with multiple value tuples, rather than multiple INSERT statements. The inserts at the top of the file follow this pattern. Please consider grouping the new VALUES clauses from this and subsequent INSERT statements (e.g., on lines 97 and 113) into a single one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting
| return response.status_code < 500 | ||
| with urllib_request.urlopen(self.pi_url, timeout=timeout) as response: | ||
| return 200 <= getattr(response, "status", 200) < 500 | ||
| except (requests.exceptions.RequestException, urllib_request.URLError): | ||
| return False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Guard optional requests module in exception tuple
is_pi_reachable is designed to work even when the requests package is missing, but the except clause still references requests.exceptions.RequestException. On systems without the dependency, requests is set to None and importing the module raises AttributeError while building the exception tuple, preventing the client from starting at all. The handler should only mention requests.exceptions when the library is available or catch a broader exception when using urllib.
Useful? React with 👍 / 👎.
| response = requests.get(self.pi_url, timeout=timeout) | ||
| return response.status_code < 500 | ||
| with urllib_request.urlopen(self.pi_url, timeout=timeout) as response: | ||
| return 200 <= getattr(response, "status", 200) < 500 | ||
| except (requests.exceptions.RequestException, urllib_request.URLError): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid referencing missing requests dependency in fallback client
ClienteWindows2 repeats the same pattern: the except (requests.exceptions.RequestException, ...) clause is evaluated even when REQUESTS_AVAILABLE is false and requests is set to None, causing an immediate crash with AttributeError instead of falling back to the urllib branch. Guard the reference or build the exception tuple dynamically so that the script runs without the optional dependency.
Useful? React with 👍 / 👎.
No description provided.