1. Home
  2. Sample Projects
  3. Health Insurance Premium Calculation

Health Insurance Premium Calculation

◷ Reading Time: 7 minutes

This Health Insurance Premium Calculation example is about calculating the health insurance price for a given individual. We have used the AutoML capability of FlexRule as a part of this project.

Therefore, this example uses the Analytics Extension.

Running the Sample

1. Open the file MainFlow.xml

Main Flow diagram for the Health Insurance Premium Calculation project

2. Click on Logic Run Template.

Detail view of the Logic Run Template menu item

3. Click on one of the given templates.

Logic Run Template view showing the available test templates

4. Click Debug.

Detail view of the Debug menu item

5. Click Next Step to go step by step.

Detail view of the Debug Next Step menu item

6. You will see the output under the Parameters window.

Parameters view showing the output of the test run

Health Insurance Premium Calculation process steps

These are the process steps.

  1. Predict the charges based on age, sex, BMI, number of children, smoking preference, and region
  2. Calculate the extra charges
  3. Calculate situational charges
  4. Calculate the premium

Project Description

The project contains several components that can be easily added or removed as necessary.

Main Flow

  • MainFlow.xml: This is the main flow, which is the orchestration layer that combines the validation and decisioning parts of the project.

DRD

  • Health Premium Calculation.xml: The main decision requirement diagram that connects different components of the project such as the prediction, extra charges calculation, and finally calculates the health insurance premium.

Glossaries and Concepts

  • BusinessFormula.xml: The list of formulas used in the project.
  • Concept.xml: The context of the project.

Predict Charges

These files were created automatically by the AutoML Builder.

  • Predict Insurance Charges.DRD.xml: The decision requirement diagram that predicts the charges based on the model created using AutoML.
  • insurance.InputOutput.Concept.xml: The concept file that defined the inputs and outputs of the predictive model.
  • insurance.frml: The report for the model.

Extra Charges

We used decision tables and a natural language document to calculate extra charges.

  • Cover Type.xml: The decision table that calculates the charges depending on the cover type.
  • Income.xml: The natural language document that calculates the charges depending on the customer’s income.
  • Residency Status.xml: The decision table that calculates the charges depending on the residency status.

Situational Charges

The models that calculate situational charges such as discounts and time-related charges (e.g. COVID)

  • COVID.xml: The decision table that calculates the charges depending on the covid vaccination status and covid positive status.
  • Discount
    • Discount.xml: The decision table that calculates the discounts.
    • Embedded Model Expressions.xml: The business formula document that contains the expression to connect to the flow with the REST API to get the discounted customer list.
    • GetDiscountedCustomers.xml: The flow that connects to the REST API to get the discounted customer list.

The Project Design

  • The main flow connects the validation and the decisioning parts of the project.
Main flow diagram for the Health Insurance Premium Calculation project
  • The DRD connects all the decision components according to their hierarchy.
  1. First, it calculates the extra charges (from the decision tables, Residency Status, Cover Type, and Income), temporary charges, and predicts the insurance charges.
  2. Finally, adds all the charges together to determine the health premium.

The expressions used in this file are stored separately in BusinessFormula.xml.

Decision diagram connecting all the decision components according to their hierarchy.
  • Decision tables and the Natural Language Document in extra charges are used to add charges based on different criteria such as cover type, income, and residency status.
Decision table document in extra charges are used to add charges based on different criteria such as cover type, income, and residency status
Natural Language document in extra charges are used to add charges based on different criteria such as cover type, income, and residency status
  • The Business Formulas file with the expressions used in the project.
Business formula document with the expressions used in the project
The Business Glossary file with all the business terms in the project.
  • The concept file maps the business context.
Fact for the Health Insurance Premium Calculation project
  • Under Predict Charges, you can see the automatically created decision requirement diagram, concept, and ML build report.
ML Build result modal

The dataset (CSV file) used to build the model contains data of 1338 customers.

Example of the data in the CSV
  • Under Temporary Charges, you can add if there are any discounts or temporary charges.
Decision table under Temporary Charges, you can add if there are any discounts or temporary charges
  • Under Discount, you can see the discount-related documents.
Decision table to calculate any discounts

Download the project

Use the attachment at the end of the page to download the sample project.

Updated on February 29, 2024

Article Attachments

Was this article helpful?

Related Articles