diff --git a/.idea/sqlDataSources.xml b/.idea/sqlDataSources.xml
index e75a467..f73128a 100644
--- a/.idea/sqlDataSources.xml
+++ b/.idea/sqlDataSources.xml
@@ -25,6 +25,8 @@
+
+
diff --git a/.idea/sqldialects.xml b/.idea/sqldialects.xml
index aecddda..b2ef682 100644
--- a/.idea/sqldialects.xml
+++ b/.idea/sqldialects.xml
@@ -3,7 +3,6 @@
-
\ No newline at end of file
diff --git a/db/nursingHome.db b/db/nursingHome.db
index 2f42a9d..c3e0182 100644
Binary files a/db/nursingHome.db and b/db/nursingHome.db differ
diff --git a/src/main/java/de/hitec/nhplus/datastorage/DaoFactory.java b/src/main/java/de/hitec/nhplus/datastorage/DaoFactory.java
index f4fc8dc..ea4ccbe 100644
--- a/src/main/java/de/hitec/nhplus/datastorage/DaoFactory.java
+++ b/src/main/java/de/hitec/nhplus/datastorage/DaoFactory.java
@@ -1,5 +1,6 @@
package de.hitec.nhplus.datastorage;
+import de.hitec.nhplus.medication.database.MedicationDao;
import de.hitec.nhplus.nurse.database.NurseDao;
import de.hitec.nhplus.patient.database.PatientDao;
import de.hitec.nhplus.treatment.database.TreatmentDao;
@@ -56,4 +57,12 @@ public class DaoFactory {
public NurseDao createNurseDAO() {
return new NurseDao(ConnectionBuilder.getConnection());
}
+
+ /**
+ * @return a {@link MedicationDao}
+ * @author Dominik Säume
+ */
+ public MedicationDao createMedicationDAO() {
+ return new MedicationDao(ConnectionBuilder.getConnection());
+ }
}
diff --git a/src/main/java/de/hitec/nhplus/datastorage/DaoImp.java b/src/main/java/de/hitec/nhplus/datastorage/DaoImp.java
index 417c285..a9c7ff6 100644
--- a/src/main/java/de/hitec/nhplus/datastorage/DaoImp.java
+++ b/src/main/java/de/hitec/nhplus/datastorage/DaoImp.java
@@ -20,7 +20,6 @@ public abstract class DaoImp implements Dao {
/**
* @param connection a Database Connection, which should be gotten from {@link ConnectionBuilder}
- * @author Bernd Heidemann
*/
public DaoImp(Connection connection) {
this.connection = connection;
@@ -30,7 +29,6 @@ public abstract class DaoImp implements Dao {
* Creates a new Database Entry from a Model object.
*
* @param t the Model instance
- * @author Bernd Heidemann
*/
@Override
public void create(T t) throws SQLException {
@@ -41,7 +39,6 @@ public abstract class DaoImp implements Dao {
* Read a Database Entry to a Model object.
*
* @param id of the Element in the Database
- * @author Bernd Heidemann
*/
@Override
public T read(int id) throws SQLException {
@@ -55,8 +52,6 @@ public abstract class DaoImp implements Dao {
/**
* Read all Database Entries to a {@link List} of Model objects.
- *
- * @author Bernd Heidemann
*/
@Override
public List readAll() throws SQLException {
@@ -67,7 +62,6 @@ public abstract class DaoImp implements Dao {
* Update the Database according to the Values of the Model object.
*
* @param t the Model instance.
- * @author Bernd Heidemann
*/
@Override
public void update(T t) throws SQLException {
@@ -78,7 +72,6 @@ public abstract class DaoImp implements Dao {
* Delete a Database Entry.
*
* @param id of the Element in the Database.
- * @author Bernd Heidemann
*/
@Override
public void delete(int id) throws SQLException {
diff --git a/src/main/java/de/hitec/nhplus/fixtures/Fixtures.java b/src/main/java/de/hitec/nhplus/fixtures/Fixtures.java
index 5c98676..9497632 100644
--- a/src/main/java/de/hitec/nhplus/fixtures/Fixtures.java
+++ b/src/main/java/de/hitec/nhplus/fixtures/Fixtures.java
@@ -29,6 +29,11 @@ public class Fixtures
nurseFixture.setupTable(connection);
nurseFixture.load();
+ MedicationFixture medicationFixture = new MedicationFixture();
+ medicationFixture.dropTable(connection);
+ medicationFixture.setupTable(connection);
+ medicationFixture.load();
+
} catch (Exception exception){
System.out.println(exception.getMessage());
}
diff --git a/src/main/java/de/hitec/nhplus/fixtures/MedicationFixture.java b/src/main/java/de/hitec/nhplus/fixtures/MedicationFixture.java
new file mode 100644
index 0000000..719e53c
--- /dev/null
+++ b/src/main/java/de/hitec/nhplus/fixtures/MedicationFixture.java
@@ -0,0 +1,157 @@
+package de.hitec.nhplus.fixtures;
+
+import de.hitec.nhplus.Main;
+import de.hitec.nhplus.datastorage.DaoFactory;
+import de.hitec.nhplus.medication.Ingredient;
+import de.hitec.nhplus.medication.Medication;
+import de.hitec.nhplus.medication.database.MedicationDao;
+
+import java.io.InputStream;
+import java.nio.charset.StandardCharsets;
+import java.sql.Connection;
+import java.sql.SQLException;
+import java.util.*;
+
+
+public class MedicationFixture implements Fixture {
+ private static final String SCHEMA = "/de/hitec/nhplus/medication/database/Medication.sql";
+ private static final String INGREDIENT_SCHEMA = "/de/hitec/nhplus/medication/database/Medication_Ingredient.sql";
+
+ @Override
+ public void dropTable(Connection connection) throws SQLException {
+ connection.createStatement().execute("DROP TABLE IF EXISTS medication");
+ connection.createStatement().execute("DROP TABLE IF EXISTS medication_ingredient");
+ }
+
+ @Override
+ public void setupTable(Connection connection) throws SQLException {
+
+ final InputStream schema = Main.class.getResourceAsStream(SCHEMA);
+ final InputStream ingredientSchema = Main.class.getResourceAsStream(INGREDIENT_SCHEMA);
+ assert schema != null;
+ assert ingredientSchema != null;
+ String SQL = new Scanner(schema, StandardCharsets.UTF_8)
+ .useDelimiter("\\A")
+ .next();
+ String ingredientSQL = ";" + new Scanner(ingredientSchema, StandardCharsets.UTF_8)
+ .useDelimiter("\\A")
+ .next();
+ connection.createStatement().execute(SQL);
+ connection.createStatement().execute(ingredientSQL);
+
+ }
+
+ @Override
+ public Map load() throws SQLException {
+ List medications = new ArrayList<>();
+
+ Ingredient metforminhydrochlorid = new Ingredient("Metforminhydrochlorid");
+ Ingredient cellulose = new Ingredient("Cellulose");
+ Ingredient povidon = new Ingredient("Povidon");
+ Ingredient magnesiumstearat = new Ingredient("Magnesiumstearat");
+ Ingredient lisinoprilDihydrat = new Ingredient("Lisinopril-Dihydrat");
+ Ingredient mannitol = new Ingredient("Mannitol");
+ Ingredient calciumphosphat = new Ingredient("Calciumphosphat");
+ Ingredient simvastatin = new Ingredient("Simvastatin");
+ Ingredient laktose = new Ingredient("Laktose");
+ Ingredient enoxaparinNatrium = new Ingredient("Enoxaparin-Natrium");
+ Ingredient benzylalkohol = new Ingredient("Benzylalkohol");
+ Ingredient wasser = new Ingredient("Wasser");
+ Ingredient levothyroxinnatrium = new Ingredient("Levothyroxinnatrium");
+ Ingredient staerke = new Ingredient("Stärke");
+ Ingredient akaziengummi = new Ingredient("Akaziengummi");
+ Ingredient warfarinnatrium = new Ingredient("Warfarinnatrium");
+
+ medications.add(new Medication(
+ 1,
+ "Metformin",
+ "AstraZeneca",
+ List.of(
+ metforminhydrochlorid,
+ cellulose,
+ povidon,
+ magnesiumstearat
+ ),
+ "Übelkeit, Durchfall, Laktatazidose (selten)",
+ "Oral",
+ 100
+ ));
+ medications.add(new Medication(
+ 2,
+ "Lisinopril",
+ "Teva Pharmaceuticals",
+ List.of(
+ lisinoprilDihydrat,
+ mannitol,
+ calciumphosphat,
+ magnesiumstearat
+ ),
+ "Schwindel, trockener Husten",
+ "Oral",
+ 150
+ ));
+ medications.add(new Medication(
+ 3,
+ "Simvastatin",
+ "Mylan",
+ List.of(
+ simvastatin,
+ laktose,
+ cellulose,
+ magnesiumstearat
+ ),
+ "Muskelschmerzen, Leberprobleme(selten)",
+ "Oral",
+ 80
+ ));
+ medications.add(new Medication(
+ 4,
+ "Enoxaparin",
+ "Sanofi",
+ List.of(
+ enoxaparinNatrium,
+ benzylalkohol,
+ wasser
+ ),
+ "Blutungen, Reaktionen an der Injektionsstelle",
+ "Unterhautinjektion",
+ 120
+ ));
+ medications.add(new Medication(
+ 5,
+ "Levothyroxin",
+ "Sandoz",
+ List.of(
+ levothyroxinnatrium,
+ laktose,
+ staerke,
+ akaziengummi
+ ),
+ "Herzrasen, Gewichtsverlust",
+ "Oral",
+ 90
+ ));
+ medications.add(new Medication(
+ 6,
+ "Warfarin",
+ "Apotex Inc.",
+ List.of(
+ warfarinnatrium,
+ laktose,
+ staerke,
+ magnesiumstearat
+ ),
+ "Blutungen, Blutergüsse",
+ "Oral",
+ 110
+ ));
+ MedicationDao dao = DaoFactory.getInstance().createMedicationDAO();
+ Map medicationsByName = new HashMap<>();
+ for (Medication medication : medications) {
+ dao.create(medication);
+ medicationsByName.put(medication.getName(), medication);
+ }
+ return medicationsByName;
+
+ }
+}
diff --git a/src/main/java/de/hitec/nhplus/fixtures/NurseFixture.java b/src/main/java/de/hitec/nhplus/fixtures/NurseFixture.java
index c31bb4d..7c2d98a 100644
--- a/src/main/java/de/hitec/nhplus/fixtures/NurseFixture.java
+++ b/src/main/java/de/hitec/nhplus/fixtures/NurseFixture.java
@@ -14,7 +14,7 @@ import java.util.*;
public class NurseFixture implements Fixture {
@Override
public void dropTable(Connection connection) throws SQLException {
- connection.createStatement().execute("DROP TABLE nurse");
+ connection.createStatement().execute("DROP TABLE IF EXISTS nurse");
}
@Override
diff --git a/src/main/java/de/hitec/nhplus/fixtures/PatientFixture.java b/src/main/java/de/hitec/nhplus/fixtures/PatientFixture.java
index dc040bf..372a832 100644
--- a/src/main/java/de/hitec/nhplus/fixtures/PatientFixture.java
+++ b/src/main/java/de/hitec/nhplus/fixtures/PatientFixture.java
@@ -16,7 +16,7 @@ import static de.hitec.nhplus.utils.DateConverter.convertStringToLocalDate;
public class PatientFixture implements Fixture {
@Override
public void dropTable(Connection connection) throws SQLException {
- connection.createStatement().execute("DROP TABLE patient");
+ connection.createStatement().execute("DROP TABLE IF EXISTS patient");
}
@Override
diff --git a/src/main/java/de/hitec/nhplus/fixtures/TreatmentFixture.java b/src/main/java/de/hitec/nhplus/fixtures/TreatmentFixture.java
index 3925d3a..cd2b7dc 100644
--- a/src/main/java/de/hitec/nhplus/fixtures/TreatmentFixture.java
+++ b/src/main/java/de/hitec/nhplus/fixtures/TreatmentFixture.java
@@ -24,7 +24,7 @@ public class TreatmentFixture implements Fixture {
@Override
public void dropTable(Connection connection) throws SQLException {
- connection.createStatement().execute("DROP TABLE treatment");
+ connection.createStatement().execute("DROP TABLE IF EXISTS treatment");
}
@Override
diff --git a/src/main/java/de/hitec/nhplus/medication/Ingredient.java b/src/main/java/de/hitec/nhplus/medication/Ingredient.java
new file mode 100644
index 0000000..626e3c0
--- /dev/null
+++ b/src/main/java/de/hitec/nhplus/medication/Ingredient.java
@@ -0,0 +1,25 @@
+package de.hitec.nhplus.medication;
+
+import javafx.beans.property.SimpleStringProperty;
+
+public class Ingredient {
+ private final SimpleStringProperty name;
+
+ public Ingredient(String name) {
+ this.name = new SimpleStringProperty(name);
+ }
+
+ public String getName() {
+ return name.get();
+ }
+
+ public SimpleStringProperty nameProperty() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name.set(name);
+ }
+
+
+}
diff --git a/src/main/java/de/hitec/nhplus/medication/Medication.java b/src/main/java/de/hitec/nhplus/medication/Medication.java
new file mode 100644
index 0000000..f27a312
--- /dev/null
+++ b/src/main/java/de/hitec/nhplus/medication/Medication.java
@@ -0,0 +1,152 @@
+package de.hitec.nhplus.medication;
+
+import javafx.beans.property.SimpleIntegerProperty;
+import javafx.beans.property.SimpleListProperty;
+import javafx.beans.property.SimpleStringProperty;
+import javafx.collections.FXCollections;
+import javafx.collections.ObservableList;
+
+import java.util.List;
+import java.util.StringJoiner;
+import java.util.stream.Collectors;
+
+public class Medication {
+ private SimpleIntegerProperty id;
+ private final SimpleStringProperty name;
+ private final SimpleStringProperty manufacturer;
+ private final SimpleListProperty ingredients;
+ private final SimpleStringProperty possibleSideEffects;
+ private final SimpleStringProperty administrationMethod;
+ private final SimpleIntegerProperty currentStock;
+
+ public Medication(
+ String name,
+ String manufacturer,
+ List ingredients,
+ String possibleSideEffects,
+ String administrationMethod,
+ int currentStock
+ ) {
+ this.name = new SimpleStringProperty(name);
+ this.manufacturer = new SimpleStringProperty(manufacturer);
+ this.ingredients = new SimpleListProperty<>(FXCollections.observableArrayList(ingredients));
+ this.possibleSideEffects = new SimpleStringProperty(possibleSideEffects);
+ this.administrationMethod = new SimpleStringProperty(administrationMethod);
+ this.currentStock = new SimpleIntegerProperty(currentStock);
+ }
+
+ public Medication(
+ int id,
+ String name,
+ String manufacturer,
+ List ingredients,
+ String possibleSideEffects,
+ String administrationMethod,
+ int currentStock
+ ) {
+ this.id = new SimpleIntegerProperty(id);
+ this.name = new SimpleStringProperty(name);
+ this.manufacturer = new SimpleStringProperty(manufacturer);
+ this.ingredients = new SimpleListProperty<>(FXCollections.observableArrayList(ingredients));
+ this.possibleSideEffects = new SimpleStringProperty(possibleSideEffects);
+ this.administrationMethod = new SimpleStringProperty(administrationMethod);
+ this.currentStock = new SimpleIntegerProperty(currentStock);
+ }
+
+ public int getId() {
+ return id.get();
+ }
+
+ public SimpleIntegerProperty idProperty() {
+ return id;
+ }
+
+ public String getName() {
+ return name.get();
+ }
+
+ public SimpleStringProperty nameProperty() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name.set(name);
+ }
+
+ public String getManufacturer() {
+ return manufacturer.get();
+ }
+
+ public SimpleStringProperty manufacturerProperty() {
+ return manufacturer;
+ }
+
+ public void setManufacturer(String manufacturer) {
+ this.manufacturer.set(manufacturer);
+ }
+
+ public ObservableList getIngredients() {
+ return ingredients.get();
+ }
+
+ public SimpleListProperty ingredientsProperty() {
+ return ingredients;
+ }
+
+ public void setIngredients(List ingredients) {
+ this.ingredients.set(FXCollections.observableArrayList(ingredients));
+ }
+
+ public String getPossibleSideEffects() {
+ return possibleSideEffects.get();
+ }
+
+ public SimpleStringProperty possibleSideEffectsProperty() {
+ return possibleSideEffects;
+ }
+
+ public void setPossibleSideEffects(String possibleSideEffects) {
+ this.possibleSideEffects.set(possibleSideEffects);
+ }
+
+ public String getAdministrationMethod() {
+ return administrationMethod.get();
+ }
+
+ public SimpleStringProperty administrationMethodProperty() {
+ return administrationMethod;
+ }
+
+ public void setAdministrationMethod(String administrationMethod) {
+ this.administrationMethod.set(administrationMethod);
+ }
+
+ public int getCurrentStock() {
+ return currentStock.get();
+ }
+
+ public SimpleIntegerProperty currentStockProperty() {
+ return currentStock;
+ }
+
+ public void setCurrentStock(int currentStock) {
+ this.currentStock.set(currentStock);
+ }
+
+ @Override
+ public String toString() {
+ return new StringJoiner(System.lineSeparator())
+ .add("MEDICATION")
+ .add("ID: " + this.getId())
+ .add("Name: " + this.getName())
+ .add("Manufacturer: " + this.getManufacturer())
+ .add("Ingredients: " + this.getIngredients()
+ .stream()
+ .map(Ingredient::getName)
+ .collect(Collectors.joining(", ", "[", "]")))
+ .add("Possible Side Effects: " + this.getPossibleSideEffects())
+ .add("Administration Method: " + this.getAdministrationMethod())
+ .add("Current Stock: " + this.getCurrentStock())
+ .toString();
+ }
+}
diff --git a/src/main/java/de/hitec/nhplus/medication/database/MedicationDao.java b/src/main/java/de/hitec/nhplus/medication/database/MedicationDao.java
new file mode 100644
index 0000000..c9eee57
--- /dev/null
+++ b/src/main/java/de/hitec/nhplus/medication/database/MedicationDao.java
@@ -0,0 +1,161 @@
+package de.hitec.nhplus.medication.database;
+
+import de.hitec.nhplus.datastorage.Dao;
+import de.hitec.nhplus.medication.Ingredient;
+import de.hitec.nhplus.medication.Medication;
+
+import javax.sql.rowset.CachedRowSet;
+import javax.sql.rowset.RowSetProvider;
+import java.sql.*;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class MedicationDao implements Dao {
+ protected final Connection connection;
+
+ public MedicationDao(Connection connection) {
+ this.connection = connection;
+ }
+
+ @Override
+ public void create(Medication medication) throws SQLException {
+ final String medicationSQL = """
+ INSERT INTO medication
+ (name, manufacturer, possibleSideEffects, administrationMethod, currentStock)
+ VALUES (?, ?, ?, ?, ?);
+ """;
+ PreparedStatement medicationStatement = this.connection.prepareStatement(medicationSQL);
+ medicationStatement.setString(1, medication.getName());
+ medicationStatement.setString(2, medication.getManufacturer());
+ medicationStatement.setString(3, medication.getPossibleSideEffects());
+ medicationStatement.setString(4, medication.getAdministrationMethod());
+ medicationStatement.setInt(5, medication.getCurrentStock());
+ medicationStatement.execute();
+
+ final String ingredientSQL = """
+ INSERT INTO medication_ingredient
+ (id, name)
+ VALUES (?, ?);
+ """;
+ for (Ingredient ingredient : medication.getIngredients()) {
+ PreparedStatement ingredientStatement = this.connection.prepareStatement(ingredientSQL);
+ ingredientStatement.setInt(1, medication.getId());
+ ingredientStatement.setString(2, ingredient.getName());
+ ingredientStatement.execute();
+ }
+ }
+
+ @Override
+ public Medication read(int id) throws SQLException {
+ final String SQL = """
+ SELECT medication.*, medication_ingredient.id
+ FROM medication
+ LEFT JOIN medication_ingredient ON medication.id = medication_ingredient.id
+ WHERE medication.id = ?
+ """;
+ PreparedStatement statement = this.connection.prepareStatement(SQL);
+ statement.setInt(1, id);
+ ResultSet result = statement.executeQuery();
+ return getInstanceFromResultSet(result);
+ }
+
+ @Override
+ public List readAll() throws SQLException {
+ final String SQL = """
+ SELECT medication.*, medication_ingredient.id
+ FROM medication LEFT JOIN
+ medication_ingredient ON medication.id = medication_ingredient.id
+ """;
+ ResultSet result = connection.prepareStatement(SQL).executeQuery();
+ Map> resultSetMap = new HashMap<>();
+
+ while (result.next()) {
+ List resultSetList = resultSetMap.computeIfAbsent(result.getInt(0), k -> new ArrayList<>());
+ resultSetList.add(result);
+ }
+
+ List medications = new ArrayList<>();
+ for (Map.Entry> entry : resultSetMap.entrySet()) {
+ medications.add(getInstanceFromResultSet(this.mergeResultSets(entry.getValue())));
+ }
+ return medications;
+
+ }
+
+ @Override
+ public void update(Medication medication) throws SQLException {
+ final String SQL = """
+ UPDATE medication SET
+ name = ?,
+ manufacturer = ?,
+ possibleSideEffects = ?,
+ administrationMethod = ?,
+ currentStock = ?
+ WHERE id = ?
+ """;
+ PreparedStatement preparedStatement = this.connection.prepareStatement(SQL);
+ preparedStatement.setString(1, medication.getName());
+ preparedStatement.setString(2, medication.getManufacturer());
+ preparedStatement.setString(3, medication.getPossibleSideEffects());
+ preparedStatement.setString(4, medication.getAdministrationMethod());
+ preparedStatement.setInt(5, medication.getCurrentStock());
+ preparedStatement.setInt(6, medication.getId());
+ preparedStatement.executeUpdate();
+ }
+
+ @Override
+ public void delete(int id) throws SQLException {
+ final String SQL = """
+ DELETE FROM medication WHERE medication.id = ?;
+ """;
+ PreparedStatement preparedStatement = this.connection.prepareStatement(SQL);
+ preparedStatement.setInt(1, id);
+ preparedStatement.executeUpdate();
+ }
+
+ private Medication getInstanceFromResultSet(ResultSet result) throws SQLException {
+ Medication medication = new Medication(
+ result.getInt(1),
+ result.getString(2),
+ result.getString(3),
+ null,
+ result.getString(4),
+ result.getString(5),
+ result.getInt(6)
+ );
+
+ List ingredients = new ArrayList<>();
+ while (result.next()) {
+ ingredients.add(new Ingredient(result.getString(2)));
+
+ }
+ medication.setIngredients(ingredients);
+ return medication;
+ }
+
+ /**
+ * Merges a List of ResultSets to one for further use.
+ *
+ * @param resultSetList the {@link List} of {@link ResultSet} to merge
+ * @return merged {@link ResultSet}
+ */
+ private ResultSet mergeResultSets(List resultSetList) throws SQLException {
+ ResultSetMetaData metaData = resultSetList.get(0).getMetaData();
+ CachedRowSet cachedRowSet = RowSetProvider.newFactory().createCachedRowSet();
+ cachedRowSet.populate(resultSetList.get(0));
+ for (int i = 1; i < resultSetList.size(); i++) {
+ ResultSet resultSet = resultSetList.get(i);
+ while (resultSet.next()) {
+ cachedRowSet.moveToInsertRow();
+ for (int j = 1; j <= metaData.getColumnCount(); j++) {
+ cachedRowSet.updateObject(j, resultSet.getObject(j));
+ }
+ cachedRowSet.insertRow();
+ }
+ }
+ cachedRowSet.moveToCurrentRow();
+ return cachedRowSet;
+ }
+}
diff --git a/src/main/resources/de/hitec/nhplus/medication/database/Medication.sql b/src/main/resources/de/hitec/nhplus/medication/database/Medication.sql
new file mode 100644
index 0000000..fc7c049
--- /dev/null
+++ b/src/main/resources/de/hitec/nhplus/medication/database/Medication.sql
@@ -0,0 +1,9 @@
+CREATE TABLE medication
+(
+ id INTEGER PRIMARY KEY AUTOINCREMENT,
+ name TEXT NOT NULL,
+ manufacturer TEXT NOT NULL,
+ possibleSideEffects TEXT NOT NULL,
+ administrationMethod TEXT NOT NULL,
+ currentStock INTEGER NOT NULL
+)
\ No newline at end of file
diff --git a/src/main/resources/de/hitec/nhplus/medication/database/Medication_Ingredient.sql b/src/main/resources/de/hitec/nhplus/medication/database/Medication_Ingredient.sql
new file mode 100644
index 0000000..dce00b2
--- /dev/null
+++ b/src/main/resources/de/hitec/nhplus/medication/database/Medication_Ingredient.sql
@@ -0,0 +1,6 @@
+CREATE TABLE medication_ingredient
+(
+ id INTEGER NOT NULL ,
+ name TEXT NOT NULL,
+ FOREIGN KEY (id) REFERENCES medication (id) ON DELETE CASCADE
+)
\ No newline at end of file