Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Edrd ph1 sept24 release defects fixing branch #1356

Merged
merged 3 commits into from
Sep 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2700,7 +2700,7 @@
"group" : {
"operator" : "AND",
"rules" : [ {
"data" : "miglustat",
"data" : "miglustat-Gaucher",
"condition" : "=",
"field" : "MedicationNameRenewal"
} ]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,39 +11,43 @@ public with sharing class AccountContactRelationTriggerHandler {
* @date: 21 Aug 2024
* @description: The purpose of this method is to share patient records with provider on ACR insert.
* @Modification Log: [Date] - [Change Reference] - [Changed By] - [Description]
20Sept - EDRD-911 - Deepak - Adding NULL Check
20Sept - EDRD-911 - Deepak - Adding NULL Check & updated asper user trigger
*/
public static void createPatientShare(List<AccountContactRelation> aCRList){
Map<Id, Id> providerIdVsPatientId = new Map<Id, Id>();
Map<Id, Set<Id>> providerIdVsPatientIdSet = new Map<Id, Set<Id>>();
Map<Id, User> providerIdVsRec = new Map<Id, User>();
Map<Id, Set<Id>> providerIdVsUserIdSet = new Map<Id, Set<Id>>();
List<AccountShare> accShareListToInsert = new List<AccountShare>();

for(AccountContactRelation aCRObj : aCRList){
if(!providerIdVsPatientIdSet.containsKey(aCRObj.AccountId)){
providerIdVsPatientIdSet.put(aCRObj.AccountId, new Set<Id>());
}
if(aCRObj.Is_Person_Account__c && !String.IsEmpty(aCRObj.Roles) && aCRObj.Roles.containsIgnoreCase(ESA_cls_constants.EDRD_PHYSICIAN) && !aCRObj.Is_EDRD_Data_Migration__c){
providerIdVsPatientId.put(aCrObj.AccountId , acrObj.ContactAccountId__c);
providerIdVsPatientIdSet.get(aCrObj.AccountId).add(acrObj.ContactAccountId__c);
}
}

if(!providerIdVsPatientId.isEmpty()){
if(!providerIdVsPatientIdSet.isEmpty()){
providerIdVsRec = new Map<Id, User>([SELECT Id, Contact.AccountId FROM User
WHERE Contact.AccountId IN :providerIdVsPatientId.keySet()]);
WHERE Contact.AccountId IN :providerIdVsPatientIdSet.keySet()]);
}

if(!providerIdVsRec.isEmpty()){
for(User userObj : providerIdVsRec.values()){
if(!providerIdVsUserIdSet.containsKey(userObj.Contact.AccountId)){
providerIdVsUserIdSet.put(userObj.Contact.AccountId, new Set<Id>());
}

providerIdVsUserIdSet.get(userObj.Contact.AccountId).add(userObj.Id);
}

for(Id providerId: providerIdVsPatientId.keySet()){
for(Id providerId: providerIdVsPatientIdSet.keySet()){
for(Id userId: providerIdVsUserIdSet.get(providerId)){
accShareListToInsert.add(new AccountShare(AccountId = providerIdVsPatientId.get(providerId),
AccountAccessLevel = 'Edit', UserOrGroupId = UserId,
OpportunityAccessLevel = 'None'));
for(Id patientId: providerIdVsPatientIdSet.get(providerId)){
accShareListToInsert.add(new AccountShare(AccountId = patientId,
AccountAccessLevel = 'Edit', UserOrGroupId = UserId,
OpportunityAccessLevel = 'None'));
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,13 @@ public with sharing class EDRD_cls_DrugCostCalculator {
noOfUnit = Math.ceil((RecFundingDurationUnitDays)/(RecFrequencyUnitsDays));
noOfUnit = noOfUnit * RecFrequency ;
Integer reqStandrdDosePerDose = 0;
Decimal originalStrength = Strength;
Decimal accumulatedStrength = 0;

do {
reqStandrdDosePerDose = reqStandrdDosePerDose + 1;
Strength = Strength * reqStandrdDosePerDose;
} while (Strength/Dosage < 1);
accumulatedStrength = originalStrength * reqStandrdDosePerDose;
} while (accumulatedStrength/Dosage < 1);

ESA_cls_caseTriggerHandler.costPerDose = reqStandrdDosePerDose * ListPrice;
return (noOfUnit * reqStandrdDosePerDose * ListPrice);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ public with sharing class EDRD_cls_FundingForecastController {
caseDateWrapperObj.noOfDosages = wrapperObj.dosePerFrequency * 1;
}
else if(wrapperObj.frequency == 'Daily'){
caseDateWrapperObj.totalCost = wrapperObj.dosePerFrequency * wrapperObj.costPerDose * (wrapperObj.firstDoseAt.daysBetween(wrapperObj.endDate) + 1);
caseDateWrapperObj.noOfDosages = wrapperObj.dosePerFrequency * (wrapperObj.firstDoseAt.daysBetween(wrapperObj.endDate) + 1);
caseDateWrapperObj.totalCost = wrapperObj.dosePerFrequency * wrapperObj.costPerDose * (wrapperObj.firstDoseAt.daysBetween(wrapperObj.endDate));
caseDateWrapperObj.noOfDosages = wrapperObj.dosePerFrequency * (wrapperObj.firstDoseAt.daysBetween(wrapperObj.endDate));
caseDateWrapperObj.firstDoseAt = wrapperObj.startDate;
caseDateWrapperObj.lastDoseAt = wrapperObj.endDate;
}
Expand Down