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

Create get_project_details_for_billing() #204

Closed pbchase closed 7 months ago

pbchase commented 7 months ago

Create a function, get_project_details_for_billing(). Given a redcap DB connection object and a vector of project IDs, it should return all these facts needed in a billing record:

Steal code from create_and_send_new_redcap_prod_per_project_line_items.R, line 74-119, but edit out all of the filters.

To do this, the code will need data from these tables:

ljwoodley commented 7 months ago

In adding ctsi_study_id I'm wondering when it was used in the anti_join instead of service_identifier? Isn't service_identifier the project_id?

https://github.com/ctsit/rcc.billing/blob/5c8c4ea781d77bbf9eefcbbe583633f01c32f8c4/etl/create_and_send_new_redcap_prod_per_project_line_items.R#L105

This anti_join will not be included in this function but I'm pointing it out on the off chance that it's a bug.

pbchase commented 7 months ago

Yes, that's got to be a bug. That Anti join wouldn't do anything. It doesn't harm, but it doesn't help

ChemiKyle commented 7 months ago

Addressed by #209