Skip to content

Commit

Permalink
Merge branch 'develop' into feature/prime-2735_ha_care_type_vendor_page
Browse files Browse the repository at this point in the history
  • Loading branch information
bergomi02 authored Nov 9, 2024
2 parents 0ada333 + 90268ec commit 3dbffe6
Show file tree
Hide file tree
Showing 15 changed files with 20,481 additions and 72 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@
[index]="i"
[total]="formState.certifications.controls.length"
[selectedColleges]="selectedCollegeCodes"
[selectedLicenses]="selectedLicenseCodes"
(remove)="removeCertification($event)">
</app-college-certification-form>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,11 @@ export class RegulatoryComponent extends BaseEnrolmentProfilePage implements OnI
.map((certification: CollegeCertification) => +certification.collegeCode);
}

public get selectedLicenseCodes(): number[] {
return this.formState.certifications.value
.map((certification: CollegeCertification) => +certification.licenseCode);
}

public addEmptyCollegeCertification() {
this.formState.addCollegeCertification();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@
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 [email protected]</span>
</mat-radio-button>
</mat-radio-group>

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

.warning-text {
color: red;
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ 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 @@ -24,8 +23,6 @@ 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 @@ -173,42 +170,15 @@ export class CareSettingPageComponent extends AbstractCommunitySiteRegistrationP
}

protected submissionRequest(): NoContent {

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();
}
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();
}

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

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

.warning-text {
color: orangered;
font-size: 1.25rem;
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export class CollegeCertificationFormComponent implements OnInit {
@Input() public index: number;
@Input() public total: number;
@Input() public selectedColleges: number[];
@Input() public selectedLicenses: number[];
@Input() public collegeFilterPredicate: (collegeConfig: CollegeConfig) => boolean;
@Input() public licenceFilterPredicate: (licenceConfig: LicenseConfig) => boolean;
@Input() public condensed: boolean;
Expand Down Expand Up @@ -63,6 +64,13 @@ export class CollegeCertificationFormComponent implements OnInit {

public licenseGrouping = LicenseGrouping;

/**
* 21 - College of Health and Care Professionals of BC
* 22 - College of Complementary Health Professionals of BC
*/
public allowDupAmalgamatedColleges: number[] =
[CollegeLicenceClassEnum.HealthCareProfessionals, CollegeLicenceClassEnum.ComplementaryHealthProfessionals];

constructor(
private configService: ConfigService,
private viewportService: ViewportService,
Expand Down Expand Up @@ -134,7 +142,11 @@ export class CollegeCertificationFormComponent implements OnInit {
}

public getGrouping(collegeCode: string): CollegeLicenseGroupingConfig[] {
let groupingCodes = this.colleges.find((c) => c.code === +collegeCode).collegeLicenses.map((l) => l.collegeLicenseGroupingCode);
const college = this.colleges.find((c) => c.code === +collegeCode);
const selectedGroupCodes = college.collegeLicenses
.filter((l) => this.selectedLicenses.includes(l.licenseCode) && l.licenseCode !== this.licenseCode.value).map((l) => l.collegeLicenseGroupingCode);
const groupingCodes = college.collegeLicenses.filter((l) => !selectedGroupCodes.includes(l.collegeLicenseGroupingCode))
.map((l) => l.collegeLicenseGroupingCode);
return this.licenseGroups.filter((g) => groupingCodes.some((gc) => gc === g.code));
}

Expand All @@ -149,7 +161,7 @@ export class CollegeCertificationFormComponent implements OnInit {
public get filteredColleges(): CollegeConfig[] {
return this.colleges.filter((college: CollegeConfig) =>
// Allow the currently chosen value to persist
this.collegeCode.value === college.code || !this.selectedColleges?.includes(college.code)
this.collegeCode.value === college.code || !this.selectedColleges?.includes(college.code) || this.allowDupAmalgamatedColleges.includes(college.code)
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ public override IEnumerable<CollegeLicense> SeedData
new CollegeLicense { CollegeCode = 2, LicenseCode = 30 },
new CollegeLicense { CollegeCode = 2, LicenseCode = 31 },
new CollegeLicense { CollegeCode = 2, LicenseCode = 68 },
new CollegeLicense { CollegeCode = 2, LicenseCode = 178 },

// Nurses
new CollegeLicense { CollegeCode = 3, LicenseCode = 32, CollegeLicenseGroupingCode = 2 },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,15 @@ public override IEnumerable<License> SeedData
new License { Code = 67, Weight = 34, Name = "Conditional - Podiatric Surgeon Disciplined" },

// Pharmacy
new License { Code = 25, Weight = 1, Name = "Full Pharmacist" },
new License { Code = 26, Weight = 2, Name = "Limited Pharmacist" },
new License { Code = 28, Weight = 3, Name = "Student Pharmacist" },
new License { Code = 27, Weight = 4, Name = "Temporary Pharmacist" },
new License { Code = 30, Weight = 5, Name = "Non-Practicing Pharmacist" },
new License { Code = 29, Weight = 6, Name = "Pharmacy Technician" },
new License { Code = 31, Weight = 7, Name = "Non-Practicing Pharmacy Technician" },
new License { Code = 68, Weight = 8, Name = "Temporary Pharmacy Technician" },
new License { Code = 25, Weight = 10, Name = "Full Pharmacist" },
new License { Code = 26, Weight = 20, Name = "Limited Pharmacist" },
new License { Code = 28, Weight = 30, Name = "Student Pharmacist" },
new License { Code = 27, Weight = 40, Name = "Temporary Pharmacist" },
new License { Code = 178, Weight = 45, Name = "Temporary Limited Pharmacist" },
new License { Code = 30, Weight = 50, Name = "Non-Practicing Pharmacist" },
new License { Code = 29, Weight = 60, Name = "Pharmacy Technician" },
new License { Code = 31, Weight = 70, Name = "Non-Practicing Pharmacy Technician" },
new License { Code = 68, Weight = 80, Name = "Temporary Pharmacy Technician" },

// Nursing
new License { Code = 47, Weight = 1, Name = "Practicing Nurse Practitioner" },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public class LicenseDetailConfiguration : SeededTable<LicenseDetail>
public static readonly DateTime ProvisionalPhysiciansMay3rd2024 = new(2024, 5, 3, 8, 0, 0, DateTimeKind.Utc);
public static readonly DateTime NewCollegeLicenseChangeJune252024 = new(2024, 6, 25, 8, 0, 0, DateTimeKind.Utc);
public static readonly DateTime NewMultijurisdictionalBccnmLicenceClasses = new(2024, 8, 27, 8, 0, 0, DateTimeKind.Utc);
public static readonly DateTime AddTemporaryLimitedPharmacistLicenceClasses = new(2024, 10, 22, 8, 0, 0, DateTimeKind.Utc);

public override IEnumerable<LicenseDetail> SeedData
{
Expand Down Expand Up @@ -456,6 +457,9 @@ public override IEnumerable<LicenseDetail> SeedData
new LicenseDetail { Id = 367, LicenseCode = 175, Prefix = "R9", Manual = true, Validate = true, LicensedToProvideCare = true, NamedInImReg = true, PrescriberIdType = PrescriberIdType.Mandatory, AllowRequestRemoteAccess = false, NonPrescribingPrefix = "RX", EffectiveDate = NewMultijurisdictionalBccnmLicenceClasses, CreatedTimeStamp = SEEDING_DATE, UpdatedTimeStamp = SEEDING_DATE},
new LicenseDetail { Id = 368, LicenseCode = 176, Prefix = "Y9", Manual = true, Validate = true, LicensedToProvideCare = true, NamedInImReg = true, PrescriberIdType = PrescriberIdType.Mandatory, AllowRequestRemoteAccess = false, NonPrescribingPrefix = "YX", EffectiveDate = NewMultijurisdictionalBccnmLicenceClasses, CreatedTimeStamp = SEEDING_DATE, UpdatedTimeStamp = SEEDING_DATE},
new LicenseDetail { Id = 369, LicenseCode = 177, Prefix = "L9", Manual = true, Validate = true, LicensedToProvideCare = true, NamedInImReg = true, PrescriberIdType = PrescriberIdType.Mandatory, AllowRequestRemoteAccess = false, EffectiveDate = NewMultijurisdictionalBccnmLicenceClasses, CreatedTimeStamp = SEEDING_DATE, UpdatedTimeStamp = SEEDING_DATE },

// Add Temporary Limited Pharmacist
new LicenseDetail { Id = 370, LicenseCode = 178, Prefix = "P1", Manual = false, Validate = true, NamedInImReg = true, LicensedToProvideCare = true, EffectiveDate = AddTemporaryLimitedPharmacistLicenceClasses, CreatedTimeStamp = SEEDING_DATE, UpdatedTimeStamp = SEEDING_DATE },
};
}
}
Expand Down
Loading

0 comments on commit 3dbffe6

Please sign in to comment.