Skip to content

Commit 9ca07b2

Browse files
feat: add medical technology usage event
1 parent 6bb8256 commit 9ca07b2

File tree

3 files changed

+32
-5
lines changed

3 files changed

+32
-5
lines changed

src/main/kotlin/entities/process/ProcessData.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,10 @@ object ProcessData {
2626
* @param processId the id of the surgical process.
2727
*/
2828
data class ProcessInfo(val info: String, val processId: String)
29+
30+
/**
31+
* The event of medical technology usage given its [medicalTechnologyID].
32+
* @param isInUse true if the medical technology is in use, false otherwise.
33+
*/
34+
data class MedicalTechnologyUsage(val medicalTechnologyID: String, val isInUse: Boolean)
2935
}

src/main/kotlin/infrastructure/digitaltwins/events/TwinProperties.kt

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,14 @@ object TwinProperties {
2424
PRESENCE("/presence_inside")
2525
}
2626

27+
/**
28+
* The properties path of Process events.
29+
* @param path the property path.
30+
*/
31+
enum class ProcessProperties(val path: String) {
32+
MEDICAL_TECHNOLOGY("/is_in_use")
33+
}
34+
2735
/**
2836
* The properties path of Patient Model.
2937
* @param path the property path.
@@ -35,7 +43,7 @@ object TwinProperties {
3543
IS_ON_OPERATING_TABLE("/is_on_operating_table"),
3644
RESPIRATORY_RATE("/respiratory_rate"),
3745
SATURATION_PERCENTAGE("/saturation_percentage"),
38-
HEARTBEAT("/heart_beat")
46+
HEARTBEAT("/heart_beat"),
3947
}
4048

4149
/**
@@ -48,7 +56,8 @@ object TwinProperties {
4856
PROCESS_MODEL_ID("dtmi:io:github:smartoperatingblock:SurgicalProcess;1"),
4957
PATIENT_MODEL_ID("dtmi:io:github:smartoperatingblock:Patient;1"),
5058
HEALTH_PROFESSIONAL_MODEL_ID("dtmi:io:github:smartoperatingblock:HealthProfessional;1"),
51-
SURGERY_BOOKING_MODEL_ID("dtmi:io:github:smartoperatingblock:SurgeryBooking;1")
59+
SURGERY_BOOKING_MODEL_ID("dtmi:io:github:smartoperatingblock:SurgeryBooking;1"),
60+
MEDICAL_TECHNOLOGY_MODEL_ID("dtmi:io:github:smartoperatingblock:MedicalTechnology;1")
5261
}
5362

5463
/**

src/main/kotlin/infrastructure/digitaltwins/parser/UpdateEventParser.kt

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ import entities.process.PatientData.PatientData
2525
import entities.process.PatientData.RespiratoryRate
2626
import entities.process.PatientData.Saturation
2727
import entities.process.PatientData.SystolicPressure
28-
import entities.process.ProcessData
28+
import entities.process.ProcessData.MedicalTechnologyUsage
29+
import entities.process.ProcessData.ProcessInfo
30+
import infrastructure.digitaltwins.events.TwinProperties.DTModelID.MEDICAL_TECHNOLOGY_MODEL_ID
2931
import infrastructure.digitaltwins.events.TwinProperties.DTModelID.OPERATING_ROOM_MODEL_ID
3032
import infrastructure.digitaltwins.events.TwinProperties.DTModelID.PATIENT_MODEL_ID
3133
import infrastructure.digitaltwins.events.TwinProperties.DTModelID.PRE_OPERATING_ROOM_MODEL_ID
@@ -37,6 +39,7 @@ import infrastructure.digitaltwins.events.TwinProperties.PatientProperties.IS_ON
3739
import infrastructure.digitaltwins.events.TwinProperties.PatientProperties.RESPIRATORY_RATE
3840
import infrastructure.digitaltwins.events.TwinProperties.PatientProperties.SATURATION_PERCENTAGE
3941
import infrastructure.digitaltwins.events.TwinProperties.PatientProperties.SYSTOLIC_PRESSURE
42+
import infrastructure.digitaltwins.events.TwinProperties.ProcessProperties.MEDICAL_TECHNOLOGY
4043
import infrastructure.digitaltwins.events.TwinProperties.RoomProperties.HUMIDITY
4144
import infrastructure.digitaltwins.events.TwinProperties.RoomProperties.LUMINOSITY
4245
import infrastructure.digitaltwins.events.TwinProperties.RoomProperties.PRESENCE
@@ -58,7 +61,7 @@ class UpdateEventParser {
5861
OPERATING_ROOM_MODEL_ID.id, PRE_OPERATING_ROOM_MODEL_ID.id -> {
5962
manageRoomEvents(updateTwinEvent)
6063
}
61-
PATIENT_MODEL_ID.id, PROCESS_MODEL_ID.id -> {
64+
PATIENT_MODEL_ID.id, PROCESS_MODEL_ID.id, MEDICAL_TECHNOLOGY_MODEL_ID.id -> {
6265
manageProcessEvents(updateTwinEvent)
6366
}
6467
else -> EmptyEvent()
@@ -95,7 +98,7 @@ class UpdateEventParser {
9598
when (updateTwinEvent.data.patch[0].path) {
9699
IS_ON_OPERATING_TABLE.path -> {
97100
ProcessEvent(
98-
data = ProcessData.ProcessInfo("Patient on Operating Bed", updateTwinEvent.id),
101+
data = ProcessInfo("Patient on Operating Bed", updateTwinEvent.id),
99102
dateTime = updateTwinEvent.eventDateTime
100103
)
101104
}
@@ -153,6 +156,15 @@ class UpdateEventParser {
153156
dateTime = updateTwinEvent.eventDateTime
154157
)
155158
}
159+
MEDICAL_TECHNOLOGY.path -> {
160+
ProcessEvent(
161+
data = MedicalTechnologyUsage(
162+
updateTwinEvent.id,
163+
updateTwinEvent.data.patch[0].value as Boolean
164+
),
165+
dateTime = updateTwinEvent.eventDateTime
166+
)
167+
}
156168
else -> EmptyEvent()
157169
}
158170
}

0 commit comments

Comments
 (0)