Retrieve a patient's structured record
Use case
Retrieve a patient’s record in FHIR® structured format from a GP practice.
API specification
See API specification for more details about topic such as:
- Who can use the API
- Related APIs
- API status and roadmap
- Service level
- Security and authorisation
- Environments and testing
- Onboarding
- Error handling
Interaction diagram
Operation definition
See OperationDefintion: GPConnect-GetStructuredRecord-Operation-1.
Payload response body
Provider systems MUST:
- return a
200
OK HTTP status code to indicate successful retrieval of a patient’s structured record - return a
Bundle
conforming to theGPConnect-StructuredRecord-Bundle-1
profile definition - return the following resources in the
Bundle
:Patient
matching the NHS Number sent in the body of the requestOrganization
matching the patient’s registered GP practice, referenced fromPatient.generalPractitioner
Organization
matching the organisation serving the request, if different from above, referenced fromPatient.managingOrganization
Practitioner
matching the patient’s usual GP, if they have one, referenced fromPatient.generalPractitioner
PractitionerRole
matching the usual GP’s role- resources holding consultations, problems, immunisations, allergies, intolerance, medications, uncategorised data, referrals, investigations, diary entries and warnings about unsupported parameters according to the rules below:
Provider systems SHOULD:
- provide a consistent order to elements within the
Bundle
resource. It is recommended to follow the order described in the Bundle population illustrated diagram.
Consumers systems MUST NOT:
- rely on order or index of elements within the
Bundle
resource in order to parse encapsulated resources.
Unavailability of data
There are scenarios where requested clinical areas may not be returned, these are listed on the Configuration for supported clinical areas page along with guidance on implementation. Consumer systems MUST be able to handle this unavailability and warn users that some information hasn’t been returned.
Allergies
Provider systems MUST include the following in the response Bundle
.
When the includeAllergies
parameter is not set:
- no allergy or intolerance information shall be returned
When the includeAllergies
parameter is set:
- and when the
includeResolvedAllergies
parameter is set tofalse
:- A
List
resource referencingAllergyIntolerance
resources that match the supplied query parameters - A
List
resource referencingCondition
resources that are linked from the returnedAllergyIntolerance
resources Condition
andAllergyIntolerance
resources representing the patient’s allergies and intolerances, excluding those marked as resolved or ended
- A
- and when the
includeResolvedAllergies
parameter is set totrue
:- A
List
resource referencingAllergyIntolerance
resources that match the supplied query parameters - A
List
resource referencingCondition
resources that are linked from the returnedAllergyIntolerance
resources Condition
andAllergyIntolerance
resources representing the patient’s allergies and intolerances, including those marked as resolved or ended
- A
Organization
,Practitioner
andPractitionerRole
resources that are referenced by theAllergyIntolerance
resources
Medications
Provider systems MUST include the following in the response Bundle
. When the includeMedication
parameter is not set:
- no medication information shall be returned
When the includeMedication
parameter is set:
- A
List
resource referencingMedicationStatement
resources that match the supplied query parameters - A
List
resource referencingCondition
resources that are linked from the returnedMedicationStatement
resources Condition
,MedicationStatement
,MedicationRequest
with anintent
ofplan
andMedication
resources representing the patient’s medication summary information (authorisations and medication prescribed elsewhere)- and when the
medicationSearchFromDate
parameter is set:- all medications which are active on or after the
medicationSearchFromDate
MUST be returned- A medication is considered active between its
effective.start
andeffective.end
(inclusive)- when a medication does not have an
effective.end
:- an acute medication is considered active on its
effective.start
only - a repeat medication is considered on-going and is active from its
effective.start
- when a medication is not defined as an acute or repeat it MUST be treated as repeat
- an acute medication is considered active on its
- when a medication does not have an
- A medication is considered active between its
- all medications which are active on or after the
- all medications that are prescribed elsewhere will be returned regardless of the
medicationSearchFromDate
- and when the
includePrescriptionIssues
parameter is set tofalse
:- no prescription issue information should be returned
- and when the
includePrescriptionIssues
parameter is set totrue
or not included:MedicationRequest
resources with anintent
oforder
representing the patient’s prescription issues, for the above medication summary data
Organization
,Practitioner
andPractitionerRole
resources that are referenced by theMedicationStatement
andMedicationRequest
resources
Consultations
Provider systems MUST include the following in the response Bundle
.
When the includeConsultations
parameter is not set:
- no consultation information shall be returned
When the includeConsultations
parameter is set:
- A
List
resource for referencingEncounter
resources that match the supplied query parameters - A
List
resource of secondary lists referencing resources that are linked from the returnedEncounter
resources - For each
Encounter
referenced in theList
resource:- The
Encounter
resource of the Consultation - The
List
resources that describe the structure of the Consultation - The
ProblemHeader (Condition)
resource of any directly linked Problems - The
MedicationRequest
,MedicationStatement
andMedication
resources of any linked Medications or Medical Devices- Always include the
MedicationStatement
,MedicationRequest
, (intent = plan) andMedication
resources - Only include
MedicationRequest
(intent = order) for directly linked issues - Include the
ProblemHeader (Condition)
resource of any Problems linked to the returned Medications and Medical Devices
- Always include the
- The
AllergyIntolerance
resource of any linked Allergies, including resolved allergies- Include the
ProblemHeader (Condition)
resource of any Problems linked to the returned Allergies
- Include the
- The
Immunization
resource of any linked Immunisations- Include the
ProblemHeader (Condition)
resource of any Problems linked to the returned Immunisations
- Include the
- The
Observation - uncategorised
resource of any linked Uncategorised Data- Include the
ProblemHeader (Condition)
resource of any Problems linked to the returned Uncategorised Data
- Include the
- The
ReferralRequest
resource of any linked Referrals- Include the
ProblemHeader (Condition)
resource of any Problems linked to the returned Referrals
- Include the
- The
DocumentReference
resource of any linked Documents- Only include the document metadata in any returned
DocumentReference
resource, do not include the binary file - In order to retrieve the binary file, a consumer must have been assured for the Access Document capability
- Include the
ProblemHeader (Condition)
resource of any Problems linked to the returned Documents
- Only include the document metadata in any returned
- The
DiagnosticReport
,ProcedureRequest
,Observation
,Specimen
andDocumentReference
resources of any linked Investigations- Only include the document metadata in any returned
DocumentReference
resource, do not include the binary file. - Include the
ProblemHeader (Condition)
resource of any Problems linked to the returned Investigation
- Only include the document metadata in any returned
- The
ProcedureRequest
resource of any linked Diary Entries- Include the
ProblemHeader (Condition)
resource of any Problems linked to the returned Diary Entries
- Include the
- The
- and when the
consultationSearchPeriod
parameter is set:- when a
start
value is set, all consultations with anEncounter.period.start
after the date MUST be returned - and when an
end
value is set, all consultations with anEncounter.period.end
before the date MUST be returned - and when both a
start
andend
are specified, consultations with anEncounter.period.start
after thestart
and anEncounter.period.end
before theend
MUST be returned
- when a
- and when the
includeNumberOfMostRecent
parameter is set:- consultations MUST be ordered by
Encounter.period.start
descending
- consultations MUST be ordered by
- and the number of most recent consultations matching the parameter value MUST be returned
Organization
,Practitioner
,PractitionerRole
andLocation
resources that are referenced by the above resources that represent the consultation and its linked information
Problems
Provider systems MUST include the following in the response Bundle
.
When the includeProblems
parameter is not set:
- no problem information shall be returned
When the includeProblems
parameter is set:
- A
List
resource containing references toProblemHeader (Condition)
for every Problem that met the search criteria - A
List
resource containing references toProblemHeader (Condition)
for every Problem not meeting the search criteria but directly linked to a Problem which does meet the search criteria - A
List
resource of secondary lists referencing resources that are linked from the returnedEncounter
resources - For each
ProblemHeader (Condition)
referenced in theList
resource:- The
ProblemHeader (Condition)
resource of the Problem - The
ProblemHeader (Condition)
resources of any directly linked Problems - The
Encounter
resources of any linked Consultations - The
MedicationRequest
,MedicationStatement
, andMedication
resources of any linked Medications or Medical Devices- Always include the
MedicationStatement
,MedicationRequest
(intent = plan) andMedication
resources - Only include
MedicationRequest
(intent = order) for directly linked issues
- Always include the
- The
AllergyIntolerance
resource of any linked Allergies- Include the
ProblemHeader (Condition)
resource of any Problems linked to the returned Allergies
- Include the
- The
Immunization
resource of any linked Immunisations- Include the
ProblemHeader (Condition)
resource of any Problems linked to the returned Immunisations
- Include the
- The
Observation - uncategorised
resource of any linked Uncategorised Data- Include the
ProblemHeader (Condition)
resource of any Problems linked to the returned Uncategorised Data
- Include the
- The
ReferralRequest
resource of any linked Referrals- Include the
ProblemHeader (Condition)
resource of any Problems linked to the returned Referrals
- Include the
- The
DocumentReference
resource of any linked Documents- Only include the document metadata in any returned
DocumentReference
resource, do not include the binary file. - In order to retrieve the binary file, a consumer must have been assured for the Access Document capability
- Include the
ProblemHeader (Condition)
resource of any Problems linked to the returned Documents
- Only include the document metadata in any returned
- The
DiagnosticReport
,ProcedureRequest
,Observation
,Specimen
andDocumentReference
resources of any linked Investigations- Only include the document metadata in any returned
DocumentReference
resource, do not include the binary file. - Include the
ProblemHeader (Condition)
resource of any Problems linked to the returned Investigation - Where an
Observation
that represents a test or test group header has been made the actual problem then the ‘diagnosticReport’ it is from MUST be linked to the problem in therelatedClinicalContent
extension.
- Only include the document metadata in any returned
- The
ProcedureRequest
resource of any linked Diary Entries- Include the
ProblemHeader (Condition)
resource of any Problems linked to the returned Diary Entries
- Include the
- The
- and when the
filterStatus
parameter is set:- problems with a
clinicalStatus
matching the parameter value and all linked clinical information.
- problems with a
Organization
,Practitioner
andPractitionerRole
resources that are referenced by the above resources that represent the problem and its linked information
Immunisations
Provider systems MUST include the following in the response Bundle
.
When the includeImmunisations
parameter is not set:
- no immunisation information shall be returned
When the includeImmunisations
parameter is set:
- A
List
resource referencingImmunization
resources that match the supplied query parameters - A
List
resource referencingCondition
resources that are linked from the returnedImmunization
resources Condition
andImmunization
resources representing the patient’s immunisations that have been given will be returned.- and when the
includeNotGiven
part parameter is set tofalse
or not supplied:- only immunisations where
notGiven
is set tofalse
shall be returned
- only immunisations where
- and when the
includeNotGiven
part parameter is set totrue
- all immunisations where
notGiven
is set totrue
orfalse
shall be returned
- all immunisations where
- and when the
includeStatus
part parameter is set tofalse
:- only immunisations will be returned
- and when the
includeStatus
part parameter is set totrue
or not supplied:Observation - uncategorised
resources representing the status of patient’s immunisations will also be returned.
Organization
,Practitioner
,PractitionerRole
andLocation
resources that are referenced by the above resources that represent the immunization and its linked information
Uncategorised data
Provider systems MUST include the following in the response Bundle
.
When the includeUncategorisedData
parameter is not set:
- no uncategorised data shall be returned
When the includeUncategorisedData
parameter is set:
- A
List
resource referencingObservation - uncategorised
resources that match the supplied query parameters - A
List
resource referencingCondition
resources that are linked from the returnedObservation - uncategorised
resources Condition
,Observation - uncategorised
andObservation - blood pressure
resources representing the patient’s uncategorised data will be returned.- and when the
uncategorisedDataSearchPeriod
parameter is set:- when a
start
value is set, all uncategorised data with anObservation.effectiveTime
after the date MUST be returned - and when an
end
value is set, all uncategorised data with anObservation.effectiveTime
before the date MUST be returned - and when both a
start
andend
are specified, uncategorised data with anObservation.effectiveTime
after thestart
and with anObservation.effectiveTime
before theend
MUST be returned
- when a
Organization
,Practitioner
andPractitionerRole
resources that are referenced by the above resources that represent the uncategorised data and its linked information
Investigations
Provider systems MUST include the following in the response Bundle
.
When the includeInvestigations
parameter is not set:
- no investigations shall be returned
When the includeInvestigations
parameter is set:
- A
List
resource referencingDiagnosticReport
resources that match the supplied query parameters - A
List
resource referencingCondition
resources that are linked from the returnedDiagnosticReport
resources DiagnosticReport
,Observation - Test Group Header
,Observation - Test Result
,Observation - Filing Comments
,ProcedureRequest
,Specimen
andCondition
resources representing the patient’s test results- and when the
investigationSearchPeriod
parameter is set:- when a
start
value is set, all investigations with aDiagnosticReport.issued
after the date MUST be returned - and when an
end
value is set, all investigations with aDiagnosticReport.issued
before the date MUST be returned - and when both a
start
andend
are specified, investigations with aDiagnosticReport.issued
after thestart
and before theend
MUST be returned
- when a
Organization
,Practitioner
andPractitionerRole
resources that are referenced by the above resources that represent the uncategorised data and its linked information
Referrals
Provider systems MUST include the following in the response Bundle
.
When the includeReferrals
parameter is not set:
- no referrals information shall be returned
When the includeReferrals
parameter is set:
- A
List
resource referencingReferralRequest
resources that match the supplied query parameters - A
List
resource referencingCondition
resources that are linked from the returnedReferralRequest
resources ReferralRequest
,Condition
andDocumentReference
resources representing the patient’s referrals will be returned.- and when the
referralSearchPeriod
parameter is set:- when a
start
value is set, all referrals with aReferralRequest.authoredOn
after the date MUST be returned - and when an
end
value is set, all referrals with aReferralRequest.authoredOn
before the date MUST be returned - and when both a
start
andend
are specified, referrals with aReferralRequest.authoredOn
after thestart
and with aReferralRequest.authoredOn
before theend
MUST be returned
- when a
Organization
,Practitioner
,PractitionerRole
andHealthcareService
resources that are referenced by the above resources that represent the referral and its linked information
Diary entries
Provider systems MUST include the following in the response Bundle
.
When the includeDiaryEntries
parameter is not set:
- no diary entries shall be returned
When the includeDiaryEntries
parameter is set:
- A
List
resource referencingProcedureRequest
resources that match the supplied query parameters - A
List
resource referencingCondition
resources that are linked from the returnedProcedureRequest
resources ProcedureRequest
andCondition
resources representing the patient’s diary entries will be returned.- and when the
diaryEntriesSearchDate
parameter is set:- all diary entries that occur on or before the
diaryEntriesSearchDate
MUST be returned
- all diary entries that occur on or before the
Organization
,Practitioner
andPractitionerRole
resources that are referenced by the above resources that represent the diary entry and its linked information
Unknown and partial date handling in searches
Where parameters contain part parameters for date searches, the following SHALL apply:
- clinical information where an effective date is unknown or not recorded shall be returned alongside information that matches the supplied dates
- where partial dates have been recorded, they will be evaluated against the supplied dates in the following way:
- Dates with only the year specified are equivalent to an interval that starts on the first instant of January 1st and ends on the last instant of December 31st
- Dates with only the year and month specified are equivalent to an interval that starts at the first instant of the first day of the month and ends on the last instant of the last day of the month
Medication search date
The medicationSearchFromDate
identifies the start date of the requested medications search period. An end date cannot be requested by a consumer, so that all searches go to the end of the patient’s record.
The scenarios below represent how a selection of acute and repeat medications are returned based on the search date in the request. Each scenario has a different search date. Medications that have been greyed out are not returned in the response.
Scenario 1
Search date: 15/01/2018
Current date: 08/10/2018
Scenario 2
Search date: 01/03/2018
Current date: 08/10/2018
Scenario 3
Search date: 08/07/2018
Current date: 08/10/2018
Scenario 4
Search date: 08/10/2018
Current date: 08/10/2018
Bundle population illustrated
Provider systems SHOULD provide a consistent order to elements within the Bundle
resource. It is recommended to follow the order described in the bundle population illustrated diagram below.
Consumer systems MUST NOT rely on order or index of elements within the Bundle
resource in order to parse encapsulated resources.
Payload response examples
Examples of the payload requests and responses can be found here:
- Allergy examples
- Medication examples
- Consultation examples
- Problem examples
- Immunisation examples
- Uncategorised data examples
- Investigation examples
- Referral examples
- Diary entry examples
To illustrate how forwards compatibility works, the following example has been included: