1.0.3 - release CH

KisimScheduling - Local Development build (v1.0.3) built by the FHIR (HL7® FHIR® Standard) Build Tools. See the Directory of published versions

OperationDefinition: Search Appointments by Encounter

Official URL: http://fhir.kisimdocs.ch/ig/KisimScheduling/OperationDefinition/appointment-query-searchByEncounter Version: 1.0.3
Draft as of 2025-07-25 Computable Name: SearchAppointmentByEncounter

Search appointments for a specific encounter

The basic fhir specification allows the search for appointments by patient id but not by encounter. Therefore, we added this additional search algorithm.

Appointments can be searched in a time window. There are two different time windows which are supported, at least one of them needs to be used for the query.

  • date parameter: According to the FHIR specification of a date parameter this parameter can be sent multiple times to search between two dates: eg date=gt2024-10-01&date=lt2024-10-31
  • _lastUpdated date parameter as in FHIR-specification. Search for all appointments which were modified or updated in the given date range

Usage

This operation can be used by systems which have the encounter id and want to display the appointments for a patient. An example would be patient entertainment systems.

Generated Narrative: OperationDefinition appointment-query-searchByEncounter

Parameters

UseNameScopeCardinalityTypeBindingDocumentation
IN_query1..1string
(string)
BindingStrength (Required)

Extended search parameter, value has to be searchByEncounter

INencounter1..1string
(string)
BindingStrength (Required)

The encounter ID.

INdate0..1dateBindingStrength (Required)

Time window where appointments are taking place

IN_lastUpdated0..1dateBindingStrength (Required)

Time window in which the appointments were last updated

OUTreturn0..1BundleBindingStrength (Required)

A bundle of appointment ressources.

Notes:

Examples

Search for appointments which are taking place during the time window

Search appointments for encounter:

GET [base]/Appointment?_query=searchByEncounter&encounter=12345&date=gt2020-11-10&date=lt2020-11-30

Response

HTTP/1.1 200 OK
[other headers]

Response Body

The response for the different searches will always be a bundle with 0…n entries.

{
    "resourceType": "Bundle",
    "id": "05163c62-bdb8-4b21-924a-04719932f55b",
    "meta": {
        "lastUpdated": "2021-03-10T13:56:59.410+01:00"
    },
    "type": "searchset",
    "total": 1,
    "link": [
        {
            "relation": "self",
            "url": "/fhir/r4/*/Appointment?_query=searchByEncounter&encounter=12345&date=gt2020-11-10&date=lt2020-11-30"
        }
    ],
    "entry": [
        {
            "fullUrl": "/fhir/r4/*/Appointment/22839",
            "resource": {
                "resourceType": "Appointment",
                "id": "22839",
                "identifier": [
                    {
                        "system": "http://cistec.com",
                        "value": "22839"
                    }
                ],
                "status": "pending",
                "serviceCategory": [
                    {
                        "coding": [
                            {
                                "system": "http://hl7.org/fhir/ValueSet/service-category",
                                "code": "35",
                                "display": "Hospital"
                            }
                        ]
                    }
                ],
                "start": "2021-03-11T08:00:00.000+01:00",
                "end": "2021-03-11T08:10:00.000+01:00",
                "participant": [
                    {
                        "actor": {
                            "reference": "Practitioner/PRACTITIONER",
                            "display": "Test Practitioner"
                        },
                        "status": "accepted"
                    }
                ]
            }
        }
    ]
}