From 7541d7e905e4ae5b1ea5bb93431c743d55f4797c Mon Sep 17 00:00:00 2001 From: Roya Shourouni <52804311+rshourou@users.noreply.github.com> Date: Mon, 15 Apr 2024 11:43:42 -0700 Subject: [PATCH 1/6] pull mailhog-server image from OCP imageStream (#2479) * pull image from OCP imageStream * remove irrelevant files --------- Co-authored-by: Shourouni <317198@NTTDATA.COM> Co-authored-by: Jack Wong <108699279+bergomi02@users.noreply.github.com> --- infrastructure/mailhog-template.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/infrastructure/mailhog-template.yml b/infrastructure/mailhog-template.yml index 2355e919d7..831e0e8b4a 100644 --- a/infrastructure/mailhog-template.yml +++ b/infrastructure/mailhog-template.yml @@ -15,9 +15,14 @@ parameters: value: "" required: false - name: MAILHOG_IMAGE + displayName: Mailhog Docker Image + value: image-registry.openshift-image-registry.svc:5000/9c33a9-dev/mailhog-server:latest + description: The mailhog docker image to use in DeploymentConfig + required: true +- name: DOCKER_IMAGE displayName: Mailhog Docker Image value: registry.hub.docker.com/mailhog/mailhog:latest - description: The mailhog docker image to use + description: The mailhog docker image to use in ImageStream required: true message: |- The following service(s) have been created in your project: @@ -50,7 +55,7 @@ objects: tags: - from: kind: DockerImage - name: ${MAILHOG_IMAGE} + name: ${DOCKER_IMAGE} generation: 2 importPolicy: {} name: latest From 5f18df4e197e9e715969081b3eadcb80ff2c2076 Mon Sep 17 00:00:00 2001 From: Jack Wong <108699279+bergomi02@users.noreply.github.com> Date: Wed, 17 Apr 2024 08:18:54 -0700 Subject: [PATCH 2/6] PRIME-2681 allow duplicate site ID for HA site (#2481) * initial commit * initial commit * fix PR issues * fix PR issues * add comment * update comment --- .../core/resources/site-resource.service.ts | 11 ++++++ .../site-overview-page.component.ts | 36 ++++++++++++++++--- .../health-authority-table.component.html | 12 ++++++- .../health-authority-table.component.scss | 5 +++ .../health-authority-table.component.ts | 14 +++++++- .../site-registration-tabs.component.html | 6 ++-- .../site-registration-tabs.component.ts | 18 ++++++++-- .../health-authority-admin-site-list.model.ts | 3 +- .../Controllers/SitesController.cs | 28 +++++++++++++++ prime-dotnet-webapi/Services/SiteService.cs | 9 +++++ .../Services/interfaces/ISiteService.cs | 1 + 11 files changed, 130 insertions(+), 13 deletions(-) diff --git a/prime-angular-frontend/src/app/core/resources/site-resource.service.ts b/prime-angular-frontend/src/app/core/resources/site-resource.service.ts index d3a6258aea..caeabc5f4c 100644 --- a/prime-angular-frontend/src/app/core/resources/site-resource.service.ts +++ b/prime-angular-frontend/src/app/core/resources/site-resource.service.ts @@ -595,4 +595,15 @@ export class SiteResource { }) ); } + + public pecExistsWithinHa(siteId: number, pec: string): Observable { + return this.apiResource.get(`sites/${siteId}/pec/${pec}/exists-within-ha`) + .pipe( + map((response: ApiHttpResponse) => response.result), + catchError((error: any) => { + this.logger.error('[SiteRegistration] SiteResource::pecExistsWithinHa error has occurred: ', error); + throw error; + }) + ); + } } diff --git a/prime-angular-frontend/src/app/modules/adjudication/pages/health-authorities/site-overview-page/site-overview-page.component.ts b/prime-angular-frontend/src/app/modules/adjudication/pages/health-authorities/site-overview-page/site-overview-page.component.ts index 92e7f0dca8..1aaaefedbe 100644 --- a/prime-angular-frontend/src/app/modules/adjudication/pages/health-authorities/site-overview-page/site-overview-page.component.ts +++ b/prime-angular-frontend/src/app/modules/adjudication/pages/health-authorities/site-overview-page/site-overview-page.component.ts @@ -16,6 +16,7 @@ import { DialogOptions } from '@shared/components/dialogs/dialog-options.model'; import { ChangeVendorNoteComponent } from '@shared/components/dialogs/content/change-vendor-note/change-vendor-note.component'; import { MatDialog } from '@angular/material/dialog'; import { HealthAuthority } from '@shared/models/health-authority.model'; +import { ConfirmDialogComponent } from '@shared/components/dialogs/confirm-dialog/confirm-dialog.component'; interface HealthAuthorityVendorMap extends VendorConfig { id?: number; @@ -57,11 +58,36 @@ export class SiteOverviewPageComponent implements OnInit { if (this.pec.valid) { const siteId = +this.route.snapshot.params.sid; const pec = this.form.value.pec; - this.busy = this.siteResource.updatePecCode(siteId, pec) - .subscribe(() => { - this.refresh.next(true); - this.site.pec = pec; - }); + + this.siteResource.pecExistsWithinHa(siteId, pec).subscribe((result) => { + if (result) { + const data: DialogOptions = { + title: 'Site ID is in use', + message: 'This Site ID is already in use. Allow multiple sites?', + actionText: "Yes" + }; + this.busy = this.dialog.open(ConfirmDialogComponent, { data }) + .afterClosed() + .subscribe((result) => { + if (result) { + this.busy = this.siteResource.updatePecCode(siteId, pec) + .subscribe(() => { + this.refresh.next(true); + this.site.pec = pec; + }); + } else { + this.pec.setValue(this.site.pec); + } + }); + } else { + this.busy = this.siteResource.updatePecCode(siteId, pec) + .subscribe(() => { + this.refresh.next(true); + this.site.pec = pec; + }); + } + }); + } } diff --git a/prime-angular-frontend/src/app/modules/adjudication/shared/components/health-authority-table/health-authority-table.component.html b/prime-angular-frontend/src/app/modules/adjudication/shared/components/health-authority-table/health-authority-table.component.html index 11bc4bb67b..0f5f5b267a 100644 --- a/prime-angular-frontend/src/app/modules/adjudication/shared/components/health-authority-table/health-authority-table.component.html +++ b/prime-angular-frontend/src/app/modules/adjudication/shared/components/health-authority-table/health-authority-table.component.html @@ -66,7 +66,17 @@ *matHeaderCellDef scope="col"> Site ID (PEC) {{ row.pec | default }} + *matCellDef="let row;"> +
+ {{ row.pec | default }} + info + +
+ diff --git a/prime-angular-frontend/src/app/modules/adjudication/shared/components/health-authority-table/health-authority-table.component.scss b/prime-angular-frontend/src/app/modules/adjudication/shared/components/health-authority-table/health-authority-table.component.scss index 44b64c03d8..8eb67f5950 100644 --- a/prime-angular-frontend/src/app/modules/adjudication/shared/components/health-authority-table/health-authority-table.component.scss +++ b/prime-angular-frontend/src/app/modules/adjudication/shared/components/health-authority-table/health-authority-table.component.scss @@ -7,6 +7,11 @@ color: theme-palette(red); } +.pec-alert { + color: theme-palette(yellow); + font-size: large; +} + .health-auth-menu { color: theme-palette(yellow); } diff --git a/prime-angular-frontend/src/app/modules/adjudication/shared/components/health-authority-table/health-authority-table.component.ts b/prime-angular-frontend/src/app/modules/adjudication/shared/components/health-authority-table/health-authority-table.component.ts index caa8e4b69d..7a931d9af1 100644 --- a/prime-angular-frontend/src/app/modules/adjudication/shared/components/health-authority-table/health-authority-table.component.ts +++ b/prime-angular-frontend/src/app/modules/adjudication/shared/components/health-authority-table/health-authority-table.component.ts @@ -26,6 +26,7 @@ export class HealthAuthorityTableComponent implements OnInit, OnChanges { @Output() public notify: EventEmitter<{ siteId: number, healthAuthorityOrganizationId: HealthAuthorityEnum }>; @Output() public reload: EventEmitter; @Output() public route: EventEmitter; + @Output() public pecFilter: EventEmitter; public dataSource: MatTableDataSource; public healthAuthorities: HealthAuthorityRow[]; @@ -62,6 +63,7 @@ export class HealthAuthorityTableComponent implements OnInit, OnChanges { this.notify = new EventEmitter<{ siteId: number, healthAuthorityOrganizationId: HealthAuthorityEnum }>(); this.reload = new EventEmitter(); this.route = new EventEmitter(); + this.pecFilter = new EventEmitter(); this.dataSource = new MatTableDataSource([]); } @@ -86,6 +88,10 @@ export class HealthAuthorityTableComponent implements OnInit, OnChanges { this.route.emit(routePath); } + public onPecFilter(pec: string) { + this.pecFilter.emit(pec); + } + public isHealthAuthority(row: HealthAuthorityRow | HealthAuthoritySiteAdminList): boolean { return row.hasOwnProperty('hasUnderReviewUsers'); } @@ -109,7 +115,9 @@ export class HealthAuthorityTableComponent implements OnInit, OnChanges { ); this.healthAuthorities = has; this.dataSource.data = Object.assign([], this.sites).concat(has).sort(this.sortData()); - }) + }); + + } else { this.dataSource.data = Object.assign([], this.sites).sort(this.sortData()); } @@ -123,6 +131,10 @@ export class HealthAuthorityTableComponent implements OnInit, OnChanges { } } + public getDuplicatePecText(row: HealthAuthoritySiteAdminList) { + return `${row.duplicatePecSiteCount + 1} sites share the same site ID`; + } + /** * @description * Sort health authorities and their grouped sites in ascending order by ID. diff --git a/prime-angular-frontend/src/app/modules/adjudication/shared/components/site-registration-tabs/site-registration-tabs.component.html b/prime-angular-frontend/src/app/modules/adjudication/shared/components/site-registration-tabs/site-registration-tabs.component.html index 854ee6c783..dbb9cdcb07 100644 --- a/prime-angular-frontend/src/app/modules/adjudication/shared/components/site-registration-tabs/site-registration-tabs.component.html +++ b/prime-angular-frontend/src/app/modules/adjudication/shared/components/site-registration-tabs/site-registration-tabs.component.html @@ -42,7 +42,8 @@ [id]="CareSettingEnum.HEALTH_AUTHORITY">
- + (reload)="onRefresh()" + (pecFilter)="onTextSearch($event)">
diff --git a/prime-angular-frontend/src/app/modules/adjudication/shared/components/site-registration-tabs/site-registration-tabs.component.ts b/prime-angular-frontend/src/app/modules/adjudication/shared/components/site-registration-tabs/site-registration-tabs.component.ts index fb20401b5d..77ca2d2408 100644 --- a/prime-angular-frontend/src/app/modules/adjudication/shared/components/site-registration-tabs/site-registration-tabs.component.ts +++ b/prime-angular-frontend/src/app/modules/adjudication/shared/components/site-registration-tabs/site-registration-tabs.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit, Input } from '@angular/core'; +import { Component, OnInit, Input, ViewChild } from '@angular/core'; import { ActivatedRoute, Router } from '@angular/router'; import { MatTableDataSource } from '@angular/material/table'; import { MatDialog } from '@angular/material/dialog'; @@ -22,7 +22,7 @@ import { AbstractSiteAdminPage } from '@adjudication/shared/classes/abstract-sit import { HealthAuthoritySiteAdminList } from '@health-auth/shared/models/health-authority-admin-site-list.model'; import { SiteRegistrationListViewModel } from '@registration/shared/models/site-registration.model'; import { AuthService } from '@auth/shared/services/auth.service'; -import { BcscUser } from '@auth/shared/models/bcsc-user.model'; +import { SearchHAFormComponent } from '../search-ha-form/search-ha-form.component'; @Component({ selector: 'app-site-registration-tabs', @@ -32,6 +32,7 @@ import { BcscUser } from '@auth/shared/models/bcsc-user.model'; export class SiteRegistrationTabsComponent extends AbstractSiteAdminPage implements OnInit { public busy: Subscription; @Input() public refresh: Observable; + @ViewChild('searchHaForm') searchHaForm: SearchHAFormComponent; public dataSource: MatTableDataSource; public healthAuthoritySites: HealthAuthoritySiteAdminList[]; @@ -128,6 +129,11 @@ export class SiteRegistrationTabsComponent extends AbstractSiteAdminPage impleme this.routeUtils.removeQueryParams({ careSetting: this.tabIndexToCareSettingMap[tabChangeEvent.index], page: null }); } + public onTextSearch(textSearch: string | null): void { + this.routeUtils.updateQueryParams({ textSearch, page: null }); + this.searchHaForm.textSearch.setValue(textSearch); + } + public ngOnInit(): void { // Use existing query params for initial search, and // update results on query param change @@ -159,7 +165,13 @@ export class SiteRegistrationTabsComponent extends AbstractSiteAdminPage impleme if (careSettingCode === CareSettingEnum.HEALTH_AUTHORITY) { const { textSearch, careType, statusId, vendorId, assignToMe } = queryParams; this.healthAuthResource.getHealthAuthoritySitesByQuery({ textSearch, careType, statusId, vendorId, assignToMe }) - .subscribe((sites: HealthAuthoritySiteAdminList[]) => this.healthAuthoritySites = sites) + .subscribe((sites: HealthAuthoritySiteAdminList[]) => { + sites.forEach((s: HealthAuthoritySiteAdminList) => { + s.duplicatePecSiteCount = sites.filter((innerSite: HealthAuthoritySiteAdminList) => innerSite.id !== s.id + && innerSite.pec && innerSite.pec === s.pec).length; + }); + this.healthAuthoritySites = sites; + }) } else { this.busy = this.getPaginatedSites({ careSettingCode, ...queryParams }) .subscribe((paginatedList: PaginatedList) => { diff --git a/prime-angular-frontend/src/app/modules/health-auth-site-reg/shared/models/health-authority-admin-site-list.model.ts b/prime-angular-frontend/src/app/modules/health-auth-site-reg/shared/models/health-authority-admin-site-list.model.ts index 0bae3b913f..4d804feed0 100644 --- a/prime-angular-frontend/src/app/modules/health-auth-site-reg/shared/models/health-authority-admin-site-list.model.ts +++ b/prime-angular-frontend/src/app/modules/health-auth-site-reg/shared/models/health-authority-admin-site-list.model.ts @@ -34,7 +34,8 @@ export class HealthAuthoritySiteAdminList extends AbstractBaseHealthAuthoritySit public isNew: boolean, public readonly authorizedUserName: string, public readonly authorizedUserEmail: string, - public readonly adjudicatorIdir: string + public readonly adjudicatorIdir: string, + public duplicatePecSiteCount: number // number of other sites that sharing the same site ID (excluding itself) ) { super(id, healthAuthorityOrganizationId, completed, submittedDate, approvedDate, status); diff --git a/prime-dotnet-webapi/Controllers/SitesController.cs b/prime-dotnet-webapi/Controllers/SitesController.cs index 83ecf78919..e7d617f470 100755 --- a/prime-dotnet-webapi/Controllers/SitesController.cs +++ b/prime-dotnet-webapi/Controllers/SitesController.cs @@ -726,6 +726,34 @@ public async Task PecAssignable(int siteId, string pec) return Ok(await _siteService.PecAssignableAsync(siteId, pec)); } + // GET: api/sites/1/pec/abc/exists-within-ha + /// + /// Check if a given PEC exists in other site within the same health authority. + /// + /// + /// + /// + [HttpGet("{siteId}/pec/{pec}/exists-within-ha", Name = nameof(PecExistsWithinHA))] + [ProducesResponseType(StatusCodes.Status401Unauthorized)] + [ProducesResponseType(StatusCodes.Status403Forbidden)] + [ProducesResponseType(typeof(ApiMessageResponse), StatusCodes.Status400BadRequest)] + [ProducesResponseType(typeof(ApiMessageResponse), StatusCodes.Status404NotFound)] + [ProducesResponseType(typeof(ApiResultResponse), StatusCodes.Status200OK)] + public async Task PecExistsWithinHA(int siteId, string pec) + { + if (!await _siteService.SiteExistsAsync(siteId)) + { + return NotFound($"Site not found with id {siteId}"); + } + + if (string.IsNullOrWhiteSpace(pec)) + { + return BadRequest("PEC cannot be empty."); + } + + return Ok(await _siteService.PecExistsWithinHAAsync(siteId, pec)); + } + // PUT: api/Sites/5/pec /// /// Update the PEC code. diff --git a/prime-dotnet-webapi/Services/SiteService.cs b/prime-dotnet-webapi/Services/SiteService.cs index 017a4dedaa..25d8d3644d 100644 --- a/prime-dotnet-webapi/Services/SiteService.cs +++ b/prime-dotnet-webapi/Services/SiteService.cs @@ -90,6 +90,15 @@ public async Task PecAssignableAsync(int siteId, string pec) .AnyAsync(site => site.PEC == pec); } + public async Task PecExistsWithinHAAsync(int siteId, string pec) + { + var site = await _context.HealthAuthoritySites.Where(s => s.Id == siteId).SingleAsync(); + + return await _context.Sites + .Where(s => (s as HealthAuthoritySite).HealthAuthorityOrganizationId == site.HealthAuthorityOrganizationId + && s.Id != siteId && s.PEC == pec).AnyAsync(); + } + public async Task UpdateCompletedAsync(int siteId, bool completed) { var site = await _context.Sites diff --git a/prime-dotnet-webapi/Services/interfaces/ISiteService.cs b/prime-dotnet-webapi/Services/interfaces/ISiteService.cs index 1b78b058f5..aa966d8e34 100644 --- a/prime-dotnet-webapi/Services/interfaces/ISiteService.cs +++ b/prime-dotnet-webapi/Services/interfaces/ISiteService.cs @@ -13,6 +13,7 @@ public interface ISiteService Task SiteExistsAsync(int siteId); Task GetSiteCurrentStatusAsync(int siteId); Task PecAssignableAsync(int siteId, string pec); + Task PecExistsWithinHAAsync(int siteId, string pec); Task UpdateCompletedAsync(int siteId, bool completed); Task UpdateSiteAdjudicator(int siteId, int? adminId = null); Task UpdatePecCode(int siteId, string pecCode); From 30b61ff8a212f760616818d55a232f4cc71499be Mon Sep 17 00:00:00 2001 From: Jack Wong <108699279+bergomi02@users.noreply.github.com> Date: Wed, 17 Apr 2024 10:55:57 -0700 Subject: [PATCH 3/6] PRIME-2410 Add cron job template (#2487) * add cron job template * add timeout --- .../populate-transaction-log-temp.cron.yml | 88 +++++++++++++++++++ .../Services/ReportingService.cs | 1 + 2 files changed, 89 insertions(+) create mode 100644 infrastructure/cron-jobs/populate-transaction-log-temp.cron.yml diff --git a/infrastructure/cron-jobs/populate-transaction-log-temp.cron.yml b/infrastructure/cron-jobs/populate-transaction-log-temp.cron.yml new file mode 100644 index 0000000000..28ec2ee3e6 --- /dev/null +++ b/infrastructure/cron-jobs/populate-transaction-log-temp.cron.yml @@ -0,0 +1,88 @@ +apiVersion: template.openshift.io/v1 +kind: Template +metadata: + annotations: + description: Template for job that activates api to populate pharmanet transaction log temp + tags: cronjob + name: populate-transaction-log-temp-cronjob-template +objects: + - apiVersion: batch/v1 + kind: CronJob + metadata: + name: '${CRON_NAME}' + spec: + concurrencyPolicy: Forbid + jobTemplate: + spec: + template: + spec: + containers: + - command: + - bash + - '-c' + - >- + echo -e "-------- STARTING CRON --------\n" + + echo -e "-------- Getting access_token --------\n" + + TOKEN=$(curl -X POST + "${KEYCLOAK_URL}/realms/${KEYCLOAK_REALM}/protocol/openid-connect/token" + \ + -H "Content-Type: application/x-www-form-urlencoded" \ + -d "grant_type=client_credentials" \ + -d "client_id=${KEYCLOAK_CLIENT_ID}" \ + -d "client_secret=${KEYCLOAK_CLIENT_SECRET}" | jq -r '.access_token') + + echo -e ${TOKEN} + + echo -e "-------- Calling PRIME API --------\n" + + curl -v -X POST + http://${ENV_NAME}-webapi:8080/api/jobs/populate/transaction-log-temp?numberOfDays=15 + \ + -H "Authorization: Bearer ${TOKEN}" \ + -H "Content-Length: 0" + + echo -e "-------- CRON COMPLETE --------\n" + env: + - name: KEYCLOAK_CLIENT_SECRET + valueFrom: + secretKeyRef: + key: prime_service_account_client_secret + name: prime-service-account + - name: KEYCLOAK_CLIENT_ID + valueFrom: + secretKeyRef: + key: prime_service_account_client_id + name: prime-service-account + - name: KEYCLOAK_URL + valueFrom: + configMapKeyRef: + name: keycloak + key: KEYCLOAK_URL + - name: KEYCLOAK_REALM + valueFrom: + configMapKeyRef: + name: keycloak + key: KEYCLOAK_REALM + image: >- + public.ecr.aws/h0h9t7p1/alpine-bash-curl-jq:latest + limits: + cpu: 500m + memory: 2Gi + name: '${CRON_NAME}' + requests: + cpu: 100m + memory: 512Mi + resources: null + restartPolicy: Never + schedule: '${CRON_SCHEDULE}' +parameters: + - description: 'Cron-like schedule expression. Default: Once a day at 4 AM' + name: CRON_SCHEDULE + value: '0 10 * * *' + - name: CRON_NAME + value: prod-populate-transaction-log-temp-cronjob + - description: 'Environment name' + name: ENV_NAME + required: true diff --git a/prime-dotnet-webapi/Services/ReportingService.cs b/prime-dotnet-webapi/Services/ReportingService.cs index 79c59dd5dc..106a40f11d 100644 --- a/prime-dotnet-webapi/Services/ReportingService.cs +++ b/prime-dotnet-webapi/Services/ReportingService.cs @@ -156,6 +156,7 @@ public async Task PopulateTransactionLogTempAsync(int numberInDays) copySql.Append($"and \"TransactionId\" > '{maxTransactionId}' "); } + _context.Database.SetCommandTimeout(180); int result = await _context.Database.ExecuteSqlRawAsync(copySql.ToString()); return result; From f423d09991faa5f147e5b8474f9bef522c360c29 Mon Sep 17 00:00:00 2001 From: Jack Wong <108699279+bergomi02@users.noreply.github.com> Date: Fri, 19 Apr 2024 08:43:44 -0700 Subject: [PATCH 4/6] initial commit (#2490) --- .../site-information-page.component.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/prime-angular-frontend/src/app/modules/health-auth-site-reg/pages/site-information-page/site-information-page.component.ts b/prime-angular-frontend/src/app/modules/health-auth-site-reg/pages/site-information-page/site-information-page.component.ts index d232c98ab7..a1876370e3 100644 --- a/prime-angular-frontend/src/app/modules/health-auth-site-reg/pages/site-information-page/site-information-page.component.ts +++ b/prime-angular-frontend/src/app/modules/health-auth-site-reg/pages/site-information-page/site-information-page.component.ts @@ -17,6 +17,9 @@ import { HealthAuthoritySiteFormStateService } from '@health-auth/shared/service import { AbstractHealthAuthoritySiteRegistrationPage } from '@health-auth/shared/classes/abstract-health-authority-site-registration-page.class'; import { SiteInformationFormState } from './site-information-form-state.class'; import { MatSlideToggleChange } from '@angular/material/slide-toggle'; +import { SiteResource } from '@core/resources/site-resource.service'; +import { Observable, of } from 'rxjs'; +import { asyncValidator } from '@lib/validators/form-async.validators'; @Component({ selector: 'app-site-information-page', @@ -40,6 +43,7 @@ export class SiteInformationPageComponent extends AbstractHealthAuthoritySiteReg protected healthAuthoritySiteService: HealthAuthoritySiteService, protected healthAuthoritySiteFormStateService: HealthAuthoritySiteFormStateService, protected healthAuthoritySiteResource: HealthAuthoritySiteResource, + protected siteResource: SiteResource, private fb: FormBuilder, private configService: ConfigService, router: Router @@ -69,6 +73,9 @@ export class SiteInformationPageComponent extends AbstractHealthAuthoritySiteReg public ngOnInit(): void { this.createFormInstance(); this.patchForm(); + + //add validation to PEC + this.formState.pec.addAsyncValidators(asyncValidator(this.checkPecIsAssignable(), 'assignable')); } protected createFormInstance(): void { @@ -120,4 +127,8 @@ export class SiteInformationPageComponent extends AbstractHealthAuthoritySiteReg protected onSubmitFormIsInvalid(): void { this.showAddressFields = true; } + + private checkPecIsAssignable(): (value: string) => Observable { + return (value: string) => value ? this.siteResource.pecAssignable(this.route.snapshot.params.sid, value) : of(true); + } } From 411b90ccdbf4658ab643362f2f610c9f3aa50963 Mon Sep 17 00:00:00 2001 From: Jack Wong <108699279+bergomi02@users.noreply.github.com> Date: Tue, 23 Apr 2024 14:11:27 -0700 Subject: [PATCH 5/6] PRIME-2681 Update warning text (#2491) * initial commit * other text update * more changes --- .../site-overview-page/site-overview-page.component.html | 2 +- .../site-overview-page/site-overview-page.component.ts | 2 +- .../pages/site-overview/site-overview.component.html | 2 +- .../site-information-page/site-information-page.component.html | 2 +- .../site-information-form/site-information-form.component.html | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/prime-angular-frontend/src/app/modules/adjudication/pages/health-authorities/site-overview-page/site-overview-page.component.html b/prime-angular-frontend/src/app/modules/adjudication/pages/health-authorities/site-overview-page/site-overview-page.component.html index 551b19619f..1f7275a5b6 100644 --- a/prime-angular-frontend/src/app/modules/adjudication/pages/health-authorities/site-overview-page/site-overview-page.component.html +++ b/prime-angular-frontend/src/app/modules/adjudication/pages/health-authorities/site-overview-page/site-overview-page.component.html @@ -50,7 +50,7 @@ Required - Site ID has already been used by another site + Site ID already used by another organization diff --git a/prime-angular-frontend/src/app/modules/adjudication/pages/health-authorities/site-overview-page/site-overview-page.component.ts b/prime-angular-frontend/src/app/modules/adjudication/pages/health-authorities/site-overview-page/site-overview-page.component.ts index 1aaaefedbe..b2a9a447e6 100644 --- a/prime-angular-frontend/src/app/modules/adjudication/pages/health-authorities/site-overview-page/site-overview-page.component.ts +++ b/prime-angular-frontend/src/app/modules/adjudication/pages/health-authorities/site-overview-page/site-overview-page.component.ts @@ -63,7 +63,7 @@ export class SiteOverviewPageComponent implements OnInit { if (result) { const data: DialogOptions = { title: 'Site ID is in use', - message: 'This Site ID is already in use. Allow multiple sites?', + message: 'This Site ID is already in use in your organization. Allow multiple sites?', actionText: "Yes" }; this.busy = this.dialog.open(ConfirmDialogComponent, { data }) diff --git a/prime-angular-frontend/src/app/modules/adjudication/pages/site-overview/site-overview.component.html b/prime-angular-frontend/src/app/modules/adjudication/pages/site-overview/site-overview.component.html index ddf9cbba7d..f6530cdd98 100644 --- a/prime-angular-frontend/src/app/modules/adjudication/pages/site-overview/site-overview.component.html +++ b/prime-angular-frontend/src/app/modules/adjudication/pages/site-overview/site-overview.component.html @@ -134,7 +134,7 @@ Required - Site ID has already been used by another site + Site ID already used by another organization diff --git a/prime-angular-frontend/src/app/modules/health-auth-site-reg/pages/site-information-page/site-information-page.component.html b/prime-angular-frontend/src/app/modules/health-auth-site-reg/pages/site-information-page/site-information-page.component.html index 6f10d30079..9fca871251 100644 --- a/prime-angular-frontend/src/app/modules/health-auth-site-reg/pages/site-information-page/site-information-page.component.html +++ b/prime-angular-frontend/src/app/modules/health-auth-site-reg/pages/site-information-page/site-information-page.component.html @@ -56,7 +56,7 @@ [formControl]="formState.pec" /> Required - Site ID/PEC Code exists in another Health Authority + Site ID/PEC Code exists in another organization diff --git a/prime-angular-frontend/src/app/shared/components/forms/site-information-form/site-information-form.component.html b/prime-angular-frontend/src/app/shared/components/forms/site-information-form/site-information-form.component.html index 43b75d13ca..6bc7334cea 100644 --- a/prime-angular-frontend/src/app/shared/components/forms/site-information-form/site-information-form.component.html +++ b/prime-angular-frontend/src/app/shared/components/forms/site-information-form/site-information-form.component.html @@ -57,7 +57,7 @@ Must be in format BC00000XXX - Site ID has already been used by another site + Site ID has already been used by another organization From 6ba54a7c344c5cc80b7dbe839bdc80fd60d47d10 Mon Sep 17 00:00:00 2001 From: Jack Wong <108699279+bergomi02@users.noreply.github.com> Date: Wed, 24 Apr 2024 12:05:55 -0700 Subject: [PATCH 6/6] PRIME-2681 default upper case for PEC/Site ID (#2492) * initial commit * missing one field --- .../site-overview-page/site-overview-page.component.html | 3 ++- .../pages/site-overview/site-overview.component.html | 3 ++- .../site-information-page/site-information-page.component.html | 3 ++- .../organization-claim-page.component.html | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/prime-angular-frontend/src/app/modules/adjudication/pages/health-authorities/site-overview-page/site-overview-page.component.html b/prime-angular-frontend/src/app/modules/adjudication/pages/health-authorities/site-overview-page/site-overview-page.component.html index 1f7275a5b6..896cb2eb43 100644 --- a/prime-angular-frontend/src/app/modules/adjudication/pages/health-authorities/site-overview-page/site-overview-page.component.html +++ b/prime-angular-frontend/src/app/modules/adjudication/pages/health-authorities/site-overview-page/site-overview-page.component.html @@ -45,7 +45,8 @@ + formControlName="pec" + appToUppercase> Required diff --git a/prime-angular-frontend/src/app/modules/adjudication/pages/site-overview/site-overview.component.html b/prime-angular-frontend/src/app/modules/adjudication/pages/site-overview/site-overview.component.html index f6530cdd98..c045a3f4a8 100644 --- a/prime-angular-frontend/src/app/modules/adjudication/pages/site-overview/site-overview.component.html +++ b/prime-angular-frontend/src/app/modules/adjudication/pages/site-overview/site-overview.component.html @@ -129,7 +129,8 @@ + formControlName="pec" + appToUppercase> Required diff --git a/prime-angular-frontend/src/app/modules/health-auth-site-reg/pages/site-information-page/site-information-page.component.html b/prime-angular-frontend/src/app/modules/health-auth-site-reg/pages/site-information-page/site-information-page.component.html index 9fca871251..1fa0a5bd39 100644 --- a/prime-angular-frontend/src/app/modules/health-auth-site-reg/pages/site-information-page/site-information-page.component.html +++ b/prime-angular-frontend/src/app/modules/health-auth-site-reg/pages/site-information-page/site-information-page.component.html @@ -53,7 +53,8 @@ + [formControl]="formState.pec" + appToUppercase /> Required Site ID/PEC Code exists in another organization diff --git a/prime-angular-frontend/src/app/modules/site-registration/pages/organization-claim-page/organization-claim-page.component.html b/prime-angular-frontend/src/app/modules/site-registration/pages/organization-claim-page/organization-claim-page.component.html index c0873396f7..7aacd1dbe6 100644 --- a/prime-angular-frontend/src/app/modules/site-registration/pages/organization-claim-page/organization-claim-page.component.html +++ b/prime-angular-frontend/src/app/modules/site-registration/pages/organization-claim-page/organization-claim-page.component.html @@ -44,7 +44,8 @@ + formControlName="pec" + appToUppercase> Required