medal-data:icf
Differences
This shows you the differences between two versions of the page.
medal-data:icf [2024/01/12 11:50] – created Sylvain | medal-data:icf [2024/01/12 13:01] (current) – Sylvain | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== medAL-data Informed consent form management ====== | ====== medAL-data Informed consent form management ====== | ||
- | ====== Verification Procedures Documentation ====== | + | |
- | + | * [[medal-data: | |
- | ===== Step 1: SQL Query Execution ===== | + | |
- | + | ||
- | **Objective:** | + | |
- | Retrieve 300 random consents from the database for patients associated with medical cases and health facilities, excluding specific conditions. | + | |
- | + | ||
- | **Procedure:** | + | |
- | Connect | + | |
- | Execute the following SQL query: | + | |
- | + | ||
- | <code sql> | + | |
- | SELECT p.consent | + | |
- | FROM patients p | + | |
- | JOIN medical_cases m ON p.id = m.patient_id | + | |
- | JOIN health_facilities h ON h.group_id = m.group_id | + | |
- | WHERE p.id IN ( | + | |
- | SELECT m.patient_id | + | |
- | FROM medical_cases m | + | |
- | JOIN health_facilities h ON h.group_id = m.group_id | + | |
- | ORDER BY RANDOM() | + | |
- | ) | + | |
- | AND p.consent IS NOT NULL AND p.consent != '' | + | |
- | AND h.name NOT ILIKE ALL(ARRAY[' | + | |
- | ORDER BY RANDOM() | + | |
- | LIMIT 300; | + | |
- | </ | + | |
- | Review the results to ensure 300 random consents are retrieved, meeting the specified criteria. | + | |
- | + | ||
- | **Expected Results: | + | |
- | The query should return a list of 300 random consents for patients associated with medical cases and health facilities, excluding the specified conditions. | + | |
- | + | ||
- | ===== Step 2: Bash Script for SCP ===== | + | |
- | + | ||
- | **Objective: | + | |
- | Copy the identified images from the server to a local destination using scp. | + | |
- | + | ||
- | **Procedure: | + | |
- | Open a terminal on the local machine. | + | |
- | Create a new file named copy.sh | + | |
- | Copy and paste the following script into the newly created file: | + | |
- | + | ||
- | <code bash> | + | |
- | # | + | |
- | # Set your server' | + | |
- | REMOTE_SERVER=" | + | |
- | REMOTE_USER=" | + | |
- | + | ||
- | # Set the source and destination paths on the server | + | |
- | # If you don't know where the storage volume is you can retrieve it with this command while connected on the server | + | |
- | # dokku ps: | + | |
- | + | ||
- | SOURCE_PATH=" | + | |
- | DESTINATION_PATH=" | + | |
- | + | ||
- | List of image filenames | + | |
- | IMAGE_LIST=( | + | |
- | # paste here the list from the SQL script | + | |
- | # image_name.jpg | + | |
- | # image_name.jpg | + | |
- | # image_name.jpg | + | |
- | ) | + | |
- | + | ||
- | # Loop through the image filenames and copy them from the server | + | |
- | for image_name in " | + | |
- | # Use scp to copy each image from the server to the local machine | + | |
- | scp " | + | |
- | done | + | |
- | </ | + | |
- | + | ||
- | Make the script executable: | + | |
- | + | ||
- | <code bash> | + | |
- | chmod +x copy.sh | + | |
- | </ | + | |
- | Run the script: | + | |
- | + | ||
- | <code bash> | + | |
- | ./copy.sh | + | |
- | </ | + | |
- | + | ||
- | **Expected Results: | + | |
- | The bash script should successfully copy all identified images from the remote server to the specified local destination. Confirm that the images are present in the local directory specified as DESTINATION_PATH. | + |
medal-data/icf.txt · Last modified: 2024/01/12 13:01 by Sylvain