1b.app
Link copied -

ASSESSMENT: One-time cross-numbering of tasks Examination by a specialist, which are tasks of the second level and are sub-tasks of the Medical Card

We are faced with a difficult task that needs to be solved.

This should be done once.

The task is as follows:

1. There is an array of data.

2. There are two types of problems in the array:

- The patient's medical card is a first-level task

- Examination by a specialist is a second-level task and is a subtask of the Medical Card

3. In the Medical Cards and Examinations, there is a Patient who is identified by Surname, First Name, Patronymic.

4. Sub-tasks for Examination by a specialist have additional data, according to which they must be numbered from 1 to N, where N is the total number of such sub-tasks:

5. For the end-to-end numbering of tasks of the Examination by a specialist, we can rely on and take into account:

- Name of the Patient

- ID of the subtask for examination by a specialist

- The date of the actual examination for this subtask

Example as it is now:

1. There is a task Medical card for Ivanov Sergey Petrovych

The Medical Card has four subtasks for examination by a specialist, where Ivanov Serhiy Petrovych acts as a patient:

- the first: id - 45, date of actual examination - 01.11.2024

- second: id - 48, date of actual examination - 01.11.2024

- third: id - 108, date of actual examination - 11/12/2024

- fourth: id - 211, date of actual examination - 20.11.2024

2. There is a task Medical card for Kotenko Maria Oleksiivna

She has three subtasks for examination by a specialist, where Kotenko Maria Oleksiivna acts as a patient:

- the first: id - 109, date of actual examination - 12,11,2024

- second: id - 224, date of actual examination - November 20, 2024

- the third: id - 348, date of actual examination - November 30, 2024

3. There is a task Medical card for Mykhailo Ihorovych Korotkov

She has five subtasks for examination by a specialist, where Mykhailo Igorovich Korotkov acts as a patient:

- the first: id - 12, date of actual examination - October 28, 2024

- second: id - 54, date of actual examination - 01.11.2024

- third: id - 304, date of actual examination - 10,12,2024

- fourth: id - 308, date of actual examination - 10,12,2024

- fifth: id - 309, date of actual examination - 10.12.2024

After performing the end-to-end numbering action, we should get the numbering for the subtasks in the example:

1 for — the first: id - 45, date of actual examination - 01.11.2024

2 for the second: id - 48, date of actual examination - 01.11.2024

3 for — the third: id - 108, date of actual examination - 11/12/2024

4 for — the fourth: id - 211, date of actual examination - 20.11.2024

1 for — the first: id - 109, date of actual examination - 12,11,2024

2 for the second: id - 224, date of actual examination - 20.11.2024

3 for — the third: id - 348, date of actual examination - 30.11.2024

1 for — the first: id - 12, date of actual examination - 28.10.2024

2 for the second: id - 54, date of actual examination - 01.11.2024

3 for — the third: id - 304, date of actual examination - 10.12.2024

4 for — the fourth: id - 308, date of actual examination - 10.12.2024

5 for — fifth: id - 309, date of actual examination - 10.12.2024

In fact, we have in the data array:

- 1,479 problems Medical card with unique patients.

- 2,266 subtasks for Examination by a specialist.

How can such an end-to-end numbering be implemented for tasks Examination by a specialist taking into account the name of the Patient, ID of the task, Date of the actual examination?

Please rate the work.
Original question is available on version: ua Вячеслав Легеза

Answers:

Please join the conversation. If you have something to say - please write a comment. You will need a mobile phone and an SMS code for identification to enter. Log in and comment