Closed lucywilcock closed 6 years ago
The following tests have been implemented:
When patient data is brought back all mandatory fields are checked to ensure they are present and valid and the majority of required fields are also checked. This includes: the category, the asserted date, the clinical status, the code, the Id, the metadata, the patient reference, the verification status, the reaction, the end date (where applicable). It also asserts that the correct lists are returned and the patient, practitioner and organisation are there.
The following should also be tested but rely on supplier data. They have been added as manual tests for now:
Tests are currently in branch structured-record-allergies
The test around onsetDate has been commented out awaiting clarification from the specification as to whether it is mandatory or required.
If the former then the test should be added back in. If the latter then the test can be deleted.
GpConnect Version 1.0.0. specification begins to implement Access Record - Structured. One of the first sections to be included will be the Allergies section. New tests will need to be created to ensure this section works as expected.
At minimum, the following should be tested (other relevant tests may be also appropriate):
Send a valid request for the allergy section of the patient's record. The request should be made for a patient with a valid NHS number. The response should include a 200 HTTP status code, include the relevant GP Connect StructureDefinition profile details in the meta fields and include the Patient, Practitioner and Organization details in a searchset Bundle. The patient returned should be the patient requested and the details returned should be correct for that patient.
Send a valid request for the allergy section of the patient's record. The returned data should not contain allergies that have been marked as ended.
Send a valid request for the allergy section of the patient's record where the patient has been marked as 'No Known Allergies'. The data should be returned with 'No known allergies' marked.
Send a valid request for the allergy section of the patient's record where the patient has no listed allergies but has not been marked as 'No Known Allergies'. The data should contain no allergies and should not be marked as 'No known allergies' .
Send a request for the allergy section of the patient's record with an invalid NHS number (this could be a number that does not pass validation checks, an empty nhs number, multiple nhs numbers, duplicated nhs numbers or a non-existent number). This should return an error and an OperationalOutcome with additional data on the error.
Send a request for the allergy section of the patient's record with a GP organisation that is not the patient’s nominated primary care provider. This should return an error and an OperationalOutcome with additional data on the error.
Send a request for the allergy section of the patient's record with a time period specified. This should return an error and an OperationalOutcome with additional data on the error.