Get Patient Data
FHIR® includes an option to query everything associated to an individual patient. This is useful when transmitting batch data or getting the full patient history. 1upHealth supports the $everything
operator.
Although the $everything
endpoint is in the FHIR standard, many other servers do not support it due to the additional complexity it adds behind the scenes. Many of our customers have requested it and we also believe in it's usefulness. Any app can query $everything
using the 1upHealth FHIR API.
To query everything, send a GET request to the following endpoint. You must include the patient's ID, the FHIR version type (dstu2, stu3, or r4) and the patient’s bearer access token.
curl -X GET 'https://api.1up.health/{fhirVersion}/Patient/{patient_id}/$everything' \
-H "Authorization: Bearer accesstokenaccesstoken"
The query iterates through all of the resources in alphabetical order and provides them in the FHIR bundle response, in groups of ten. You can then paginate through the bundle to get additional resources. The total count is also be available in the response so you know how many pages of resources are included.
The $everything
request endpoint is case sensitive. It must be lower case.
FHIR R4 $everything Search Parameters
We support the following search parameters for FHIR R4.
Parameter |
Description |
Example |
---|---|---|
_type |
Allows you to specify which types of resources will be included in the response. For example, |
/r4/Patient/{PatientId}/$everything?_type=Observation,Encounter |
_since |
Returns only resources that have been modified since the time you specify, based on |
/r4/Patient/{PatientId}/$everything?_since=2021-05-27T05:00:00Z |
start |
Specifying the start date includes resources where their clinical date is after the specified start date. If no start date is provided, all records before the end date are in scope. This will filter out resources that have date attributes. However, it will not filter resources that don't have date attributes (such as Patient, Group, FamilyMemberHistory). Resources that reference the patient are always returned. |
/r4/Patient/{PatientId}/$everything?start=2021-05-27T05:00:00Z |
end |
Specifying the end date will pull in resources where their clinical date is before the specified end date. If no end date is provided, all records after the start date are in scope. This will filter out resources that have date attributes. However, it will not filter resources that don't have date attributes (such as Patient, Group, FamilyMemberHistory). Resources that reference the patient are always returned. |
/r4/Patient/{PatientId}/$everything?end=2021-12-27T05:00:00Z |
$everything Start and End Resource Attributes
The following resource attributes are supported for the start and end search parameters for the $everything
operator.
Attribute |
Element |
---|---|
Account | servicePeriod.start |
AdverseEvent | date |
AllergyIntolerance | recordedDate |
Appointment | start |
AppointmentResponse | start |
AuditEvent | period.start |
Basic | created |
BodyStructure | NO_DATE |
CarePlan | period.start |
CareTeam | period.start |
ChargeItem | occurrenceDateTime, occurrencePeriod.start, occurrenceTiming.event |
Claim | billablePeriod.start |
ClaimResponse | created |
ClinicalImpression | date |
Communication | sent |
CommunicationRequest | occurrenceDateTime, occurrencePeriod.start |
Composition | date |
Condition | recordedDate |
Consent | dateTime |
Coverage | period.start |
CoverageEligibilityRequest | created |
CoverageEligibilityResponse | created |
DetectedIssue | identifiedDateTime |
DeviceRequest | authoredOn |
DeviceUseStatement | recordedOn |
DiagnosticReport | effectiveDateTime, effectivePeriod.start |
DocumentManifest | created |
DocumentReference | context.period.start |
Encounter | period.start |
EnrollmentRequest | created |
EpisodeOfCare | period.start |
ExplanationOfBenefit | billablePeriod.start |
FamilyMemberHistory | NO_DATE |
Flag | period.start |
Goal | statusDate |
Group | NO_DATE |
ImagingStudy | started |
Immunization | recorded |
ImmunizationEvaluation | date |
ImmunizationRecommendation | date |
Invoice | date |
List | date |
MeasureReport | period.start |
Media | issued |
MedicationAdministration | effectiveDateTime, effectivePeriod.start |
MedicationDispense | whenPrepared |
MedicationRequest | authoredOn |
MedicationStatement | dateAsserted |
MolecularSequence | NO_DATE |
NutritionOrder | dateTime |
Observation | effectiveDateTime |
Observation | effectivePeriod.start |
Observation | effectiveTiming.event |
Observation | effectiveInstant |
Patient | NO_DATE |
Person | NO_DATE |
Procedure | performedDateTime, performedPeriod.start |
Provenance | occurredPeriod.start, occurredDateTime |
QuestionnaireResponse | authored |
RelatedPerson | NO_DATE |
RequestGroup | authoredOn |
ResearchSubject | period.start |
RiskAssessment | occurrenceDateTime, occurrencePeriod.start |
Schedule | planningHorizon.start |
ServiceRequest | authoredOn |
Specimen | receivedTime |
SupplyDelivery | occurrenceDateTime, occurrencePeriod.start, occurrenceTiming.event |
SupplyRequest | authoredOn |
VisionPrescription | dateWritten |
VisionPrescription | dateWritten |
VisionPrescription | dateWritten |
DELETE $everything (R4 Only)
In FHIR R4 only, you can also delete all patient data (FHIR resources) at once by making a DELETE request to the same endpoint.
Resources deleted by this request must be directly patient-related. There is no deletion of shared resources such as Organization, Location, Medication, Practitioner, etc. which do not directly reference the Patient resource.
In this way you can delete all patient data with less time and effort rather than making delete request for every patient related resource type using our FHIR delete endpoint.
To query everything send a request to this endpoint with the patient's ID and the patient’s bearer access token.