S
S
seric02020-11-17 05:52:32
Database design
seric0, 2020-11-17 05:52:32

How to store work schedules of doctors in the database?

Hello, I store work schedules in the database in one line. The table has fields:
Reception start date, Reception end date - Here I store the dates
Monday, Tuesday, Wednesday, Thursday, Friday and Saturday - Here I store the reception time by day of the week.
Charts can be created for 1-2-3 weeks, a month, several days.
How to properly organize the saving of graphs in the database?
Store charts by week, day or whole?
I can display charts for a month and a week, but I don’t know how to display charts for 2-3 weeks and cross charts (for example, from 11/30/2020 - 12/05/2020).
Tell me how to implement it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Korotenko, 2020-11-17
@firedragon

It is better to store by day
availability_schedule
id - bigint (guid)
doc_id - int
base_date - date (perhaps it is worth inserting the base date, then start end will be just time)
start - datetime
end - datetime
doc_spec - int (doctor's main specialization)
Plus you do this scheme just requests and ready-made intervals are given to you.
You implement the breakdown by months and so on already in the application.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question