-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Persist a new request to the data_requests table only if the patient id, project id combination does not exist. #12
base: main
Are you sure you want to change the base?
Conversation
mmwaikar
commented
Jan 10, 2025
- created a data_access/data_requests module which contains code only to interact with the Sqlite db
- used the above in requests module
- added code in create_data_request to check for existence of record with patient id, project id combination
- added test-log crate as a dev dependency (which automatically configures logger or a tracer)
Can you rebase and maybe remove formatting commit so that you will have less merge conflicts |
- introduce the data_access module
- so that tracing is pre-configured - improve the tests
534675e
to
78303ba
Compare
This is done Jan (thanks for your help). |
src/requests.rs
Outdated
) -> axum::response::Result<(StatusCode, Json<DataRequest>)> { | ||
let mut consent = payload.consent; | ||
let mut patient = payload.patient; | ||
let mut project_id = ""; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems odd. Do we ever want to have an empty project id?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Assigned a default value of "DEFAULT_PROJECT_ID".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thats not really what I meant. I am thinking about initializing this in a way where we know we have a valid project id like in the if or it can happen that we actually don't know the project_id we can make it an Option
. I don't really know how the logic here is supposed to work here so I can't say for sure what the right approach is
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've modified the logic to based on exchange id & project id combination (after discussing with @torbrenner) so you may please review the PR again.
I've rebased from main, so I am not sure why one of the CI/CD step still fails.
This should fix a test that is currently failing due to wrong password
- exchange id is like patient id (and it will always be present) - project id may not be present always
Can you revert the str extension traits I don't really see their point as they only do very simple things that I would not even hide behind a method call and its not like we need that functionality everywhere. |