ctsit / rcc.billing

Automated, data-driven service billing implemented on REDCap Custodian
https://ctsit.github.io/rcc.billing/
Apache License 2.0
0 stars 3 forks source link

Revise `get_new_project_invoice_line_items` to use organizational data #231

Open pbchase opened 2 months ago

pbchase commented 2 months ago

Revise get_new_project_invoice_line_items (See PR #230) to use organizational data to determine if we should charge DSO Shands customers the $215, external non-profit rate.

ctsi_rcc_billing.org_hierarchies will tell you DEPT_IDs have string::str_detect(dept_name, "DSO-SHANDS"). ctsi_rcc_billing.person_org will tell you which people are in which organization. The orgs of interest all have this pattern:

SELECT * FROM org_hierarchies
where
DEPT_ID like '9501%';

So you can filter for people that work for UF Health Shands like this:

SELECT * FROM ctsi_rcc_billing.person_org
where
primary_uf_fiscal_org like '9501%';

Any PI/Owner who has stringr::str_starts(primary_uf_fiscal_org, "9501") should be charged the $215/hour (or $215/project) rate