This guide offers comprehensive instructions on importing result range data into the OpenELIS PostgreSQL database using a shell script and a CSV file.
Prerequisites
Environment Setup:
Ensure that you are operating within the openelisdb-1 container where the OpenELIS PostgreSQL database is accessible.
Required Files:
Shell script: copy-result-range.sh
CSV file: result-ranges.csv
Step-by-Step Instructions
Download and Copy Required Files
Download the shell script (from bahmni-scripts/openelis/copy-result-range.sh repository), define result ranges in CSV format, and then copy them to the appropriate directories within your bahmni-docker folder.
CSV File Accessibility: Verify that the result-ranges.csv file is correctly formatted and accessible from the script's execution context.
Test Result Ranges: Confirm that the test result ranges added to the result-ranges.csv do not include the unit in which the results are to be captured. The field expects a numeric value, and any non-numeric character will result in an error.
Test Unit: Ensure that the test result ranges are defined in the unit in which the test has been defined.
Concept UUID Matching: Validate that the Concept UUID in the CSV matches the test UUID in the OpenMRS dictionary.
Environment Variables: Review and configure the following environment variables to align with your specific OpenELIS PostgreSQL database setup:
POSTGRES_DB: The database name (e.g., clinlims).
POSTGRES_USER: The database user (e.g., clinlims).
POSTGRES_HOST: The database host (default: localhost).
POSTGRES_PORT: The database port (default: 5432).
Troubleshooting
If you encounter any issues, ensure that:
The Docker Compose file is correctly configured, and the volumes are appropriately mounted.
The shell script has the correct permissions and is executable.
The CSV file path is accurately specified in the environment variables.
The environment variables match the OpenELIS PostgreSQL database configuration.
Conclusion
By adhering to these steps, you can effectively import result range data into the OpenELIS PostgreSQL database using the provided shell script and CSV file.