Skip to content

Commit

Permalink
Merge branch 'test'
Browse files Browse the repository at this point in the history
  • Loading branch information
neophyte57 committed Sep 4, 2024
2 parents afab296 + 9e5e260 commit 119980e
Show file tree
Hide file tree
Showing 16 changed files with 20,922 additions and 85 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export class LicenseClassesMaintenancePageComponent implements OnInit {
collegeLicenseGroupingCode: collegeLicense.collegeLicenseGroupingCode,
...license
} as LicenseMaintenanceConfig;
})
}).sort((a: LicenseMaintenanceConfig, b: LicenseMaintenanceConfig) => a.weight - b.weight)
: { collegeName: college.name } as LicenseMaintenanceConfig;
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { EnrolmentStatusEnum } from '@shared/enums/enrolment-status.enum';
import { AuthService } from '@auth/shared/services/auth.service';
import { EnrolmentRoutes } from '@enrolment/enrolment.routes';
import { EnrolmentService } from '@enrolment/shared/services/enrolment.service';
import { EnrolmentResource } from '@enrolment/shared/services/enrolment-resource.service';

@Component({
selector: 'app-collection-notice',
Expand All @@ -19,7 +20,8 @@ export class CollectionNoticeComponent implements OnInit {
private route: ActivatedRoute,
private router: Router,
private authService: AuthService,
private enrolmentService: EnrolmentService
private enrolmentService: EnrolmentService,
private enrolmentResource: EnrolmentResource,
) {
this.isFull = true;
}
Expand All @@ -32,7 +34,13 @@ export class CollectionNoticeComponent implements OnInit {
this.router.navigate([EnrolmentRoutes.SUBMISSION_CONFIRMATION], { relativeTo: this.route.parent });
break;
case EnrolmentStatusEnum.REQUIRES_TOA:
this.router.navigate([EnrolmentRoutes.PENDING_ACCESS_TERM], { relativeTo: this.route.parent });
if (this.enrolmentService.enrolment?.requireRedoSelfDeclaration) {
this.enrolmentResource.returnToEditing(this.enrolmentService.enrolment.id).subscribe(() =>
this.router.navigate([EnrolmentRoutes.OVERVIEW], { relativeTo: this.route.parent })
);
} else {
this.router.navigate([EnrolmentRoutes.PENDING_ACCESS_TERM], { relativeTo: this.route.parent });
}
break;
default:
this.router.navigate([EnrolmentRoutes.OVERVIEW], { relativeTo: this.route.parent });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,22 @@ export class EnrolmentResource {
);
}

public returnToEditing(enrolleeId: number): Observable<HttpEnrollee> {
return this.apiResource.post<HttpEnrollee>(`enrollees/${enrolleeId}/status-actions/return-to-editing`)
.pipe(
map((response: ApiHttpResponse<HttpEnrollee>) => response.result),
tap((enrollee: HttpEnrollee) => {
this.toastService.openErrorToast('Enrolment is now editable');
this.logger.info('UPDATED_ENROLLEE', enrollee);
}),
catchError((error: any) => {
this.toastService.openErrorToast('Enrolment status could not be updated');
this.logger.error('[Enrolment] EnrolmentResource::returnToEditing error has occurred: ', error);
throw error;
})
);
}

public getCurrentStatus(enrolleeId: number): Observable<EnrolmentStatusAdmin> {
return this.apiResource.get<EnrolmentStatusAdmin>(`enrollees/${enrolleeId}/current-status`)
.pipe(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { CollegeLicenceClassEnum } from '@shared/enums/college-licence-class.enu
import { PrescriberIdTypeEnum } from '@shared/enums/prescriber-id-type.enum';
import { CollegeCertification } from '@enrolment/shared/models/college-certification.model';
import { EnrolmentService } from '@enrolment/shared/services/enrolment.service';
import { NurseGrouping } from '@shared/enums/college-licence-grouping.enum';
import { LicenseGrouping } from '@shared/enums/college-licence-grouping.enum';

@Component({
selector: 'app-college-certification-form',
Expand Down Expand Up @@ -61,7 +61,7 @@ export class CollegeCertificationFormComponent implements OnInit {
public CollegeLicenceClassEnum = CollegeLicenceClassEnum;
public PrescriberIdTypeEnum = PrescriberIdTypeEnum;

public nurseGrouping = NurseGrouping;
public licenseGrouping = LicenseGrouping;

constructor(
private configService: ConfigService,
Expand Down Expand Up @@ -230,7 +230,7 @@ export class CollegeCertificationFormComponent implements OnInit {
)
)
.subscribe((collegeLicenseGroupingCode: number) => {
if (this.nurseGrouping.some(g => g === collegeLicenseGroupingCode)) {
if (this.licenseGrouping.some(g => g === collegeLicenseGroupingCode)) {
this.setNursingCategoryValidators();
}
this.loadLicensesByCategory(collegeLicenseGroupingCode);
Expand Down Expand Up @@ -260,7 +260,10 @@ export class CollegeCertificationFormComponent implements OnInit {
return;
}

if ((collegeCode === CollegeLicenceClassEnum.BCCNM || collegeCode === CollegeLicenceClassEnum.OralHealth) && !this.condensed) {
if ((collegeCode === CollegeLicenceClassEnum.BCCNM ||
collegeCode === CollegeLicenceClassEnum.OralHealth ||
collegeCode === CollegeLicenceClassEnum.HealthCareProfessionals ||
collegeCode === CollegeLicenceClassEnum.ComplementaryHealthProfessionals) && !this.condensed) {
this.formUtilsService.setValidators(this.category, [Validators.required]);
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@ export enum CollegeLicenceClassEnum {
BCCNM = 3,
CDSBC = 7,
OptometryBC = 14,
OralHealth = 20
OralHealth = 20,
HealthCareProfessionals = 21,
ComplementaryHealthProfessionals = 22
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,52 @@ export enum CollegeLicenceGroupingEnum {
RPN = 3,
NP = 4,
MW = 5,
CertifiedDentalAssistant = 6,
DentalHygienist = 7,
DentalTechnician = 8,
DentalTherapist = 9,
Dentist = 10,
Denturist = 11,
HealthProfessionOfDietetics = 12,
HealthProfessionOfOccupationalTherapy = 13,
HealthProfessionOfOpticianry = 14,
HealthProfessionOfOptomety = 15,
HealthProfessionOfPhysicalTherapy = 16,
HealthProfessionOfPsychology = 17,
HealthProfessionOfAudiology = 18,
HealthProfessionOfHearingInstrumentDispensing = 19,
HealthProfessionOfSpeechLanguagePathology = 20,
HealthProfessionOfChiropractic = 21,
HealthProfessionOfMassageTherapy = 22,
HealthProfessionOfNaturopathicMedicine = 23,
HealthProfessionOfTraditionalChineseMedicineAcupuncture = 24
}

export const NurseGrouping: number[] = [
export const LicenseGrouping: number[] = [
CollegeLicenceGroupingEnum.LPN,
CollegeLicenceGroupingEnum.RN,
CollegeLicenceGroupingEnum.RPN,
CollegeLicenceGroupingEnum.NP,
CollegeLicenceGroupingEnum.MW
CollegeLicenceGroupingEnum.MW,
CollegeLicenceGroupingEnum.CertifiedDentalAssistant,
CollegeLicenceGroupingEnum.DentalHygienist,
CollegeLicenceGroupingEnum.DentalTechnician,
CollegeLicenceGroupingEnum.DentalTherapist,
CollegeLicenceGroupingEnum.Dentist,
CollegeLicenceGroupingEnum.Denturist,
CollegeLicenceGroupingEnum.HealthProfessionOfDietetics,
CollegeLicenceGroupingEnum.HealthProfessionOfOccupationalTherapy,
CollegeLicenceGroupingEnum.HealthProfessionOfOpticianry,
CollegeLicenceGroupingEnum.HealthProfessionOfOptomety,
CollegeLicenceGroupingEnum.HealthProfessionOfPhysicalTherapy,
CollegeLicenceGroupingEnum.HealthProfessionOfPsychology,
CollegeLicenceGroupingEnum.HealthProfessionOfAudiology,
CollegeLicenceGroupingEnum.HealthProfessionOfHearingInstrumentDispensing,
CollegeLicenceGroupingEnum.HealthProfessionOfSpeechLanguagePathology,
CollegeLicenceGroupingEnum.HealthProfessionOfChiropractic,
CollegeLicenceGroupingEnum.HealthProfessionOfMassageTherapy,
CollegeLicenceGroupingEnum.HealthProfessionOfNaturopathicMedicine,
CollegeLicenceGroupingEnum.HealthProfessionOfTraditionalChineseMedicineAcupuncture
]


Original file line number Diff line number Diff line change
Expand Up @@ -58,32 +58,35 @@ public override IEnumerable<CollegeLicense> SeedData
new CollegeLicense { CollegeCode = 2, LicenseCode = 68 },

// Nurses
new CollegeLicense { CollegeCode = 3, LicenseCode = 32, CollegeLicenseGroupingCode = 2 },
new CollegeLicense { CollegeCode = 3, LicenseCode = 33, CollegeLicenseGroupingCode = 2 },
new CollegeLicense { CollegeCode = 3, LicenseCode = 34, CollegeLicenseGroupingCode = 2 },
new CollegeLicense { CollegeCode = 3, LicenseCode = 35, CollegeLicenseGroupingCode = 2 },
new CollegeLicense { CollegeCode = 3, LicenseCode = 36, CollegeLicenseGroupingCode = 2 },
new CollegeLicense { CollegeCode = 3, LicenseCode = 37, CollegeLicenseGroupingCode = 2 },
new CollegeLicense { CollegeCode = 3, LicenseCode = 39, CollegeLicenseGroupingCode = 2 },
new CollegeLicense { CollegeCode = 3, LicenseCode = 40, CollegeLicenseGroupingCode = 2 },
new CollegeLicense { CollegeCode = 3, LicenseCode = 41, CollegeLicenseGroupingCode = 3 },
new CollegeLicense { CollegeCode = 3, LicenseCode = 42, CollegeLicenseGroupingCode = 3 },
new CollegeLicense { CollegeCode = 3, LicenseCode = 43, CollegeLicenseGroupingCode = 3 },
new CollegeLicense { CollegeCode = 3, LicenseCode = 45, CollegeLicenseGroupingCode = 3 },
new CollegeLicense { CollegeCode = 3, LicenseCode = 46, CollegeLicenseGroupingCode = 3 },
new CollegeLicense { CollegeCode = 3, LicenseCode = 47, CollegeLicenseGroupingCode = 4 },
new CollegeLicense { CollegeCode = 3, LicenseCode = 48, CollegeLicenseGroupingCode = 4 },
new CollegeLicense { CollegeCode = 3, LicenseCode = 49, CollegeLicenseGroupingCode = 4 },
new CollegeLicense { CollegeCode = 3, LicenseCode = 51, CollegeLicenseGroupingCode = 4 },
new CollegeLicense { CollegeCode = 3, LicenseCode = 52, CollegeLicenseGroupingCode = 1 },
new CollegeLicense { CollegeCode = 3, LicenseCode = 53, CollegeLicenseGroupingCode = 1 },
new CollegeLicense { CollegeCode = 3, LicenseCode = 54, CollegeLicenseGroupingCode = 1 },
new CollegeLicense { CollegeCode = 3, LicenseCode = 55, CollegeLicenseGroupingCode = 1 },
new CollegeLicense { CollegeCode = 3, LicenseCode = 60, CollegeLicenseGroupingCode = 5 },
new CollegeLicense { CollegeCode = 3, LicenseCode = 61, CollegeLicenseGroupingCode = 5 },
new CollegeLicense { CollegeCode = 3, LicenseCode = 62, CollegeLicenseGroupingCode = 5 },
new CollegeLicense { CollegeCode = 3, LicenseCode = 63, CollegeLicenseGroupingCode = 5 },
new CollegeLicense { CollegeCode = 3, LicenseCode = 69, CollegeLicenseGroupingCode = 5 },
new CollegeLicense { CollegeCode = 3, LicenseCode = 32, CollegeLicenseGroupingCode = 2 },
new CollegeLicense { CollegeCode = 3, LicenseCode = 33, CollegeLicenseGroupingCode = 2 },
new CollegeLicense { CollegeCode = 3, LicenseCode = 34, CollegeLicenseGroupingCode = 2 },
new CollegeLicense { CollegeCode = 3, LicenseCode = 35, CollegeLicenseGroupingCode = 2 },
new CollegeLicense { CollegeCode = 3, LicenseCode = 36, CollegeLicenseGroupingCode = 2 },
new CollegeLicense { CollegeCode = 3, LicenseCode = 37, CollegeLicenseGroupingCode = 2 },
new CollegeLicense { CollegeCode = 3, LicenseCode = 39, CollegeLicenseGroupingCode = 2 },
new CollegeLicense { CollegeCode = 3, LicenseCode = 40, CollegeLicenseGroupingCode = 2 },
new CollegeLicense { CollegeCode = 3, LicenseCode = 175, CollegeLicenseGroupingCode = 2 },
new CollegeLicense { CollegeCode = 3, LicenseCode = 41, CollegeLicenseGroupingCode = 3 },
new CollegeLicense { CollegeCode = 3, LicenseCode = 42, CollegeLicenseGroupingCode = 3 },
new CollegeLicense { CollegeCode = 3, LicenseCode = 43, CollegeLicenseGroupingCode = 3 },
new CollegeLicense { CollegeCode = 3, LicenseCode = 45, CollegeLicenseGroupingCode = 3 },
new CollegeLicense { CollegeCode = 3, LicenseCode = 46, CollegeLicenseGroupingCode = 3 },
new CollegeLicense { CollegeCode = 3, LicenseCode = 176, CollegeLicenseGroupingCode = 3 },
new CollegeLicense { CollegeCode = 3, LicenseCode = 47, CollegeLicenseGroupingCode = 4 },
new CollegeLicense { CollegeCode = 3, LicenseCode = 48, CollegeLicenseGroupingCode = 4 },
new CollegeLicense { CollegeCode = 3, LicenseCode = 49, CollegeLicenseGroupingCode = 4 },
new CollegeLicense { CollegeCode = 3, LicenseCode = 51, CollegeLicenseGroupingCode = 4 },
new CollegeLicense { CollegeCode = 3, LicenseCode = 52, CollegeLicenseGroupingCode = 1 },
new CollegeLicense { CollegeCode = 3, LicenseCode = 53, CollegeLicenseGroupingCode = 1 },
new CollegeLicense { CollegeCode = 3, LicenseCode = 54, CollegeLicenseGroupingCode = 1 },
new CollegeLicense { CollegeCode = 3, LicenseCode = 55, CollegeLicenseGroupingCode = 1 },
new CollegeLicense { CollegeCode = 3, LicenseCode = 177, CollegeLicenseGroupingCode = 1 },
new CollegeLicense { CollegeCode = 3, LicenseCode = 60, CollegeLicenseGroupingCode = 5 },
new CollegeLicense { CollegeCode = 3, LicenseCode = 61, CollegeLicenseGroupingCode = 5 },
new CollegeLicense { CollegeCode = 3, LicenseCode = 62, CollegeLicenseGroupingCode = 5 },
new CollegeLicense { CollegeCode = 3, LicenseCode = 63, CollegeLicenseGroupingCode = 5 },
new CollegeLicense { CollegeCode = 3, LicenseCode = 69, CollegeLicenseGroupingCode = 5 },

// College of Dental Surgeons of BC
new CollegeLicense { CollegeCode = 7, LicenseCode = 70, Discontinued = true },
Expand Down
Loading

0 comments on commit 119980e

Please sign in to comment.