Insurance clients send their data to Ledger. The data_tracker offers a management solution for these database snapshots. It allows you to browse through views of ledger S3 buckets and describe their data status. It’s built with security and speed in mind.
The data_tracker API offers a solution for building apps on top of Ledger insurance data. Register for an API key first. Then:
curl -X GET -i -H "X-Api-Key: YOUR_API_KEY" "https://api.data-tracker.cation.ee/api/policies/map/?program_slug=YOUR_PROGRAM_SLUG&geojson=true"
Data Ingestion Process
Our data ingestion process involves the use of an S3 bucket structured similarly to your own. We've set up an AWS Lambda function linked to this bucket, which activates every time a file is uploaded. We have a backup of this Lambda function located here.
When this AWS Lambda function is triggered, it prepares the data structure for the files and sends it to the "api/files" endpoint. Once we receive a POST request at this endpoint, a request record is generated, capturing details such as the request's body, headers, response, and API-Key. Subsequently, a file record is created in our database, and a scheduled FileProcessing task is initiated. The FileProcessing task takes care of parsing and uploading files (CSV, XLS, XLSX) from the AWS S3 bucket to our database.
Mapping Patterns:
To enable automatic mapping of the program's file data, a corresponding mapping file is required. This mapping file should have the same name as the "program.slug". The mappings cover various aspects, including policies, claims, and payments. Importantly, the mapping data is dynamic, allowing you to add more columns for mapping and saving as needed.
Policy mapping example:
policies:
data_mapping:
origin_reference: Policy Number
program_slug: Program ID
program_slug: Policy Effective Date
expiration_date: Policy Expiry Date
metadata:
event_origin_reference: TransactionID
Here are the fields from the policies that we need to store: origin_reference, program_slug, program_slug, expiration_date, metadata.event_origin_reference
And correspondingly, these are the column names as they appear in the policies file: Policy Number, Program ID, Policy Effective Date, Policy Expiry Date, Transaction ID