💻 Coding Prompt
The Healthcare QA Engineer's Intermediate Playbook for Documenting an API with DeepSeek
Intermediate-level strategies for Healthcare QA Engineers — fix poor error handling while documenting an API and make the codebase maintainable
The Prompt
You are a specialist QA engineer with 12 years of experience in healthcare software systems, API documentation, and regulatory-compliant testing for HIPAA-sensitive platforms. Help me create a database schema so I can make the codebase maintainable.
My situation:
Healthcare API type: [e.g., patient data retrieval API / clinical lab results service / appointment scheduling API]
Poor error handling symptom: [e.g., API returns 200 status with an error message in the body / error responses do not include enough information for the QA team to reproduce the failure / null values are returned instead of error codes when a record is not found]
Database schema context: [e.g., schema supports the API being documented / current schema has no error state tracking / schema needs to support audit logging for HIPAA compliance]
Current documentation state: [e.g., Swagger file exists but is 6 months out of date / no error response documentation / only happy path is documented]
Regulatory constraint: [e.g., HIPAA requires audit trails for all data access / HL7 FHIR compliance required for interoperability / error logs must not contain PHI]
Team reviewing this documentation: [e.g., internal developers / third-party integration partners / hospital IT compliance team]
Most problematic API endpoint: [describe the endpoint with the worst error handling — e.g., the patient record fetch that returns a 500 with no body on a missing ID]
Deliver:
A database schema for error state tracking: define the tables, fields, and relationships needed to log API errors in a way that supports debugging, audit compliance, and future error pattern analysis — with field-level annotations explaining the HIPAA constraint each design decision addresses
An error response standardization spec: define the error response structure for all API endpoints — HTTP status code, error code, human-readable message, correlation ID, and timestamp — with a specific rule for what information is safe to include given PHI restrictions
An error handling audit of the most problematic endpoint: document the current behavior, identify the specific error handling gap, and specify the corrected behavior at the code level and the database schema level
An API documentation update for error responses: rewrite the Swagger or OpenAPI error response section for the 3 most critical endpoints, including all error codes the endpoint can return, the condition that triggers each, and the resolution path for the integration partner
A QA test matrix for error handling: define 10 test cases that cover error handling behavior across the API — missing required fields, invalid data types, unauthorized access attempts, database connection failures, and PHI boundary violations
A schema migration plan: define the steps to add the error state tracking schema to the existing database without breaking current API functionality — including the migration script structure, rollback procedure, and the test that confirms the migration succeeded
A documentation maintenance standard: define how the API error documentation stays current — which team member updates it, what event triggers an update, and the review step that confirms error response documentation matches actual API behavior before each release
A compliance documentation checklist: 6 items the QA team verifies before submitting the API documentation to the hospital IT compliance team — confirming that no PHI appears in error logs, audit trail fields are present, and all error responses meet the regulatory standard
Design the error state tracking schema before writing any documentation — documentation that describes undocumented error behavior is accurate today and wrong the moment the error handling changes without a schema to anchor it.
💡 How to use this prompt
- Start with output #2 — the error response standardization spec. In healthcare APIs, poor error handling is almost always a consistency problem, not a code problem. Every endpoint returns errors differently because there is no agreed format. Define the standard first, and both the schema and the documentation become straightforward to produce.
- The most common mistake is documenting the current broken error behavior instead of documenting the corrected behavior. QA engineers in healthcare environments often write documentation that reflects what the API actually does to satisfy an audit deadline — creating documentation that enshrines the bug rather than flagging it for a fix.
- DeepSeek handles this at a fraction of the API cost of GPT-4o or Claude. Use DeepSeek R1 with Deep Thinking mode enabled for complex logic tasks. For public-facing or client-sensitive outputs, review DeepSeek's data storage policy before use.
Best Tools for This Prompt
🤖 Best AI Coding Tools for This Prompt
Tested & reviewed — run this prompt with the best AI tools
About This Coding AI Prompt
This free Coding prompt is designed for DeepSeek and works with any modern AI assistant including ChatGPT, Claude, Gemini, and more. Simply copy the prompt above, paste it into your preferred AI tool, and customize the bracketed sections to fit your specific needs.
Coding prompts like this one help you get better, more consistent results from AI tools. Instead of starting from scratch every time, you can use this tested prompt as a foundation and adapt it to your workflow. Browse more Coding prompts →