---
title: Medical Booking System - Use Case UML example
tags: tutorials
---
Medical Booking System (MBS)
===
###### tags: `BPAS`
[ToC]
## TO-BE Scenario
:::info
:bulb: **TO-BE Scenario**
*Mac submits the appointment request online to make an appointment for a yearly health-checkup. Doctor records his/her availability in the staff module. The receptionist finds the nearest empty time slot in the appointment module and available doctor from the staff module. She schedules the appointment for the time slot with an available doctor and saves*
:::
## UML - Use Case example
## :memo: Modeling use cases
### Step 1: Identify Actors
#### Who are the main busines participants?
* The Patient
* The Receptionist
* The Doctor
#### Drawing the Actors
```plantuml
@startuml
:Receptionist: as R
:Patient: as P
:Doctor: as D
@enduml
```
:::danger
:no_entry_sign: Common error: using ***Mac*** a particular *patient* instead of the general actor **Patient**
:::
### Step 2: Identify use cases
### Step 3: Depict cases in graphical mode
```plantuml
@startuml
left to right direction
'Wrong: use a generic term for actors
'actor "Mac" is an error
:Patient: --> (submit appointment request)
'Wrong: this is a process rather than a use case
'(yearly health-checkup)
:Doctor: --> (record availability)
:Receptionist: --> (find time slot)
:Receptionist: --> (find available doctor)
:Receptionist: --> (book appointment)
@enduml
```
### :memo: Draft Model
```plantuml
@startuml
left to right direction
'Wrong: use a generic term for actors
'actor "Mac" is an error
:Patient: --> (submit appointment request)
'Wrong: this is a process rather than a use case
'(yearly health-checkup)
:Doctor: --> (record availability)
:Receptionist: --> (find time slot)
:Receptionist: --> (find available doctor)
:Receptionist: --> (schedule appointment)
@enduml
```
---
### :memo: Use Case with System Rectangle
```plantuml
@startuml
Rectangle "Medical Booking System"{
(submit appointment request) as UC1
(record availability) as UC2
(find time slot) as UC3
(find available doctor) as UC4
(schedule appointment) as UC5
}
:Receptionist: as R
:Patient: as P
:Doctor: as D
UC2 <--- D
UC3 <--- R
UC4 <--- R
UC5 <--- R
P ---> UC1
@enduml
```
---
## :memo: Function Packaging Example
```plantuml
@startuml
package "Staff Module" {
usecase "Find schedule" as UC1
usecase "Find available staff" as UC2
usecase "Submit availability" as UC3
}
package "Appointment Module" {
usecase "Book appointment" as UC4
usecase "Request appointment" as UC5
}
@enduml
```
___
## Deployment Diagram
https://plantuml.com/deployment-diagram
HackMD's PlantUML dead again :100:
Use this to render
http://www.plantuml.com/plantuml/uml/SyfFKj2rKt3CoKnELR1Io4ZDoSa70000
```plantuml
@startuml
left to right direction
'Function = component
'System = node
'Interface = interface
'Actor = actor
'Coloring the Function and System
skinparam component{
backgroundColor<<new>> White
backgroundColor<<tbm>> LightYellow
backgroundColor<<ext>> Gray
}
skinparam node{
backgroundColor White
backgroundColor<<ext>> LightBlue
}
'Legend
frame Legend{
[New Function] <<new>>
[To-be Modified Function] <<tbm>>
[Existing Function] <<ext>>
node "Existing System" <<ext>>
node "Grouping of Function"
:Actor:
() "Interface to Application"
}
'Enter the Functions with type and System
node "System A" as A{
[Function 1] <<new>>
[Function 2] <<new>>
[Function 3] <<new>>
[Function 4] <<new>>
}
node "System B" as B{
[Function 6] <<tbm>>
[Function 7] <<ext>>
}
node "System C" as C{
[Function 5] <<ext>>
}
node "System D" as D <<ext>>
'Draw the Actor-Interface Relationship
:Actor 1: <--> () "Non-web-based/\nWeb-based"
:Actor 2: <--> () "Non-web-based"
'Draw the Interface-System and System-System Relationship
() "Non-web-based/\nWeb-based" <--> A
() "Non-web-based/\nWeb-based" <--> B
A <--> B
() "Non-web-based" <--> B
A <--> C
A <--> D
@enduml
```
## :memo: Packaging use cases
### Step 1: Identify related use cases
### Step 2: Group related use cases
### Step 3: Provide function name to the package
```plantuml
@startuml
left to right direction
package "Staff Module"{
(find time slot) as UC2
(find available doctor) as UC3
}
package "Appointment Module"{
(record availability) as UC5
(book appointment) as UC4
(submit appointment request) as UC1
}
UC1 <-- :Patient:
:Doctor: --> UC5
:Receptionist: as R
R --> UC3
R --> UC4
@enduml
```
## :memo: Function Model
| Function | Use Case | Type (New/Existing/To-be-modified ) | System/ Comment |
|----------|----------|-|-|
|Appointment Module|...|...|...|
|Staff Module|...|...|...|