Patient search in Datashare
This document provides comprehensive documentation for FHIR Patient search endpoints. These endpoints allow you to query patient information using various identifiers and parameters supported by the system.
Basic Patient Queries
Get top 10 from all patients
Retrieves the first 10 patients from the system. This is useful for quick testing or when you need a sample of patient data.
/Patient
Get N amount of patients
Allows you to specify the exact number of patients you want to retrieve. Replace N with your desired number.
/Patient?_count=N
Get a single patient by FhirId
Retrieves a specific patient using their FHIR ID. This is the most direct way to get a single patient's information.
/Patient?[fhirId]
Advanced Patient Search
Available Identifier Systems
The system supports multiple identifier systems for patient lookup:
### FnrSystem = urn:oid:2.16.578.1.12.4.1.4.1
(National ID number)### DnrSystem = urn:oid:2.16.578.1.12.4.1.4.2
(D-number)### XxxidSystem = urn:oid:2.16.578.1.12.4.1.4.14
(Other ID system)
Get a single patient by DNR number
Retrieves a patient using their D-number. This is particularly useful for patients who don't have a national ID number.
/Patient?identifier=urn:oid:2.16.578.1.12.4.1.4.2|DnrNumber
Get multiple patients by identifiers
Allows you to search for multiple patients using a combination of different identifier types. This is useful for batch processing or when you need to retrieve information for multiple patients at once. The identifiers should be comma-separated with no spaces.
/Patient?identifier=urn:oid:2.16.578.1.12.4.1.4.1|FnrNumber,urn:oid:2.16.578.1.12.4.1.4.1|FnrNumber,urn:oid:2.16.578.1.12.4.1.4.2|DnrNumber
Get multiple patients by medication
Allows you to search for multiple patients using a combination of different medication types. This is useful for batch processing or when you need to retrieve information for multiple patients at once. The medications should be comma-separated with no spaces.
/Patient?medication=urn:oid:2.16.578.1.12.4.1.1.7180|MedicationName
Get multiple patients by medication and date range
Allows you to search for multiple patients using a combination of different medication types and a date range. This is useful for batch processing or when you need to retrieve information for multiple patients at once. The medications should be comma-separated with no spaces.
/Patient?medication=urn:oid:2.16.578.1.12.4.1.1.7180|MedicationName&from=2025-01-01&to=2025-04-30
Get multiple patients by name
Allows you to search for multiple patients using a combination of different first, middle or last names. This is useful for batch processing or when you need to retrieve a patient by a part of their name.
/Patient?name=PatientName
Utility Endpoints
Get patient count
Returns the total number of patients matching your search criteria. This is useful for pagination or when you need to know the total number of results before retrieving them.
/Patient?_summary=count
Example Usage
Here's a practical example combining multiple features:
/Patient?identifier=urn:oid:2.16.578.1.12.4.1.4.1|FnrNumber,urn:oid:2.16.578.1.12.4.1.4.1|InvalidFnrNumber,urn:oid:2.16.578.1.12.4.1.4.2|DnrNumber&_summary=count
This example demonstrates:
- Searching for multiple patients using different identifier types
- Including an invalid identifier (which will be handled gracefully)
- Using the count summary to get the total number of matching patients