Skip to content

Commit a266b15

Browse files
chore: create medical technology usage event
1 parent 1991feb commit a266b15

File tree

3 files changed

+130
-0
lines changed

3 files changed

+130
-0
lines changed
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
/*
2+
* Copyright (c) 2023. Smart Operating Block
3+
*
4+
* Use of this source code is governed by an MIT-style
5+
* license that can be found in the LICENSE file or at
6+
* https://opensource.org/licenses/MIT.
7+
*/
8+
9+
package application.presenter.event.model.medicaltechnology;
10+
11+
import application.presenter.event.model.Event;
12+
import application.presenter.event.model.medicaltechnology.payload.MedicalTechnologyUsagePayload;
13+
14+
/**
15+
* Medical Technology update event.
16+
*/
17+
public class MedicalTechnologyEvent implements Event<MedicalTechnologyUsagePayload> {
18+
private final String key;
19+
private final MedicalTechnologyUsagePayload data;
20+
private final String dateTime;
21+
22+
/**
23+
* Default constructor.
24+
* @param key the key of the event.
25+
* @param data the data payload of the event.
26+
* @param dateTime the date time of the event.
27+
*/
28+
public MedicalTechnologyEvent(
29+
final String key,
30+
final MedicalTechnologyUsagePayload data,
31+
final String dateTime) {
32+
this.key = key;
33+
this.data = data;
34+
this.dateTime = dateTime;
35+
}
36+
37+
@Override
38+
public final String getKey() {
39+
return this.key;
40+
}
41+
42+
@Override
43+
public final MedicalTechnologyUsagePayload getData() {
44+
return this.data;
45+
}
46+
47+
@Override
48+
public final String getDateTime() {
49+
return this.dateTime;
50+
}
51+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/*
2+
* Copyright (c) 2023. Smart Operating Block
3+
*
4+
* Use of this source code is governed by an MIT-style
5+
* license that can be found in the LICENSE file or at
6+
* https://opensource.org/licenses/MIT.
7+
*/
8+
9+
package application.presenter.event.model.medicaltechnology;
10+
11+
/**
12+
* Type of medical technology that is involved in the {@link MedicalTechnologyEvent}.
13+
*/
14+
public enum MedicalTechnologyTypePayload {
15+
/** Endoscope. */
16+
ENDOSCOPE,
17+
/** X-Ray. */
18+
XRAY
19+
}
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
/*
2+
* Copyright (c) 2023. Smart Operating Block
3+
*
4+
* Use of this source code is governed by an MIT-style
5+
* license that can be found in the LICENSE file or at
6+
* https://opensource.org/licenses/MIT.
7+
*/
8+
9+
package application.presenter.event.model.medicaltechnology.payload;
10+
11+
import application.presenter.event.model.medicaltechnology.MedicalTechnologyTypePayload;
12+
13+
/**
14+
* {@link application.presenter.event.model.medicaltechnology.MedicalTechnologyEvent} event payload.
15+
*/
16+
public class MedicalTechnologyUsagePayload {
17+
private final String medicalTechnologyID;
18+
private final MedicalTechnologyTypePayload medicalTechnologyType;
19+
private final boolean inUse;
20+
21+
/**
22+
* Default constructor.
23+
* @param medicalTechnologyID the medical technology id.
24+
* @param medicalTechnologyType the type of the medical technology.
25+
* @param inUse if the medical technology is in use.
26+
*/
27+
public MedicalTechnologyUsagePayload(
28+
final String medicalTechnologyID,
29+
final MedicalTechnologyTypePayload medicalTechnologyType,
30+
final boolean inUse
31+
) {
32+
this.medicalTechnologyID = medicalTechnologyID;
33+
this.medicalTechnologyType = medicalTechnologyType;
34+
this.inUse = inUse;
35+
}
36+
37+
/**
38+
* Get the medical technology id involved in the event.
39+
* @return the medical technology id.
40+
*/
41+
public String getMedicalTechnologyID() {
42+
return this.medicalTechnologyID;
43+
}
44+
45+
/**
46+
* Get the medical technology type involved in the event.
47+
* @return the medical technology type.
48+
*/
49+
public MedicalTechnologyTypePayload getMedicalTechnologyType() {
50+
return this.medicalTechnologyType;
51+
}
52+
53+
/**
54+
* State if the medical technology is being used.
55+
* @return true if the involved medical technology is in use, false otherwise.
56+
*/
57+
public boolean isInUse() {
58+
return this.inUse;
59+
}
60+
}

0 commit comments

Comments
 (0)