Skip to content

Commit

Permalink
PRIME-2803 reflect changes at CareConnect (#2614)
Browse files Browse the repository at this point in the history
* initial commit

* update text

* address PR issues

* more fix

* Minor tweaks

---------

Co-authored-by: Alan Leung <alan.leung57@gmail.com>
  • Loading branch information
bergomi02 and neophyte57 authored Nov 5, 2024
1 parent 529064e commit 7f69811
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
class="radio-button"
[value]="vendor.code">
{{ vendor.name }}
<span *ngIf="vendor.name === 'CareConnect'" class="warning-text">*Do not select CareConnect as the vendor without first contacting CareConnect at private.careconnect@phsa.ca</span>
</mat-radio-button>
</mat-radio-group>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,7 @@
.radio-button {
margin: .25rem 0;
}

.warning-text {
color: red;
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { ActivatedRoute, Router } from '@angular/router';
import { MatDialog } from '@angular/material/dialog';

import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy';
import { EMPTY } from 'rxjs';

import { noop, of } from 'rxjs';
import { exhaustMap, map, pairwise, startWith, tap } from 'rxjs/operators';
Expand All @@ -23,6 +24,8 @@ import { SiteFormStateService } from '@registration/shared/services/site-form-st
import { CareSettingPageFormState } from './care-setting-page-form-state.class';
import { NoContent } from '@core/resources/abstract-resource';
import { IStep } from '@shared/components/progress-indicator/progress-indicator.component';
import { DialogOptions } from '@shared/components/dialogs/dialog-options.model';
import { ConfirmDialogComponent } from '@shared/components/dialogs/confirm-dialog/confirm-dialog.component';

@UntilDestroy()
@Component({
Expand Down Expand Up @@ -170,15 +173,42 @@ export class CareSettingPageComponent extends AbstractCommunitySiteRegistrationP
}

protected submissionRequest(): NoContent {
if (this.formState.json.careSettingCode !== CareSettingEnum.DEVICE_PROVIDER) {
this.siteFormStateService.deviceProviderFormState.clearIndividualDeviceProviders();
}
if (this.formState.json.careSettingCode === CareSettingEnum.PRIVATE_COMMUNITY_HEALTH_PRACTICE) {
this.siteFormStateService.businessLicenceFormState.resetSiteId();

const sitePayload = this.siteFormStateService.json;
const request$ = this.siteResource.updateSite(sitePayload);


if (this.formState.json.careSettingCode === CareSettingEnum.PRIVATE_COMMUNITY_HEALTH_PRACTICE
&& this.vendorConfig.find(v => v.code === this.formState.vendorCode.value).name === 'CareConnect'
) {
const data: DialogOptions = {
title: 'Confirmation',
message: `I confirm I have contacted CareConnect.`,
actionText: 'Yes, I\'ve contacted CareConnect',
actionType: 'warn'
};

return this.dialog.open(ConfirmDialogComponent, { data })
.afterClosed()
.pipe(
exhaustMap((confirmation: boolean) => {
if (confirmation) {
this.siteFormStateService.businessLicenceFormState.resetSiteId();
return request$;
}
return EMPTY;
})
);
} else {
if (this.formState.json.careSettingCode === CareSettingEnum.PRIVATE_COMMUNITY_HEALTH_PRACTICE) {
this.siteFormStateService.businessLicenceFormState.resetSiteId();
}
if (this.formState.json.careSettingCode !== CareSettingEnum.DEVICE_PROVIDER) {
this.siteFormStateService.deviceProviderFormState.clearIndividualDeviceProviders();
}
}

const payload = this.siteFormStateService.json;
return this.siteResource.updateSite(payload);
return request$;
}

protected onSubmitFormIsValid(): void {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,10 @@
<div class="mid-content">
<div class="mt1">Site registration for:</div>
<div class="button_title">
- Private community health practice<br/>
- Private community health practice
<div class="warning-text">*Before starting a new site registration with CareConnect as the vendor, contact
CareConnect at private.careconnect@phsa.ca
</div>
- Community pharmacy<br/>
- Device providers
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,3 +150,8 @@ a.tab-link:visited {
.mat-select-value {
color: #ffffff !important;
}

.warning-text {
color: orangered;
font-size: 1.25rem;
}

0 comments on commit 7f69811

Please sign in to comment.