Updating Orthodontic Maximum Not Reflecting in OpenDental UI

For requests or help with our API
Post Reply
induced
Posts: 4
Joined: Tue Sep 17, 2024 1:13 am

Updating Orthodontic Maximum Not Reflecting in OpenDental UI

Post by induced » Tue Sep 17, 2024 9:33 am

We're using the /benefits API to update orthodontic information, including the lifetime maximum, but it's not appearing in the expected field in the OpenDental UI. Here's our current code:

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');
The code appears to successfully update the ortho age limit. However, the orthodontic maximum and lifetime max is not appearing in the expected field in the OpenDental UI.
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:
Image

justine
Posts: 286
Joined: Tue Dec 28, 2021 7:59 am

Re: Updating Orthodontic Maximum Not Reflecting in OpenDental UI

Post by justine » Tue Sep 17, 2024 10:01 am

induced wrote: ↑
Tue Sep 17, 2024 9:33 am
We're using the /benefits API to update orthodontic information, including the lifetime maximum, but it's not appearing in the expected field in the OpenDental UI. Here's our current code:

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');
The code appears to successfully update the ortho age limit. However, the orthodontic maximum and lifetime max is not appearing in the expected field in the OpenDental UI.
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:
Image
Hello induced,

Ortho max is a specific kind of benefit, so the existing API benefits endpoints should be able to handle this.

Here is how Open Dental determines if a benefit is an ortho max benefit.

No separate step is needed to refresh the UI other than to open the form.

No, there are not permission issues preventing this specific field from being updated.

Thanks!

Post Reply