Skip to content

Commit 865983a

Browse files
giacomoaccursiandrea-acampora
authored andcommitted
chore: edit surgertReportEntry class with right parameters
1 parent bebd02b commit 865983a

File tree

1 file changed

+27
-17
lines changed

1 file changed

+27
-17
lines changed

src/main/kotlin/entity/surgeryreport/SurgeryReportEntry.kt

Lines changed: 27 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,25 @@
88

99
package entity.surgeryreport
1010

11+
import kotlinx.serialization.Contextual
1112
import java.time.Instant
1213

1314
/**
1415
* Class that model the principal information of a surgery report in the surgery report archive.
15-
* @param processId the id of the surgery process.
16-
* @param patientInfo the name and the surname of the patient.
17-
* @param processType the type of the surgery.
18-
* @param processDate the date of the surgery.
16+
* @param surgicalProcessID the id of the surgical process.
17+
* @param patientId the id of the patient.
18+
* @param patientName the name of the patient.
19+
* @param patientSurname the surname of the patient.
20+
* @param surgicalProcessDescription the description of the surgical process.
21+
* @param surgeryDate the date of the surgical process.
1922
*/
2023
data class SurgeryReportEntry(
21-
val processId: ProcessId,
22-
val patientInfo: PatientInfo,
23-
val processType: ProcessType,
24-
val processDate: ProcessDate,
24+
val surgicalProcessID: ProcessId,
25+
val patientId: PatientId,
26+
val patientName: PatientName?,
27+
val patientSurname: PatientSurname?,
28+
val surgicalProcessDescription: SurgicalProcessDescription,
29+
@Contextual val surgeryDate: SurgeryDate,
2530
)
2631

2732
/**
@@ -34,28 +39,33 @@ data class ProcessId(val id: String) {
3439
}
3540

3641
/**
37-
* The [patientInfo].
42+
* The [id] of the patient.
3843
*/
39-
data class PatientInfo(val patientInfo: String) {
44+
data class PatientId(val id: String) {
4045
init {
41-
require(patientInfo.isNotEmpty())
46+
require(id.isNotEmpty())
4247
}
4348
}
4449

4550
/**
46-
* The [processType].
51+
* The [surname] of the patient.
4752
*/
48-
data class ProcessType(val processType: String) {
53+
data class PatientSurname(val surname: String) {
4954
init {
50-
require(processType.isNotEmpty())
55+
require(surname.isNotEmpty())
5156
}
5257
}
5358

5459
/**
55-
* The [processDate].
60+
* The [description] of the surgical process.
5661
*/
57-
data class ProcessDate(val processDate: Instant) {
62+
data class SurgicalProcessDescription(val description: String) {
5863
init {
59-
require(processDate.isBefore(Instant.now()))
64+
require(description.isNotEmpty())
6065
}
6166
}
67+
68+
/**
69+
* The [date] of the surgical process.
70+
*/
71+
data class SurgeryDate(val date: Instant)

0 commit comments

Comments
 (0)