-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature/964 report behavior can send radiograms on last patient of a …
…category (#982) * Create transfer category completed radiogram * Fix variable name * Fix import * Display new radiogram * Create radiogram when category is completed * Add migration * Add test scenarios * Add changes to changelog * Disable per region reports by default
- Loading branch information
1 parent
d3e33b7
commit a58ceac
Showing
22 changed files
with
399 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
...sfer-category-completed/radiogram-card-content-transfer-category-completed.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<h5>Transport für SK abgeschlossen</h5> | ||
|
||
<ng-container *appLet="radiogram$ | async as radiogram"> | ||
<span> | ||
In | ||
<strong *ngIf="radiogram.scope === 'singleRegion'"> | ||
dieser Patientenablage | ||
</strong> | ||
<strong *ngIf="radiogram.scope === 'transportManagement'"> | ||
allen von dieser Transportorganisation verwalteten Patientenablagen | ||
</strong> | ||
ist der Abtransport der Patienten mit Sichtungskategorie | ||
</span> | ||
<app-patient-status-badge [status]="radiogram.completedCategory" /> | ||
<span> abgeschlossen.</span> | ||
</ng-container> |
Empty file.
34 changes: 34 additions & 0 deletions
34
...ansfer-category-completed/radiogram-card-content-transfer-category-completed.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import type { OnInit } from '@angular/core'; | ||
import { Component, Input } from '@angular/core'; | ||
import { Store } from '@ngrx/store'; | ||
import type { TransferCategoryCompletedRadiogram } 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-category-completed', | ||
templateUrl: | ||
'./radiogram-card-content-transfer-category-completed.component.html', | ||
styleUrls: [ | ||
'./radiogram-card-content-transfer-category-completed.component.scss', | ||
], | ||
}) | ||
export class RadiogramCardContentTransferCategoryCompletedComponent | ||
implements OnInit | ||
{ | ||
@Input() radiogramId!: UUID; | ||
|
||
radiogram$!: Observable<TransferCategoryCompletedRadiogram>; | ||
|
||
constructor(private readonly store: Store<AppState>) {} | ||
|
||
ngOnInit(): void { | ||
this.radiogram$ = this.store.select( | ||
createSelectRadiogram<TransferCategoryCompletedRadiogram>( | ||
this.radiogramId | ||
) | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
shared/src/models/radiogram/transfer-category-completed-radiogram.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
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 { getCreate, PatientStatus, patientStatusAllowedValues } from '../utils'; | ||
import type { Radiogram } from './radiogram'; | ||
import { ExerciseRadiogramStatus } from './status/exercise-radiogram-status'; | ||
import { | ||
Scope as TransferProgressScope, | ||
scopeAllowedValues, | ||
} from './utils/transfer-progress-scope'; | ||
|
||
export class TransferCategoryCompletedRadiogram implements Radiogram { | ||
@IsUUID(4, uuidValidationOptions) | ||
readonly id: UUID; | ||
|
||
@IsValue('transferCategoryCompletedRadiogram') | ||
readonly type = 'transferCategoryCompletedRadiogram'; | ||
|
||
@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; | ||
|
||
@IsLiteralUnion(patientStatusAllowedValues) | ||
readonly completedCategory: PatientStatus = 'white'; | ||
|
||
@IsLiteralUnion(scopeAllowedValues) | ||
readonly scope: TransferProgressScope = 'singleRegion'; | ||
|
||
/** | ||
* @deprecated Use {@link create} instead | ||
*/ | ||
constructor( | ||
id: UUID, | ||
simulatedRegionId: UUID, | ||
status: ExerciseRadiogramStatus | ||
) { | ||
this.id = id; | ||
this.simulatedRegionId = simulatedRegionId; | ||
this.status = status; | ||
} | ||
|
||
static readonly create = getCreate(this); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
export * from './scope'; | ||
export * from './transfer-progress-scope'; |
This file was deleted.
Oops, something went wrong.
14 changes: 14 additions & 0 deletions
14
shared/src/models/radiogram/utils/transfer-progress-scope.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import type { AllowedValues } from '../../../utils/validators'; | ||
|
||
/** | ||
* Defines the scope of the radiogram on the transfer progress. | ||
* * `singleRegion`: The information is only about the simulated region that sent the radiogram | ||
* * `transportManagement`: The information is about all simulated regions that are managed | ||
* by the transport management behavior of the simulated region that sent the radiogram | ||
*/ | ||
export type Scope = 'singleRegion' | 'transportManagement'; | ||
|
||
export const scopeAllowedValues: AllowedValues<Scope> = { | ||
singleRegion: true, | ||
transportManagement: true, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.