-
Notifications
You must be signed in to change notification settings - Fork 343
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
Updated the max length of gender field to 35 in patient model #2720
Updated the max length of gender field to 35 in patient model #2720
Conversation
📝 WalkthroughWalkthroughA migration script has been introduced to modify the Changes
Poem
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? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 0
🔭 Outside diff range comments (1)
care/emr/models/patient.py (1)
Line range hint
39-39
: Fix the CharField definition for blood_group.Oh, looks like someone forgot that CharField needs a max_length parameter. This will raise a Django system check error.
Apply this fix:
- blood_group = models.CharField() + blood_group = models.CharField(max_length=5, default="")
🧹 Nitpick comments (2)
care/emr/models/patient.py (1)
15-15
: Consider adding validation for consistent data entry.While increasing the max_length is... nice, we might want to consider adding some basic validation or choices to ensure data consistency. You know, just to avoid having 35 different ways to spell the same gender.
Consider adding choices like this:
- gender = models.CharField(max_length=35, default="") + GENDER_CHOICES = [ + ("M", "Male"), + ("F", "Female"), + ("O", "Other"), + ("N", "Prefer not to say"), + ] + gender = models.CharField( + max_length=35, + default="", + choices=GENDER_CHOICES, + blank=True, + )care/emr/migrations/0002_alter_patient_gender.py (1)
9-17
: Maintain quote style consistency.I see we're mixing single and double quotes here. The static analysis tool is gently suggesting we stick to double quotes, as per the project's style guide.
Here's a quick fix:
- ('emr', '0001_initial'), + ("emr", "0001_initial"), - model_name='patient', - name='gender', - field=models.CharField(default='', max_length=35), + model_name="patient", + name="gender", + field=models.CharField(default="", max_length=35),🧰 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)
16-16: 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
📒 Files selected for processing (2)
care/emr/migrations/0002_alter_patient_gender.py
(1 hunks)care/emr/models/patient.py
(1 hunks)
🧰 Additional context used
🪛 Ruff (0.8.2)
care/emr/migrations/0002_alter_patient_gender.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)
16-16: Single quotes found but double quotes preferred
Replace single quotes with double quotes
(Q000)
Proposed Changes
Associated Issue
Merge Checklist
/docs
Only PR's with test cases included and passing lint and test pipelines will be reviewed
@ohcnetwork/care-backend-maintainers @ohcnetwork/care-backend-admins
Summary by CodeRabbit