From 4608f89364ba2347f0eb69e961b64e818ad959b7 Mon Sep 17 00:00:00 2001 From: Lukas Radermacher <49586507+lukasrad02@users.noreply.github.com> Date: Thu, 11 May 2023 11:09:33 +0200 Subject: [PATCH 01/12] Add transfer counts radiogram --- .../models/radiogram/exercise-radiogram.ts | 3 + shared/src/models/radiogram/index.ts | 1 + .../radiogram/transfer-counts-radiogram.ts | 70 +++++++++++++++++++ 3 files changed, 74 insertions(+) create mode 100644 shared/src/models/radiogram/transfer-counts-radiogram.ts diff --git a/shared/src/models/radiogram/exercise-radiogram.ts b/shared/src/models/radiogram/exercise-radiogram.ts index 1ac3e1fc1..492d61208 100644 --- a/shared/src/models/radiogram/exercise-radiogram.ts +++ b/shared/src/models/radiogram/exercise-radiogram.ts @@ -8,6 +8,7 @@ import { Radiogram } from './radiogram'; import { TreatmentStatusRadiogram } from './treatment-status-radiogram'; import { VehicleCountRadiogram } from './vehicle-count-radiogram'; import { ResourceRequestRadiogram } from './resource-request-radiogram'; +import { TransferCountsRadiogram } from './transfer-counts-radiogram'; export const radiograms = { MaterialCountRadiogram, @@ -15,6 +16,7 @@ export const radiograms = { PatientCountRadiogram, PersonnelCountRadiogram, ResourceRequestRadiogram, + TransferCountsRadiogram, TreatmentStatusRadiogram, VehicleCountRadiogram, }; @@ -33,6 +35,7 @@ export const radiogramDictionary: ExerciseRadiogramDictionary = { patientCountRadiogram: PatientCountRadiogram, personnelCountRadiogram: PersonnelCountRadiogram, resourceRequestRadiogram: ResourceRequestRadiogram, + transferCountsRadiogram: TransferCountsRadiogram, treatmentStatusRadiogram: TreatmentStatusRadiogram, vehicleCountRadiogram: VehicleCountRadiogram, }; diff --git a/shared/src/models/radiogram/index.ts b/shared/src/models/radiogram/index.ts index dfea8ddf1..9ea090f50 100644 --- a/shared/src/models/radiogram/index.ts +++ b/shared/src/models/radiogram/index.ts @@ -8,3 +8,4 @@ export * from './treatment-status-radiogram'; export * from './vehicle-count-radiogram'; export * from './resource-request-radiogram'; export * from './status'; +export * from './transfer-counts-radiogram'; diff --git a/shared/src/models/radiogram/transfer-counts-radiogram.ts b/shared/src/models/radiogram/transfer-counts-radiogram.ts new file mode 100644 index 000000000..b1fffb612 --- /dev/null +++ b/shared/src/models/radiogram/transfer-counts-radiogram.ts @@ -0,0 +1,70 @@ +import { IsBoolean, IsUUID, ValidateNested } from 'class-validator'; +import { UUID, uuidValidationOptions } from '../../utils'; +import { IsLiteralUnion, IsValue } from '../../utils/validators'; +import { IsRadiogramStatus } from '../../utils/validators/is-radiogram-status'; +import type { PatientStatus } from '../utils'; +import { getCreate } from '../utils'; +import { ResourceDescription } from '../utils/resource-description'; +import { IsResourceDescription } from '../../utils/validators/is-resource-description'; +import type { Radiogram } from './radiogram'; +import { ExerciseRadiogramStatus } from './status/exercise-radiogram-status'; + +type Scope = 'singleRegion' | 'transportManagement'; + +export class TransferCountsRadiogram implements Radiogram { + @IsUUID(4, uuidValidationOptions) + readonly id: UUID; + + @IsValue('transferCountsRadiogram') + readonly type = 'transferCountsRadiogram'; + + @IsUUID(4, uuidValidationOptions) + readonly simulatedRegionId: UUID; + + /** + * @deprecated use the helpers from {@link radiogram-helpers.ts} + * or {@link radiogram-helpers-mutable.ts} instead + */ + @IsRadiogramStatus() + @ValidateNested() + readonly status: ExerciseRadiogramStatus; + + @IsBoolean() + readonly informationAvailable: boolean = false; + + @IsResourceDescription() + readonly transferredPatientsCounts!: ResourceDescription; + + @IsResourceDescription() + readonly remainingPatientsCounts!: ResourceDescription; + + /** + * Defines the scope of the counts reported with this radiogram. + * * `singleRegion`: The patient counts refer only to the simulated region that sent the radiogram + * * `transportManagement`: The patient counts refer to all simulated regions + * that are managed by the transport management behavior of the simulated region that sent the radiogram + */ + @IsLiteralUnion({ singleRegion: true, transportManagement: true }) + readonly scope!: Scope; + + /** + * @deprecated Use {@link create} instead + */ + constructor( + id: UUID, + simulatedRegionId: UUID, + status: ExerciseRadiogramStatus, + transferredPatientsCounts: ResourceDescription, + remainingPatientsCounts: ResourceDescription, + scope: Scope + ) { + this.id = id; + this.simulatedRegionId = simulatedRegionId; + this.status = status; + this.transferredPatientsCounts = transferredPatientsCounts; + this.remainingPatientsCounts = remainingPatientsCounts; + this.scope = scope; + } + + static readonly create = getCreate(this); +} From 8a98513321f987d9edafafc472979ce4acdd37e4 Mon Sep 17 00:00:00 2001 From: Lukas Radermacher <49586507+lukasrad02@users.noreply.github.com> Date: Thu, 11 May 2023 11:14:29 +0200 Subject: [PATCH 02/12] Add empty radiogram component --- ...ard-content-transfer-counts.component.html | 1 + ...ard-content-transfer-counts.component.scss | 0 ...-card-content-transfer-counts.component.ts | 27 +++++++++++++++++++ .../radiogram-card-content.component.html | 23 +++++++++------- .../simulated-region-overview.module.ts | 2 ++ 5 files changed, 43 insertions(+), 10 deletions(-) create mode 100644 frontend/src/app/pages/exercises/exercise/shared/simulated-region-overview/radiogram-list/radiogram-card/radiogram-card-content-transfer-counts/radiogram-card-content-transfer-counts.component.html create mode 100644 frontend/src/app/pages/exercises/exercise/shared/simulated-region-overview/radiogram-list/radiogram-card/radiogram-card-content-transfer-counts/radiogram-card-content-transfer-counts.component.scss create mode 100644 frontend/src/app/pages/exercises/exercise/shared/simulated-region-overview/radiogram-list/radiogram-card/radiogram-card-content-transfer-counts/radiogram-card-content-transfer-counts.component.ts diff --git a/frontend/src/app/pages/exercises/exercise/shared/simulated-region-overview/radiogram-list/radiogram-card/radiogram-card-content-transfer-counts/radiogram-card-content-transfer-counts.component.html b/frontend/src/app/pages/exercises/exercise/shared/simulated-region-overview/radiogram-list/radiogram-card/radiogram-card-content-transfer-counts/radiogram-card-content-transfer-counts.component.html new file mode 100644 index 000000000..acada3bce --- /dev/null +++ b/frontend/src/app/pages/exercises/exercise/shared/simulated-region-overview/radiogram-list/radiogram-card/radiogram-card-content-transfer-counts/radiogram-card-content-transfer-counts.component.html @@ -0,0 +1 @@ +

radiogram-card-content-transfer-counts works!

diff --git a/frontend/src/app/pages/exercises/exercise/shared/simulated-region-overview/radiogram-list/radiogram-card/radiogram-card-content-transfer-counts/radiogram-card-content-transfer-counts.component.scss b/frontend/src/app/pages/exercises/exercise/shared/simulated-region-overview/radiogram-list/radiogram-card/radiogram-card-content-transfer-counts/radiogram-card-content-transfer-counts.component.scss new file mode 100644 index 000000000..e69de29bb diff --git a/frontend/src/app/pages/exercises/exercise/shared/simulated-region-overview/radiogram-list/radiogram-card/radiogram-card-content-transfer-counts/radiogram-card-content-transfer-counts.component.ts b/frontend/src/app/pages/exercises/exercise/shared/simulated-region-overview/radiogram-list/radiogram-card/radiogram-card-content-transfer-counts/radiogram-card-content-transfer-counts.component.ts new file mode 100644 index 000000000..cb206ecfc --- /dev/null +++ b/frontend/src/app/pages/exercises/exercise/shared/simulated-region-overview/radiogram-list/radiogram-card/radiogram-card-content-transfer-counts/radiogram-card-content-transfer-counts.component.ts @@ -0,0 +1,27 @@ +import type { OnInit } from '@angular/core'; +import { Component, Input } from '@angular/core'; +import { Store } from '@ngrx/store'; +import type { TransferCountsRadiogram } from 'digital-fuesim-manv-shared'; +import { UUID } from 'digital-fuesim-manv-shared'; +import type { Observable } from 'rxjs'; +import type { AppState } from 'src/app/state/app.state'; +import { createSelectRadiogram } from 'src/app/state/application/selectors/exercise.selectors'; + +@Component({ + selector: 'app-radiogram-card-content-transfer-counts', + templateUrl: './radiogram-card-content-transfer-counts.component.html', + styleUrls: ['./radiogram-card-content-transfer-counts.component.scss'], +}) +export class RadiogramCardContentTransferCountsComponent implements OnInit { + @Input() radiogramId!: UUID; + + radiogram$!: Observable; + + constructor(private readonly store: Store) {} + + ngOnInit(): void { + this.radiogram$ = this.store.select( + createSelectRadiogram(this.radiogramId) + ); + } +} diff --git a/frontend/src/app/pages/exercises/exercise/shared/simulated-region-overview/radiogram-list/radiogram-card/radiogram-card-content/radiogram-card-content.component.html b/frontend/src/app/pages/exercises/exercise/shared/simulated-region-overview/radiogram-list/radiogram-card/radiogram-card-content/radiogram-card-content.component.html index a211acb09..a1006ec7f 100644 --- a/frontend/src/app/pages/exercises/exercise/shared/simulated-region-overview/radiogram-list/radiogram-card/radiogram-card-content/radiogram-card-content.component.html +++ b/frontend/src/app/pages/exercises/exercise/shared/simulated-region-overview/radiogram-list/radiogram-card/radiogram-card-content/radiogram-card-content.component.html @@ -5,39 +5,42 @@ + /> - + /> + /> + /> + /> + /> + /> + + /> + /> diff --git a/frontend/src/app/pages/exercises/exercise/shared/simulated-region-overview/simulated-region-overview.module.ts b/frontend/src/app/pages/exercises/exercise/shared/simulated-region-overview/simulated-region-overview.module.ts index b752dcb93..5f611040c 100644 --- a/frontend/src/app/pages/exercises/exercise/shared/simulated-region-overview/simulated-region-overview.module.ts +++ b/frontend/src/app/pages/exercises/exercise/shared/simulated-region-overview/simulated-region-overview.module.ts @@ -50,6 +50,7 @@ import { SimulatedRegionOverviewVehiclesTabComponent } from './tabs/vehicles-tab import { SimulatedRegionOverviewPatientsTableComponent } from './patients-table/simulated-region-overview-patients-table.component'; import { StartTransferService } from './start-transfer.service'; import { SimulatedRegionOverviewBehaviorTransferVehiclesComponent } from './tabs/behavior-tab/behaviors/transfer-vehicles/simulated-region-overview-behavior-transfer-vehicles.component'; +import { RadiogramCardContentTransferCountsComponent } from './radiogram-list/radiogram-card/radiogram-card-content-transfer-counts/radiogram-card-content-transfer-counts.component'; @NgModule({ declarations: [ @@ -90,6 +91,7 @@ import { SimulatedRegionOverviewBehaviorTransferVehiclesComponent } from './tabs SimulatedRegionOverviewVehiclesTabComponent, SimulatedRegionOverviewPatientsTableComponent, SimulatedRegionOverviewBehaviorTransferVehiclesComponent, + RadiogramCardContentTransferCountsComponent, ], imports: [ FormsModule, From 74af19883ca043d76e021e271b929cd42613f822 Mon Sep 17 00:00:00 2001 From: Lukas Radermacher <49586507+lukasrad02@users.noreply.github.com> Date: Thu, 11 May 2023 12:21:15 +0200 Subject: [PATCH 03/12] Make transfer counts radiogram reportable --- .../human-readable-radiogram-type.pipe.ts | 1 + ...gion-overview-behavior-report.component.ts | 1 + .../radiogram/transfer-counts-radiogram.ts | 21 ++++++++++--------- shared/src/simulation/behaviors/utils.ts | 4 ++++ 4 files changed, 17 insertions(+), 10 deletions(-) diff --git a/frontend/src/app/pages/exercises/exercise/shared/simulated-region-overview/radiogram-list/human-readable-radiogram-type.pipe.ts b/frontend/src/app/pages/exercises/exercise/shared/simulated-region-overview/radiogram-list/human-readable-radiogram-type.pipe.ts index 4ef2d47aa..a1edc587c 100644 --- a/frontend/src/app/pages/exercises/exercise/shared/simulated-region-overview/radiogram-list/human-readable-radiogram-type.pipe.ts +++ b/frontend/src/app/pages/exercises/exercise/shared/simulated-region-overview/radiogram-list/human-readable-radiogram-type.pipe.ts @@ -10,6 +10,7 @@ const map: { [Key in ExerciseRadiogram['type']]: string } = { treatmentStatusRadiogram: 'Behandlungsstatus', vehicleCountRadiogram: 'Anzahl an Fahrzeugen', resourceRequestRadiogram: 'Anfrage nach Fahrzeugen', + transferCountsRadiogram: 'Anzahl transportierter Patienten', }; @Pipe({ diff --git a/frontend/src/app/pages/exercises/exercise/shared/simulated-region-overview/tabs/behavior-tab/behaviors/report/simulated-region-overview-behavior-report.component.ts b/frontend/src/app/pages/exercises/exercise/shared/simulated-region-overview/tabs/behavior-tab/behaviors/report/simulated-region-overview-behavior-report.component.ts index 276fc1596..b61cbf4b5 100644 --- a/frontend/src/app/pages/exercises/exercise/shared/simulated-region-overview/tabs/behavior-tab/behaviors/report/simulated-region-overview-behavior-report.component.ts +++ b/frontend/src/app/pages/exercises/exercise/shared/simulated-region-overview/tabs/behavior-tab/behaviors/report/simulated-region-overview-behavior-report.component.ts @@ -43,6 +43,7 @@ export class SimulatedRegionOverviewBehaviorReportComponent implements OnInit { personnelCount: 'Anzahl an Rettungskräften', materialCount: 'Anzahl an Material', treatmentStatus: 'Behandlungsstatus', + transferCounts: 'Anzahl der ins Krankenhaus transportierten Patienten', }; createReportCollapsed = true; diff --git a/shared/src/models/radiogram/transfer-counts-radiogram.ts b/shared/src/models/radiogram/transfer-counts-radiogram.ts index b1fffb612..6c9fd0a4c 100644 --- a/shared/src/models/radiogram/transfer-counts-radiogram.ts +++ b/shared/src/models/radiogram/transfer-counts-radiogram.ts @@ -11,6 +11,11 @@ import { ExerciseRadiogramStatus } from './status/exercise-radiogram-status'; type Scope = 'singleRegion' | 'transportManagement'; +type TransferablePatientStatus = Exclude< + PatientStatus, + 'black' | 'blue' | 'white' +>; + export class TransferCountsRadiogram implements Radiogram { @IsUUID(4, uuidValidationOptions) readonly id: UUID; @@ -33,10 +38,12 @@ export class TransferCountsRadiogram implements Radiogram { readonly informationAvailable: boolean = false; @IsResourceDescription() - readonly transferredPatientsCounts!: ResourceDescription; + readonly transferredPatientsCounts: ResourceDescription = + { red: 0, yellow: 0, green: 0 }; @IsResourceDescription() - readonly remainingPatientsCounts!: ResourceDescription; + readonly remainingPatientsCounts: ResourceDescription = + { red: 0, yellow: 0, green: 0 }; /** * Defines the scope of the counts reported with this radiogram. @@ -45,7 +52,7 @@ export class TransferCountsRadiogram implements Radiogram { * that are managed by the transport management behavior of the simulated region that sent the radiogram */ @IsLiteralUnion({ singleRegion: true, transportManagement: true }) - readonly scope!: Scope; + readonly scope: Scope = 'singleRegion'; /** * @deprecated Use {@link create} instead @@ -53,17 +60,11 @@ export class TransferCountsRadiogram implements Radiogram { constructor( id: UUID, simulatedRegionId: UUID, - status: ExerciseRadiogramStatus, - transferredPatientsCounts: ResourceDescription, - remainingPatientsCounts: ResourceDescription, - scope: Scope + status: ExerciseRadiogramStatus ) { this.id = id; this.simulatedRegionId = simulatedRegionId; this.status = status; - this.transferredPatientsCounts = transferredPatientsCounts; - this.remainingPatientsCounts = remainingPatientsCounts; - this.scope = scope; } static readonly create = getCreate(this); diff --git a/shared/src/simulation/behaviors/utils.ts b/shared/src/simulation/behaviors/utils.ts index 679d24ff0..b5fcd1157 100644 --- a/shared/src/simulation/behaviors/utils.ts +++ b/shared/src/simulation/behaviors/utils.ts @@ -1,3 +1,4 @@ +import { TransferCountsRadiogram } from '../../models/radiogram'; import type { ExerciseRadiogram } from '../../models/radiogram/exercise-radiogram'; import { MaterialCountRadiogram } from '../../models/radiogram/material-count-radiogram'; import { PatientCountRadiogram } from '../../models/radiogram/patient-count-radiogram'; @@ -14,6 +15,7 @@ export const reportableInformationAllowedValues: AllowedValues Date: Thu, 11 May 2023 12:21:26 +0200 Subject: [PATCH 04/12] Display information of transfer counts radiogram --- ...ard-content-transfer-counts.component.html | 32 ++++++++++++++++++- ...-card-content-transfer-counts.component.ts | 2 ++ 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/frontend/src/app/pages/exercises/exercise/shared/simulated-region-overview/radiogram-list/radiogram-card/radiogram-card-content-transfer-counts/radiogram-card-content-transfer-counts.component.html b/frontend/src/app/pages/exercises/exercise/shared/simulated-region-overview/radiogram-list/radiogram-card/radiogram-card-content-transfer-counts/radiogram-card-content-transfer-counts.component.html index acada3bce..2a958d588 100644 --- a/frontend/src/app/pages/exercises/exercise/shared/simulated-region-overview/radiogram-list/radiogram-card/radiogram-card-content-transfer-counts/radiogram-card-content-transfer-counts.component.html +++ b/frontend/src/app/pages/exercises/exercise/shared/simulated-region-overview/radiogram-list/radiogram-card/radiogram-card-content-transfer-counts/radiogram-card-content-transfer-counts.component.html @@ -1 +1,31 @@ -

radiogram-card-content-transfer-counts works!

+
Transportstatus
+ + +

Für diese Patientenablage.

+

+ Für alle von dieser Transportorganisation verwalteten Patientenablagen. +

+ + + + + + + + + + + + + + + + +
SKTransportiertVerbleibend
+ + + {{ radiogram.transferredPatientsCounts[category] }} + + {{ radiogram.remainingPatientsCounts[category] }} +
+
diff --git a/frontend/src/app/pages/exercises/exercise/shared/simulated-region-overview/radiogram-list/radiogram-card/radiogram-card-content-transfer-counts/radiogram-card-content-transfer-counts.component.ts b/frontend/src/app/pages/exercises/exercise/shared/simulated-region-overview/radiogram-list/radiogram-card/radiogram-card-content-transfer-counts/radiogram-card-content-transfer-counts.component.ts index cb206ecfc..ff6e31549 100644 --- a/frontend/src/app/pages/exercises/exercise/shared/simulated-region-overview/radiogram-list/radiogram-card/radiogram-card-content-transfer-counts/radiogram-card-content-transfer-counts.component.ts +++ b/frontend/src/app/pages/exercises/exercise/shared/simulated-region-overview/radiogram-list/radiogram-card/radiogram-card-content-transfer-counts/radiogram-card-content-transfer-counts.component.ts @@ -13,6 +13,8 @@ import { createSelectRadiogram } from 'src/app/state/application/selectors/exerc styleUrls: ['./radiogram-card-content-transfer-counts.component.scss'], }) export class RadiogramCardContentTransferCountsComponent implements OnInit { + readonly categories = ['red', 'yellow', 'green'] as const; + @Input() radiogramId!: UUID; radiogram$!: Observable; From 7b470660a0a495ac32d102b31bda97d60da3efbc Mon Sep 17 00:00:00 2001 From: Lukas Radermacher <49586507+lukasrad02@users.noreply.github.com> Date: Thu, 11 May 2023 12:26:16 +0200 Subject: [PATCH 05/12] Add changes to changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 49e7cd081..65ad60f38 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project does **not** adhere to [Semantic Versioning](https://semver.org ## [Unreleased] +### Added + +- The reports behavior can generate reports on the counts of transferred patients per triage category. + ### Changed - Add behaviors button now opens towards the top. From 9842402f6e7bb8278d8c80267db39f8f18a59b7f Mon Sep 17 00:00:00 2001 From: Lukas Radermacher <49586507+lukasrad02@users.noreply.github.com> Date: Thu, 11 May 2023 12:27:10 +0200 Subject: [PATCH 06/12] Add test scenario --- test-scenarios | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test-scenarios b/test-scenarios index e2e137a14..68698db4c 160000 --- a/test-scenarios +++ b/test-scenarios @@ -1 +1 @@ -Subproject commit e2e137a14c2c4375db93900311de0eabc6a41aed +Subproject commit 68698db4cce70ebf808682c634c80069dd4b8b52 From 6eadae0d9233db1e88a237cc0b4a5ee51aafde83 Mon Sep 17 00:00:00 2001 From: Lukas Radermacher <49586507+lukasrad02@users.noreply.github.com> Date: Thu, 11 May 2023 13:41:47 +0200 Subject: [PATCH 07/12] Use more descriptive radiogram title --- .../radiogram-list/human-readable-radiogram-type.pipe.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/app/pages/exercises/exercise/shared/simulated-region-overview/radiogram-list/human-readable-radiogram-type.pipe.ts b/frontend/src/app/pages/exercises/exercise/shared/simulated-region-overview/radiogram-list/human-readable-radiogram-type.pipe.ts index a1edc587c..dde5c1291 100644 --- a/frontend/src/app/pages/exercises/exercise/shared/simulated-region-overview/radiogram-list/human-readable-radiogram-type.pipe.ts +++ b/frontend/src/app/pages/exercises/exercise/shared/simulated-region-overview/radiogram-list/human-readable-radiogram-type.pipe.ts @@ -10,7 +10,7 @@ const map: { [Key in ExerciseRadiogram['type']]: string } = { treatmentStatusRadiogram: 'Behandlungsstatus', vehicleCountRadiogram: 'Anzahl an Fahrzeugen', resourceRequestRadiogram: 'Anfrage nach Fahrzeugen', - transferCountsRadiogram: 'Anzahl transportierter Patienten', + transferCountsRadiogram: 'Anzahl abtransportierter Patienten', }; @Pipe({ From f4ecf505a40928bd3b767ff14e32c5732fd71f25 Mon Sep 17 00:00:00 2001 From: Lukas Radermacher <49586507+lukasrad02@users.noreply.github.com> Date: Thu, 11 May 2023 13:43:57 +0200 Subject: [PATCH 08/12] Use more descriptive table header --- .../radiogram-card-content-transfer-counts.component.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/app/pages/exercises/exercise/shared/simulated-region-overview/radiogram-list/radiogram-card/radiogram-card-content-transfer-counts/radiogram-card-content-transfer-counts.component.html b/frontend/src/app/pages/exercises/exercise/shared/simulated-region-overview/radiogram-list/radiogram-card/radiogram-card-content-transfer-counts/radiogram-card-content-transfer-counts.component.html index 2a958d588..7fd300906 100644 --- a/frontend/src/app/pages/exercises/exercise/shared/simulated-region-overview/radiogram-list/radiogram-card/radiogram-card-content-transfer-counts/radiogram-card-content-transfer-counts.component.html +++ b/frontend/src/app/pages/exercises/exercise/shared/simulated-region-overview/radiogram-list/radiogram-card/radiogram-card-content-transfer-counts/radiogram-card-content-transfer-counts.component.html @@ -10,7 +10,7 @@
Transportstatus
SK - Transportiert + Abtransportiert Verbleibend From 8cb457e5153624724f7f41f1e2ab393cb8edf84b Mon Sep 17 00:00:00 2001 From: Lukas Radermacher <49586507+lukasrad02@users.noreply.github.com> Date: Thu, 11 May 2023 14:04:19 +0200 Subject: [PATCH 09/12] Support all triage categories --- ...ard-content-transfer-counts.component.html | 35 ++++++++++++++++++- ...-card-content-transfer-counts.component.ts | 19 +++++++++- .../radiogram/transfer-counts-radiogram.ts | 25 ++++++++----- 3 files changed, 68 insertions(+), 11 deletions(-) diff --git a/frontend/src/app/pages/exercises/exercise/shared/simulated-region-overview/radiogram-list/radiogram-card/radiogram-card-content-transfer-counts/radiogram-card-content-transfer-counts.component.html b/frontend/src/app/pages/exercises/exercise/shared/simulated-region-overview/radiogram-list/radiogram-card/radiogram-card-content-transfer-counts/radiogram-card-content-transfer-counts.component.html index 7fd300906..1327e36ab 100644 --- a/frontend/src/app/pages/exercises/exercise/shared/simulated-region-overview/radiogram-list/radiogram-card/radiogram-card-content-transfer-counts/radiogram-card-content-transfer-counts.component.html +++ b/frontend/src/app/pages/exercises/exercise/shared/simulated-region-overview/radiogram-list/radiogram-card/radiogram-card-content-transfer-counts/radiogram-card-content-transfer-counts.component.html @@ -15,7 +15,7 @@
Transportstatus
- + @@ -26,6 +26,39 @@
Transportstatus
{{ radiogram.remainingPatientsCounts[category] }} + + + + + + + {{ radiogram.transferredPatientsCounts[category] }} + + + {{ radiogram.remainingPatientsCounts[category] }} + + + + + + + + + + {{ radiogram.transferredPatientsCounts[category] }} + + + {{ radiogram.remainingPatientsCounts[category] }} + + + diff --git a/frontend/src/app/pages/exercises/exercise/shared/simulated-region-overview/radiogram-list/radiogram-card/radiogram-card-content-transfer-counts/radiogram-card-content-transfer-counts.component.ts b/frontend/src/app/pages/exercises/exercise/shared/simulated-region-overview/radiogram-list/radiogram-card/radiogram-card-content-transfer-counts/radiogram-card-content-transfer-counts.component.ts index ff6e31549..34c659e07 100644 --- a/frontend/src/app/pages/exercises/exercise/shared/simulated-region-overview/radiogram-list/radiogram-card/radiogram-card-content-transfer-counts/radiogram-card-content-transfer-counts.component.ts +++ b/frontend/src/app/pages/exercises/exercise/shared/simulated-region-overview/radiogram-list/radiogram-card/radiogram-card-content-transfer-counts/radiogram-card-content-transfer-counts.component.ts @@ -13,7 +13,24 @@ import { createSelectRadiogram } from 'src/app/state/application/selectors/exerc styleUrls: ['./radiogram-card-content-transfer-counts.component.scss'], }) export class RadiogramCardContentTransferCountsComponent implements OnInit { - readonly categories = ['red', 'yellow', 'green'] as const; + /** + * Categories that should always be listed in the table. + */ + readonly alwaysShowCategories = ['red', 'yellow', 'green'] as const; + + /** + * Categories that should be listed in the table if patients of these categories have been transferred and/or are remaining. + */ + readonly showIfTransferredOrRemainingCategories = [ + 'blue', + 'white', + ] as const; + + /** + * Categories that should only be listed in the table if patients of these categories have been transferred. + * (Black patients should usually never be transferred, so its okay to not show their remaining number.) + */ + readonly showIfTransferredCategories = ['black'] as const; @Input() radiogramId!: UUID; diff --git a/shared/src/models/radiogram/transfer-counts-radiogram.ts b/shared/src/models/radiogram/transfer-counts-radiogram.ts index 6c9fd0a4c..bcca47969 100644 --- a/shared/src/models/radiogram/transfer-counts-radiogram.ts +++ b/shared/src/models/radiogram/transfer-counts-radiogram.ts @@ -11,11 +11,6 @@ import { ExerciseRadiogramStatus } from './status/exercise-radiogram-status'; type Scope = 'singleRegion' | 'transportManagement'; -type TransferablePatientStatus = Exclude< - PatientStatus, - 'black' | 'blue' | 'white' ->; - export class TransferCountsRadiogram implements Radiogram { @IsUUID(4, uuidValidationOptions) readonly id: UUID; @@ -38,12 +33,24 @@ export class TransferCountsRadiogram implements Radiogram { readonly informationAvailable: boolean = false; @IsResourceDescription() - readonly transferredPatientsCounts: ResourceDescription = - { red: 0, yellow: 0, green: 0 }; + readonly transferredPatientsCounts: ResourceDescription = { + red: 0, + yellow: 0, + green: 0, + blue: 0, + black: 0, + white: 0, + }; @IsResourceDescription() - readonly remainingPatientsCounts: ResourceDescription = - { red: 0, yellow: 0, green: 0 }; + readonly remainingPatientsCounts: ResourceDescription = { + red: 0, + yellow: 0, + green: 0, + blue: 0, + black: 0, + white: 0, + }; /** * Defines the scope of the counts reported with this radiogram. From 554d57582b6dd0845cf177cbdb1ef18ffc9ccfb9 Mon Sep 17 00:00:00 2001 From: Lukas Radermacher <49586507+lukasrad02@users.noreply.github.com> Date: Thu, 11 May 2023 14:06:59 +0200 Subject: [PATCH 10/12] Update test scenarios to use all triage categories --- test-scenarios | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test-scenarios b/test-scenarios index 68698db4c..7c4d485f2 160000 --- a/test-scenarios +++ b/test-scenarios @@ -1 +1 @@ -Subproject commit 68698db4cce70ebf808682c634c80069dd4b8b52 +Subproject commit 7c4d485f201a068e03da9c860ef68a39177cbbfa From 28255b8706b429818839ccd4c46162390a4158c6 Mon Sep 17 00:00:00 2001 From: Lukas Radermacher <49586507+lukasrad02@users.noreply.github.com> Date: Thu, 11 May 2023 14:20:49 +0200 Subject: [PATCH 11/12] Extract scope type to utils --- shared/src/models/radiogram/index.ts | 1 + shared/src/models/radiogram/transfer-counts-radiogram.ts | 5 ++--- shared/src/models/radiogram/utils/index.ts | 1 + shared/src/models/radiogram/utils/scope.ts | 6 ++++++ 4 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 shared/src/models/radiogram/utils/index.ts create mode 100644 shared/src/models/radiogram/utils/scope.ts diff --git a/shared/src/models/radiogram/index.ts b/shared/src/models/radiogram/index.ts index 9ea090f50..01d5f969a 100644 --- a/shared/src/models/radiogram/index.ts +++ b/shared/src/models/radiogram/index.ts @@ -9,3 +9,4 @@ export * from './vehicle-count-radiogram'; export * from './resource-request-radiogram'; export * from './status'; export * from './transfer-counts-radiogram'; +export * from './utils'; diff --git a/shared/src/models/radiogram/transfer-counts-radiogram.ts b/shared/src/models/radiogram/transfer-counts-radiogram.ts index bcca47969..265f898e1 100644 --- a/shared/src/models/radiogram/transfer-counts-radiogram.ts +++ b/shared/src/models/radiogram/transfer-counts-radiogram.ts @@ -8,8 +8,7 @@ import { ResourceDescription } from '../utils/resource-description'; import { IsResourceDescription } from '../../utils/validators/is-resource-description'; import type { Radiogram } from './radiogram'; import { ExerciseRadiogramStatus } from './status/exercise-radiogram-status'; - -type Scope = 'singleRegion' | 'transportManagement'; +import { Scope, scopeAllowedValues } from './utils/scope'; export class TransferCountsRadiogram implements Radiogram { @IsUUID(4, uuidValidationOptions) @@ -58,7 +57,7 @@ export class TransferCountsRadiogram implements Radiogram { * * `transportManagement`: The patient counts refer to all simulated regions * that are managed by the transport management behavior of the simulated region that sent the radiogram */ - @IsLiteralUnion({ singleRegion: true, transportManagement: true }) + @IsLiteralUnion(scopeAllowedValues) readonly scope: Scope = 'singleRegion'; /** diff --git a/shared/src/models/radiogram/utils/index.ts b/shared/src/models/radiogram/utils/index.ts new file mode 100644 index 000000000..4f041b0c7 --- /dev/null +++ b/shared/src/models/radiogram/utils/index.ts @@ -0,0 +1 @@ +export * from './scope'; diff --git a/shared/src/models/radiogram/utils/scope.ts b/shared/src/models/radiogram/utils/scope.ts new file mode 100644 index 000000000..3c9392280 --- /dev/null +++ b/shared/src/models/radiogram/utils/scope.ts @@ -0,0 +1,6 @@ +export type Scope = 'singleRegion' | 'transportManagement'; + +export const scopeAllowedValues = { + singleRegion: true, + transportManagement: true, +} as const; From ff5498d9760a200a253bdf85b5d1f1fb35fded78 Mon Sep 17 00:00:00 2001 From: Lukas Radermacher <49586507+lukasrad02@users.noreply.github.com> Date: Thu, 11 May 2023 14:32:49 +0200 Subject: [PATCH 12/12] Fix mutability problem --- shared/src/models/radiogram/utils/scope.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/shared/src/models/radiogram/utils/scope.ts b/shared/src/models/radiogram/utils/scope.ts index 3c9392280..8bb06460f 100644 --- a/shared/src/models/radiogram/utils/scope.ts +++ b/shared/src/models/radiogram/utils/scope.ts @@ -1,6 +1,8 @@ +import type { AllowedValues } from '../../../utils/validators'; + export type Scope = 'singleRegion' | 'transportManagement'; -export const scopeAllowedValues = { +export const scopeAllowedValues: AllowedValues = { singleRegion: true, transportManagement: true, -} as const; +};