Your task is to create a dockerized service, claim_process to process claims.
- claim_process transforms a JSON payload representing a single claim input with multiple lines and stores it into a RDB.
- An example input (in CSV format) - claim_1234.csv is provided. Note that the names are not consistent in capitalization.
- claim_process generates a unique id per claim.
- claim_process computes the “net fee” as a result per the formula below. “net fee” = “provider fees” + “member coinsurance” + “member copay” - “Allowed fees” (note again that the names are not consistent in capitalization).
- A downstream service, payments, will consume “net fee” computed by claim_process.
- You have up to 120 min to complete your solution. Mail [email protected] a copy/link to your solution.
- Feel free to make and reasonable assumptions, state them and proceed if anything is unclear.
- You’re free to choose any Python based API framework as you see fit such as FastApi/Django/Flask. As noted earlier the solution must be dockerized.
- Use sqlite as a db and any ORM of your choice such as SQLModel/Sqlalchemy/Tortoise.
- Please add data validation for “submitted procedure” and “Provider NPI” columns. “Submitted procedure” always begins with the letter ‘D’ and “Provider NPI” is always a 10 digit number. The data validation should be flexible to allow for other validation rules as needed. All fields except ”quadrant” are required.
- Write pseudo code or comments in your code to indicate how claim_process will communicate with payments. There are multiple choices here but propose a reasonable solution based on:
- What needs to be done if there is a failure in either service and steps need to be unwinded.
- Multiple instances of either service are running concurrently to handle a large volume of claims.
- Clean, documented code and avoidance of anti-patterns
- Functioning code
- Consideration of corner cases