Skip to content
This repository has been archived by the owner on Jun 20, 2022. It is now read-only.

Commit

Permalink
Merge dev into master (file upload / link test result)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kuettner Tobias committed Mar 25, 2020
2 parents fe20fbc + 8ef3b14 commit 91abce0
Show file tree
Hide file tree
Showing 21 changed files with 473 additions and 322 deletions.
14 changes: 8 additions & 6 deletions client/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,12 @@
</div>

<a-layout id="components-layout-demo-responsive">
<div class="logo" />
<Navigation />
<a-layout>
<a-layout-header
:style="{ background: '#fff', padding: 0, height: 'auto' }"
>
<a-layout-header style="height: auto">
<Navigation />
</a-layout-header>
<a-layout-content
style="margin: '0px auto'; box-sizing: border-box; padding: 2rem 4rem; width: 100%; min-height: calc(100vh - 46px - 69px);"
style="margin: auto; box-sizing: border-box; padding: 0rem 4rem; width: 100%;"
>
<div :style="{ padding: '0px', minHeight: '360px', width: '100%' }">
<router-view></router-view>
Expand Down Expand Up @@ -51,6 +48,11 @@ export default {
.prototype-warning {
border: 2px solid red;
font-size: 20px;
height: 35px;
background-color: #ffdddd;
}
#components-layout-demo-responsive {
height: calc(100vh - 35px);
}
</style>
40 changes: 22 additions & 18 deletions client/src/api/Api.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,27 @@ class Api {
}

/*
* ----------------------------------
* -----------IMPLEMENTED IN UI-----------
*/

postInstitution(request) {
return this.executeRequest("/institutions", METHOD.POST, request);
}

postPatient(request) {
return this.executeRequest("/patients", METHOD.POST, request);
}

postLabTest(request) {
return this.executeRequest("/labtests", METHOD.POST, request);
}

putLabTest(testId, request) {
return this.executeRequest(`/labtests/${testId}`, METHOD.PUT, request);
}

/*
* ---------NOT IMPLEMENTED IN UI---------
*/

postDoctorCreateAppointment({ doctorId, laboratoryId, patientId }) {
Expand Down Expand Up @@ -74,19 +94,7 @@ class Api {
}

deleteTestReport(testId) {
return this.executeRequest(`/test_report/${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);
return this.executeRequest(`/test_reports/${testId}`, METHOD.DELETE);
}

getLabtestByPatient(patientId) {
Expand All @@ -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);
}
Expand Down
6 changes: 3 additions & 3 deletions client/src/components/Navigation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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" },
Expand Down
91 changes: 0 additions & 91 deletions client/src/components/laboratory/LinkSampleAndPatient.vue

This file was deleted.

122 changes: 122 additions & 0 deletions client/src/components/laboratory/LinkTestAndPatient.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
<template>
<a-card style="width: 500px; margin: 2rem auto; min-height: 300px">
<div v-if="!createdLabTest">
<a-form
:label-col="{ span: 6 }"
:wrapper-col="{ span: 18 }"
:colon="false"
:form="form"
@submit="handleSubmit"
>
<a-form-item label="Patienten-ID">
<a-input
v-decorator="[
'patientId',
{
rules: [
{
required: true,
message: 'Bitte geben Sie die Patienten-ID ein.'
}
]
}
]"
placeholder="z.B 1337-4237-9438"
/>
</a-form-item>
<a-form-item label="Test-ID">
<a-input
v-decorator="[
'testId',
{
rules: [
{
required: true,
message: 'Bitte geben Sie die Test-ID ein.'
}
]
}
]"
placeholder="z.B ae48-hr43-sk97"
/>
</a-form-item>
<a-form-item label="Kommentar">
<a-textarea
v-decorator="['comment']"
placeholder="Kommentar hinzufügen"
:autoSize="{ minRows: 3, maxRows: 5 }"
/>
</a-form-item>
<a-divider />
<a-form-item :wrapper-col="{ span: 24, offset: 0 }">
<a-button type="primary" html-type="submit">
Speichern
</a-button>
</a-form-item>
</a-form>
</div>
<div v-else>
<div>Der Test wurde erfolgreich angelegt.</div>
<br />
<div>Test ID: {{ createdLabTest.id }}</div>
<div>Test Status: {{ createdLabTest.testStatus }}</div>
</div>
</a-card>
</template>

<script>
import Api from "../../api/Api";
export default {
name: "LinkTestAndPatient",
props: {
laboratoryId: {
type: String,
required: true
}
},
data() {
return {
form: this.$form.createForm(this),
createdLabTest: null
};
},
methods: {
handleSubmit(e) {
e.preventDefault();
this.form.validateFields((err, values) => {
if (err) {
return;
}
const request = {
...values,
laboratoryId: this.laboratoryId
};
Api.postLabTest(request)
.then(labTest => {
this.createdLabTest = labTest;
const notification = {
message: "Test angelegt und verknüpft.",
description:
"Der Test wurde erfolgreich angelegt und mit dem Patienten verknüpft."
};
this.$notification["success"](notification);
})
.catch(err => {
const notification = {
message: "Fehler beim Anlegen des Tests.",
description: err.message
};
this.$notification["error"](notification);
});
});
}
}
};
</script>

<style></style>
Loading

0 comments on commit 91abce0

Please sign in to comment.