Skip to content

Commit

Permalink
Merge branch 'test'
Browse files Browse the repository at this point in the history
  • Loading branch information
neophyte57 committed Dec 1, 2023
2 parents 4ce9730 + 3a8f03d commit 5b1d8ac
Show file tree
Hide file tree
Showing 22 changed files with 17,282 additions and 19 deletions.
3 changes: 3 additions & 0 deletions documentation/GpidLookup-API.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,3 +179,6 @@ Lastly, due to privacy issues, in the very rare cases that a PRIME enrollee has
|Independent User - without OBOs|
|On-behalf-of User|
|On-behalf-of User – Pharmacy|
|Device Provider Agent – with OBOs|
|On-behalf-of User – Device Provider|
|On-behalf-of User (can prescribe independently)|
7 changes: 5 additions & 2 deletions documentation/HpdidLookup-API.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,10 @@ Lastly, due to privacy issues, in the very rare cases that a PRIME enrollee has
|Possible values for `accessType`|
|--------------------------------|
|Independent User – with OBOs, Pharmacy|
|Independent User - with OBOs|
|Independent User - without OBOs|
|Independent User with OBOs|
|Independent User without OBOs|
|On-behalf-of User|
|On-behalf-of User – Pharmacy|
|Device Provider Agent – with OBOs|
|On-behalf-of User – Device Provider|
|On-behalf-of User (can prescribe independently)|
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ export class AdjudicatorActionsComponent implements OnInit, OnChanges {
{ type: AgreementType.LICENCED_PRACTICAL_NURSE_TOA, name: 'LPNRU' },
{ type: AgreementType.DEVICE_PROVIDER_RU_TOA, name: 'DP RU' },
{ type: AgreementType.DEVICE_PROVIDER_OBO_TOA, name: 'DP OBO' },
{ type: AgreementType.PRESCRIBER_OBO_TOA, name: 'OBO Prescriber' },
];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,14 @@
</ng-container>

<ng-container *ngFor="let careSetting of certificate.careSettings">
<app-enrollee-property title="Organization Type"
<app-enrollee-property title="Care Setting"
[makeBold]="true">
{{ careSetting.name }}
</app-enrollee-property>
</ng-container>

<app-enrollee-property *ngIf="!certificate.careSettings.length"
title="Organization Type"
title="Care Setting"
[makeBold]="true">
None
</app-enrollee-property>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const PHARMACY_TECHNICIAN_TOA = 'Pharmacy Technician Toa';
const LICENCED_PRACTICAL_NURSE_TOA = 'Licenced Practical Nurse Toa';
const DEVICE_PROVIDER_RU_TOA = 'Device Provider RU Toa';
const DEVICE_PROVIDER_OBO_TOA = 'Device Provider OBO Toa';
const PRESCRIBER_OBO_TOA = 'On Behalf Of User (can prescribe independently)';

export enum AgreementType {
COMMUNITY_PHARMACIST_TOA = 1,
Expand All @@ -21,7 +22,8 @@ export enum AgreementType {
PHARMACY_TECHNICIAN_TOA,
LICENCED_PRACTICAL_NURSE_TOA,
DEVICE_PROVIDER_RU_TOA,
DEVICE_PROVIDER_OBO_TOA
DEVICE_PROVIDER_OBO_TOA,
PRESCRIBER_OBO_TOA
}

export const AgreementTypeNameMap: Record<AgreementType, string> = {
Expand All @@ -36,6 +38,7 @@ export const AgreementTypeNameMap: Record<AgreementType, string> = {
[AgreementType.LICENCED_PRACTICAL_NURSE_TOA]: LICENCED_PRACTICAL_NURSE_TOA,
[AgreementType.DEVICE_PROVIDER_RU_TOA]: DEVICE_PROVIDER_RU_TOA,
[AgreementType.DEVICE_PROVIDER_OBO_TOA]: DEVICE_PROVIDER_OBO_TOA,
[AgreementType.PRESCRIBER_OBO_TOA]: PRESCRIBER_OBO_TOA,
};

// Paper Enrolment
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public class AgreementVersionConfiguration : SeededTable<AgreementVersion>
public static readonly DateTime July29th2023AgreementUpdate = new(2023, 7, 29, 8, 0, 0, DateTimeKind.Utc);
public static readonly DateTime August9th2023AgreementUpdate = new(2023, 8, 9, 8, 0, 0, DateTimeKind.Utc);
public static readonly DateTime August15th2023AgreementUpdate = new(2023, 8, 15, 8, 0, 0, DateTimeKind.Utc);
public static readonly DateTime PhysicianAssistantAgreementUpdate = new(2023, 11, 29, 8, 0, 0, DateTimeKind.Utc);

public override IEnumerable<AgreementVersion> SeedData
{
Expand Down Expand Up @@ -60,7 +61,9 @@ public override IEnumerable<AgreementVersion> SeedData
new AgreementVersion { Id = 32, AgreementType = AgreementType.DeviceProviderRUTOA, Text = "device-provider-ru-toa-v1.html", EffectiveDate = August9th2023AgreementUpdate, CreatedTimeStamp = SEEDING_DATE, UpdatedTimeStamp = SEEDING_DATE },
new AgreementVersion { Id = 33, AgreementType = AgreementType.DeviceProviderOBOTOA, Text = "device-provider-obo-toa-v1.html", EffectiveDate = August9th2023AgreementUpdate, CreatedTimeStamp = SEEDING_DATE, UpdatedTimeStamp = SEEDING_DATE },

new AgreementVersion { Id = 34, AgreementType = AgreementType.DeviceProviderOrgAgreement, Text = "device-provider-org-v3.html", EffectiveDate = August15th2023AgreementUpdate, CreatedTimeStamp = SEEDING_DATE, UpdatedTimeStamp = SEEDING_DATE }
new AgreementVersion { Id = 34, AgreementType = AgreementType.DeviceProviderOrgAgreement, Text = "device-provider-org-v3.html", EffectiveDate = August15th2023AgreementUpdate, CreatedTimeStamp = SEEDING_DATE, UpdatedTimeStamp = SEEDING_DATE },

new AgreementVersion { Id = 35, AgreementType = AgreementType.PrescriberOBOTOA, Text = "obo-access-terms-v6.html", EffectiveDate = PhysicianAssistantAgreementUpdate, CreatedTimeStamp = SEEDING_DATE, UpdatedTimeStamp = SEEDING_DATE }
};
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public override IEnumerable<CollegeLicense> SeedData
new CollegeLicense { CollegeCode = 1, LicenseCode = 89 },
new CollegeLicense { CollegeCode = 1, LicenseCode = 90 },
new CollegeLicense { CollegeCode = 1, LicenseCode = 91 },
new CollegeLicense { CollegeCode = 1, LicenseCode = 92 },

// Pharmacists
new CollegeLicense { CollegeCode = 2, LicenseCode = 25 },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,11 @@ public override IEnumerable<License> SeedData
new License { Code = 87, Weight = 27, Name = "Associate - Acute Care" },
new License { Code = 88, Weight = 28, Name = "Associate - Community Primary Care" },
new License { Code = 89, Weight = 29, Name = "USA Certified" },
new License { Code = 59, Weight = 30, Name = "Full - Podiatric Surgeon" },
new License { Code = 65, Weight = 31, Name = "Educational - Podiatric Surgeon Student (Elective)" },
new License { Code = 66, Weight = 32, Name = "Educational - Podiatric Surgeon Resident (Elective)" },
new License { Code = 67, Weight = 33, Name = "Conditional - Podiatric Surgeon Disciplined" },
new License { Code = 92, Weight = 30, Name = "Certified Physician Assistant" },
new License { Code = 59, Weight = 31, Name = "Full - Podiatric Surgeon" },
new License { Code = 65, Weight = 32, Name = "Educational - Podiatric Surgeon Student (Elective)" },
new License { Code = 66, Weight = 33, Name = "Educational - Podiatric Surgeon Resident (Elective)" },
new License { Code = 67, Weight = 34, Name = "Conditional - Podiatric Surgeon Disciplined" },

// Pharmacy
new License { Code = 25, Weight = 1, Name = "Full Pharmacist" },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public class LicenseDetailConfiguration : SeededTable<LicenseDetail>
public static readonly DateTime AdjustmentsToOnboardCollegeOfOptometristsAug2nd2023 = new(2023, 8, 2, 8, 0, 0, DateTimeKind.Utc);
public static readonly DateTime AdjustmentsToCPSBCAug28th2023 = new(2023, 8, 28, 8, 0, 0, DateTimeKind.Utc);
public static readonly DateTime EmployedStudentNurseChangeAug28th2023 = new(2023, 8, 28, 8, 0, 0, DateTimeKind.Utc);
public static readonly DateTime PhysicianAssistantChange = new(2023, 11, 27, 8, 0, 0, DateTimeKind.Utc);

public override IEnumerable<LicenseDetail> SeedData
{
Expand Down Expand Up @@ -321,6 +322,9 @@ public override IEnumerable<LicenseDetail> SeedData

// Employed Student Nurse Change
new LicenseDetail { Id = 275, LicenseCode = 40, Prefix = "R9", Manual = false, Validate = true, LicensedToProvideCare = true, NamedInImReg = false, PrescriberIdType = PrescriberIdType.Optional, AllowRequestRemoteAccess = false, NonPrescribingPrefix = "RX", EffectiveDate = EmployedStudentNurseChangeAug28th2023, CreatedTimeStamp = SEEDING_DATE, UpdatedTimeStamp = SEEDING_DATE },

// CPSBC - Physician Assistant
new LicenseDetail { Id = 276, LicenseCode = 92, Prefix = "M9", Manual = true, Validate = true, LicensedToProvideCare = true, NamedInImReg = false, PrescriberIdType = null, AllowRequestRemoteAccess = false, NonPrescribingPrefix = null, EffectiveDate = PhysicianAssistantChange, CreatedTimeStamp = SEEDING_DATE, UpdatedTimeStamp = SEEDING_DATE },
};
}
}
Expand Down
8 changes: 7 additions & 1 deletion prime-dotnet-webapi/Controllers/OrganizationsController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -203,14 +203,20 @@ public async Task<ActionResult> ApproveOrganizationClaim(int organizationId, int
var notificationRequired = existingSigningAuthorityId != orgClaim.NewSigningAuthorityId;

await _organizationService.SwitchSigningAuthorityAsync(organizationId, orgClaim.NewSigningAuthorityId);
await _communitySiteService.UpdateSigningAuthorityForOrganization(organizationId, orgClaim.NewSigningAuthorityId);
await _organizationService.RemoveUnsignedOrganizationAgreementsAsync(organizationId);
await _organizationService.FlagPendingTransferIfOrganizationAgreementsRequireSignaturesAsync(organizationId);

await _organizationClaimService.DeleteClaimAsync(orgClaim.Id);

if (notificationRequired)
{
await _partyService.RemovePartyEnrolmentAsync(existingSigningAuthorityId, PartyType.SigningAuthority);
var organizations = await _organizationService.GetOrganizationsByPartyIdAsync(existingSigningAuthorityId);
if (organizations.Count() == 0)
{
//if no organization belong to existing signing authority, remove Party Enrolment record
await _partyService.RemovePartyEnrolmentAsync(existingSigningAuthorityId, PartyType.SigningAuthority);
}
await _businessEventService.CreateOrganizationEventAsync(organizationId, orgClaim.NewSigningAuthorityId, $"Organization Claim (Site ID/PEC provided: {orgClaim.ProvidedSiteId}, Reason: {orgClaim.Details}) approved.");
await _emailService.SendOrgClaimApprovalNotificationAsync(orgClaim);
await _businessEventService.CreateOrganizationEventAsync(organizationId, orgClaim.NewSigningAuthorityId, "Sent organization claim approval notification");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,14 @@ public ProvisionerAccessController(
public async Task<ActionResult> GetEnrolmentCertificate(Guid accessTokenId)
{
var certificate = await _certificateService.GetEnrolmentCertificateAsync(accessTokenId);

//set health authority
if (certificate.HealthAuthories.Count() > 0)
{
var careSetting = certificate.CareSettings.First(cs => cs.Code == (int)CareSettingType.HealthAuthority);
careSetting.Name += $" - {string.Join(", ", certificate.HealthAuthories.Select(ha => ha.Name))}";
}

if (certificate == null)
{
return NotFound($"No valid Enrolment Certificate Access Token found with id {accessTokenId}");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ public static class CertificationDigest
{
public static ICertificationDigest Create(ICollection<CertificationDto> certs, ICollection<EnrolleeDeviceProvider> dps)
{
if(dps != null && dps.Count > 0){
if (dps != null && dps.Count > 0)
{
return new DeviceProvider(dps.First().DeviceProviderId, dps.First().CertificationNumber);
}

Expand Down Expand Up @@ -51,7 +52,11 @@ public static ICertificationDigest Create(ICollection<CertificationDto> certs, I
}
else
{
if (License.isLicensedPracticalNurse(cert.License.CurrentLicenseDetail))
if (License.isPhysicianAssistant(cert.License.CurrentLicenseDetail))
{
return new PhysicianAssistant();
}
else if (License.isLicensedPracticalNurse(cert.License.CurrentLicenseDetail))
{
return new LicensedPracticalNurse(regulated);
}
Expand All @@ -63,6 +68,16 @@ public static ICertificationDigest Create(ICollection<CertificationDto> certs, I
}
}

public class PhysicianAssistant : ICertificationDigest
{
public PhysicianAssistant() { }

public AgreementType? ResolveWith(SettingsDigest settings)
{
return AgreementType.PrescriberOBOTOA;
}
}

public class DeviceProvider : ICertificationDigest
{
private string _dpId { get; set; }
Expand All @@ -79,7 +94,9 @@ public DeviceProvider(string dpId, string certNumber)
if (!string.IsNullOrWhiteSpace(_certNumber))
{
return AgreementType.DeviceProviderRUTOA;
}else{
}
else
{
return AgreementType.DeviceProviderOBOTOA;
}
}
Expand Down
Loading

0 comments on commit 5b1d8ac

Please sign in to comment.