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

Feature: Add doctor availability date and time #6968

Closed
7 tasks
nihal467 opened this issue Jan 3, 2024 · 10 comments
Closed
7 tasks

Feature: Add doctor availability date and time #6968

nihal467 opened this issue Jan 3, 2024 · 10 comments

Comments

@nihal467
Copy link
Member

nihal467 commented Jan 3, 2024

Is your feature request related to a problem? Please describe.

Currently we are not recording doctors availability in a facility based on a date and time

Describe the solution you'd like

  • Add a feature to mark the availability of a doctor
  • Should support multiple time slots in a day, and multiple days of the week.
  • Should disallow creating conflicting/overlapping entires.
  • The availability record should be optionally linked to a location that belongs to their home facility.
  • A user should be able to set or edit only their availability.
  • DistrictAdmin and above should be able to set or edit all doctors' availability.
  • The option should support marking multiple days and times, or all day.

For example, if a user is available on Monday from 2:00 to 4:00 PM, and Tuesday from 3:00 to 4:00 PM, we should be able to mark it or specify day availability without a specific time. Alternatively, there can be an option to specify availability all day in case the user does not want to mention specific times or days of availability.

@rithviknishad
Copy link
Member

rithviknishad commented Jan 3, 2024

@gigincg / @aparnacoronasafe

  1. Should the doctor availability record be optionally or mandatorily related to a Facility or a Location?

  2. If yes (1), should they be allowed to be available in multiple facility/locations at the same time?

@rithviknishad rithviknishad moved this from Triage to Up Next in Care Jan 3, 2024
@rithviknishad rithviknishad moved this from Up Next to Review required in Care Jan 3, 2024
@rithviknishad
Copy link
Member

Dropping a mock UI here for suggestions

image

@rithviknishad
Copy link
Member

rithviknishad commented Jan 3, 2024

Dropping a draft model schema here:

UserAvailabilityModel:
  # relations
  user: ForeignKey(UserModel.id)
  location: ForeignKey(AssetLocationModel.id, null=True) # Any one of location or facility or none in final
  facility: ForeignKey(Facility.id, null=True) # Any one of location or facility or none in final

  # fields
  day_of_week: SmallIntegerField(choices=[sun, mon, tue, wed, thu, fri, sat], db_index=True)
  start_time: TimeField(db_index=True)
  end_time: TimeField(db_index=True)

  # meta fields
  removed_at: DateTimeField(auto_delete_now=True, null=True)

Indexes on fields day_of_week, start_time, end_time fields in addition to user, location, facility foreign keys.

@shramanpaul
Copy link
Contributor

shramanpaul commented Jan 4, 2024

@rithviknishad I also want to work on this issue.

@rithviknishad
Copy link
Member

Hey @shramanpaul
As you can see this issue is already assigned and requires changes in both backend and frontend.

Feel free to pickup other unassigned issues: https://github.com/coronasafe/care_fe/issues?q=is%3Aissue+is%3Aopen+no%3Aassignee

@shramanpaul
Copy link
Contributor

Ok @rithviknishad

@rithviknishad
Copy link
Member

rithviknishad commented Jan 5, 2024

Should the doctor availability record be optionally or mandatorily related to a Facility or a Location?

If yes (1), should they be allowed to be available in multiple facility/locations at the same time?

Updates as per discussion,

The availability record should be optionally linked to a location and not a facility.
Only location of doctor's home facility should be selectable

@rithviknishad rithviknishad moved this from Review required to Up Next in Care Jan 5, 2024
@rithviknishad
Copy link
Member

As discussed,

A doctor's availability must be understood as:
•⁠ ⁠physical availability (only to be given in a home facility) link to a facility is mandatory, with optional linking to one or more locations in that facility. ( Let's assume availability across locations may be overlapping, but not across facilities)
•⁠ ⁠availability for online engagement

Now for nurses this will be different.
Their availability will always be physical availability, restricted to 1 location at a time.

Also, we may be allowing multiple home facilities for doctors, to support palliative care use cases. Since a doctor can be involved with multiple palliative care teams.

The above schedule will be the duty staff schedule for locations. Duty Staff and this is essentially the same.

cc: @aparnacoronasafe

Copy link

Hi, @gigincg, @nihal467, @khavinshankar, @mathew-alex, @aparnacoronasafe, This issue has been automatically marked as stale because it has not had any recent activity.

@github-actions github-actions bot added the stale label Jan 31, 2024
@rithviknishad rithviknishad removed their assignment Apr 27, 2024
@github-actions github-actions bot removed the stale label Apr 28, 2024
@bodhish
Copy link
Member

bodhish commented Dec 15, 2024

Resolved with scheduling

@bodhish bodhish closed this as completed Dec 15, 2024
@github-project-automation github-project-automation bot moved this from Up Next to Done in Care Dec 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

No branches or pull requests

4 participants