Classer les résultats de recherche dans le secteur de la santé
Restez organisé à l'aide des collections
Enregistrez et classez les contenus selon vos préférences.
Par défaut, lorsque vous recherchez des données de santé, les résultats de recherche sont renvoyés dans l'ordre chronologique inverse.
Lorsque vous effectuez une recherche sur les types de ressources FHIR suivants qui contiennent du texte non structuré, vous pouvez trier vos résultats de recherche en fonction de leur pertinence par rapport à votre requête :
Composition
DiagnosticReport
DocumentReference
Exemple de scénario
Supposons que vous recherchiez le mot clé insulin pour un patient donné et que vous ayez filtré les résultats pour afficher les ressources contenant du texte non structuré. Vous obtenez, entre autres, les documents suivants :
Résultat 1 : ressource DocumentReference, datée du 24 avril 2024, contenant des notes sur les niveaux d'HbA1c du patient.
Résultat 2 : ressource DiagnosticReport, datée du 11 janvier 2024, contenant des notes sur le "régime d'insuline" que le patient doit suivre.
Par défaut, le résultat 1 s'affiche plus haut dans les résultats, car il s'agit d'un document plus récent. Toutefois, lorsque vous triez les résultats par pertinence, le résultat 2 s'affiche plus haut. En effet, il est plus pertinent pour la requête de recherche insulin.
Trier vos résultats de recherche de données de santé
Pour trier vos résultats de recherche par pertinence, procédez comme suit :
Sauf indication contraire, le contenu de cette page est régi par une licence Creative Commons Attribution 4.0, et les échantillons de code sont régis par une licence Apache 2.0. Pour en savoir plus, consultez les Règles du site Google Developers. Java est une marque déposée d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2025/09/08 (UTC).
[[["Facile à comprendre","easyToUnderstand","thumb-up"],["J'ai pu résoudre mon problème","solvedMyProblem","thumb-up"],["Autre","otherUp","thumb-up"]],[["Difficile à comprendre","hardToUnderstand","thumb-down"],["Informations ou exemple de code incorrects","incorrectInformationOrSampleCode","thumb-down"],["Il n'y a pas l'information/les exemples dont j'ai besoin","missingTheInformationSamplesINeed","thumb-down"],["Problème de traduction","translationIssue","thumb-down"],["Autre","otherDown","thumb-down"]],["Dernière mise à jour le 2025/09/08 (UTC)."],[[["\u003cp\u003eHealthcare data searches initially display results in reverse chronological order by default.\u003c/p\u003e\n"],["\u003cp\u003eWhen searching FHIR resource types like Composition, DiagnosticReport, and DocumentReference that contain unstructured text, results can be ordered by relevance instead.\u003c/p\u003e\n"],["\u003cp\u003eOrdering by relevance prioritizes results that are most closely related to the search query, rather than the newest document, as shown with the example of searching the keyword \u003ccode\u003einsulin\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eUsers can change the sorting order from reverse chronological to relevance within the Google Cloud console by selecting the "Relevance" filter for these specific resource types.\u003c/p\u003e\n"],["\u003cp\u003eUsing REST, sorting by relevance can be achieved by adding a \u003ccode\u003efilter\u003c/code\u003e field to limit the search results to Composition, DiagnosticReport, and DocumentReference resources and adding the \u003ccode\u003eorderBy\u003c/code\u003e field with the value \u003ccode\u003e_RELEVANCE\u003c/code\u003e in the request.\u003c/p\u003e\n"]]],[],null,["# Order healthcare search results\n\nBy default, when you [search healthcare data](/generative-ai-app-builder/docs/search-hc-data), the search results are returned in\nreverse chronological order.\nWhen you search over the following FHIR resource types that contain unstructured text, you can\norder your search results according to their relevance to your query:\n\n- Composition\n- DiagnosticReport\n- DocumentReference\n\nExample scenario\n----------------\n\nSuppose that you're searching for the keyword\n`insulin` for a given patient and you've filtered the results to the resources\nthat contain unstructured text. Among other results, you receive the following\ndocuments:\n\n- Result 1: A DocumentReference resource, dated 24 April, 2024, that contains notes about the patient's \"HbA1c\" levels.\n- Result 2: A DiagnosticReport resource, dated 11 January, 2024, that contains notes about the \"insulin regimen\" that the patient must follow.\n\nBy default, Result 1 is shown higher in the results because it is a newer\ndocument, but when you order by relevance, Result 2 shows up higher in the\nresults. This is because it is more relevant to the search query `insulin`.\n\nOrder your healthcare search results\n------------------------------------\n\nTo order your search results according to relevance, complete the following\nsteps: \n\n### Console\n\n1. In the Google Cloud console, go to the **AI Applications** page.\n\n [AI Applications](https://console.cloud.google.com/gen-app-builder/)\n2. Select the healthcare search app that you want to query.\n\n3. In the navigation menu, click **Preview**.\n\n4. In the **Patient ID** field, enter the ID of the patient whose data\n you want to query. Patient IDs are case-sensitive.\n\n5. Press **Enter** or click **Preview** to submit the patient ID.\n\n6. In the **Search here** search bar, enter your query.\n\n If you enabled autocomplete, you see a list of autocomplete suggestions below\n the search bar as you type.\n7. Press **Enter** to submit the query.\n\n - The search results are displayed in paginated tables that are categorized based on their FHIR resource type.\n - By default, the search results for all FHIR resource types are displayed in reverse chronological order.\n8. For the Composition, the DocumentReference, and the DiagnosticReport\n resources, click the **Sort: Reverse Chronological** filter and select\n **Relevance** from the list. The results for these resources are then ordered\n according to relevance.\n\n### REST\n\nTo order your search results according to relevance, modify your\n[`search`](/generative-ai-app-builder/docs/reference/rest/v1/projects.locations.collections.engines.servingConfigs/search) request in the following way:\n\n- Add the `filter` field to your request to limit the search results to only those FHIR resources that contain unstructured text: Composition, DiagnosticReport, and DocumentReference.\n- Add the `orderBy` field to your search request and set its value to `_RELEVANCE` to get search responses that are sorted according to their relevance.\n\n1. Send the search request.\n\n ```\n curl -X POST -H \"Authorization: Bearer $(gcloud auth print-access-token)\" \\\n -H \"Content-Type: application/json\" \\\n \"https://us-discoveryengine.googleapis.com/v1/projects/PROJECT_ID/locations/us/collections/default_collection/engines/APP_ID/servingConfigs/default_search:search\" \\\n -d '{\n \"query\": \"KEYWORD_QUERY\",\n \"filter\": \"patient_id: ANY(\\\"PATIENT_ID\\\") AND resource_type: ANY(\\\"Composition\\\", \\\"DiagnosticReport\\\", \\\"DocumentReference\\\")\",\n \"orderBy\": \"_RELEVANCE\"\n }'\n ```\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: the ID of your Google Cloud project.\n - \u003cvar translate=\"no\"\u003eAPP_ID\u003c/var\u003e: the ID of the Vertex AI Search app that you want to query.\n - \u003cvar translate=\"no\"\u003eKEYWORD_QUERY\u003c/var\u003e: the keyword that you want to search across the patient clinical data for the filtered patient, such as \"diabetes\" or \"a1c\".\n - \u003cvar translate=\"no\"\u003ePATIENT_ID\u003c/var\u003e: the resource ID of the patient whose data you want to search.\n\n You should receive a JSON response that contains itemized search results\n listed in the order of their relevance.\n\n\u003cbr /\u003e"]]