From bd297fdb29e36a00f8fcf06f0c0338c2dc45c950 Mon Sep 17 00:00:00 2001 From: nik Date: Fri, 10 Oct 2025 18:59:30 +0300 Subject: [PATCH] complete lab4 --- labs/lab4/assets/1.svg | 102 +++++++++++++++++++++++++++++++++++++++++ labs/lab4/assets/2.svg | 102 +++++++++++++++++++++++++++++++++++++++++ labs/lab4/assets/3.svg | 102 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 306 insertions(+) create mode 100644 labs/lab4/assets/1.svg create mode 100644 labs/lab4/assets/2.svg create mode 100644 labs/lab4/assets/3.svg diff --git a/labs/lab4/assets/1.svg b/labs/lab4/assets/1.svg new file mode 100644 index 00000000..29cd97e6 --- /dev/null +++ b/labs/lab4/assets/1.svg @@ -0,0 +1,102 @@ +

users

patients

appointments

appointments

handledAppointments

1
1
1
1
1
0..*
0..*
0..*
0..*
0..*

«singleton»

HospitalSystem

-instance: HospitalSystem

-dbConnection: DBConnection

+getInstance() : : HospitalSystem

+addUser(user: User)

+addPatient(p: Patient)

+scheduleAppointment(a: Appointment)

«abstract»

User

+id: UUID

+name: string

+role: string

+login()

+logout()

Registrar

+registerPatient(data)

+findPatient(query)

Doctor

+specialty: string

+assignTreatment(patientId, plan)

+createMedicalRecord()

Patient

+id: UUID

+name: string

+birthDate: date

+policyNumber: string

+getMedicalRecord()

+updateInfo()

Appointment

+id: UUID

+dateTime: datetime

+status: string

+cancel()

+reschedule()

UntitledClass

\ No newline at end of file diff --git a/labs/lab4/assets/2.svg b/labs/lab4/assets/2.svg new file mode 100644 index 00000000..460e45e7 --- /dev/null +++ b/labs/lab4/assets/2.svg @@ -0,0 +1,102 @@ +

uses

manages

createUser()

1
1
1
0..*

«singleton»

HospitalSystem

-instance: HospitalSystem

-dbConnection: DBConnection

-HospitalSystem()

+getInstance() : : HospitalSystem

+getUserFactory() : : UserFactory

+getPatients() : : List

UserFactory

+createUser(type: string, params) : : User

+createRegistrar(params) : : Registrar

+createDoctor(params) : : Doctor

«abstract»

User

+id: UUID

+name: string

+role: string

+authenticate(credentials) : : boolean

+getProfile() : : Profile

Registrar

+registerPatient(data)

+findPatient(query)

Doctor

+specialty: string

+assignTreatment(patientId, plan)

\ No newline at end of file diff --git a/labs/lab4/assets/3.svg b/labs/lab4/assets/3.svg new file mode 100644 index 00000000..227def9f --- /dev/null +++ b/labs/lab4/assets/3.svg @@ -0,0 +1,102 @@ +

observers

uses

notify()

calculate()

1
1
0..*
1

Subject

-observers: List<Observer>

+attach(o: Observer)

+detach(o: Observer)

+notify(event)

«interface»

Observer

+update(event)

NotificationService

+send(contact, message)

+update(event)

Billing

-strategy: PaymentStrategy

+setStrategy(s: PaymentStrategy)

+calculateTotal(context) : : money

«interface»

PaymentStrategy

+calculate(amount, context) : : money

InsurancePayment

+calculate(amount, context) : : money

SelfPayment

+calculate(amount, context) : : money

\ No newline at end of file