From b9159c274364b9b4cf557e60fa03285e8a04f40a Mon Sep 17 00:00:00 2001 From: Kuettner Tobias Date: Wed, 25 Mar 2020 08:02:54 +0100 Subject: [PATCH 1/3] Make link between test and patient working --- client/src/api/Api.js | 30 +++-- client/src/components/Navigation.vue | 6 +- .../laboratory/LinkSampleAndPatient.vue | 91 ------------- .../laboratory/LinkTestAndPatient.vue | 121 ++++++++++++++++++ .../laboratory/LinkTestResultAndPatient.vue | 2 +- client/src/components/laboratory/Login.vue | 7 +- ...entPage.vue => LinkTestAndPatientPage.vue} | 18 +-- client/src/routes/routes.js | 6 +- .../de/coronavirus/imis/TestDataLoader.java | 7 +- .../imis/api/LabTestController.java | 13 +- .../imis/api/dto/CreateLabTestDTO.java | 3 +- .../imis/api/dto/UpdateTestStatusDTO.java | 2 +- .../de/coronavirus/imis/domain/LabTest.java | 13 +- .../imis/services/LabTestService.java | 43 ++++--- .../resources/sample_data/createLabTest.json | 5 +- 15 files changed, 204 insertions(+), 163 deletions(-) delete mode 100644 client/src/components/laboratory/LinkSampleAndPatient.vue create mode 100644 client/src/components/laboratory/LinkTestAndPatient.vue rename client/src/components/page/{LinkSampleAndPatientPage.vue => LinkTestAndPatientPage.vue} (60%) diff --git a/client/src/api/Api.js b/client/src/api/Api.js index 72ba6525..deb26f58 100644 --- a/client/src/api/Api.js +++ b/client/src/api/Api.js @@ -42,7 +42,23 @@ class Api { } /* - * ---------------------------------- + * -----------IMPLEMENTED IN UI----------- + */ + + postInstitution(institution) { + return this.executeRequest("/institutions", METHOD.POST, institution); + } + + postPatient(patient) { + return this.executeRequest("/patients", METHOD.POST, patient); + } + + postLabTest(labtest) { + return this.executeRequest("/labtests", METHOD.POST, labtest); + } + + /* + * ---------NOT IMPLEMENTED IN UI--------- */ postDoctorCreateAppointment({ doctorId, laboratoryId, patientId }) { @@ -77,14 +93,6 @@ class Api { return this.executeRequest(`/test_reports/${testId}`, METHOD.DELETE); } - postInstitution(institution) { - return this.executeRequest("/institutions", METHOD.POST, institution); - } - - postLabtest(labtest) { - return this.executeRequest("/labtest", METHOD.POST, labtest); - } - putLabtest({ updatedTestStatus }) { return this.executeRequest("/labtest", METHOD.PUT, updatedTestStatus); } @@ -97,10 +105,6 @@ class Api { return this.executeRequest("/patients", METHOD.GET); } - postPatient(patient) { - return this.executeRequest("/patients", METHOD.POST, patient); - } - getPatient(id) { return this.executeRequest(`/patients/${id}`, METHOD.GET); } diff --git a/client/src/components/Navigation.vue b/client/src/components/Navigation.vue index c73827a2..1baf1759 100644 --- a/client/src/components/Navigation.vue +++ b/client/src/components/Navigation.vue @@ -19,15 +19,15 @@ const items = [ }, { key: "2", - url: "/link-sample-and-patient", + url: "/link-test-and-patient", type: "deployment-unit", - text: "Probe Zuordnen" + text: "Test Zuordnen" }, { key: "3", url: "/link-test-result", type: "experiment", - text: "Laborresultate" + text: "Testresultat Zuordnen" }, { key: "4", url: "/patient-overview", type: "user", text: "Patienten-Daten" }, { key: "5", url: "/all-data", type: "team", text: "Alle Patienten" }, diff --git a/client/src/components/laboratory/LinkSampleAndPatient.vue b/client/src/components/laboratory/LinkSampleAndPatient.vue deleted file mode 100644 index 2e7e5373..00000000 --- a/client/src/components/laboratory/LinkSampleAndPatient.vue +++ /dev/null @@ -1,91 +0,0 @@ - - - - - diff --git a/client/src/components/laboratory/LinkTestAndPatient.vue b/client/src/components/laboratory/LinkTestAndPatient.vue new file mode 100644 index 00000000..7cd4f878 --- /dev/null +++ b/client/src/components/laboratory/LinkTestAndPatient.vue @@ -0,0 +1,121 @@ + + + + + diff --git a/client/src/components/laboratory/LinkTestResultAndPatient.vue b/client/src/components/laboratory/LinkTestResultAndPatient.vue index fe2b9abd..4a9eb0d8 100644 --- a/client/src/components/laboratory/LinkTestResultAndPatient.vue +++ b/client/src/components/laboratory/LinkTestResultAndPatient.vue @@ -5,7 +5,7 @@ :wrapper-col="{ span: 18 }" @submit="handleSubmit" > - + - Testzugang: Kennung 1234, Password asdf + Testzugang mit Password asdf

@@ -71,8 +70,8 @@ export default { return; } - if (values.id === "1234" && values.password === "asdf") { - this.$emit("on-login-success"); + if (values.id && values.password === "asdf") { + this.$emit("on-login-success", values.id); } else { this.$notification["error"]({ message: "Login Fehler", diff --git a/client/src/components/page/LinkSampleAndPatientPage.vue b/client/src/components/page/LinkTestAndPatientPage.vue similarity index 60% rename from client/src/components/page/LinkSampleAndPatientPage.vue rename to client/src/components/page/LinkTestAndPatientPage.vue index b955e8a4..034cb65e 100644 --- a/client/src/components/page/LinkSampleAndPatientPage.vue +++ b/client/src/components/page/LinkTestAndPatientPage.vue @@ -5,17 +5,17 @@ - + @@ -23,22 +23,24 @@