-
Notifications
You must be signed in to change notification settings - Fork 297
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
Added constraints to models to not allot multiple patients the same bed #1038
Conversation
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
@@ -65,3 +65,10 @@ class ConsultationBed(BaseModel): | |||
start_date = models.DateTimeField(null=False, blank=False) | |||
end_date = models.DateTimeField(null=True, blank=True, default=None) | |||
meta = JSONField(default=dict, blank=True) | |||
|
|||
class Meta: | |||
constraints = [ |
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.
Let's take a case where a patient starts off in a regular bed, moves to an ICU, and then moves back to the normal bed, this is practically possible right?
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.
The correct solution should check if there is any patient currently using the bed.
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.
So, do you suggest I modify the api route when assigning patients to bed along with the added constraints?
@vigneshhari I tried adding a patient to the same bed, except we don't get that bed listed when we're trying to add another patient. |
Already Resolved in #854 cc: @vigneshhari |
Proposed Changes
Associated Issue
Issue #898