Health-Informatics-UoN / Carrot-Mapper

Carrot: Convenient And Reusable Rapid Omop Transformer.
https://carrot4omop.ac.uk
MIT License
12 stars 3 forks source link

Add serverless mapping rules #675

Closed AndyRae closed 2 months ago

AndyRae commented 2 months ago

Changes

Adds a new Azure Function MappingRules, that generates mapping rules when given a table_id.

The UX change is that reused mapping rules will now be generated when a user selects the Person Id and Date Event for that table, instead of using the "Refresh Rules" button. This enables larger scan reports, as the workload is now serverless, and only happening on a table basis rather than a whole Scan Report.

The UI has been updated with a notice to reflect this, and removing the "Refresh Rules" button entirely. The JSX changes are mostly Prettier working away.

The code to generate the rules is mostly lift and shift (added docs, types, tests), as we can now use the database directly in Azure functions. I've moved this code into the shared package, with the intention of removing it from the CLI (which will use the new service), and the existing services_rules.py.

Closes #663 Closes #612

Screenshots

Screenshot 2024-04-12 at 11 38 49

Deployment

Needs the following environment variables added:

COCONNECT_DB_ENGINE
COCONNECT_DB_HOST
COCONNECT_DB_NAME
COCONNECT_DB_PASSWORD
COCONNECT_DB_PORT
COCONNECT_DB_USER
MAPPING_RULES_QUEUE_NAME

A new MappingRules queue for:

Checks

Important: please complete these before merging.

github-actions[bot] commented 2 months ago
Tests Skipped Failures Errors Time
25 1 :zzz: 0 :x: 0 :fire: 2.427s :stopwatch: