PLAN_009 Validation of request and response data against FHIR schemas
Description
This test verifies that all JSON requests and responses for the clinical API endpoints adhere to the FHIR resource definitions and are properly validated.
System requirements
No special hardware or software is required to run this test.
Preconditions
- The entire system (including the reverse proxy, REST API, and all upstream services) is deployed, operational, and accessible online.
Input data
Before working with the JSON documents for your requests, download this image, convert it to Base64, and save it in an easily accessible text file. This setup step is crucial because the test needs body requests that include a Base64 encoded image.
To run the tests, you need these two JSON documents:
- Valid JSON request payload based on FHIR
CommunicationRequestresource.
{
"subject": {
"reference": "fake-patient-id"
},
"media": [
{
"contentType": "image/jpeg",
"data": <Paste-here-the-encoded-image>,
}
]
}
- Invalid JSON request payload with deviations from FHIR
CommunicationRequestresource.
{
"user": {
"reference": ["fake-patient-id"]
},
"images": [
{
"contentType": "image/jpeg",
"data": <Paste-here-the-encoded-image>,
}
]
}
Steps
- Send a POST request to the clinical API endpoint
/diagnosis-supportusing the valid JSON payload provided in the test data. - Send a POST request to the same endpoint, this time using the invalid JSON payload from the test data.