Skip to content

Commit 254f34b

Browse files
feat: add configuration model
1 parent 0e66e90 commit 254f34b

File tree

7 files changed

+479
-0
lines changed

7 files changed

+479
-0
lines changed
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
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 infrastructure.configuration.model;
10+
11+
import infrastructure.configuration.model.environment.EnvironmentalDataConfig;
12+
import infrastructure.configuration.model.environment.OperatingRoomEnvironmentalDataConfig;
13+
import infrastructure.configuration.model.scenario.MedicalTechnologyScenario;
14+
import infrastructure.configuration.model.standby.OperatingRoomStandbyMode;
15+
import infrastructure.configuration.model.standby.PrePostOperatingRoomStandbyMode;
16+
17+
import java.util.ArrayList;
18+
import java.util.List;
19+
20+
/**
21+
* Class that models the configuration loaded.
22+
*/
23+
public class Configuration {
24+
private OperatingRoomEnvironmentalDataConfig operatingRoom;
25+
private OperatingRoomStandbyMode operatingRoomStandbyMode;
26+
private EnvironmentalDataConfig prePostOperatingRoom;
27+
private PrePostOperatingRoomStandbyMode prePostOperatingRoomStandbyMode;
28+
private List<MedicalTechnologyScenario> medicalTechnologyScenarios;
29+
30+
/**
31+
* Operating room environmental data config getter.
32+
* @return the operating room environmental data config.
33+
*/
34+
public OperatingRoomEnvironmentalDataConfig getOperatingRoom() {
35+
return new OperatingRoomEnvironmentalDataConfig(this.operatingRoom);
36+
}
37+
38+
/**
39+
* Operating room environmental data config setter.
40+
* @param operatingRoom the operating room environmental data config to set.
41+
*/
42+
public void setOperatingRoom(final OperatingRoomEnvironmentalDataConfig operatingRoom) {
43+
this.operatingRoom = new OperatingRoomEnvironmentalDataConfig(operatingRoom);
44+
}
45+
46+
/**
47+
* Operating room standby mode config getter.
48+
* @return the operating room standby mode.
49+
*/
50+
public OperatingRoomStandbyMode getOperatingRoomStandbyMode() {
51+
return new OperatingRoomStandbyMode(this.operatingRoomStandbyMode);
52+
}
53+
54+
/**
55+
* Operating room standby mode config setter.
56+
* @param operatingRoomStandbyMode config to set.
57+
*/
58+
public void setOperatingRoomStandbyMode(final OperatingRoomStandbyMode operatingRoomStandbyMode) {
59+
this.operatingRoomStandbyMode = new OperatingRoomStandbyMode(operatingRoomStandbyMode);
60+
}
61+
62+
/**
63+
* Pre/Post operating room environmental data config getter.
64+
* @return the pre/post operating room environmental data config.
65+
*/
66+
public EnvironmentalDataConfig getPrePostOperatingRoom() {
67+
return new EnvironmentalDataConfig(this.prePostOperatingRoom);
68+
}
69+
70+
/**
71+
* Pre/Post operating room environmental data config setter.
72+
* @param prePostOperatingRoom the pre/post operating room environmental data config to set.
73+
*/
74+
public void setPrePostOperatingRoom(final EnvironmentalDataConfig prePostOperatingRoom) {
75+
this.prePostOperatingRoom = new EnvironmentalDataConfig(prePostOperatingRoom);
76+
}
77+
78+
/**
79+
* Pre/Post operating room standby mode config getter.
80+
* @return the pre/post operating room standby mode.
81+
*/
82+
public PrePostOperatingRoomStandbyMode getPrePostOperatingRoomStandbyMode() {
83+
return new PrePostOperatingRoomStandbyMode(this.prePostOperatingRoomStandbyMode);
84+
}
85+
86+
/**
87+
* Pre/Post operating room standby mode config setter.
88+
* @param prePostOperatingRoomStandbyMode config to set.
89+
*/
90+
public void setPrePostOperatingRoomStandbyMode(final PrePostOperatingRoomStandbyMode prePostOperatingRoomStandbyMode) {
91+
this.prePostOperatingRoomStandbyMode = new PrePostOperatingRoomStandbyMode(prePostOperatingRoomStandbyMode);
92+
}
93+
94+
/**
95+
* Medical Technology scenario list getter.
96+
* @return the medical technology scenarios set in the configuration.
97+
*/
98+
public List<MedicalTechnologyScenario> getMedicalTechnologyScenarios() {
99+
return new ArrayList<>(this.medicalTechnologyScenarios);
100+
}
101+
102+
/**
103+
* Setter of the medical technology scenarios.
104+
* @param medicalTechnologyScenarios to set.
105+
*/
106+
public void setMedicalTechnologyScenarios(final List<MedicalTechnologyScenario> medicalTechnologyScenarios) {
107+
this.medicalTechnologyScenarios = new ArrayList<>(medicalTechnologyScenarios);
108+
}
109+
}
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
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 infrastructure.configuration.model.environment;
10+
11+
/**
12+
* Class that models the data provided in the configuration.
13+
*/
14+
public class EnvironmentalDataConfig {
15+
private Double temperature;
16+
private Double humidity;
17+
private Double ambientIlluminance;
18+
19+
/** Default constructor. */
20+
public EnvironmentalDataConfig() {
21+
// This constructor is intentionally empty. Nothing special is needed here.
22+
}
23+
24+
/**
25+
* Constructor to perform copy.
26+
* @param other to copy.
27+
*/
28+
public EnvironmentalDataConfig(final EnvironmentalDataConfig other) {
29+
this.temperature = other.temperature;
30+
this.humidity = other.humidity;
31+
this.ambientIlluminance = other.ambientIlluminance;
32+
}
33+
34+
/**
35+
* Temperature getter.
36+
* @return the temperature.
37+
*/
38+
public Double getTemperature() {
39+
return this.temperature;
40+
}
41+
42+
/**
43+
* Temperature setter.
44+
* @param temperature the temperature to set.
45+
*/
46+
public void setTemperature(final Double temperature) {
47+
this.temperature = temperature;
48+
}
49+
50+
/**
51+
* Humidity getter.
52+
* @return the humidity.
53+
*/
54+
public Double getHumidity() {
55+
return this.humidity;
56+
}
57+
58+
/**
59+
* Humidity setter.
60+
* @param humidity to set.
61+
*/
62+
public void setHumidity(final Double humidity) {
63+
this.humidity = humidity;
64+
}
65+
66+
/**
67+
* Illuminance getter.
68+
* @return the illuminance.
69+
*/
70+
public Double getAmbientIlluminance() {
71+
return this.ambientIlluminance;
72+
}
73+
74+
/**
75+
* Illuminance setter.
76+
* @param ambientIlluminance to set.
77+
*/
78+
public void setAmbientIlluminance(final Double ambientIlluminance) {
79+
this.ambientIlluminance = ambientIlluminance;
80+
}
81+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
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 infrastructure.configuration.model.environment;
10+
11+
/**
12+
* Class that model the environmental data of an operating room.
13+
* It differs from the standard one for the presence of the surgical lights.
14+
*/
15+
public class OperatingRoomEnvironmentalDataConfig extends EnvironmentalDataConfig {
16+
private Double surgicalIlluminance;
17+
18+
/** Default constructor. */
19+
public OperatingRoomEnvironmentalDataConfig() {
20+
super();
21+
}
22+
23+
/**
24+
* Constructor to perform copy.
25+
* @param other to copy.
26+
*/
27+
public OperatingRoomEnvironmentalDataConfig(final OperatingRoomEnvironmentalDataConfig other) {
28+
super(other);
29+
this.surgicalIlluminance = other.surgicalIlluminance;
30+
}
31+
32+
/**
33+
* Surgical illuminance getter.
34+
* @return the surgical illuminance.
35+
*/
36+
public Double getSurgicalIlluminance() {
37+
return this.surgicalIlluminance;
38+
}
39+
40+
/**
41+
* Surgical illuminance setter.
42+
* @param surgicalIlluminance to set.
43+
*/
44+
public void setSurgicalIlluminance(final Double surgicalIlluminance) {
45+
this.surgicalIlluminance = surgicalIlluminance;
46+
}
47+
}
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
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 infrastructure.configuration.model.scenario;
10+
11+
/**
12+
* Class that models a medical technology scenario config.
13+
*/
14+
public class MedicalTechnologyScenario {
15+
private String medicalTechnologyType;
16+
private Double ambientIlluminance;
17+
private Double surgicalIlluminance;
18+
19+
/** Default constructor. */
20+
public MedicalTechnologyScenario() {
21+
// This constructor is intentionally empty. Nothing special is needed here.
22+
}
23+
24+
/**
25+
* Constructor to perform copy.
26+
* @param other to copy.
27+
*/
28+
public MedicalTechnologyScenario(final MedicalTechnologyScenario other) {
29+
this.medicalTechnologyType = other.medicalTechnologyType;
30+
this.ambientIlluminance = other.ambientIlluminance;
31+
this.surgicalIlluminance = other.surgicalIlluminance;
32+
}
33+
34+
/**
35+
* Medical technology type getter.
36+
* @return the medical technology type.
37+
*/
38+
public String getMedicalTechnologyType() {
39+
return this.medicalTechnologyType;
40+
}
41+
42+
/**
43+
* Medical Technology type setter.
44+
* @param medicalTechnologyType to set.
45+
*/
46+
public void setMedicalTechnologyType(final String medicalTechnologyType) {
47+
this.medicalTechnologyType = medicalTechnologyType;
48+
}
49+
50+
/**
51+
* Ambient light getter.
52+
* @return the ambient light.
53+
*/
54+
public Double getAmbientIlluminance() {
55+
return this.ambientIlluminance;
56+
}
57+
58+
/**
59+
* Ambient light setter.
60+
* @param ambientIlluminance to set.
61+
*/
62+
public void setAmbientIlluminance(final Double ambientIlluminance) {
63+
this.ambientIlluminance = ambientIlluminance;
64+
}
65+
66+
/**
67+
* Surgical light getter.
68+
* @return the surgical light.
69+
*/
70+
public Double getSurgicalIlluminance() {
71+
return this.surgicalIlluminance;
72+
}
73+
74+
/**
75+
* Surgical light setter.
76+
* @param surgicalIlluminance to set.
77+
*/
78+
public void setSurgicalIlluminance(final Double surgicalIlluminance) {
79+
this.surgicalIlluminance = surgicalIlluminance;
80+
}
81+
}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
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 infrastructure.configuration.model.standby;
10+
11+
import infrastructure.configuration.model.environment.OperatingRoomEnvironmentalDataConfig;
12+
13+
/**
14+
* Standby configuration for operating room.
15+
*/
16+
public class OperatingRoomStandbyMode extends StandbyMode {
17+
private OperatingRoomEnvironmentalDataConfig environment;
18+
19+
/** Default constructor. */
20+
public OperatingRoomStandbyMode() {
21+
super();
22+
}
23+
24+
/**
25+
* Constructor to perform copy.
26+
* @param other to copy.
27+
*/
28+
public OperatingRoomStandbyMode(final OperatingRoomStandbyMode other) {
29+
super(other);
30+
this.environment = new OperatingRoomEnvironmentalDataConfig(other.environment);
31+
}
32+
33+
/**
34+
* Standby mode environmental data configuration getter.
35+
* @return the environmental data configuration.
36+
*/
37+
public OperatingRoomEnvironmentalDataConfig getEnvironment() {
38+
return new OperatingRoomEnvironmentalDataConfig(this.environment);
39+
}
40+
41+
/**
42+
* Set the environmental data config for standby mode.
43+
* @param environment config to set.
44+
*/
45+
public void setEnvironment(final OperatingRoomEnvironmentalDataConfig environment) {
46+
this.environment = new OperatingRoomEnvironmentalDataConfig(environment);
47+
}
48+
}

0 commit comments

Comments
 (0)