Search with GET examples
You can search a HealthLake data store by making GET requests. HealthLake only supports providing query parameters as part of the URI, and not as part of a request body.
Note
For queries that involve Personally identifiable information (PII) or Protected Health Information (PHI) it's recommended to use POST
requests. In a POST
request, PII or PHI is added as part of the request body and is encrypted in transit.
The topic provides examples of how to search with GET
using supported resource types in HealthLake.
-
Age: Age is not a defined resource type in FHIR. Instead, age is captured as a part of the patient resource type. To search for a group of patients based on specific age or age range, you need to use a Supported search comparators. For more details, see Resource type: Patient
in the FHIR Documentation Index. -
Condition: This resource type stores details related to clinical concepts such as a diagnosis, situations, a clinical condition, and problems that have risen to a level of concern. To learn more, see Resource type: Condition
in the FHIR Documentation Index. HealthLake creates new conditions based on documents found in the DocumentReference. These additions are excluded by default when making a POST
request. To include them, you must specify valid identifier for a condition resource in your search. -
DocumentReference:This resource type is supported by HealthLake. This resource type supports referencing documents of any type. To learn more, see Resource type: DocumentReference
in the FHIR Documentation Index. HealthLake also provides integrated natural language processing (NLP) of documents found in the DocumentReference. To learn more, see Using automated resource generation based on natural language processing (NLP) of the FHIR DocumentReference resource type in AWS HealthLake. -
Location: This resource type includes both incidental locations (a place that is used for healthcare without prior designation or authorization) and dedicated, formally appointed locations For more details, see Resource type: Location
in the FHIR Documentation Index. -
Observation: Measurements and simple assertions made about a patient, device, or other subject. HealthLake creates new observation resources based on documents found in the DocumentReference resource. To learn more about how HealthLake create new resources, see Using automated resource generation based on natural language processing (NLP) of the FHIR DocumentReference resource type in AWS HealthLake. These additions are excluded by default when making a
POST
request. To include them, you must specify a valid identifier for an observation resource in your search. To learn more, see Resource type: Observationin the FHIR Documentation Index.
Each tab shows an example of how to search on the specified resource type. It includes an example of how to specify the request in the URI, and the related JSON response.
- Age
-
Use the following to make a
GET
-based search request on thePatient
resource type. This search uses theeq
search comparator to search for individuals who were born in 1997.GET https://healthlake.
your-region
.amazonaws.com/datastore/your-datastore-id
/r4//Patient?birthdate=eq1997JSON Response
When successful, you will get a
200
HTTP response code. - Condition
-
Use the following to make a
GET
request on theCondition
resource type. This search finds locations in your HealthLake data store that contain the medical code72892002
.You have to specify a request URL and a request body. Here is an example request URL.
GET https://healthlake.
your-region
.amazonaws.com/datastore/your-datastore-id
/r4/Condition?code=72892002JSON Response
When successful, you will get a
200
HTTP response code. The following JSON response has been truncated for clarity.{ "resourceType": "Bundle", "type": "searchset", "entry": [{ "resource": { "resourceType": "Condition", "id": "0063326c-6b42-4d13-af2f-1efe0a65f016", "meta": { "lastUpdated": "2022-08-23T00:22:49.681Z" }, "clinicalStatus": { "coding": [{ "system": "http://terminology.hl7.org/CodeSystem/condition-clinical", "code": "resolved" }] }, "verificationStatus": { "coding": [{ "system": "http://terminology.hl7.org/CodeSystem/condition-ver-status", "code": "confirmed" }] }, "code": { "coding": [{ "system": "http://snomed.info/sct", "code": "72892002", "display": "Normal pregnancy" }], "text": "Normal pregnancy" }, "subject": { "reference": "Patient/5fc0070a-696a-4855-94a9-175f1c641a33" }, "encounter": { "reference": "Encounter/44078ab9-7ac7-4731-9ac8-4b3ff21a7bdb" }, "onsetDateTime": "2019-08-15T01:19:17-07:00", "abatementDateTime": "2020-03-26T01:19:17-07:00", "recordedDate": "2019-08-15T01:19:17-07:00" }, "search": { "mode": "match" } }, { "resource": { "resourceType": "Condition", "id": "d00afdb2-1d2c-44fe-9f3b-033c0fe751a3", "meta": { "lastUpdated": "2022-08-23T00:20:47.100Z" }, "clinicalStatus": { "coding": [{ "system": "http://terminology.hl7.org/CodeSystem/condition-clinical", "code": "resolved" }] }, "verificationStatus": { "coding": [{ "system": "http://terminology.hl7.org/CodeSystem/condition-ver-status", "code": "confirmed" }] }, "code": { "coding": [{ "system": "http://snomed.info/sct", "code": "72892002", "display": "Normal pregnancy" }], "text": "Normal pregnancy" }, "subject": { "reference": "Patient/d0a5cd1e-8da7-41bd-9b2f-41eef45246e5" }, "encounter": { "reference": "Encounter/73758e67-4aaf-4e80-982b-8821f0b6fdfb" }, "onsetDateTime": "2019-06-13T20:37:40-07:00", "abatementDateTime": "2020-01-23T19:37:40-08:00", "recordedDate": "2019-06-13T20:37:40-07:00" }, "search": { "mode": "match" } } ] }
- DocumentationReference
-
This example shows how to create a search request on the
DocumentReference
resource type for patients with a streptococcal diagnosis and who have also been prescribed amoxicillin.GET https://healthlake.
your-region
.amazonaws.com/datastore/your-datastore-id
/r4/DocumentReference?_lastUpdated=le2021-12-19&infer-icd10cm-entity-text-concept-score;=streptococcal|0.6&infer-rxnorm-entity-text-concept-score=Amoxicillin|0.8When successful you will get the following JSON response.
{ "resourceType": "Bundle", "type": "searchset", "entry": [ { "resource": { "resourceType": "DocumentReference", "id": "985c3e94-4219-4c79-97a1-c94694525e24", "meta": { "lastUpdated": "2020-11-23T06:09:10.719Z" }, "extension": [ { "url": "http://healthlake.amazonaws.com/aws-cm/", "extension": [ { "url": "http://healthlake.amazonaws.com/aws-cm/infer-icd10/", "extension": [ { "url": "http://healthlake.amazonaws.com/aws-cm/infer-icd10/raw-response", "valueString": "{Entities: [{Id: 0,Text: otitis media,Category: MEDICAL_CONDITION,Type: DX_NAME,Score: 0.9815994,BeginOffset: 151,EndOffset: 163,Attributes: [],Traits: [{Name: DIAGNOSIS,Score: 0.95042425}],ICD10CMConcepts: [{Description: Otitis media, unspecified, unspecified ear,Code: H66.90,Score: 0.7176407}, {Description: Otitis media, unspecified,Code: H66.9,Score: 0.6930445}, {Description: Otitis media, unspecified, left ear,Code: H66.92,Score: 0.688161}, {Description: Otitis media, unspecified, bilateral,Code: H66.93,Score: 0.6748094}, {Description: Otitis media, unspecified, right ear,Code: H66.91,Score: 0.6645618}]}, {Id: 1,Text: streptococcal sore throat,Category: MEDICAL_CONDITION,Type: DX_NAME,Score: 0.92208487,BeginOffset: 461,EndOffset: 486,Attributes: [],Traits: [],ICD10CMConcepts: [{Description: Streptococcal pharyngitis,Code: J02.0,Score: 0.55638546}, {Description: Acute streptococcal tonsillitis, unspecified,Code: J03.00,Score: 0.53159785}, {Description: Streptococcal sepsis, unspecified,Code: A40.9,Score: 0.51865804}, {Description: Acute pharyngitis, unspecified,Code: J02.9,Score: 0.45085955}, {Description: Streptococcal infection, unspecified site,Code: A49.1,Score: 0.41550553}]}, {Id: 3,Text: disorder,Category: MEDICAL_CONDITION,Type: DX_NAME,Score: 0.9191257,BeginOffset: 488,EndOffset: 496,Attributes: [],Traits: [{Name: DIAGNOSIS,Score: 0.93372077}],ICD10CMConcepts: [{Description: Parkinson's disease,Code: G20,Score: 0.6959145}, {Description: Illness, unspecified,Code: R69,Score: 0.68428487}, {Description: Disorder of bone, unspecified,Code: M89.9,Score: 0.6542605}, {Description: Unspecified mental disorder due to known physiological condition,Code: F09,Score: 0.6240179}, {Description: Mental disorder, not otherwise specified,Code: F99,Score: 0.61046}]}],ModelVersion: 0.1.0}" }, { "url": "http://healthlake.amazonaws.com/aws-cm/infer-icd10/model-version", "valueString": "0.1.0" }, { "url": "http://healthlake.amazonaws.com/aws-cm/infer-icd10/aws-cm-icd10-entity", "extension": [ { "url": "http://healthlake.amazonaws.com/aws-cm/infer-icd10/aws-cm-icd10-entity-id", "valueInteger": 0 }, { "url": "http://healthlake.amazonaws.com/aws-cm/infer-icd10/aws-cm-icd10-entity-text", "valueString": "otitis media" }, { "url": "http://healthlake.amazonaws.com/aws-cm/infer-icd10/aws-cm-icd10-entity-begin-offset", "valueInteger": 151 }, { "url": "http://healthlake.amazonaws.com/aws-cm/infer-icd10/aws-cm-icd10-entity-end-offset", "valueInteger": 163 }, { "url": "http://healthlake.amazonaws.com/aws-cm/infer-icd10/aws-cm-icd10-entity-score", "valueDecimal": 0.9815994 }, { "url": "http://healthlake.amazonaws.com/aws-cm/infer-icd10/aws-cm-icd10-entity-ConceptList", "extension": [ { "url": "http://healthlake.amazonaws.com/aws-cm/infer-icd10/aws-cm-icd10-entity-Concept", "extension": [ { "url": "http://healthlake.amazonaws.com/aws-cm/infer-icd10/aws-cm-icd10-entity-Concept-Code", "valueString": "H66.90" }, { "url": "http://healthlake.amazonaws.com/aws-cm/infer-icd10/aws-cm-icd10-entity-Concept-Description", "valueString": "Otitis media, unspecified, unspecified ear" }, { "url": "http://healthlake.amazonaws.com/aws-cm/infer-icd10/aws-cm-icd10-entity-Concept-Score", "valueDecimal": 0.7176407 } ] }, { "url": "http://healthlake.amazonaws.com/aws-cm/infer-icd10/aws-cm-icd10-entity-Concept", "extension": [ { "url": "http://healthlake.amazonaws.com/aws-cm/infer-icd10/aws-cm-icd10-entity-Concept-Code", "valueString": "H66.9" }, { "url": "http://healthlake.amazonaws.com/aws-cm/infer-icd10/aws-cm-icd10-entity-Concept-Description", "valueString": "Otitis media, unspecified" }, { "url": "http://healthlake.amazonaws.com/aws-cm/infer-icd10/aws-cm-icd10-entity-Concept-Score", "valueDecimal": 0.6930445 } ] }, { "url": "http://healthlake.amazonaws.com/aws-cm/infer-icd10/aws-cm-icd10-entity-Concept", "extension": [ { "url": "http://healthlake.amazonaws.com/aws-cm/infer-icd10/aws-cm-icd10-entity-Concept-Code", "valueString": "H66.92" } ] }
- Location
-
Use the following to make a
GET
request on theLocation
resource type. This search finds locations in your HealthLake data store that contain the city name Boston as part of the address.GET https://healthlake.
your-region
.amazonaws.com/datastore/your-datastore-id
/r4//Location?address=bostonJSON Response
When successful, you will get a
200
HTTP response code. The JSON response has been truncated for clarity.{ "resourceType": "Bundle", "type": "searchset", "entry": [ { "resource": { "resourceType": "Location", "id": "0a6903c7-25c5-4ae4-8354-be88f9c5f2ee", "meta": { "lastUpdated": "2022-08-23T00:24:24.570Z" }, "status": "active", "name": "BRIGHAM AND WOMEN'S HOSPITAL", "telecom": [ { "system": "phone", "value": "6177325500" } ], "address": { "line": [ "75 FRANCIS STREET" ], "city": "BOSTON", "state": "MA", "postalCode": "02115", "country": "US" }, "position": { "longitude": -71.020173, "latitude": 42.33196 }, "managingOrganization": { "reference": "Organization/27379046-608b-32f0-9df7-8c833cf5d11d", "display": "BRIGHAM AND WOMEN'S HOSPITAL" } }, "search": { "mode": "match" } }, { "resource": { "resourceType": "Location", "id": "3cc3ad99-e0ff-48b4-b277-052abfc41058", "meta": { "lastUpdated": "2022-08-23T00:19:37.029Z" }, "status": "active", "name": "NEW ENGLAND BAPTIST HOSPITAL", "telecom": [ { "system": "phone", "value": "6177545800" } ], "address": { "line": [ "125 PARKER HILL AVENUE" ], "city": "BOSTON", "state": "MA", "postalCode": "02120", "country": "US" }, "position": { "longitude": -71.020173, "latitude": 42.33196 }, "managingOrganization": { "reference": "Organization/9a7149fa-49fc-3c87-b935-d29c55808717", "display": "NEW ENGLAND BAPTIST HOSPITAL" } }, "search": { "mode": "match" } }, { "resource": { "resourceType": "Location", "id": "3f956715-3890-4235-85be-3fba5e3488ee", "meta": { "lastUpdated": "2022-08-23T00:23:38.981Z" }, "status": "active", "name": "MASSACHUSETTS GENERAL HOSPITAL", "telecom": [ { "system": "phone", "value": "6177262000" } ], "address": { "line": [ "55 FRUIT STREET" ], "city": "BOSTON", "state": "MA", "postalCode": "02114", "country": "US" }, "position": { "longitude": -71.020173, "latitude": 42.33196 }, "managingOrganization": { "reference": "Organization/d78e84ec-30aa-3bba-a33a-f29a3a454662", "display": "MASSACHUSETTS GENERAL HOSPITAL" } }, "search": { "mode": "match" } }, { "resource": { "resourceType": "Location", "id": "6cc07b51-7287-443c-b772-c864f7831e13", "meta": { "lastUpdated": "2022-08-23T00:21:11.045Z" }, "status": "active", "name": "TUFTS MEDICAL CENTER", "telecom": [ { "system": "phone", "value": "6176365000" } ], "address": { "line": [ "800 WASHINGTON STREET" ], "city": "BOSTON", "state": "MA", "postalCode": "02111", "country": "US" }, "position": { "longitude": -71.020173, "latitude": 42.33196 }, "managingOrganization": { "reference": "Organization/b7175ab4-bde5-3848-891b-579bccb77c7c", "display": "TUFTS MEDICAL CENTER" } }, "search": { "mode": "match" } }, { "resource": { "resourceType": "Location", "id": "8101300f-f685-49e7-b428-43b7855c39ee", "meta": { "lastUpdated": "2022-08-23T00:22:06.474Z" }, "status": "active", "name": "BOSTON CHILDREN'S HOSPITAL", "telecom": [ { "system": "phone", "value": "6177356000" } ], "address": { "line": [ "300 LONGWOOD AVENUE" ], "city": "BOSTON", "state": "MA", "postalCode": "02115", "country": "US" }, "position": { "longitude": -71.020173, "latitude": 42.33196 }, "managingOrganization": { "reference": "Organization/d7b11827-25f2-350b-bcd8-939fc59851b0", "display": "BOSTON CHILDREN'S HOSPITAL" } }, "search": { "mode": "match" } }, { "resource": { "resourceType": "Location", "id": "8b7641d3-6997-48bb-bd60-23e35dfaae9d", "meta": { "lastUpdated": "2022-08-23T00:20:47.099Z" }, "status": "active", "name": "BRIGHAM AND WOMEN'S FAULKNER HOSPITAL", "telecom": [ { "system": "phone", "value": "6179837000" } ], "address": { "line": [ "1153 CENTRE STREET" ], "city": "BOSTON", "state": "MA", "postalCode": "02130", "country": "US" }, "position": { "longitude": -71.020173, "latitude": 42.33196 }, "managingOrganization": { "reference": "Organization/d733d4a9-080d-3593-b910-2366e652b7ea", "display": "BRIGHAM AND WOMEN'S FAULKNER HOSPITAL" } }, "search": { "mode": "match" } }, { "resource": { "resourceType": "Location", "id": "998ef80b-7b58-4dc3-99ac-c440ec9e282d", "meta": { "lastUpdated": "2022-08-23T00:21:11.046Z" }, "status": "active", "name": "BRIGHAM AND WOMEN'S FAULKNER HOSPITAL", "telecom": [ { "system": "phone", "value": "6179837000" } ], "address": { "line": [ "1153 CENTRE STREET" ], "city": "BOSTON", "state": "MA", "postalCode": "02130", "country": "US" }, "position": { "longitude": -71.020173, "latitude": 42.33196 }, "managingOrganization": { "reference": "Organization/d733d4a9-080d-3593-b910-2366e652b7ea", "display": "BRIGHAM AND WOMEN'S FAULKNER HOSPITAL" } }, "search": { "mode": "match" } }, { "resource": { "resourceType": "Location", "id": "c454bed3-7013-4376-81cf-4f49342f1402", "meta": { "lastUpdated": "2022-08-23T00:24:24.573Z" }, "status": "active", "name": "MASSACHUSETTS GENERAL HOSPITAL", "telecom": [ { "system": "phone", "value": "6177262000" } ], "address": { "line": [ "55 FRUIT STREET" ], "city": "BOSTON", "state": "MA", "postalCode": "02114", "country": "US" }, "position": { "longitude": -71.020173, "latitude": 42.33196 }, "managingOrganization": { "reference": "Organization/d78e84ec-30aa-3bba-a33a-f29a3a454662", "display": "MASSACHUSETTS GENERAL HOSPITAL" } }, "search": { "mode": "match" } }, { "resource": { "resourceType": "Location", "id": "ca5e7f65-4eb5-4bff-9a6f-07bc80acf8d0", "meta": { "lastUpdated": "2022-08-23T00:20:47.100Z" }, "status": "active", "name": "BETH ISRAEL DEACONESS MEDICAL CENTER", "telecom": [ { "system": "phone", "value": "6176677000" } ], "address": { "line": [ "330 BROOKLINE AVENUE" ], "city": "BOSTON", "state": "MA", "postalCode": "02215", "country": "US" }, "position": { "longitude": -71.020173, "latitude": 42.33196 }, "managingOrganization": { "reference": "Organization/cb6a50e0-af76-3758-99ad-3200ede03fff", "display": "BETH ISRAEL DEACONESS MEDICAL CENTER" } }, "search": { "mode": "match" } } ] }
- Observation
-
Use the following to make a
GET
-based search request on theObservation
resource type. This search uses thevalue-concept
search parameter to look for medical code,266919005
. This status indicatesNever smoker
.You have to specify a request URL and a query string. Here is an example request URL.
POST https://healthlake.
your-region
.amazonaws.com/datastore/your-datastore-id
/r4/Observation?value-concept=266919005To specify the status,
Never smoker
, setvalue-concept=266919005
as the query string.JSON Response
When successful, you will get a
200
HTTP response code. The following JSON response has been truncated for clarity.{ "resourceType": "Bundle", "type": "searchset", "link": [{ "relation": "next", "url": "https://healthlake.us-west-2.amazonaws.com/datastore/3651c6d3c1e81e785adba06b710b52a9/r4/Observation?value-concept=266919005&=AAMA-EFRSURBSGlpcGIyN250ZG9WRXVnTTFOdmtxQk9Bb3Y0YjhVcVdUMGV0eVozNmdjQU9nRjRNUUtscjhCZ1NMUG84VGNqN09nNEFBQUFmakI4QmdrcWhraUc5dzBCQndhZ2J6QnRBZ0VBTUdnR0NTcUdTSWIzRFFFSEFUQWVCZ2xnaGtnQlpRTUVBUzR3RVFRTXI1VWxTbC9lZksydlVkMlpBZ0VRZ0R2bnF6cFFtQzBPdDBXaE82ZWhqbW92QndlcmVkVVBrbU40cnlsWGI1VWJJVWdxVDhUZkxqS3dHSHZOQUNZWkVsajZsa05FNzV6R1dtZnhSZz09tEeRZ6lNDlYyIdmiLObGMU7YIThPsFO5z9gTfXONPrm7i8GdXQgsbBjgMu2BrOFUdPhGOf4Ly8aBOGcCjN60es9nGG27XzRk_3_CkaVjEFZFlbwmPvWM6RXGKdbyExLlR3yOdIFQscvlT1iKj5DlHHLQDanYppTopxDRpTsiy8MozsqK0ENS0NLViqJsCCSmGOxuTZYllB5dckwimpQKfesMxmc_LKEmsjc=" }], "entry": [{ "resource": { "resourceType": "Observation", "id": "000038e0-71c6-4cc0-9c6c-50c8b1c53309", "meta": { "lastUpdated": "2022-11-03T01:02:38.981Z" }, "status": "final", "category": [{ "coding": [{ "system": "http://terminology.hl7.org/CodeSystem/observation-category", "code": "survey", "display": "survey" }] }], "code": { "coding": [{ "system": "http://loinc.org", "code": "72166-2", "display": "Tobacco smoking status NHIS" }], "text": "Tobacco smoking status NHIS" }, "subject": { "reference": "Patient/598c9d7a-0494-448e-a81e-d50e3606e8db" }, "encounter": { "reference": "Encounter/86bdee4a-2aa9-474a-b43f-6237cd68e512" }, "effectiveDateTime": "2019-12-11T19:44:57-08:00", "issued": "2019-12-11T19:44:57.438-08:00", "valueCodeableConcept": { "coding": [{ "system": "http://snomed.info/sct", "code": "266919005", "display": "Never smoker" }], "text": "Never smoker" } }, "search": { "mode": "match" } }, { "resource": { "resourceType": "Observation", "id": "0c2f6260-e671-4cfd-ac3d-e75f073fa3cd", "meta": { "lastUpdated": "2022-11-03T01:05:21.488Z" }, "status": "final", "category": [{ "coding": [{ "system": "http://terminology.hl7.org/CodeSystem/observation-category", "code": "survey", "display": "survey" }] }], "code": { "coding": [{ "system": "http://loinc.org", "code": "72166-2", "display": "Tobacco smoking status NHIS" }], "text": "Tobacco smoking status NHIS" }, "subject": { "reference": "Patient/89d9a9b7-9720-4881-a2ab-d7907544b26f" }, "encounter": { "reference": "Encounter/8ebba7b0-fdfc-4ec1-a9aa-907cccf60925" }, "effectiveDateTime": "2018-11-17T03:59:36-08:00", "issued": "2018-11-17T03:59:36.550-08:00", "valueCodeableConcept": { "coding": [{ "system": "http://snomed.info/sct", "code": "266919005", "display": "Never smoker" }], "text": "Never smoker" } }, "search": { "mode": "match" } } ] }