Skip to content

Commit

Permalink
chore: add process events payloads
Browse files Browse the repository at this point in the history
  • Loading branch information
andrea-acampora committed Mar 28, 2023
1 parent c847648 commit 02bfb73
Showing 1 changed file with 107 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
/*
* 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.payloads

import application.presenter.event.model.ProcessEvent
import kotlinx.serialization.Serializable

/** Module that wraps all payloads of process events. */
object ProcessEventsPayloads {

/** Interface that identify a data payload that is accepted inside a [ProcessEvent]. */
interface ProcessEventPayload

/** Interface that identify a data payload that is accepted inside a [PatientData] event. */
interface PatientDataPayload

/**
* The medical device used in the surgical process.
* @param medicalDeviceID the id of the technology.
* @param processId the id of the surgical process.
*/
@Serializable
data class MedicalDeviceUsage(val medicalDeviceID: String, val processId: String) : ProcessEventPayload

/**
* An information for the surgical process.
* @param info the information of the process.
* @param processId the id of the surgical process.
*/
@Serializable
data class ProcessInfo(val info: String, val processId: String) : ProcessEventPayload

/**
* The event of medical technology usage given its [medicalTechnologyID].
* @param inUse true if the medical technology is in use, false otherwise.
*/
@Serializable
data class MedicalTechnologyUsage(val medicalTechnologyID: String, val inUse: Boolean) : ProcessEventPayload

/**
* The event of patient tracking inside the operating block.
* @param patientId the id of the patient.
* @param roomId the id of the room.
* @param entered true if is entered in the room, false otherwise.
* @param roomType the type of the room.
*/
@Serializable
data class PatientTracked(
val patientId: String,
val roomId: String,
val entered: Boolean,
val roomType: RoomType
) : ProcessEventPayload

/**
* The [data] of the patient identified by [patientId].
*/
@Serializable
data class PatientData<E : PatientDataPayload>(val patientId: String, val data: E) : ProcessEventPayload

/** The type of the room where the patient is tracked. **/
enum class RoomType {
PRE_OPERATING_ROOM, OPERATING_ROOM
}

/**
* The body [temperature] of the patient.
*/
@Serializable
data class BodyTemperature(val temperature: Double) : PatientDataPayload

/**
* The [heartbeat] of the patient.
*/
@Serializable
data class Heartbeat(val heartbeat: Int) : PatientDataPayload

/**
* The diastolic [pressure] of the patient.
*/
@Serializable
data class DiastolicPressure(val pressure: Int) : PatientDataPayload

/**
* The systolic [pressure] of the patient.
*/
@Serializable
data class SystolicPressure(val pressure: Int) : PatientDataPayload

/**
* The [rate] of respiration the patient.
*/
@Serializable
data class RespiratoryRate(val rate: Int) : PatientDataPayload

/**
* The [saturation] of the patient oxygen.
*/
@Serializable
data class Saturation(val saturation: Int) : PatientDataPayload
}

0 comments on commit 02bfb73

Please sign in to comment.