### Search by _id - Python example Source: https://github.com/ansforge/annuaire-sante-fhir-documentation/blob/main/docs/pages/guide/version-2/resources/practitioner-role.md Imports requests and fhir.resources.fhirtypes.PractitionerRole for searching by _id. ```python import requests from fhir.resources.fhirtypes import PractitionerRole ``` -------------------------------- ### Search PractitionerRole by role with TRE codes Source: https://github.com/ansforge/annuaire-sante-fhir-documentation/blob/main/docs/pages/guide/version-2/resources/practitioner-role.md HTTP GET requests to search PractitionerRole by role using different TRE code systems. Each example shows a specific role code and its meaning. ```sh GET [base]/PractitionerRole?role=https://mos.esante.gouv.fr/NOS/TRE_R85-RolePriseCharge/FHIR/TRE-R85-RolePriseCharge%7C318 # récupère dans la TRE Role Prise Charge le code 318 correspondant à la fonction "Auxiliaire de vie sociale" ``` ```sh GET [base]/PractitionerRole?role=https://mos.esante.gouv.fr/NOS/TRE_R06-SectionTableauCNOP/FHIR/TRE-R06-SectionTableauCNOP%7CA # récupère dans la TRE SectionTableauCNOP le code A correspondant au Pharmacien titulaire d'officine " ``` ```sh GET [base]/PractitionerRole?mailbox-mss:contains=apycript.org # récupère dans le PractitionerRole les adresses mail MSS qui contiennent la valeur apycript.org" ``` -------------------------------- ### Requêtes GET pour rechercher par source d'informations (sh) Source: https://github.com/ansforge/annuaire-sante-fhir-documentation/blob/main/docs/pages/guide/version-2/resources/organization.md Deux requêtes GET pour rechercher des organisations selon leur source d'informations : RPPS ou FINESS. Chaque requête est accompagnée d'un commentaire indiquant la source concernée. ```sh GET [base]/Organization?data-information-system=RPPS # récupère les organisations qui proviennent de la source d'information RPPS GET [base]/Organization?data-information-system=FINESS # récupère les organisations qui proviennent de la source d'information FINESS ``` -------------------------------- ### Fetch PractitionerRole by ID (C#) Source: https://github.com/ansforge/annuaire-sante-fhir-documentation/blob/main/docs/pages/guide/version-2/resources/practitioner-role.md C# client example for fetching a PractitionerRole by its ID using FhirTestUtils. The client is created and the resource is read directly. ```csharp // Création du client var client = FhirTestUtils.CreateClient(); var practitionerRole = client.Read("PractitionerRole?_id=005-5087586-6923328"); Console.WriteLine($"PractitionerRole found: id={practitionerRole.IdElement.Value}"); ``` -------------------------------- ### Search by _id - curl example Source: https://github.com/ansforge/annuaire-sante-fhir-documentation/blob/main/docs/pages/guide/version-2/resources/practitioner-role.md Uses curl to search for a PractitionerRole by its technical identifier (_id) with the ESANTE-API-KEY header. ```bash curl -H "ESANTE-API-KEY: {{site.ans.api_key }}" "{{site.ans.api_url}}/fhir/v2/PractitionerRole?_id=005-5087586-6923328" ``` -------------------------------- ### Search by _id - Java example Source: https://github.com/ansforge/annuaire-sante-fhir-documentation/blob/main/docs/pages/guide/version-2/resources/practitioner-role.md Creates a FHIR client and reads a PractitionerRole resource by its ID, logging the ID part. ```java // Création du client var client = FhirTestUtils.createClient(); var practitionerRole = client.read() .resource(PractitionerRole.class) .withId("005-5087586-6923328") .execute(); logger.info("Practitioner Role found: id={}", practitionerRole.getIdElement().getIdPart()); ``` -------------------------------- ### curl example for Organization search by postal code and city Source: https://github.com/ansforge/annuaire-sante-fhir-documentation/blob/main/docs/pages/guide/version-2/resources/organization.md Curl command using the ESANTE-API-KEY header and the API URL to search for organizations in Paris 75016. ```bash curl -H "ESANTE-API-KEY: {{site.ans.api_key }}" "{{site.ans.api_url}}/fhir/v2/Organization?address-postalcode=75016&address-city=PARIS" ``` -------------------------------- ### Search PractitionerRole by active status (C#) Source: https://github.com/ansforge/annuaire-sante-fhir-documentation/blob/main/docs/pages/guide/version-2/resources/practitioner-role.md C# client example to search for active PractitionerRole resources. Uses FhirTestUtils and prints the ID and active flag of each result. ```csharp // create the client: var client = FhirTestUtils.CreateClient(); var q = new SearchParams() .Where("active=true") .LimitTo(50); var bundle = client.Search(q); foreach (var be in bundle.Entry) { // print ids: var practitionerRole = be.Resource as PractitionerRole; Console.WriteLine($"PractitionerRole found: id={practitionerRole.IdElement.Value} active={practitionerRole.Active.Value}"); } ``` -------------------------------- ### Fetch PractitionerRole by ID (Java) Source: https://github.com/ansforge/annuaire-sante-fhir-documentation/blob/main/docs/pages/guide/version-2/resources/practitioner-role.md Java client example for fetching a PractitionerRole by its ID using FhirTestUtils. The client is created and the resource is read directly. ```java // Création du client var client = FhirTestUtils.createClient(); var practitionerRole = client.read() .resource(PractitionerRole.class) .withId("005-5087586-6923328") .execute(); logger.info("PractitionerRole found: id={}", practitionerRole.getIdElement().getValue()); ``` -------------------------------- ### Search PractitionerRole by active status (Java) Source: https://github.com/ansforge/annuaire-sante-fhir-documentation/blob/main/docs/pages/guide/version-2/resources/practitioner-role.md Java client example to search for active PractitionerRole resources. Uses FhirTestUtils and prints the ID and active flag of each result. ```java // create the client: var client = FhirTestUtils.createClient(); var activeSearchClause = PractitionerRole.ACTIVE.exactly().code("true"); var bundle = client.search() .forResource(PractitionerRole.class) .where(activeSearchClause) .returnBundle(Bundle.class).execute(); for (var roleEntry : bundle.getEntry()) { // print PractitionerRole data: var role = (PractitionerRole) roleEntry.getResource(); logger.info("Practitioner Role found: id={} active={}", role.getIdElement().getIdPart(), role.getActive()); } ``` -------------------------------- ### GET [base]/Organization?name=Renard Source: https://github.com/ansforge/annuaire-sante-fhir-documentation/blob/main/docs/pages/guide/version-2/advanced/common-search-params.md Searches for organizations by their name (string type search parameter). The example searches for the legal name 'Renard'. ```APIDOC ## GET [base]/Organization?name=Renard ### Description Searches for organizations by their name (string type search parameter). The example searches for the legal name 'Renard'. ### Method GET ### Endpoint [base]/Organization ### Parameters #### Query Parameters - **name** (string) - Required - The name to search for. ### Request Example ```sh GET [base]/Organization?name=Renard ``` ### Response Example ```sh curl -H "ESANTE-API-KEY: {{site.ans.api_key }}" "{{site.ans.api_url}}/fhir/v2/Organization?name=Renard" ``` ``` -------------------------------- ### Exemple de réponse pour la ressource Practitioner Source: https://github.com/ansforge/annuaire-sante-fhir-documentation/blob/main/docs/pages/guide/version-2/getting-started/test-api.md Exemple de réponse JSON pour la requête Practitioner. Montre un Bundle de type searchset avec un total de 1811966 et un exemple d'entrée avec les détails d'un Practitioner. ```json { "resourceType": "Bundle", "type": "searchset", "id": "207ab354-2ac9-4228-a2e5-86d4fd996cfe", "total": 1811966, "entry": [ { "fullUrl": "https://gateway.preprod.api.esante.gouv.fr/fhir/v2/Practitioner/003-5818457-5939334", "resource": { "resourceType": "Practitioner", "id": "003-5818457-5939334", "meta": { "versionId": "1", "lastUpdated": "2025-01-29T15:29:39.003+01:00", "source": "https://annuaire.sante.fr", "profile": [ "https://hl7.fr/ig/fhir/core/StructureDefinition/fr-core-practitioner", "https://interop.esante.gouv.fr/ig/fhir/annuaire/StructureDefinition/as-dp-practitioner" ] }, "language": "fr", "identifier": [ { "use": "official", "type": { "coding": [ { "system": "https://hl7.fr/ig/fhir/core/CodeSystem/fr-core-cs-v2-0203", "code": "IDNPS" } ] }, ... ``` -------------------------------- ### GET [base]/Device?_include=* Source: https://github.com/ansforge/annuaire-sante-fhir-documentation/blob/main/docs/pages/guide/version-2/resources/device.md Récupère l'ensemble des équipements matériels lourds en incluant toutes les ressources qui sont référencées par les Devices. Cette requête est équivalente à la précédente avec _include=Device:organization. ```APIDOC ## GET [base]/Device?_include=* ### Description Récupère l'ensemble des équipements matériels lourds en incluant toutes les ressources qui sont référencées par les Devices. ### Method GET ### Endpoint [base]/Device?_include=* ### Request Example ```sh GET [base]/Device?_include=* ``` ``` -------------------------------- ### GET [base]/HealthcareService?_lastUpdated=ge2025-08-01 Source: https://github.com/ansforge/annuaire-sante-fhir-documentation/blob/main/docs/pages/guide/version-2/resources/healthcare-service.md Searches for HealthcareService resources that have been updated since a specified date (inclusive). The example uses the date 2025-08-01. ```APIDOC ## GET [base]/HealthcareService?_lastUpdated=ge2025-08-01 ### Description Searches for HealthcareService resources that have been updated since a specified date (inclusive). The example uses the date 2025-08-01. ### Method GET ### Endpoint [base]/HealthcareService?_lastUpdated=ge2025-08-01 ### Parameters #### Query Parameters - **_lastUpdated** (date) - Required - The date to filter by, using the prefix 'ge' for greater than or equal to ### Response #### Success Response (200) - **Bundle** - A FHIR Bundle containing matching HealthcareService resources ### Request Example ```sh GET [base]/HealthcareService?_lastUpdated=ge2025-08-01 # Rechercher les HealthcareService qui ont été mis à jour depuis le 01/08/2025 inclus ``` ### Request Example (curl) ```bash curl -H "ESANTE-API-KEY: {{site.ans.api_key }}" "{{site.ans.api_url}}/fhir/v2/HealthcareService?_lastUpdated=ge2025-08-01" ``` ### Request Example (Java) ```java // create the client: var client = FhirTestUtils.createClient(); // create the date search parameter : var dateParam = new DateClientParam("_lastUpdated"); var bundle = client.search() .forResource(HealthcareService.class) .where(dateParam.afterOrEquals().day("2025-08-01")) .returnBundle(Bundle.class).execute(); for (var healthcareServiceEntry : bundle.getEntry()) { // cast entry : var healthcareService = (HealthcareService) healthcareServiceEntry.getResource(); // print update date & id : logger.info("HealthcarService found: id={} lastUpdate={}", healthcareService.getIdElement().getIdPart(), healthcareService.getMeta().getLastUpdated()); } ``` ### Request Example (C#) ```csharp // create the client: var client = FhirTestUtils.CreateClient(); var q = new SearchParams() .Where("_lastUpdated=ge2025-08-01") .LimitTo(50); var bundle = client.Search(q); foreach (var be in bundle.Entry) { // print HealthcareService data: var healthcareService = be.Resource as HealthcareService; Console.WriteLine($"Healthcare Service found: id={healthcareService.IdElement.Value} lastUpdate={healthcareService.Meta.LastUpdated.Value}"); } ``` ``` -------------------------------- ### GET [base]/Device?identifier={identifier} Source: https://github.com/ansforge/annuaire-sante-fhir-documentation/blob/main/docs/pages/guide/version-2/resources/device.md Search for devices by identifier. The identifier parameter accepts a comma-separated list of identifiers, with an example searching for devices with identifiers '32-31-1156' and '93-93-4364'. ```APIDOC ## GET [base]/Device?identifier={identifier} ### Description Search for devices by identifier. The identifier parameter accepts a comma-separated list of identifiers, with an example searching for devices with identifiers '32-31-1156' and '93-93-4364'. ### Method GET ### Endpoint [base]/Device?identifier={identifier} ### Parameters #### Query Parameters - **identifier** (string) - Required - Comma-separated list of device identifiers. Example: `32-31-1156,93-93-4364` ### Request Example ```sh GET [base]/Device?identifier=32-31-1156,93-93-4364 ``` ### Code Examples #### curl ```bash curl -H "ESANTE-API-KEY: {{site.ans.api_key }}" "{{site.ans.api_url}}/fhir/v2/Device?v2/identifier=32-31-1156%2C93-93-4364" ``` #### Java ```java // create the client: var client = FhirTestUtils.createClient(); // create the identifier search parameters : var identifierParams = Device.IDENTIFIER.exactly().codes("32-31-1156", "93-93-4364"); var bundle = client.search() .forResource(Device.class) .where(identifierParams) .returnBundle(Bundle.class).execute(); for (var deviceEntry : bundle.getEntry()) { // print Device data var device = (Device) deviceEntry.getResource(); logger.info("Device found: id={}", device.getIdentifierFirstRep().getValue()); } ``` #### C# ```csharp // create the client: var client = FhirTestUtils.CreateClient(); var q = new SearchParams() .Where("identifier=32-31-1156,93-93-4364") .LimitTo(50); var bundle = client.Search(q); foreach (var be in bundle.Entry) { // print ids: var device = be.Resource as Device; Console.WriteLine($"Device found: id={device.IdElement.Value}"); } ``` ``` -------------------------------- ### Recherche par statut avec C# (Firely .NET) Source: https://github.com/ansforge/annuaire-sante-fhir-documentation/blob/main/docs/pages/guide/version-2/resources/device.md Utilise FhirTestUtils.CreateClient() et SearchParams avec Where("status=active") et LimitTo(50) pour rechercher les équipements actifs. ```csharp // create the client: var client = FhirTestUtils.CreateClient(); var q = new SearchParams() .Where("status=active") .LimitTo(50); var bundle = client.Search(q); foreach (var be in bundle.Entry) { // print Device data var device = be.Resource as Device; Console.WriteLine($"Device found: id={device.IdElement.Value} | status={device.Status.Value}"); } ``` -------------------------------- ### Recherche par statut avec curl Source: https://github.com/ansforge/annuaire-sante-fhir-documentation/blob/main/docs/pages/guide/version-2/resources/device.md Requête curl avec l'en-tête ESANTE-API-KEY pour rechercher les équipements actifs. ```bash curl -H "ESANTE-API-KEY: {{site.ans.api_key }}" "{{site.ans.api_url}}/fhir/v2/Device?status=active" ``` -------------------------------- ### Exemple curl pour rechercher tous les PractitionerRole Source: https://github.com/ansforge/annuaire-sante-fhir-documentation/blob/main/docs/pages/guide/version-2/resources/practitioner-role.md Exemple d'appel HTTP avec curl en utilisant la clé API ESANTE-API-KEY et l'URL de base de l'API. ```bash curl -H "ESANTE-API-KEY: {{site.ans.api_key }}" "{{site.ans.api_url}}/fhir/v2/PractitionerRole" ``` -------------------------------- ### GET [base]/Device?type={type} Source: https://github.com/ansforge/annuaire-sante-fhir-documentation/blob/main/docs/pages/guide/version-2/resources/device.md Search for devices (EML) by heavy material equipment type. The type parameter uses a canonical URL from the TRE_R272-EquipementMaterielLourd terminology, with an example searching for scanographs with code 05602. ```APIDOC ## GET [base]/Device?type={type} ### Description Search for devices (EML) by heavy material equipment type. The type parameter uses a canonical URL from the TRE_R272-EquipementMaterielLourd terminology, with an example searching for scanographs with code 05602. ### Method GET ### Endpoint [base]/Device?type={type} ### Parameters #### Query Parameters - **type** (string) - Required - The type of equipment, using a canonical URL from the TRE_R272-EquipementMaterielLourd terminology. Example: `https://mos.esante.gouv.fr/NOS/TRE_R272-EquipementMaterielLourd/FHIR/TRE-R272-EquipementMaterielLourd%7C05602` ### Request Example ```sh GET [base]/Device?type=https://mos.esante.gouv.fr/NOS/TRE_R272-EquipementMaterielLourd/FHIR/TRE-R272-EquipementMaterielLourd%7C05602 ``` ### Code Examples #### curl ```bash curl -H "ESANTE-API-KEY: {{site.ans.api_key }}" "{{site.ans.api_url}}/fhir/v2/Device?type=https%3A%2F%2Fmos.esante.gouv.fr%2FNOS%2FTRE_R272-EquipementMaterielLourd%2FFHIR%2FTRE-R272-EquipementMaterielLourd%7C05602" ``` #### Java ```java // create the client: var client = FhirTestUtils.createClient(); // create the type search parameter : var typeSearchClause = Organization.TYPE.exactly().systemAndValues( "https://mos.esante.gouv.fr/NOS/TRE_R272-EquipementMaterielLourd/FHIR/TRE-R272-EquipementMaterielLourd", "05602"); var bundle = client.search() .forResource(Device.class) .where(typeSearchClause) .returnBundle(Bundle.class).execute(); for (var deviceEntry : bundle.getEntry()) { // print Device data: var device = (Device) deviceEntry.getResource(); logger.info("Device found: id={} | type={}", device.getIdElement().getIdPart(), device.getType().getCodingFirstRep().getCode()); } ``` #### C# ```csharp // create the client: var client = FhirTestUtils.CreateClient(); var q = new SearchParams() .Where("type=https://mos.esante.gouv.fr/NOS/TRE_R272-EquipementMaterielLourd/FHIR/TRE-R272-EquipementMaterielLourd|05602") .LimitTo(50); var bundle = client.Search(q); foreach (var be in bundle.Entry) { // print Device data var device = be.Resource as Device; Console.WriteLine($"Device found: id={device.IdElement.Value} | type={device.Type.Coding[0].Code}"); } ``` ``` -------------------------------- ### Get Capability Statement with GET [base]/metadata Source: https://github.com/ansforge/annuaire-sante-fhir-documentation/blob/main/docs/pages/guide/version-2/advanced/common-search-params.md Query the FHIR server's Capability Statement to discover supported search parameters. ```sh GET [base]/metadata ``` -------------------------------- ### Python client configuration and search for PractitionerRole Source: https://github.com/ansforge/annuaire-sante-fhir-documentation/blob/main/docs/pages/guide/version-2/resources/practitioner-role.md Configures the API URL and key, then fetches PractitionerRole resources and prints their IDs and codes. Uses the ESANTE-API-KEY header and expects a FHIR Bundle response. ```python # Configuration du client api_url = "{{site.ans.api_url}}/fhir/v2/PractitionerRole" api_key = "{{site.ans.api_key}}" headers = { "ESANTE-API-KEY": api_key, "Content-Type": "application/json" } # Fonction pour effectuer une requête FHIR def fetch_practitioner_roles(): response = requests.get(api_url, headers=headers) if response.status_code == 200: bundle = Bundle(**response.json()) for entry in bundle.entry: practitioner_role = entry.resource if isinstance(practitioner_role, PractitionerRole): code = practitioner_role.code[0].coding[0].code if practitioner_role.code else "Unknown" print(f"Practitioner Role found: id={practitioner_role.id} code={code}") else: response.raise_for_status() # Utilisation du client fetch_practitioner_roles() ``` -------------------------------- ### Requêtes FHIR GET par statut (status) Source: https://github.com/ansforge/annuaire-sante-fhir-documentation/blob/main/docs/pages/guide/version-2/resources/device.md Exemples de requêtes HTTP GET pour rechercher des équipements selon leur statut (actif ou inactif) via l'API FHIR. ```sh GET [base]/Device?status=active # Rechercher les équipement dont le statut est actif GET [base]/Device?status=inactive # Rechercher les équipement dont le statut est inactif ``` -------------------------------- ### GET [base]/metadata - Récupérer les capacités du serveur FHIR Source: https://github.com/ansforge/annuaire-sante-fhir-documentation/blob/main/docs/pages/guide/version-2/getting-started/nouveautes.md Commande shell pour interroger le Capability Statement du serveur FHIR. Elle retourne les capacités et spécifications du serveur, dont le format de réponse a été revu dans cette version. ```sh GET [base]/metadata # récupère les capacités et spécifications du serveur FHIR ``` -------------------------------- ### Recherche de praticiens par nom (Python) Source: https://github.com/ansforge/annuaire-sante-fhir-documentation/blob/main/docs/pages/guide/version-2/resources/practitioner.md Configure le client avec l'URL de l'API et la clé API, puis recherche des praticiens par nom de famille et prénom. Utilise l'en-tête ESANTE-API-KEY et la requête FHIR avec les paramètres name:family et name:given. Affiche les IDs et noms des praticiens trouvés. ```python # Configuration du client api_url = "{{site.ans.api_url}}/fhir/v2/Practitioner" api_key = "{{site.ans.api_key}}" family_name = "MASI" given_name = "BRUNO" headers = { "ESANTE-API-KEY": api_key, "Content-Type": "application/json" } # Fonction pour effectuer une requête FHIR avec un prénom et un nom d'exercice def fetch_practitioners_by_name(): response = requests.get(f"{api_url}?name:family={family_name}&name:given={given_name}", headers=headers) if response.status_code == 200: bundle = Bundle(**response.json()) for entry in bundle.entry: practitioner = entry.resource if isinstance(practitioner, Practitioner): name = practitioner.name[0].text if practitioner.name else "Unknown" print(f"Practitioner found: id={practitioner.id} name={name}") else: response.raise_for_status() # Utilisation du client fetch_practitioners_by_name() ``` -------------------------------- ### Exemple Java pour rechercher tous les PractitionerRole Source: https://github.com/ansforge/annuaire-sante-fhir-documentation/blob/main/docs/pages/guide/version-2/resources/practitioner-role.md Exemple Java utilisant FhirTestUtils pour créer un client et exécuter une recherche de PractitionerRole. Affiche l'id et le code de chaque rôle trouvé. ```java // Création du client var client = FhirTestUtils.createClient(); var bundle = client.search().forResource(PractitionerRole.class).returnBundle(Bundle.class).execute(); for (var roleEntry : bundle.getEntry()) { // Print les données du PractitionerRole var role = (PractitionerRole) roleEntry.getResource(); logger.info("Practitioner Role found: id={} code={}", role.getIdElement().getIdPart(), role.getCodeFirstRep().getCodingFirstRep().getCode()); } ``` -------------------------------- ### GET [base]/Organization?data-information-system=FINESS Source: https://github.com/ansforge/annuaire-sante-fhir-documentation/blob/main/docs/pages/guide/version-2/resources/organization.md Retrieves organizations that come from the FINESS information source. ```APIDOC ## GET [base]/Organization?data-information-system=FINESS ### Description Retrieves organizations that come from the FINESS information source. ### Method GET ### Endpoint [base]/Organization?data-information-system=FINESS ### Parameters #### Query Parameters - **data-information-system** (string) - Required - The information source identifier (e.g., FINESS). ### Response #### Success Response (200) - **Bundle** (object) - A FHIR Bundle containing Organization resources from the specified information source. ``` -------------------------------- ### GET [base]/Device?_include=Device:organization Source: https://github.com/ansforge/annuaire-sante-fhir-documentation/blob/main/docs/pages/guide/version-2/resources/device.md Récupère l'ensemble des équipements matériels lourds en incluant les Organization qui sont référencées par les Devices. Cette requête permet d'obtenir les ressources Device et Organization associées. ```APIDOC ## GET [base]/Device?_include=Device:organization ### Description Récupère l'ensemble des équipements matériels lourds en incluant les Organization qui sont référencées par les Devices. ### Method GET ### Endpoint [base]/Device?_include=Device:organization ### Request Example ```sh GET [base]/Device?_include=Device:organization ``` ``` -------------------------------- ### Recherche de praticiens par statut actif (curl) Source: https://github.com/ansforge/annuaire-sante-fhir-documentation/blob/main/docs/pages/guide/version-2/resources/practitioner.md Requête curl pour rechercher tous les praticiens actifs en utilisant le paramètre active=true. Nécessite l'en-tête ESANTE-API-KEY. ```bash curl -H "ESANTE-API-KEY: {{site.ans.api_key }}" "{{site.ans.api_url}}/fhir/v1/Practitioner?active=true" ``` -------------------------------- ### GET [base]/Organization?data-information-system=RPPS Source: https://github.com/ansforge/annuaire-sante-fhir-documentation/blob/main/docs/pages/guide/version-2/resources/organization.md Retrieves organizations that come from the RPPS information source. ```APIDOC ## GET [base]/Organization?data-information-system=RPPS ### Description Retrieves organizations that come from the RPPS information source. ### Method GET ### Endpoint [base]/Organization?data-information-system=RPPS ### Parameters #### Query Parameters - **data-information-system** (string) - Required - The information source identifier (e.g., RPPS). ### Response #### Success Response (200) - **Bundle** (object) - A FHIR Bundle containing Organization resources from the specified information source. ``` -------------------------------- ### Requêtes GET pour rechercher par forme/type d'activité Source: https://github.com/ansforge/annuaire-sante-fhir-documentation/blob/main/docs/pages/guide/version-2/resources/healthcare-service.md Exemples de requêtes GET pour rechercher des HealthcareService selon la forme d'activité (chirurgie ambulatoire, code 07) ou le type d'activité (hébergement complet ou internat, code 11). Les codes proviennent des référentiels NOS TRE-R276-FormeActivite et TRE-R209-TypeActivite. ```sh GET [base]/HealthcareService?characteristic=https://mos.esante.gouv.fr/NOS/TRE_R276-FormeActivite/FHIR/TRE-R276-FormeActivite%7C07 # Rechercher les HealthcareService selon la forme d'activité chirurgie ambulatoire (code: 07) GET [base]/HealthcareService?characteristic=https://mos.esante.gouv.fr/NOS/TRE_R209-TypeActivite/FHIR/TRE-R209-TypeActivite%7C11 # Rechercher les HealthcareService selon le type d'hébergement complet ou internat (code: 11) ``` -------------------------------- ### Rechercher tous les Devices (GET [base]/Device) Source: https://github.com/ansforge/annuaire-sante-fhir-documentation/blob/main/docs/pages/guide/version-2/resources/device.md Récupère l'ensemble des équipements matériels lourds (EML), incluant les actifs et les inactifs. Trois variantes sont présentées : sans critère, avec inclusion des Organization référencées via _include=Device:organization, et avec inclusion de toutes les ressources référencées via _include=*. ```sh GET [base]/Device # récupère l'ensemble des équipements matériels lourds (incluant les actifs et les inactifs) ``` ```sh GET [base]/Device?_include=Device:organization # inclure les Organization qui sont référencées par les Devices (Device + Organization) ``` ```sh GET [base]/Device?_include=* # inclure toutes les ressources qui sont référencées par les Devices (idem que la précédente requête) ``` -------------------------------- ### Exemple Python pour rechercher tous les PractitionerRole Source: https://github.com/ansforge/annuaire-sante-fhir-documentation/blob/main/docs/pages/guide/version-2/resources/practitioner-role.md Exemple Python utilisant les bibliothèques requests et fhir.resources pour interroger l'API. Le code est partiellement affiché dans la source. ```python import requests from fhir.resources.fhirtypes import Bundle, PractitionerRole ``` -------------------------------- ### GET /PractitionerRole Source: https://github.com/ansforge/annuaire-sante-fhir-documentation/blob/main/docs/pages/guide/version-2/resources/practitioner-role.md Searches for PractitionerRole resources. Returns a FHIR Bundle containing matching PractitionerRole resources. ```APIDOC ## [GET] [base]/PractitionerRole ### Description Searches for PractitionerRole resources. Returns a FHIR Bundle containing matching PractitionerRole resources. ### Method GET ### Endpoint [base]/PractitionerRole ### Parameters #### Query Parameters - **_id** (string) - Optional - The technical identifier of the PractitionerRole resource. ### Response #### Success Response (200) - **Bundle** - A FHIR Bundle containing PractitionerRole resources. ### Request Example ```sh GET [base]/PractitionerRole?_id=005-69329-7187020 ``` ### Response Example No response example provided in the source. ``` -------------------------------- ### Java client example for Organization search by postal code and city Source: https://github.com/ansforge/annuaire-sante-fhir-documentation/blob/main/docs/pages/guide/version-2/resources/organization.md Java code using FhirTestUtils and the HAPI FHIR client to search for organizations by postal code and city, then print the results. ```java // create the client: var client = FhirTestUtils.createClient(); // create the search parameters: var postalCodeParam = Organization.ADDRESS_POSTALCODE.matchesExactly().values("75016"); var cityParam = Organization.ADDRESS_CITY.matchesExactly().values("PARIS"); var bundle = client.search() .forResource(Organization.class) .where(postalCodeParam) .and(cityParam) .returnBundle(Bundle.class).execute(); for (var organizationEntry : bundle.getEntry()) { // Convertir l'entrée: var organization = (Organization) organizationEntry.getResource(); // print la data: logger.info("Organization found: name={} | zipCode={} | city={}", organization.getName(), organization.getAddressFirstRep().getPostalCode(), organization.getAddressFirstRep().getCity()); } ``` -------------------------------- ### GET [base]/metadata Source: https://github.com/ansforge/annuaire-sante-fhir-documentation/blob/main/docs/pages/guide/version-2/advanced/common-search-params.md Retrieves the Capability Statement (metadata) from the FHIR server to discover supported search parameters. ```APIDOC ## GET [base]/metadata ### Description Retrieves the Capability Statement (metadata) from the FHIR server to discover supported search parameters. ### Method GET ### Endpoint [base]/metadata ### Request Example ```sh GET [base]/metadata ``` ``` -------------------------------- ### GET [base]/PractitionerRole?_include=* Source: https://github.com/ansforge/annuaire-sante-fhir-documentation/blob/main/docs/pages/guide/version-2/resources/practitioner-role.md Récupère les PractitionerRole et inclut toutes les ressources référencées (Practitioner et Organization). La réponse contient les PractitionerRole, les Practitioner et les Organization. ```APIDOC ## GET [base]/PractitionerRole?_include=* ### Description Récupère les PractitionerRole et inclut toutes les ressources référencées (Practitioner et Organization). ### Method GET ### Endpoint [base]/PractitionerRole?_include=* ### Parameters #### Query Parameters - **_include** (string) - Requis - Valeur fixe : `*` pour inclure toutes les ressources référencées. ### Response #### Success Response (200) - **Bundle** - Contient les PractitionerRole, les Practitioner et les Organization. ### Request Example ```sh GET [base]/PractitionerRole?_include=* ``` ### Response Example Aucun exemple de réponse fourni. ``` -------------------------------- ### GET /Practitioner?qualification-code=SM41 Source: https://github.com/ansforge/annuaire-sante-fhir-documentation/blob/main/docs/pages/guide/version-2/resources/practitioner.md Search for practitioners by specialty. The qualification-code parameter can be a simple code or a full TRE URL. ```APIDOC ## GET [base]/Practitioner?qualification-code=SM41 ### Description Search for practitioners by specialty. The qualification-code parameter can be a simple code or a full TRE URL. ### Method GET ### Endpoint [base]/Practitioner?qualification-code=SM41 ### Parameters #### Query Parameters - **qualification-code** (string) - Required - The specialty code (e.g., SM41 for Pneumology) or a full TRE URL. ### Response #### Success Response (200) Returns a FHIR Bundle containing Practitioner resources that match the specialty. ### Request Example ```sh GET [base]/Practitioner?qualification-code=SM41 # Récupère tous les professionnels dont la spécialité est Pneumologie (SM41) GET [base]/Practitioner?qualification-code=https://mos.esante.gouv.fr/NOS/TRE_R38-SpecialiteOrdinale/FHIR/TRE-R38-SpecialiteOrdinale%7CSM41 # Récupère tous les professionnels dont la spécialité est Pneumologie (SM41) en indiquant la TRE ``` ``` -------------------------------- ### GET /Practitioner?qualification-code=21 Source: https://github.com/ansforge/annuaire-sante-fhir-documentation/blob/main/docs/pages/guide/version-2/resources/practitioner.md Search for practitioners by profession. The qualification-code parameter can be a simple code or a full TRE URL. ```APIDOC ## GET [base]/Practitioner?qualification-code=21 ### Description Search for practitioners by profession. The qualification-code parameter can be a simple code or a full TRE URL. ### Method GET ### Endpoint [base]/Practitioner?qualification-code=21 ### Parameters #### Query Parameters - **qualification-code** (string) - Required - The profession code (e.g., 21 for pharmacist) or a full TRE URL. ### Response #### Success Response (200) Returns a FHIR Bundle containing Practitioner resources that match the profession. ### Request Example ```sh GET [base]/Practitioner?qualification-code=21 # Récupère tous les professionnels dont la profession est pharmacien (code 21) GET [base]/Practitioner?qualification-code=https://mos.esante.gouv.fr/NOS/TRE_G15-ProfessionSante/FHIR/TRE-G15-ProfessionSante%7C21 # Récupère tous les professionnels dont la profession est pharmacien en indiquant la TRE (Table de REférence) ``` ``` -------------------------------- ### Search all practitioners with GET [base]/Practitioner Source: https://github.com/ansforge/annuaire-sante-fhir-documentation/blob/main/docs/pages/guide/version-2/resources/practitioner.md Retrieves all professional exercises (active and inactive) from the API. Use the base URL and optional _revinclude parameter to include related PractitionerRole resources. ```sh GET [base]/Practitioner # récupère l'ensemble des exercices professionnels (incluant les actifs et les inactifs) GET [base]/Practitioner?_revinclude=PractitionerRole:practitioner # récupère l'ensemble des exercices professionnels ainsi que les activités liées (Practitioner + PractitionerRole actifs et inactifs) ``` -------------------------------- ### GET [base]/Organization?type=...&mailbox-mss:contains=%40 Source: https://github.com/ansforge/annuaire-sante-fhir-documentation/blob/main/docs/pages/guide/version-2/use-case/uc-bal-mss.md Interroge la ressource Organization pour récupérer les BAL MSS des organisations appartenant à un secteur d'activité donné. Le filtre type permet de sélectionner le secteur d'activité (ex: SA05 pour les centres de santé) et le filtre mailbox-mss:contains=%40 garantit que l'organisation dispose d'au moins une BAL MSS. ```APIDOC ## GET [base]/Organization?type=...&mailbox-mss:contains=%40 ### Description Interroge la ressource Organization pour récupérer les BAL MSS des organisations appartenant à un secteur d'activité donné. Le filtre type permet de sélectionner le secteur d'activité (ex: SA05 pour les centres de santé) et le filtre mailbox-mss:contains=%40 garantit que l'organisation dispose d'au moins une BAL MSS. ### Method GET ### Endpoint [base]/Organization ### Parameters #### Query Parameters - **type** (string) - Required - Secteur(s) d'activité à filtrer, encodé selon la nomenclature TRE_R02-SecteurActivite (ex: https://mos.esante.gouv.fr/NOS/TRE_R02-SecteurActivite/FHIR/TRE-R02-SecteurActivite%7CSA05). Plusieurs valeurs peuvent être séparées par des virgules. - **mailbox-mss:contains** (string) - Required - Filtre pour inclure uniquement les organisations disposant d'au moins une BAL MSS (valeur : %40). ### Response #### Success Response (200) Un Bundle contenant la première page de résultats. ### Request Example ```sh GET [base]/Organization?type=https://mos.esante.gouv.fr/NOS/TRE_R02-SecteurActivite/FHIR/TRE-R02-SecteurActivite%7CSA05&mailbox-mss:contains=%40 # récupère les centres de santé (SA05) et qui disposent au moins d'une BAL MSS GET [base]/Organization?type=https://mos.esante.gouv.fr/NOS/TRE_R02-SecteurActivite/FHIR/TRE-R02-SecteurActivite%7CSA25,https://mos.esante.gouv.fr/NOS/TRE_R02-SecteurActivite/FHIR/TRE-R02-SecteurActivite%7CSA29&mailbox-mss:contains=%40 # récupère les laboratoires (SA25, SA29) et qui disposent au moins d'une BAL MSS ``` ``` -------------------------------- ### GET /fhir/v1/Practitioner?active=true Source: https://github.com/ansforge/annuaire-sante-fhir-documentation/blob/main/docs/pages/guide/version-2/resources/practitioner.md Search for active practitioners. This endpoint retrieves all practitioners with the active flag set to true. ```APIDOC ## GET /fhir/v1/Practitioner?active=true ### Description Search for active practitioners. This endpoint retrieves all practitioners with the active flag set to true. ### Method GET ### Endpoint /fhir/v1/Practitioner?active=true ### Parameters #### Query Parameters - **active** (boolean) - Required - Filter for active practitioners. ### Response #### Success Response (200) - **Bundle** (object) - FHIR Bundle containing practitioner resources. ### Request Example ```sh GET [base]/Practitioner?active=true ``` ### Response Example No response example provided in the source. ``` -------------------------------- ### Recherche de praticiens par statut actif (Java) Source: https://github.com/ansforge/annuaire-sante-fhir-documentation/blob/main/docs/pages/guide/version-2/resources/practitioner.md Configure le client FHIR et recherche les praticiens actifs en utilisant la clause Practitioner.ACTIVE.exactly().code("true"). Affiche le nom et le statut actif de chaque praticien trouvé. ```java // Configuration du client var client = FhirTestUtils.createClient(); var activeSearchClause = Practitioner.ACTIVE.exactly().code("true"); var bundle = client.search() .forResource(Practitioner.class) .where(activeSearchClause) .returnBundle(Bundle.class).execute(); for (var practitionerEntry : bundle.getEntry()) { // Enregistrer les IDs Organization var practitioner = (Practitioner) practitionerEntry.getResource(); logger.info("Practitioner found: name={} | active={}", practitioner.getNameFirstRep().getNameAsSingleString(), practitioner.getActive()); } ``` -------------------------------- ### GET [base]/HealthcareService?_id={id} Source: https://github.com/ansforge/annuaire-sante-fhir-documentation/blob/main/docs/pages/guide/version-2/resources/healthcare-service.md Searches for a HealthcareService by its technical identifier (_id) or business identifier (identifier). ```APIDOC ## GET [base]/HealthcareService?_id={id} ### Description Searches for a HealthcareService by its technical identifier (_id) or business identifier (identifier). ### Method GET ### Endpoint [base]/HealthcareService?_id={id} ### Parameters #### Query Parameters - **_id** (string) - Required - Technical identifier of the HealthcareService. - **identifier** (string) - Required - Business identifier of the HealthcareService. ### Response #### Success Response (200) - **Bundle** - Bundle containing the matching HealthcareService resource(s). ### Request Example ```sh GET [base]/HealthcareService?_id=004-1014485-03 # récupère le HealthcareService en fonction de son identifiant technique GET [base]/HealthcareService?identifier=52-52-49883 # récupère le HealthcareService en fonction de son identifiant métier ``` ### Code Examples #### curl ```bash curl -H "ESANTE-API-KEY: {{site.ans.api_key }}" "{{site.ans.api_url}}/fhir/v2/HealthcareService?identifier=52-52-49883" ``` #### java ```java // create the client: var client = FhirTestUtils.createClient(); var typeSearchClause = HealthcareService.IDENTIFIER.exactly().codes("52-52-49883"); var bundle = client.search() .forResource(HealthcareService.class) .where(typeSearchClause) .returnBundle(Bundle.class).execute(); for (var healthcareServiceEntry : bundle.getEntry()) { // print HealthcareService data: var healthcareService = (HealthcareService) healthcareServiceEntry.getResource(); logger.info("Healthcare Service found: id={}", healthcareService.getIdentifierFirstRep().getValue()); } ``` #### C# ```csharp // create the client: var client = FhirTestUtils.CreateClient(); var q = new SearchParams() .Where("identifier=52-52-49883") .LimitTo(50); var bundle = client.Search(q); foreach (var be in bundle.Entry) { // print HealthcareService data: var healthcareService = be.Resource as HealthcareService; Console.WriteLine($"Healthcare Service found: id={healthcareService.IdElement.Value}"); } ``` ``` -------------------------------- ### Python FHIR client configuration and fetch_practitioners function Source: https://github.com/ansforge/annuaire-sante-fhir-documentation/blob/main/docs/pages/guide/version-2/resources/practitioner.md Configures the FHIR client with api_url and api_key, sets headers with ESANTE-API-KEY, and defines fetch_practitioners() to search for Practitioner resources and print their IDs and names. Requires requests and fhir.resources libraries. ```python # Configuration du client api_url = "{{site.ans.api_url}}/fhir/v2/Practitioner" api_key = "{{site.ans.api_key}}" headers = { "ESANTE-API-KEY": api_key, "Content-Type": "application/json" } # Fonction pour effectuer une requête FHIR def fetch_practitioners(): response = requests.get(api_url, headers=headers) if response.status_code == 200: bundle = Bundle(**response.json()) for entry in bundle.entry: practitioner = entry.resource if isinstance(practitioner, Practitioner): name = practitioner.name[0].text if practitioner.name else "Unknown" print(f"Practitioner found: id={practitioner.id} name={name}") else: response.raise_for_status() # Utilisation du client fetch_practitioners() ``` -------------------------------- ### GET [api-url]/Device Source: https://github.com/ansforge/annuaire-sante-fhir-documentation/blob/main/docs/pages/guide/version-2/getting-started/api-basics.md Récupère les équipements matériels lourds (EML). ```APIDOC ## GET [api-url]/Device ### Description Récupère les équipements matériels lourds (EML). ### Method GET ### Endpoint [api-url]/Device ### Response #### Success Response (200) - **Bundle** (FHIR Resource) - Contient les ressources Device correspondantes. ``` -------------------------------- ### Requête GET pour les Laboratoires (SA25, SA29) avec BAL MSS Source: https://github.com/ansforge/annuaire-sante-fhir-documentation/blob/main/docs/pages/guide/version-2/use-case/uc-bal-mss.md Interroge la ressource Organization pour filtrer les organisations des secteurs d'activité SA25 et SA29 (Laboratoires) et inclure uniquement celles disposant d'au moins une BAL MSS via le paramètre mailbox-mss:contains=%40. ```sh GET [base]/Organization?type=https://mos.esante.gouv.fr/NOS/TRE_R02-SecteurActivite/FHIR/TRE-R02-SecteurActivite%7CSA25,https://mos.esante.gouv.fr/NOS/TRE_R02-SecteurActivite/FHIR/TRE-R02-SecteurActivite%7CSA29&mailbox-mss:contains=%40 # récupère les laboratoires (SA25, SA29) et qui disposent au moins d'une BAL MSS ``` -------------------------------- ### GET [api-url]/PractitionerRole Source: https://github.com/ansforge/annuaire-sante-fhir-documentation/blob/main/docs/pages/guide/version-2/getting-started/api-basics.md Récupère les situations d'exercice des professionnels. ```APIDOC ## GET [api-url]/PractitionerRole ### Description Récupère les situations d'exercice des professionnels. ### Method GET ### Endpoint [api-url]/PractitionerRole ### Response #### Success Response (200) - **Bundle** (FHIR Resource) - Contient les ressources PractitionerRole correspondantes. ``` -------------------------------- ### Rechercher par date de mise à jour (_lastUpdated) Source: https://github.com/ansforge/annuaire-sante-fhir-documentation/blob/main/docs/pages/guide/version-2/resources/device.md Recherche tous les équipements mis à jour depuis une date donnée. L'exemple utilise le paramètre _lastUpdated avec l'opérateur ge (greater or equal) pour récupérer les Devices mis à jour à partir du 07 août 2025 (inclus) jusqu'à aujourd'hui. ```sh GET [base]/Device?_lastUpdated=ge2025-08-07 # Récupère tous les Practitioners mis à jour à partir du 07 août 2025 (inclus) jusqu'à aujourd'hui ```