The CSV files you describe are not yet ready for insertion into a database. So first, write a script or use shell commands to create a single CSV file containing all records that need to go into the BloodTestResults
table, reading the appropriate values from the path and filename.
Then open the CSV file with Calc and move it into Base as explained at https://help.libreoffice.org/Common/Importing_and_Exporting_Data_in_Base.
Another approach would be to write a Python-UNO macro to read the CSV files and execute SQL insert commands. I would recommend Python rather than Basic for this type of task because file handling and regular expressions are easier.
EDIT:
It sounds like you are comfortable with Java, so that may be a good choice for you even though it's not scripting. For Java, it will help if you are comfortable with an IDE such as Eclipse or NetBeans. You can run code from the IDE to interact with LibreOffice.