Skip to content

Commit

Permalink
Feature/966 add transport patient to hospital ocupation (#979)
Browse files Browse the repository at this point in the history
* Add patient transfer occupation

* Show a description for patient transfer occupation
  • Loading branch information
lukasrad02 authored May 11, 2023
1 parent 631cf6a commit ec2d28f
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@
<ng-container *ngSwitchCase="'waitForTransferOccupation'">
<span>Das Fahrzeug wartet auf den Transfer.</span>
</ng-container>
<ng-container *ngSwitchCase="'patientTransferOccupation'">
<span>
Das Fahrzeug ist für den Transport von Patienten ins Krankenhaus
reserviert.
</span>
</ng-container>
<ng-container *ngSwitchDefault>
<span class="text-muted">Die Tätigkeit ist unbekannt.</span>
</ng-container>
Expand Down
3 changes: 3 additions & 0 deletions shared/src/models/utils/occupations/exercise-occupation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ 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,
NoOccupation,
LoadOccupation,
WaitForTransferOccupation,
UnloadingOccupation,
PatientTransferOccupation,
};

export type ExerciseOccupation = InstanceType<
Expand All @@ -31,6 +33,7 @@ export const occupationDictionary: ExerciseOccupationDictionary = {
loadOccupation: LoadOccupation,
waitForTransferOccupation: WaitForTransferOccupation,
unloadingOccupation: UnloadingOccupation,
patientTransferOccupation: PatientTransferOccupation,
};

export const occupationTypeOptions: Parameters<typeof Type> = [
Expand Down
6 changes: 6 additions & 0 deletions shared/src/models/utils/occupations/index.ts
Original file line number Diff line number Diff line change
@@ -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';
19 changes: 19 additions & 0 deletions shared/src/models/utils/occupations/patient-transfer-occupation.ts
Original file line number Diff line number Diff line change
@@ -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);
}

0 comments on commit ec2d28f

Please sign in to comment.