Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions Docs/Locations.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
@startuml

title Location Service Module Architecture (Detailed)

' 1. Interface Service (Berdasarkan kode yang Anda kirim)
interface LocationService {
' Core Location methods
+ saveLocation(Location) : Location
+ getLocation(Integer) : Location
+ getLocationByUuid(String) : Location
+ getAllLocations(boolean) : List<Location>
+ retireLocation(Location, String) : Location
+ purgeLocation(Location) : void

' Location Tag methods (Ditemukan di source code)
+ saveLocationTag(LocationTag) : LocationTag
+ getAllLocationTags() : List<LocationTag>
+ getLocationsByTag(LocationTag) : List<Location>

' Attribute methods (Ditemukan di source code)
+ saveLocationAttributeType(LocationAttributeType) : LocationAttributeType
}

' 2. Class Implementasi
class LocationServiceImpl {
- dao : LocationDAO
+ saveLocation(Location) : Location
+ getLocation(Integer) : Location
+ saveLocationTag(LocationTag) : LocationTag
}

' 3. Interface DAO
interface LocationDAO {
+ saveLocation(Location) : Location
+ getLocation(Integer) : Location
+ getAllLocations(boolean) : List<Location>
+ saveLocationTag(LocationTag) : LocationTag
}

' 4. ENTITIES (Data Objects)
class Location {
- locationId : Integer
- name : String
- parentLocation : Location
- tags : Set<LocationTag>
}

class LocationTag {
- locationTagId : Integer
- name : String
}

' 5. HUBUNGAN (RELATIONSHIPS)

' Realization
LocationService <|.. LocationServiceImpl : implements

' Dependency Injection
LocationServiceImpl --> LocationDAO : uses

' Entity Relationships
LocationService ..> Location : manages
LocationService ..> LocationTag : manages
Location "1" *-- "0..*" LocationTag : has

@enduml
Binary file added Docs/Screenshot 2025-12-06 093138.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
39 changes: 39 additions & 0 deletions Docs/Week 12/Analisis.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Domain Encounter — Analisis

## 1. Apakah sebuah encounter merupakan bagian dari sebuah visit, atau sebuah visit merupakan bagian dari sebuah encounter?

**Jawaban:**
**Encounter adalah bagian dari visit.**

**Alasan:**
Dalam skema database OpenMRS, foreign key berada pada tabel **`encounter`**, yaitu:


Ini berarti:

- Satu **visit** dapat berisi **banyak encounter**.
- Karena itu, encounter termasuk di dalam visit, bukan sebaliknya.

Sehingga interpretasi yang benar adalah:

**Encounter ⟶ bagian dari Visit**
(Visit adalah entitas induk, encounter adalah entitas anak di dalam visit)

---

## 2. Bagaimana provider terhubung dengan person?

**Jawaban:**
Provider terhubung dengan person melalui kolom `person_id` pada tabel **`provider`**.


**Penjelasan:**
- Setiap provider di OpenMRS sebenarnya adalah seorang **person** yang memiliki peran klinis.
- Informasi demografis (nama, jenis kelamin, tanggal lahir, dll.) disimpan di tabel **person**.
- Tabel provider menambahkan informasi khusus provider, seperti identifier, role, dan metadata.

Dengan demikian:

**Provider** adalah **person** yang diberi atribut tambahan sebagai penyedia layanan,
dihubungkan melalui **`provider.person_id` → `person.person_id`**.

91 changes: 91 additions & 0 deletions Docs/Week 12/Encounter_domain_erd.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
@startuml

hide circle
skinparam linetype ortho

title Encounter Domain ER Diagram (Week 12)

' 1. TABLE: ENCOUNTER (Center)
entity "encounter" as e {
*encounter_id : int <<PK>>
--
*encounter_datetime : datetime
*patient_id : int <<FK>>
*location_id : int <<FK>>
*encounter_type_id : int <<FK>>
*visit_id : int <<FK>>
form_id : int
}

' 2. TABLE: ENCOUNTER TYPE
entity "encounter_type" as et {
*encounter_type_id : int <<PK>>
--
*name : varchar
description : text
}

' 3. TABLE: VISIT
entity "visit" as v {
*visit_id : int <<PK>>
--
*patient_id : int <<FK>>
start_datetime : datetime
end_datetime : datetime
visit_type_id : int
}

' 4. TABLE: PATIENT
entity "patient" as p {
*patient_id : int <<PK>>
--
gender : varchar
birthdate : date
}

' 5. TABLE: LOCATION
entity "location" as l {
*location_id : int <<PK>>
--
*name : varchar
address1 : varchar
}

' 6. TABLE: PROVIDER (Who did it?)
entity "provider" as prov {
*provider_id : int <<PK>>
--
*person_id : int <<FK>>
identifier : varchar
name : varchar
}

' Junction Table (Penghubung Encounter & Provider)
entity "encounter_provider" as ep {
*encounter_provider_id : int <<PK>>
--
*encounter_id : int <<FK>>
*provider_id : int <<FK>>
*encounter_role_id : int <<FK>>
}

' --- RELATIONSHIPS ---

' Encounter is part of Visit
v ||..o{ e : "contains"

' Patient Relations
p ||..o{ v : "has visits"
p ||..o{ e : "has encounters"

' Location Relations
l ||..o{ e : "happens at"

' Type Relations
et ||..o{ e : "defines type of"

' Provider Relations
e ||..|{ ep : "has"
ep }|..|| prov : "performed by"

@enduml
Binary file added Docs/Week 12/Screenshot 2025-12-06 093138.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.