From ec2d28fdd62f4dfc6491df32cc41959914d615cf Mon Sep 17 00:00:00 2001
From: Lukas Radermacher <49586507+lukasrad02@users.noreply.github.com>
Date: Thu, 11 May 2023 13:26:02 +0200
Subject: [PATCH] Feature/966 add transport patient to hospital ocupation
(#979)
* Add patient transfer occupation
* Show a description for patient transfer occupation
---
.../vehicle-occupation-editor.component.html | 6 ++++++
.../utils/occupations/exercise-occupation.ts | 3 +++
shared/src/models/utils/occupations/index.ts | 6 ++++++
.../patient-transfer-occupation.ts | 19 +++++++++++++++++++
4 files changed, 34 insertions(+)
create mode 100644 shared/src/models/utils/occupations/patient-transfer-occupation.ts
diff --git a/frontend/src/app/shared/components/vehicle-occupation-editor/vehicle-occupation-editor.component.html b/frontend/src/app/shared/components/vehicle-occupation-editor/vehicle-occupation-editor.component.html
index a5a70ed56..df187bfb1 100644
--- a/frontend/src/app/shared/components/vehicle-occupation-editor/vehicle-occupation-editor.component.html
+++ b/frontend/src/app/shared/components/vehicle-occupation-editor/vehicle-occupation-editor.component.html
@@ -18,6 +18,12 @@
Das Fahrzeug wartet auf den Transfer.
+
+
+ Das Fahrzeug ist für den Transport von Patienten ins Krankenhaus
+ reserviert.
+
+
Die Tätigkeit ist unbekannt.
diff --git a/shared/src/models/utils/occupations/exercise-occupation.ts b/shared/src/models/utils/occupations/exercise-occupation.ts
index 2261ab1c7..68a57dd36 100644
--- a/shared/src/models/utils/occupations/exercise-occupation.ts
+++ b/shared/src/models/utils/occupations/exercise-occupation.ts
@@ -6,6 +6,7 @@ import { NoOccupation } from './no-occupation';
import { LoadOccupation } from './load-occupation';
import { WaitForTransferOccupation } from './wait-for-transfer-occupation';
import { UnloadingOccupation } from './unloading-occupation';
+import { PatientTransferOccupation } from './patient-transfer-occupation';
export const occupations = {
IntermediateOccupation,
@@ -13,6 +14,7 @@ export const occupations = {
LoadOccupation,
WaitForTransferOccupation,
UnloadingOccupation,
+ PatientTransferOccupation,
};
export type ExerciseOccupation = InstanceType<
@@ -31,6 +33,7 @@ export const occupationDictionary: ExerciseOccupationDictionary = {
loadOccupation: LoadOccupation,
waitForTransferOccupation: WaitForTransferOccupation,
unloadingOccupation: UnloadingOccupation,
+ patientTransferOccupation: PatientTransferOccupation,
};
export const occupationTypeOptions: Parameters = [
diff --git a/shared/src/models/utils/occupations/index.ts b/shared/src/models/utils/occupations/index.ts
index 04a0f6c42..40f2e8f16 100644
--- a/shared/src/models/utils/occupations/index.ts
+++ b/shared/src/models/utils/occupations/index.ts
@@ -1,3 +1,9 @@
export * from './exercise-occupation';
export * from './intermediate-occupation';
export * from './no-occupation';
+export * from './load-occupation';
+export * from './occupation-helpers-mutable';
+export * from './occupation-helpers';
+export * from './patient-transfer-occupation';
+export * from './unloading-occupation';
+export * from './wait-for-transfer-occupation';
diff --git a/shared/src/models/utils/occupations/patient-transfer-occupation.ts b/shared/src/models/utils/occupations/patient-transfer-occupation.ts
new file mode 100644
index 000000000..87b9929ed
--- /dev/null
+++ b/shared/src/models/utils/occupations/patient-transfer-occupation.ts
@@ -0,0 +1,19 @@
+import { IsUUID } from 'class-validator';
+import { IsValue } from '../../../utils/validators';
+import { getCreate } from '../get-create';
+import { UUID, uuidValidationOptions } from '../../../utils';
+import type { Occupation } from './occupation';
+
+export class PatientTransferOccupation implements Occupation {
+ @IsValue('patientTransferOccupation')
+ readonly type = 'patientTransferOccupation';
+
+ @IsUUID(4, uuidValidationOptions)
+ readonly transportManagementRegionId: UUID;
+
+ constructor(transportManagementRegionId: UUID) {
+ this.transportManagementRegionId = transportManagementRegionId;
+ }
+
+ static readonly create = getCreate(this);
+}