notebookvb

This commit is contained in:
Vladimir Buzalka
2026-06-02 06:37:25 +02:00
parent a9ef60212d
commit c1a5909f65
2 changed files with 930 additions and 2 deletions
+95 -2
View File
@@ -41,7 +41,8 @@ response = requests.post(GRAPHQL_URL, headers=headers, cookies=cookies, data=jso
|--------|----|
| Clinic | `25f24970-dae3-4f80-9337-d3616e53fb10` |
| Clinic slug | `mudr-buzalkova` |
| Calendar MUDr. Buzalkova | `144c4e12-347c-49ca-9ec0-8ca965a4470d` |
| Calendar MUDr. Buzalkova (manzelka) | `144c4e12-347c-49ca-9ec0-8ca965a4470d` |
| Calendar Vlado | `b6555c7e-4e95-4657-b441-87c2c9a7b2ca` |
| AIS entity (Medicus) | `ef1549a5-d266-4f52-9a4d-7275e79ac82e` |
---
@@ -217,6 +218,15 @@ Výsledek: 1963 pacientů synchronizováno (květen 2026).
| Operation | Variables | Response |
|-----------|-----------|----------|
| `ClinicLegacyRequestList_ListPatientRequestsForClinic` | `clinicSlug`, `locale`, `pageInfo {first: 30, offset}`, `queueAssignment`, `queueId`, `state` (ACTIVE/DONE) | `requests`, `clinic` |
| `ClinicRequestList2` | `clinicSlug`, `queueId`, `queueAssignment`, `state` (ACTIVE/DONE), `pageInfo {first, offset}`, `locale` | `requestsResponse { count, patientRequests [] }` |
`ClinicRequestList2` volá `listPatientRequestsForClinic2` — novější endpoint, vrací `count` a plně stránkovaný seznam. Struktura položky:
```
patientRequest { id, displayTitle, createdAt, updatedAt, doneAt, removedAt,
extendedPatient { name, surname, identificationNumber },
lastMessage { createdAt } }
```
Skript: `Medevio/10ReadPozadavky/PRAVIDELNE_0_READ_ALL_ACTIVE_POZADAVKY.py`
#### Request list item structure
```
@@ -238,7 +248,48 @@ request {
| `ClinicRequestDetail_GetPatientRequest2` | `clinicSlug`, `isDoctor`, `requestId`, `locale` | `request` (full detail) |
| `UseMessages_ListMessages` | `requestId`, `updatedSince` | `messages` |
| `Communication_GetClinicFooter` | `clinicSlug` | `footer` |
| `ClinicRequestNotes_Get` | `patientRequestId` | `notes` |
| `ClinicRequestNotes_Get` | `patientRequestId` | `notes []` |
| `ClinicRequestNotes_Update` | `noteInput { id, content }` | `{ id }` |
| `ClinicRequestNotes_Create` | `noteInput { requestId, content }` | `{ id }` |
| `ClinicRequestDetail_GetMessages` | `clinicSlug`, `requestId` | zprávy (alternativní endpoint) |
#### Interní poznámky k požadavku (klinické notes)
```graphql
# Čtení
query ClinicRequestNotes_Get($patientRequestId: String!) {
notes: getClinicPatientRequestNotes(requestId: $patientRequestId) {
id content createdAt updatedAt createdBy { id name surname }
}
}
# Aktualizace existující
mutation ClinicRequestNotes_Update($noteInput: UpdateClinicPatientRequestNoteInput!) {
updateClinicPatientRequestNote(noteInput: $noteInput) { id }
}
# Vytvoření nové
mutation ClinicRequestNotes_Create($noteInput: CreateClinicPatientRequestNoteInput!) {
createClinicPatientRequestNote(noteInput: $noteInput) { id }
}
```
K jednomu požadavku existuje typicky jedna interní poznámka. Pokud neexistuje → Create, pokud existuje → Update.
Skript: `Medevio/30 ManipulacePoznámek/101 JednoducheDoplneniInterniPoznamky.py`
#### Alternativní endpoint pro zprávy konverzace
```graphql
query ClinicRequestDetail_GetMessages($clinicSlug: String!, $requestId: ID!) {
clinicRequestDetail_GetPatientRequestMessages(clinicSlug: $clinicSlug, requestId: $requestId) {
id text createdAt
sender { id name }
extendedPatient { name surname identificationNumber }
}
}
```
Skript: `Medevio/10ReadPozadavky/10 UpdateMessageswithJmeno.py`
#### Request detail structure
```
@@ -264,6 +315,48 @@ request {
|-----------|-----------|----------|
| `ClinicCalendar_ListClinicReservations` | `calendarIds []`, `clinicCountry`, `clinicSlug`, `locale`, `since` (ISO), `until` (ISO), `showTimeSlots`, `schedulePatientId`, `emptyCalendarIds` | `holidays`, `reservations`, `vacations` |
| `ClinicCalendar_GetWindows` | `calendarIds []`, `clinicSlug`, `locale`, `since`, `until` | `calendarWindows` (ordinacni hodiny) |
| `Agenda_ListAll` | `calendarIds []`, `clinicSlug`, `locale`, `since`, `until` | `reservations` (jednorazove) + `recurringReservations` (opakujici) |
`Agenda_ListAll` volá dva endpointy zároveň:
- `listClinicReservations` → jednorazové rezervace (pacienti + poznámky lékaře)
- `listClinicRecurringReservations` → opakující se rezervace; vrací `recurringReservation { id calendarId color note rrule { frequency interval dtstart tzid byweekday bymonthday byweekno } }` a `instances { start end note color }`
Fungující skript: `Medevio/agenda_dne.py` — funkce `list_agendu(start, end, calendar)`
#### Vytvoření poznámky lékaře v kalendáři
```graphql
mutation CreateReservation_MakeReservationByDoctor(
$clinicSlug: String!, $color: ECRFIconColor, $note: String!, $timeSlotInput: TimeSlotInput!
) {
reservation: makeReservationByDoctor(
clinicSlug: $clinicSlug color: $color note: $note timeSlotInput: $timeSlotInput
) { id __typename }
}
```
Variables: `clinicSlug`, `color` (např. `"CHARCOAL"`), `note` (text), `timeSlotInput { calendarId, start (UTC ISO), end (UTC ISO) }`
Vrací: `reservation.id` — UUID nové rezervace.
Skript: `Medevio/zapis_poznamky.py` — funkce `zapis_poznamku(calendar, den, cas, trvani_min, poznamka, color)`
#### Smazání / zrušení rezervace
```graphql
# Jednorazová:
mutation UpdateReservation_CancelReservationByDoctor(
$clinicSlug: String!, $reservationId: UUID!
) {
reservation: cancelReservationByDoctor(clinicSlug: $clinicSlug, reservationId: $reservationId) { id __typename }
}
# Opakující se:
mutation UpdateReservation_CancelRecurringReservationByDoctor($input: RemoveRecurringReservationInput!) {
success: removeDateFromRecurringReservation(input: $input)
}
```
Pro opakující se: `input { clinicSlug, recurringReservationId, date (UTC ISO), updateType: "Single"|"ThisAndFuture"|"All" }`
Skript: `Medevio/smaz_poznamku.py` — funkce `smaz_jednorazovou(reservation_id)`, `smaz_opakujici(recurring_id, date, update_type)`
#### Reservation structure
```