Setup Utilities #12
9 changed files with 196 additions and 26 deletions
4
Makefile
4
Makefile
|
@ -23,8 +23,8 @@ stan: ## Runs Static Code Analysis
|
|||
test: ## Runs all tests
|
||||
@echo TODO
|
||||
|
||||
lint: ## Runs all Linting
|
||||
@echo TODO
|
||||
lint: ## Checks if the Code follows the Styling Conventions
|
||||
@mvn checkstyle:check
|
||||
|
||||
##|——[ linting ]———————————————————————————————————————————————————————————————————|
|
||||
java-lint: ## Corrects Code Linting in Java
|
||||
|
|
19
checkstyle.xml
Normal file
19
checkstyle.xml
Normal file
|
@ -0,0 +1,19 @@
|
|||
<?xml version="1.0"?>
|
||||
<!DOCTYPE module PUBLIC
|
||||
"-//Puppy Crawl//DTD Check Configuration 1.3//EN"
|
||||
"https://checkstyle.org/dtds/configuration_1_3.dtd">
|
||||
|
||||
<module name="Checker">
|
||||
<property name="severity" value="error"/>
|
||||
<property name="tabWidth" value="4"/>
|
||||
|
||||
<module name="LineLength">
|
||||
<property name="max" value="120"/>
|
||||
</module>
|
||||
<module name="FileTabCharacter">
|
||||
<property name="eachLine" value="true"/>
|
||||
</module>
|
||||
|
||||
<module name="NewlineAtEndOfFile"/>
|
||||
|
||||
</module>
|
12
pom.xml
12
pom.xml
|
@ -95,6 +95,18 @@
|
|||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<!-- Checkstyle Plugin -->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-checkstyle-plugin</artifactId>
|
||||
<version>3.3.1</version>
|
||||
<configuration>
|
||||
<configLocation>checkstyle.xml</configLocation>
|
||||
<failOnViolation>true</failOnViolation>
|
||||
<consoleOutput>true</consoleOutput>
|
||||
<sourceDirectories>src</sourceDirectories>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
|
|
|
@ -14,7 +14,6 @@ import java.io.IOException;
|
|||
public class Main extends Application {
|
||||
|
||||
private Stage primaryStage;
|
||||
|
||||
@Override
|
||||
public void start(Stage primaryStage) {
|
||||
this.primaryStage = primaryStage;
|
||||
|
|
|
@ -30,7 +30,14 @@ public class Patient extends Person {
|
|||
* @param roomNumber Room number of the patient.
|
||||
* @param assets Assets of the patient.
|
||||
*/
|
||||
public Patient(String firstName, String surname, LocalDate dateOfBirth, String careLevel, String roomNumber, String assets) {
|
||||
public Patient(
|
||||
String firstName,
|
||||
String surname,
|
||||
LocalDate dateOfBirth,
|
||||
String careLevel,
|
||||
String roomNumber,
|
||||
String assets
|
||||
) {
|
||||
super(firstName, surname);
|
||||
this.dateOfBirth = new SimpleStringProperty(DateConverter.convertLocalDateToString(dateOfBirth));
|
||||
this.careLevel = new SimpleStringProperty(careLevel);
|
||||
|
@ -50,7 +57,15 @@ public class Patient extends Person {
|
|||
* @param roomNumber Room number of the patient.
|
||||
* @param assets Assets of the patient.
|
||||
*/
|
||||
public Patient(long pid, String firstName, String surname, LocalDate dateOfBirth, String careLevel, String roomNumber, String assets) {
|
||||
public Patient(
|
||||
long pid,
|
||||
String firstName,
|
||||
String surname,
|
||||
LocalDate dateOfBirth,
|
||||
String careLevel,
|
||||
String roomNumber,
|
||||
String assets
|
||||
) {
|
||||
super(firstName, surname);
|
||||
this.pid = new SimpleLongProperty(pid);
|
||||
this.dateOfBirth = new SimpleStringProperty(DateConverter.convertLocalDateToString(dateOfBirth));
|
||||
|
|
|
@ -87,12 +87,54 @@ public class SetUpDB {
|
|||
private static void setUpPatients() {
|
||||
try {
|
||||
PatientDao dao = DaoFactory.getDaoFactory().createPatientDAO();
|
||||
dao.create(new Patient("Seppl", "Herberger", convertStringToLocalDate("1945-12-01"), "4", "202", "vermögend"));
|
||||
dao.create(new Patient("Martina", "Gerdsen", convertStringToLocalDate("1954-08-12"), "5", "010", "arm"));
|
||||
dao.create(new Patient("Gertrud", "Franzen", convertStringToLocalDate("1949-04-16"), "3", "002", "normal"));
|
||||
dao.create(new Patient("Ahmet", "Yilmaz", convertStringToLocalDate("1941-02-22"), "3", "013", "normal"));
|
||||
dao.create(new Patient("Hans", "Neumann", convertStringToLocalDate("1955-12-12"), "2", "001", "sehr vermögend"));
|
||||
dao.create(new Patient("Elisabeth", "Müller", convertStringToLocalDate("1958-03-07"), "5", "110", "arm"));
|
||||
dao.create(new Patient(
|
||||
"Seppl",
|
||||
"Herberger",
|
||||
convertStringToLocalDate("1945-12-01"),
|
||||
"4",
|
||||
"202",
|
||||
"vermögend"
|
||||
));
|
||||
dao.create(new Patient(
|
||||
"Martina",
|
||||
"Gerdsen",
|
||||
convertStringToLocalDate("1954-08-12"),
|
||||
"5",
|
||||
"010",
|
||||
"arm"
|
||||
));
|
||||
dao.create(new Patient(
|
||||
"Gertrud",
|
||||
"Franzen",
|
||||
convertStringToLocalDate("1949-04-16"),
|
||||
"3",
|
||||
"002",
|
||||
"normal"
|
||||
));
|
||||
dao.create(new Patient(
|
||||
"Ahmet",
|
||||
"Yilmaz",
|
||||
convertStringToLocalDate("1941-02-22"),
|
||||
"3",
|
||||
"013",
|
||||
"normal"
|
||||
));
|
||||
dao.create(new Patient(
|
||||
"Hans",
|
||||
"Neumann",
|
||||
convertStringToLocalDate("1955-12-12"),
|
||||
"2",
|
||||
"001",
|
||||
"sehr vermögend"
|
||||
));
|
||||
dao.create(new Patient(
|
||||
"Elisabeth",
|
||||
"Müller",
|
||||
convertStringToLocalDate("1958-03-07"),
|
||||
"5",
|
||||
"110",
|
||||
"arm"
|
||||
));
|
||||
} catch (SQLException exception) {
|
||||
exception.printStackTrace();
|
||||
}
|
||||
|
@ -101,16 +143,99 @@ public class SetUpDB {
|
|||
private static void setUpTreatments() {
|
||||
try {
|
||||
TreatmentDao dao = DaoFactory.getDaoFactory().createTreatmentDao();
|
||||
dao.create(new Treatment(1, 1, convertStringToLocalDate("2023-06-03"), convertStringToLocalTime("11:00"), convertStringToLocalTime("15:00"), "Gespräch", "Der Patient hat enorme Angstgefühle und glaubt, er sei überfallen worden. Ihm seien alle Wertsachen gestohlen worden.\nPatient beruhigt sich erst, als alle Wertsachen im Zimmer gefunden worden sind."));
|
||||
dao.create(new Treatment(2, 1, convertStringToLocalDate("2023-06-05"), convertStringToLocalTime("11:00"), convertStringToLocalTime("12:30"), "Gespräch", "Patient irrt auf der Suche nach gestohlenen Wertsachen durch die Etage und bezichtigt andere Bewohner des Diebstahls.\nPatient wird in seinen Raum zurückbegleitet und erhält Beruhigungsmittel."));
|
||||
dao.create(new Treatment(3, 2, convertStringToLocalDate("2023-06-04"), convertStringToLocalTime("07:30"), convertStringToLocalTime("08:00"), "Waschen", "Patient mit Waschlappen gewaschen und frisch angezogen. Patient gewendet."));
|
||||
dao.create(new Treatment(4, 1, convertStringToLocalDate("2023-06-06"), convertStringToLocalTime("15:10"), convertStringToLocalTime("16:00"), "Spaziergang", "Spaziergang im Park, Patient döst im Rollstuhl ein"));
|
||||
dao.create(new Treatment(8, 1, convertStringToLocalDate("2023-06-08"), convertStringToLocalTime("15:00"), convertStringToLocalTime("16:00"), "Spaziergang", "Parkspaziergang; Patient ist heute lebhafter und hat klare Momente; erzählt von seiner Tochter"));
|
||||
dao.create(new Treatment(9, 2, convertStringToLocalDate("2023-06-07"), convertStringToLocalTime("11:00"), convertStringToLocalTime("11:30"), "Waschen", "Waschen per Dusche auf einem Stuhl; Patientin gewendet;"));
|
||||
dao.create(new Treatment(12, 5, convertStringToLocalDate("2023-06-08"), convertStringToLocalTime("15:00"), convertStringToLocalTime("15:30"), "Physiotherapie", "Übungen zur Stabilisation und Mobilisierung der Rückenmuskulatur"));
|
||||
dao.create(new Treatment(14, 4, convertStringToLocalDate("2023-08-24"), convertStringToLocalTime("09:30"), convertStringToLocalTime("10:15"), "KG", "Lympfdrainage"));
|
||||
dao.create(new Treatment(16, 6, convertStringToLocalDate("2023-08-31"), convertStringToLocalTime("13:30"), convertStringToLocalTime("13:45"), "Toilettengang", "Hilfe beim Toilettengang; Patientin klagt über Schmerzen beim Stuhlgang. Gabe von Iberogast"));
|
||||
dao.create(new Treatment(17, 6, convertStringToLocalDate("2023-09-01"), convertStringToLocalTime("16:00"), convertStringToLocalTime("17:00"), "KG", "Massage der Extremitäten zur Verbesserung der Durchblutung"));
|
||||
dao.create(new Treatment(
|
||||
1,
|
||||
1,
|
||||
convertStringToLocalDate("2023-06-03"),
|
||||
convertStringToLocalTime("11:00"),
|
||||
convertStringToLocalTime("15:00"),
|
||||
"Gespräch",
|
||||
"Der Patient hat enorme Angstgefühle und glaubt, er sei überfallen worden."
|
||||
+ "Ihm seien alle Wertsachen gestohlen worden."
|
||||
+ "Patient beruhigt sich erst, als alle Wertsachen im Zimmer gefunden worden sind."
|
||||
));
|
||||
dao.create(new Treatment(
|
||||
2,
|
||||
1,
|
||||
convertStringToLocalDate("2023-06-05"),
|
||||
convertStringToLocalTime("11:00"),
|
||||
convertStringToLocalTime("12:30"),
|
||||
"Gespräch",
|
||||
"Patient irrt auf der Suche nach gestohlenen Wertsachen durch die Etage "
|
||||
+ "und bezichtigt andere Bewohner des Diebstahls."
|
||||
+ "Patient wird in seinen Raum zurückbegleitet und erhält Beruhigungsmittel."
|
||||
));
|
||||
dao.create(new Treatment(
|
||||
3,
|
||||
2,
|
||||
convertStringToLocalDate("2023-06-04"),
|
||||
convertStringToLocalTime("07:30"),
|
||||
convertStringToLocalTime("08:00"),
|
||||
"Waschen",
|
||||
"Patient mit Waschlappen gewaschen und frisch angezogen. Patient gewendet."
|
||||
));
|
||||
dao.create(new Treatment(
|
||||
4,
|
||||
1,
|
||||
convertStringToLocalDate("2023-06-06"),
|
||||
convertStringToLocalTime("15:10"),
|
||||
convertStringToLocalTime("16:00"),
|
||||
"Spaziergang",
|
||||
"Spaziergang im Park, Patient döst im Rollstuhl ein")
|
||||
);
|
||||
dao.create(new Treatment(
|
||||
8,
|
||||
1,
|
||||
convertStringToLocalDate("2023-06-08"),
|
||||
convertStringToLocalTime("15:00"),
|
||||
convertStringToLocalTime("16:00"),
|
||||
"Spaziergang",
|
||||
"Parkspaziergang; Patient ist heute lebhafter und hat klare Momente; erzählt von seiner Tochter")
|
||||
);
|
||||
dao.create(new Treatment(
|
||||
9,
|
||||
2,
|
||||
convertStringToLocalDate("2023-06-07"),
|
||||
convertStringToLocalTime("11:00"),
|
||||
convertStringToLocalTime("11:30"),
|
||||
"Waschen",
|
||||
"Waschen per Dusche auf einem Stuhl; Patientin gewendet;")
|
||||
);
|
||||
dao.create(new Treatment(
|
||||
12,
|
||||
5,
|
||||
convertStringToLocalDate("2023-06-08"),
|
||||
convertStringToLocalTime("15:00"),
|
||||
convertStringToLocalTime("15:30"),
|
||||
"Physiotherapie",
|
||||
"Übungen zur Stabilisation und Mobilisierung der Rückenmuskulatur")
|
||||
);
|
||||
dao.create(new Treatment(
|
||||
14,
|
||||
4,
|
||||
convertStringToLocalDate("2023-08-24"),
|
||||
convertStringToLocalTime("09:30"),
|
||||
convertStringToLocalTime("10:15"),
|
||||
"KG",
|
||||
"Lympfdrainage"));
|
||||
dao.create(new Treatment(
|
||||
16,
|
||||
6,
|
||||
convertStringToLocalDate("2023-08-31"),
|
||||
convertStringToLocalTime("13:30"),
|
||||
convertStringToLocalTime("13:45"),
|
||||
"Toilettengang",
|
||||
"Hilfe beim Toilettengang; Patientin klagt über Schmerzen beim Stuhlgang. Gabe von Iberogast")
|
||||
);
|
||||
dao.create(new Treatment(
|
||||
17,
|
||||
6,
|
||||
convertStringToLocalDate("2023-09-01"),
|
||||
convertStringToLocalTime("16:00"),
|
||||
convertStringToLocalTime("17:00"),
|
||||
"KG",
|
||||
"Massage der Extremitäten zur Verbesserung der Durchblutung")
|
||||
);
|
||||
} catch (SQLException exception) {
|
||||
exception.printStackTrace();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue