Skip to content
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

Remove COVID-specific fields from Patient model and serializers #2671

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from

Conversation

areebahmeddd
Copy link
Contributor

@areebahmeddd areebahmeddd commented Dec 21, 2024

Proposed Changes

  • Removed all COVID-specific fields from the PatientRegistration model in care/facility/models/patient.py.
  • Updated the PatientDetailSerializer in care/facility/api/serializers/patient.py to exclude the removed fields.
  • Removed references to COVID-specific fields in care/facility/api/viewsets/patient.py.
  • Updated tests in care/facility/tests/test_patient.py to remove tests that referenced the removed fields.

Associated Issue

Merge Checklist

  • Tests added/fixed
  • Update docs in path/docs
  • Linting Complete
  • Any other necessary step

@ohcnetwork/care-backend-maintainers @ohcnetwork/care-backend-admins

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features

    • Enhanced validation for bed and action fields in daily rounds and patient consultations.
    • Streamlined patient filtering by removing deprecated COVID-related filters.
  • Bug Fixes

    • Improved authorization checks for creating daily rounds and consultations.
  • Documentation

    • Removed references to deprecated COVID-related fields and categories across various models and serializers.
  • Refactor

    • Simplified data models by eliminating unused fields related to COVID-19, including several patient registration and consultation fields.
    • Updated facility types and room types to reflect current requirements.
  • Tests

    • Removed tests related to the deprecated covin_id parameter.

@areebahmeddd areebahmeddd requested a review from a team as a code owner December 21, 2024 20:42
Copy link

coderabbitai bot commented Dec 21, 2024

📝 Walkthrough
📝 Walkthrough

Walkthrough

The changes represent a comprehensive cleanup of COVID-19 related fields and categories across multiple files in the care facility management system. The modifications involve removing deprecated COVID-specific attributes, streamlining data models, and simplifying serializers and filtering mechanisms. This systematic removal suggests a transition away from pandemic-specific tracking, focusing on more generalized patient and facility management functionality.

Changes

File Change Summary
care/facility/models/... Removed COVID-related room types, facility types, patient registration fields, and category choices
care/facility/api/serializers/... Eliminated deprecated_covid_category from serializers, refined validation logic
care/facility/api/viewsets/patient.py Removed deprecated_covid_category and covin_id filters
care/facility/tests/test_patient_api.py Deleted test_invalid_covin_id_param test method

Poem

Farewell, COVID categories, your time has passed,
Streamlined code now moves so fast! 🏥
Deprecated fields, now swept away,
A cleaner system sees the light of day 🌟
Code evolution, silent and bright ✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6ccd830 and 8f74e81.

📒 Files selected for processing (1)
  • care/utils/tests/test_utils.py (0 hunks)
💤 Files with no reviewable changes (1)
  • care/utils/tests/test_utils.py

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
care/facility/models/patient_base.py (1)

62-62: Maybe consider adding a general infectious disease category?

While removing COVID-specific fields is the goal, the DISEASE_CHOICES_MAP lacks any categories for infectious diseases. This might limit the system's ability to handle future disease outbreaks or epidemics.

Consider adding a general "Infectious Disease" category to DISEASE_CHOICES_MAP, which could be used for tracking any future infectious diseases without requiring model changes.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fbf76d7 and 44b5f0d.

📒 Files selected for processing (9)
  • care/facility/api/serializers/daily_round.py (0 hunks)
  • care/facility/api/serializers/patient_consultation.py (0 hunks)
  • care/facility/api/viewsets/patient.py (0 hunks)
  • care/facility/models/daily_round.py (0 hunks)
  • care/facility/models/facility.py (0 hunks)
  • care/facility/models/patient.py (0 hunks)
  • care/facility/models/patient_base.py (1 hunks)
  • care/facility/models/patient_consultation.py (0 hunks)
  • care/facility/tests/test_patient_api.py (0 hunks)
💤 Files with no reviewable changes (8)
  • care/facility/tests/test_patient_api.py
  • care/facility/api/viewsets/patient.py
  • care/facility/models/daily_round.py
  • care/facility/models/patient.py
  • care/facility/models/facility.py
  • care/facility/models/patient_consultation.py
  • care/facility/api/serializers/daily_round.py
  • care/facility/api/serializers/patient_consultation.py
🔇 Additional comments (2)
care/facility/models/patient_base.py (2)

62-62: The list comprehension looks fine, I suppose...

The transformation from DISEASE_CHOICES_MAP to DISEASE_CHOICES maintains the expected format for Django choice fields.


Line range hint 1-150: Verify that removed COVID choices aren't referenced elsewhere

Since COVID_CATEGORY_CHOICES and REVERSE_COVID_CATEGORY_CHOICES have been removed, we should ensure no other code still depends on them.

✅ Verification successful

Well, it seems the COVID choices removal was actually quite clean

Our thorough search across the codebase shows no remaining references to the removed COVID_CATEGORY_CHOICES or REVERSE_COVID_CATEGORY_CHOICES constants. We've checked for:

  • Direct references to the removed constants
  • Any COVID-related choices or constants
  • Model fields that might have been using these choices
  • Recent changes in the file history

I suppose someone did their homework before removing these constants. How refreshing.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for any remaining references to the removed COVID choices
echo "Searching for references to removed COVID category choices..."
rg -i "COVID_CATEGORY_CHOICES|REVERSE_COVID_CATEGORY_CHOICES" 

# Search for any COVID-related imports from this module
echo "Searching for imports of removed constants..."
ast-grep --pattern 'from care.facility.models.patient_base import $$$COVID$$$'

Length of output: 378


Script:

#!/bin/bash
# Let's search more broadly for any COVID-related constants that might have been renamed or modified
echo "Searching for any COVID-related constants or choices..."
rg -i "covid.*choices" -A 2 -B 2

# Check for any historical references in git history
echo "Checking recent git history for these constants..."
git log --oneline -n 5 -- care/facility/models/patient_base.py

# Let's also check for any COVID-related model fields that might use these choices
echo "Searching for model fields possibly using these choices..."
ast-grep --pattern 'models.CharField($$$COVID$$$)'
ast-grep --pattern 'models.IntegerField($$$COVID$$$)'

Length of output: 502

@areebahmeddd
Copy link
Contributor Author

Performed a full search in the codebase to identify and remove all COVID-specific fields and references using the terms:

covid
covid-19
covid_19
covid_id
covid-id
COVID_CATEGORY_CHOICES

There were some mentions of the word "corona" should they be removed as well?

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (2)
care/facility/migrations/0469_remove_dailyround_deprecated_covid_category_and_more.py (2)

1-123: Consider splitting this migration for safer deployment.

This migration makes quite a few changes at once. While it's technically fine, splitting it into separate migrations (one for removals and one for alterations) might make it easier to rollback if needed... but I suppose that's just me being extra careful. 🤷

🧰 Tools
🪛 Ruff (0.8.2)

9-9: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


9-9: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


14-14: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


15-15: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


18-18: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


19-19: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


22-22: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


23-23: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


26-26: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


27-27: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


30-30: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


31-31: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


34-34: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


35-35: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


38-38: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


39-39: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


42-42: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


43-43: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


46-46: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


47-47: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


50-50: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


51-51: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


54-54: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


55-55: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


58-58: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


59-59: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


62-62: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


63-63: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


66-66: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


67-67: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


70-70: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


71-71: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


74-74: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


75-75: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


78-78: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


79-79: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


82-82: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


83-83: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


86-86: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


87-87: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


90-90: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


91-91: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


94-94: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


95-95: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


96-96: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


96-96: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


96-96: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


96-96: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


96-96: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


96-96: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


96-96: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


96-96: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


96-96: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


96-96: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


96-96: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


96-96: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


96-96: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


96-96: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


96-96: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


96-96: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


96-96: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


96-96: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


96-96: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


96-96: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


96-96: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


96-96: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


96-96: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


96-96: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


99-99: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


100-100: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


101-101: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


101-101: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


104-104: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


105-105: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


106-106: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


106-106: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


106-106: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


106-106: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


106-106: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


106-106: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


106-106: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


106-106: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


109-109: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


110-110: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


111-111: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


111-111: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


114-114: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


115-115: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


116-116: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


116-116: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


116-116: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


116-116: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


116-116: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


116-116: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


116-116: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


116-116: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


116-116: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


116-116: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


116-116: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


119-119: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


120-120: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


121-121: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


121-121: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


121-121: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


121-121: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


121-121: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


121-121: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


121-121: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


121-121: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


121-121: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


121-121: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


121-121: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


121-121: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


121-121: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


121-121: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


121-121: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


121-121: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


121-121: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


121-121: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


121-121: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


121-121: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


121-121: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


121-121: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


121-121: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


121-121: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


1-123: Those single quotes are looking a bit lonely.

The static analysis tool suggests using double quotes instead of single quotes. While this is a generated file and it doesn't really matter, consistency is... nice?

🧰 Tools
🪛 Ruff (0.8.2)

9-9: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


9-9: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


14-14: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


15-15: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


18-18: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


19-19: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


22-22: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


23-23: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


26-26: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


27-27: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


30-30: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


31-31: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


34-34: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


35-35: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


38-38: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


39-39: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


42-42: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


43-43: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


46-46: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


47-47: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


50-50: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


51-51: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


54-54: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


55-55: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


58-58: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


59-59: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


62-62: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


63-63: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


66-66: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


67-67: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


70-70: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


71-71: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


74-74: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


75-75: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


78-78: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


79-79: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


82-82: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


83-83: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


86-86: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


87-87: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


90-90: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


91-91: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


94-94: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


95-95: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


96-96: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


96-96: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


96-96: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


96-96: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


96-96: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


96-96: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


96-96: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


96-96: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


96-96: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


96-96: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


96-96: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


96-96: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


96-96: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


96-96: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


96-96: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


96-96: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


96-96: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


96-96: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


96-96: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


96-96: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


96-96: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


96-96: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


96-96: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


96-96: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


99-99: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


100-100: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


101-101: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


101-101: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


104-104: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


105-105: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


106-106: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


106-106: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


106-106: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


106-106: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


106-106: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


106-106: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


106-106: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


106-106: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


109-109: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


110-110: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


111-111: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


111-111: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


114-114: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


115-115: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


116-116: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


116-116: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


116-116: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


116-116: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


116-116: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


116-116: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


116-116: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


116-116: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


116-116: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


116-116: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


116-116: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


119-119: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


120-120: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


121-121: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


121-121: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


121-121: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


121-121: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


121-121: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


121-121: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


121-121: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


121-121: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


121-121: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


121-121: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


121-121: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


121-121: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


121-121: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


121-121: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


121-121: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


121-121: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


121-121: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


121-121: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


121-121: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


121-121: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


121-121: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


121-121: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


121-121: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


121-121: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 44b5f0d and 6ccd830.

📒 Files selected for processing (1)
  • care/facility/migrations/0469_remove_dailyround_deprecated_covid_category_and_more.py (1 hunks)
🧰 Additional context used
🪛 Ruff (0.8.2)
care/facility/migrations/0469_remove_dailyround_deprecated_covid_category_and_more.py

9-9: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


9-9: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


14-14: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


15-15: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


18-18: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


19-19: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


22-22: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


23-23: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


26-26: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


27-27: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


30-30: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


31-31: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


34-34: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


35-35: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


38-38: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


39-39: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


42-42: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


43-43: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


46-46: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


47-47: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


50-50: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


51-51: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


54-54: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


55-55: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


58-58: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


59-59: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


62-62: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


63-63: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


66-66: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


67-67: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


70-70: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


71-71: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


74-74: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


75-75: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


78-78: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


79-79: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


82-82: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


83-83: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


86-86: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


87-87: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


90-90: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


91-91: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


94-94: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


95-95: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


96-96: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


96-96: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


96-96: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


96-96: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


96-96: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


96-96: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


96-96: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


96-96: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


96-96: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


96-96: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


96-96: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


96-96: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


96-96: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


96-96: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


96-96: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


96-96: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


96-96: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


96-96: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


96-96: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


96-96: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


96-96: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


96-96: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


96-96: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


96-96: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


99-99: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


100-100: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


101-101: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


101-101: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


104-104: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


105-105: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


106-106: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


106-106: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


106-106: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


106-106: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


106-106: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


106-106: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


106-106: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


106-106: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


109-109: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


110-110: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


111-111: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


111-111: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


114-114: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


115-115: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


116-116: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


116-116: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


116-116: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


116-116: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


116-116: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


116-116: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


116-116: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


116-116: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


116-116: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


116-116: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


116-116: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


119-119: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


120-120: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


121-121: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


121-121: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


121-121: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


121-121: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


121-121: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


121-121: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


121-121: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


121-121: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


121-121: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


121-121: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


121-121: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


121-121: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


121-121: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


121-121: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


121-121: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


121-121: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


121-121: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


121-121: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


121-121: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


121-121: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


121-121: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


121-121: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


121-121: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


121-121: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)

🔇 Additional comments (3)
care/facility/migrations/0469_remove_dailyround_deprecated_covid_category_and_more.py (3)

8-10: LGTM! Migration dependency looks correct.

The migration properly depends on the previous migration '0468_alter_facilitypatientstatshistory_unique_together_and_more'.

🧰 Tools
🪛 Ruff (0.8.2)

9-9: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


9-9: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


13-92: Consider data preservation before removing fields.

While removing COVID-specific fields aligns with the PR objectives, it might be worth considering if any historical data needs to be preserved or archived before removal. You know, just in case someone asks for it later... 😏

Let's check if there's any valuable data in these fields:

✅ Verification successful

Field removal appears safe, though I suppose a heads-up would've been nice

The fields being removed seem to be already phased out from active use. The only remaining references are in:

  • Filter definitions that will be automatically cleaned up
  • Test data that's using these fields with default/empty values
  • No actual data processing or reporting logic depends on these fields

While it would have been slightly more considerate to announce the deprecation of these fields beforehand, their removal shouldn't cause any data preservation concerns. The migration can proceed as planned... not that anyone asked for my blessing. 😌

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check for non-null values in COVID-related fields before removal
ast-grep --pattern 'class PatientRegistration(models.Model):
  $$$
  $field: models.$type = $$$
  $$$
}'

# Check for any references to these fields in reports or analytics
rg -l "covin_id|is_vaccinated|date_declared_positive" --type py

Length of output: 598


Script:

#!/bin/bash
# Let's check the actual model definitions and their usage
rg -A 5 "contact_with_confirmed_carrier|contact_with_suspected_carrier|covin_id|date_declared_positive|estimated_contact_date|has_SARI|is_declared_positive|is_vaccinated|last_vaccinated_date" care/facility/models/patient.py

# Check if there are any data export or reporting functions using these fields
rg -A 5 "contact_with_confirmed_carrier|contact_with_suspected_carrier|covin_id|date_declared_positive|estimated_contact_date|has_SARI|is_declared_positive|is_vaccinated|last_vaccinated_date" care/facility/api/viewsets/patient.py

# Check if these fields are used in any serializers
rg -A 5 "contact_with_confirmed_carrier|contact_with_suspected_carrier|covin_id|date_declared_positive|estimated_contact_date|has_SARI|is_declared_positive|is_vaccinated|last_vaccinated_date" care/facility/api/serializers/patient.py

# Look for any test cases that might indicate data usage
rg -A 5 "contact_with_confirmed_carrier|contact_with_suspected_carrier|covin_id|date_declared_positive|estimated_contact_date|has_SARI|is_declared_positive|is_vaccinated|last_vaccinated_date" care/facility/models/tests/test_patient.py

Length of output: 3371

🧰 Tools
🪛 Ruff (0.8.2)

14-14: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


15-15: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


18-18: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


19-19: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


22-22: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


23-23: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


26-26: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


27-27: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


30-30: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


31-31: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


34-34: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


35-35: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


38-38: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


39-39: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


42-42: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


43-43: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


46-46: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


47-47: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


50-50: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


51-51: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


54-54: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


55-55: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


58-58: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


59-59: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


62-62: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


63-63: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


66-66: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


67-67: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


70-70: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


71-71: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


74-74: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


75-75: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


78-78: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


79-79: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


82-82: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


83-83: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


86-86: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


87-87: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


90-90: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


91-91: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


93-122: Verify the completeness of facility type choices.

The changes to facility_type and other choice fields look comprehensive, but it would be nice if we could be absolutely certain we haven't missed any values that might be in use.

Let's verify the choices:

✅ Verification successful

All facility type values appear to be accounted for... how thoughtful of you to ask.

After a rather thorough investigation of the codebase, I can confirm that the facility type choices in the migration match exactly with the canonical FACILITY_TYPES list defined in care/facility/models/facility.py. The values are consistently used across the codebase, and even the old-to-new mapping tables in previous migrations don't reveal any sneaky forgotten values that might cause issues.

I suppose I should mention that the migration handles all currently defined facility types:

  • Educational institutions (1)
  • Healthcare facilities (2, 800-870)
  • Labs (9, 10)
  • Treatment centers (1100-1200)
  • Administrative facilities (1500-1600)
  • And other miscellaneous types (3-7)
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check for any facility types in use that might not be in the new choices
ast-grep --pattern 'facility_type = $value' 

# Look for any hardcoded facility type values in views or tests
rg "facility_type.*=.*\d+" --type py

Length of output: 84


Script:

#!/bin/bash
# Let's try a more comprehensive search for facility type values
# Search for facility type in models and migrations
rg "facility_type.*=.*\[.*\]" --type py -A 5

# Search for any direct assignments or comparisons with facility type values
rg "facility_type\s*[=!<>]=\s*\d+" --type py

# Look for any constants or enums related to facility types
rg "FACILITY_TYPE.*=.*\d+" --type py

# Check for any facility type references in test data
rg "facility_type.*:" --type py --glob "*test*.py" -A 2

Length of output: 5320


Script:

#!/bin/bash
# Let's check the models.py for the original facility type definitions
rg "FACILITY_TYPES|facility_type.*choices" --type py -B 2 -A 2

# And let's look for any facility type mappings or constants
fd -e py -x cat {} | grep -A 10 "FACILITY_TYPE.*=.*{" 

# Just to be thorough, check for any enum definitions
ast-grep --pattern 'class $name(Enum):
  $$$
  facility_type
  $$$
'

Length of output: 5944

🧰 Tools
🪛 Ruff (0.8.2)

94-94: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


95-95: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


96-96: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


96-96: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


96-96: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


96-96: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


96-96: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


96-96: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


96-96: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


96-96: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


96-96: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


96-96: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


96-96: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


96-96: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


96-96: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


96-96: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


96-96: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


96-96: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


96-96: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


96-96: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


96-96: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


96-96: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


96-96: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


96-96: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


96-96: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


96-96: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


99-99: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


100-100: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


101-101: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


101-101: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


104-104: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


105-105: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


106-106: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


106-106: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


106-106: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


106-106: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


106-106: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


106-106: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


106-106: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


106-106: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


109-109: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


110-110: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


111-111: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


111-111: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


114-114: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


115-115: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


116-116: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


116-116: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


116-116: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


116-116: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


116-116: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


116-116: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


116-116: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


116-116: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


116-116: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


116-116: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


116-116: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


119-119: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


120-120: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


121-121: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


121-121: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


121-121: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


121-121: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


121-121: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


121-121: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


121-121: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


121-121: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


121-121: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


121-121: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


121-121: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


121-121: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


121-121: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


121-121: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


121-121: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


121-121: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


121-121: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


121-121: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


121-121: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


121-121: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


121-121: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


121-121: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


121-121: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)


121-121: Single quotes found but double quotes preferred

Replace single quotes with double quotes

(Q000)

@areebahmeddd
Copy link
Contributor Author

Getting some test failures upon doing make test, can anyone help me understand? (tried using llm but no success)

docker compose exec backend bash -c "python manage.py test --keepdb --parallel --shuffle"
Using shuffle seed: 4296328100 (generated)
Found 427 test(s).
Using existing test database for alias 'default'...
Traceback (most recent call last):
  File "/app/manage.py", line 34, in <module>
    main()
    ~~~~^^
  File "/app/manage.py", line 30, in main
    execute_from_command_line(sys.argv)
    ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^
  File "/.venv/lib/python3.13/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line
    utility.execute()
    ~~~~~~~~~~~~~~~^^
  File "/.venv/lib/python3.13/site-packages/django/core/management/__init__.py", line 436, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
  File "/.venv/lib/python3.13/site-packages/django/core/management/commands/test.py", line 24, in run_from_argv
    super().run_from_argv(argv)
    ~~~~~~~~~~~~~~~~~~~~~^^^^^^
  File "/.venv/lib/python3.13/site-packages/django/core/management/base.py", line 413, in run_from_argv
    self.execute(*args, **cmd_options)
    ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
  File "/.venv/lib/python3.13/site-packages/django/core/management/base.py", line 459, in execute
    output = self.handle(*args, **options)
  File "/.venv/lib/python3.13/site-packages/django/core/management/commands/test.py", line 63, in handle
    failures = test_runner.run_tests(test_labels)
  File "/.venv/lib/python3.13/site-packages/django/test/runner.py", line 1066, in run_tests
    old_config = self.setup_databases(
        aliases=databases,
        serialized_aliases=suite.serialized_aliases,
    )
  File "/.venv/lib/python3.13/site-packages/django/test/runner.py", line 964, in setup_databases
    return _setup_databases(
        self.verbosity,
    ...<5 lines>...
        **kwargs,
    )
  File "/.venv/lib/python3.13/site-packages/django/test/utils.py", line 206, in setup_databases
    connection.creation.create_test_db(
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
        verbosity=verbosity,
        ^^^^^^^^^^^^^^^^^^^^
    ...<2 lines>...
        serialize=serialize_alias,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/.venv/lib/python3.13/site-packages/django/db/backends/base/creation.py", line 78, in create_test_db
    call_command(
    ~~~~~~~~~~~~^
        "migrate",
        ^^^^^^^^^^
    ...<3 lines>...
        run_syncdb=True,
        ^^^^^^^^^^^^^^^^
    )
    ^
  File "/.venv/lib/python3.13/site-packages/django/core/management/__init__.py", line 194, in call_command
    return command.execute(*args, **defaults)
           ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^
  File "/.venv/lib/python3.13/site-packages/django/core/management/base.py", line 459, in execute
    output = self.handle(*args, **options)
  File "/.venv/lib/python3.13/site-packages/django/core/management/base.py", line 107, in wrapper
    res = handle_func(*args, **kwargs)
  File "/.venv/lib/python3.13/site-packages/django/core/management/commands/migrate.py", line 303, in handle
    pre_migrate_apps = pre_migrate_state.apps
                       ^^^^^^^^^^^^^^^^^^^^^^
  File "/.venv/lib/python3.13/site-packages/django/utils/functional.py", line 47, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
                                         ~~~~~~~~~^^^^^^^^^^
  File "/.venv/lib/python3.13/site-packages/django/db/migrations/state.py", line 565, in apps
    return StateApps(self.real_apps, self.models)
  File "/.venv/lib/python3.13/site-packages/django/db/migrations/state.py", line 636, in __init__
    raise ValueError("\n".join(error.msg for error in errors))
ValueError: The field users.User.asset was declared with a lazy reference to 'facility.asset', but app 'facility' isn't installed.
The field users.User.home_facility was declared with a lazy reference to 'facility.facility', but app 'facility' isn't installed.
make: *** [Makefile:53: test] Error 1

@DraKen0009
Copy link
Contributor

@areebahmeddd use make test command without --keepdb

docker compose exec backend bash -c "python manage.py test --parallel --shuffle"

After creating a migration to db one is suppose to destroy the existing test db for the first time after creating migrations.

OR you can simply use - make teardown -> make up -> make test.

Try any of the above and see if the issue is resolved or not

@DraKen0009
Copy link
Contributor

Also connect the PR to the issue by prepending Fixes {issue link} instead of Issue {issue link}

@areebahmeddd
Copy link
Contributor Author

Fixed the error! It seems there were few unused fields that were going to PatientRegistration model.
Thanks @DraKen0009

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove Covid specific fields from patient
2 participants