Search for a patient's documents
Use case
Search for a patient’s documents from a GP practice.
API specification
Search parameters
Provider systems SHALL support the following search parameters:
| Name | Type | Description | Paths |
|---|---|---|---|
created |
date or dateTime |
Creation/Edit datetime of the document | DocumentReference.created |
author |
token |
The organisation that authored the document | DocumentReference.author |
description |
string |
Keyword based search | DocumentReference.description + DocumentReference.type |
Important: GP Connect does not support searching for documents based on a practitioner author. The
author search parameter MUST only be used to search by an organisation author using an ODS code Important: The
type and facility parameters have been removed from the API. These will be reinstated in the future when provider systems contain the metadata to support them. The original release of the Access Documents capability contained type and facility parameters which could be used to search for types of clinical document and the types of clinical settings where they were created. These have been removed while the quality of the metadata in provider systems around these items improves. They will be reinstated at the point that they can be supported._include parameters
Provider systems SHALL support the following include parameters:
| Name | Description | Paths |
|---|---|---|
_include= DocumentReference:subject:Patient |
Include Patient resources referenced within the returned DocumentReference resources |
DocumentReference.subject |
_include= DocumentReference:custodian:Organization |
Details of organisations that are custodians for the documents that are returned in DocumentReference resources | |
_include= DocumentReference:author:Organization |
Details of organisations that authored the documents that are returned in DocumentReference resources | |
_include= DocumentReference:author:Practitioner |
Details of who/what authored the documents that are returned in DocumentReference resources | |
_revinclude:recurse= PractitionerRole:practitioner |
Include PractitionerRole resources referenced from matching Practitioner resources |
DocumentReference.author:Practitioner |
Consumer systems MUST send the following parameters to reduce the number of API calls:
_include=DocumentReference:subject:Patient_include=DocumentReference:custodian:Organization_include=DocumentReference:author:Organization_include=DocumentReference:author:Practitioner_revinclude:recurse=PractitionerRole:practitioner
Consumer systems MAY send the following parameters in the request:
createdauthordescription
When using the ‘created’ parameter, consumers MUST do the following
- to search for a lower boundary of a date:
- a single
createdparameter with a date prefixed bygeshould be supplied
- a single
- to search for a upper boundary of a date:
- a single
createdparameter with a date prefixed byleshould be supplied
- a single
- to search between two dates:
- two created parameters should be supplied
- a single
createdparameter with a date prefixed byge - a single
createdparameter with a date prefixed byle
- a single
- two created parameters should be supplied
Interaction diagram
Payload response body
Provider systems MUST:
- return a
200OK HTTP status code to indicate successful search of a patient’s documents - return a
Bundle - return the following resources in the
Bundle:Patientmatching the NHS Number sent in the body of the requestOrganizationmatching the patient’s registered GP practice, referenced fromPatient.generalPractitionerOrganizationmatching the organisation serving the request, if different from above, referenced fromPatient.managingOrganizationPractitionermatching the patient’s usual GP, if they have one, referenced fromPatient.generalPractitionerPractitionerRolematching the usual GP’s rolePractitionerresources for supplementary actorsPractitionerRoleresources for the roles of supplementary actorsDocumentReferenceresources conforming to the CareConnect-GPC-DocumentReference-1 profile that match the supplied search criteria- where the
createdparameter has been supplied andDocumentReference.createddoesn’t exist,DocumentReference.indexedMUST be used instead - where the
descriptionparameter has been supplied, bothDocumentReference.descriptionandDocumentReference.typeMUST be searched
- where the
Organizationresources for supplementary actors