Code: Select all
console.log('π¦· Updating orthodontic information...');
try {
const orthoCovCat:any = coverageCategoryMapping['Orthodontics']
const orthoCovCatNum = await getCovCatNum(orthoCovCat);
if (orthoCovCatNum) {
console.log('π― Orthodontic coverage category found');
// Orthodontic lifetime maximum
try {
await makeApiRequest('POST', '/benefits', {
PlanNum: planNum,
BenefitType: 'Limitations',
MonetaryAmt: OrthodonticInformation.LifetimeMaximum,
TimePeriod: 'Lifetime',
CovCatNum: orthoCovCatNum,
CoverageLevel: 'None',
});
console.log('π° Orthodontic lifetime maximum updated successfully');
} catch (error) {
console.error('β Error updating orthodontic lifetime maximum:', (error as Error).message);
}
// Orthodontic age limit
try {
let ageLimitValue = parseInt(OrthodonticInformation.AgeLimit.code.substring(1));
if (!isNaN(ageLimitValue) && ageLimitValue > 0) {
ageLimitValue -= 1; // Adjust age limit to be under the specified age
}
await makeApiRequest('POST', '/benefits', {
PlanNum: planNum,
BenefitType: 'Limitations',
QuantityQualifier: 'AgeLimit',
Quantity: ageLimitValue,
CovCatNum: orthoCovCatNum,
CoverageLevel: 'None',
});
console.log('π Orthodontic age limit updated successfully');
} catch (error) {
console.error('β Error updating orthodontic age limit:', (error as Error).message);
}
} else {
console.warn('β οΈ Orthodontic coverage category not found');
}
} catch (error) {
console.error('β Error in orthodontic information update:', (error as Error).message);
}
console.log('π Orthodontic information update completed');
Specifically, the field in the top right of the UI where "Ortho Max" should be displayed is not being populated.
Questions:
1. Is there a different API endpoint or parameter we should be using to update the "Ortho Max" field specifically?
2. Are we missing any required parameters in our current API call that would ensure the UI field is updated?
3. Is there a separate step needed to refresh or update the UI after making these API calls?
4. Could there be any permission issues preventing this specific field from being updated?
Screenshot attached:
