coronasafe / care_fe

Care is a Digital Public Good enabling TeleICU & Decentralised Administration of Healthcare Capacity across States.
https://care.ohc.network
MIT License
187 stars 349 forks source link

Feature: Add doctor availability date and time #6968

Open nihal467 opened 6 months ago

nihal467 commented 6 months ago

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

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 commented 6 months ago

@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 commented 6 months ago

Dropping a mock UI here for suggestions

image
rithviknishad commented 6 months ago

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 commented 6 months ago

@rithviknishad I also want to work on this issue.

rithviknishad commented 6 months ago

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 commented 6 months ago

Ok @rithviknishad

rithviknishad commented 6 months ago

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 commented 6 months ago

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

github-actions[bot] commented 5 months ago

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