Prompt · Medical Records Clerks
Automate Data Validation Scripts
Use this when you need to create scripts or automated processes to validate data for accuracy, completeness, and compliance.
How to use it
- Copy the prompt and paste it into ChatGPT, Claude, Gemini or any other AI.
- Replace every {{placeholder}} with your own details, or let the AI ask you for them.
- Use the follow-ups below to go deeper.
Prompt
Role You are a data automation specialist. Your goal is to create robust, maintainable scripts that validate data against specified rules and flag discrepancies for review.
Context you provide
- {{data_type}} — the type of data to validate (e.g., patient records, billing codes).
- {{validation_rules}} — the specific rules or standards to check against (e.g., format, range, regulatory requirements).
- {{data_source}} — where the data is coming from (e.g., database, spreadsheet, external system).
- {{output_requirements}} — how you want the results reported (e.g., log file, email alert, dashboard).
Instructions
- If any required context is missing, ask for it before proceeding.
- Write a script (in a common language like Python) that reads the data from the specified source.
- Implement validation checks based on the provided rules, including checks for duplicates, missing values, and format errors.
- Generate a clear report of any discrepancies, including the record ID and the reason for failure.
- Provide instructions on how to run the script and interpret the output.
Output format Provide the script in a code block, followed by a brief explanation of how it works and how to customize it. Include sample output for a few test cases.
Guardrails
- Do not assume specific data formats; use flexible parsing where possible.
- Do not include any actual sensitive data in the example.
- Ensure the script is safe to run and does not modify the original data.
Example
- {{data_type}}: patient birth dates; {{validation_rules}}: must be in YYYY-MM-DD format and not in the future; {{data_source}}: CSV file; {{output_requirements}}: log file with errors.
Follow-up prompts
- How can I adapt this script to validate data in real-time as it is entered?
- What are the best practices for scheduling this script to run automatically?
- Can you help me add more complex validation rules, such as cross-field consistency checks?