From 242743cf260b1aa9580a36995602b54b80ae4413 Mon Sep 17 00:00:00 2001 From: Andrea Giulianelli Date: Fri, 19 May 2023 18:20:31 +0200 Subject: [PATCH] chore: add medical device model representation in incoming events --- .../event/model/MedicalDeviceEventData.kt | 60 +++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 src/main/kotlin/application/presenter/event/model/MedicalDeviceEventData.kt diff --git a/src/main/kotlin/application/presenter/event/model/MedicalDeviceEventData.kt b/src/main/kotlin/application/presenter/event/model/MedicalDeviceEventData.kt new file mode 100644 index 0000000..34d765b --- /dev/null +++ b/src/main/kotlin/application/presenter/event/model/MedicalDeviceEventData.kt @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2023. Smart Operating Block + * + * Use of this source code is governed by an MIT-style + * license that can be found in the LICENSE file or at + * https://opensource.org/licenses/MIT. + */ + +package application.presenter.event.model + +import kotlinx.serialization.Serializable + +/** + * Presenter class that represents data about an Implantable medical device. + * It has data about the [id] and the [type] of it. + */ +@Serializable +data class ImplantableMedicalDeviceEventDto( + val id: ImplantableMedicalDeviceIDEventDto, + val type: ImplantableMedicalDeviceTypeEventDto, +) + +/** + * Presenter class for the [id] of [ImplantableMedicalDeviceEventDto]. + */ +@Serializable +data class ImplantableMedicalDeviceIDEventDto(val id: String) + +/** The type of [ImplantableMedicalDeviceEventDto]. */ +@Serializable +enum class ImplantableMedicalDeviceTypeEventDto { + PACE_MAKER, + CATHETER, +} + +/** + * Presenter class that represents data about a Medical technology. + * It has data about the [id], the [name], the [description], its [type] and if it is [inUse] or not. + */ +@Serializable +data class MedicalTechnologyEventDto( + val id: MedicalTechnologyIDEventDto, + val name: String, + val description: String? = null, + val type: MedicalTechnologyTypeEventDto, + val inUse: Boolean, +) + +/** + * Presenter class for the [id] of [MedicalTechnologyEventDto]. + */ +@Serializable +data class MedicalTechnologyIDEventDto(val id: String) + +/** The type of [MedicalTechnologyEventDto]. */ +@Serializable +enum class MedicalTechnologyTypeEventDto { + ENDOSCOPE, + X_RAY, +}