Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Wenn Sie Gesundheitsdaten durchsuchen, werden die Suchergebnisse standardmäßig in umgekehrt chronologischer Reihenfolge zurückgegeben.
Wenn Sie in den folgenden FHIR-Ressourcentypen suchen, die unstrukturierten Text enthalten, können Sie Ihre Suchergebnisse nach ihrer Relevanz für Ihre Anfrage sortieren:
Komposition
DiagnosticReport
DocumentReference
Beispielszenario
Angenommen, Sie suchen nach dem Keyword insulin für einen bestimmten Patienten und haben die Ergebnisse nach den Ressourcen gefiltert, die unstrukturierten Text enthalten. Sie erhalten unter anderem die folgenden Dokumente:
Ergebnis 1: Eine DocumentReference-Ressource vom 24. April 2024, die Notizen zu den HbA1c-Werten des Patienten enthält.
Ergebnis 2: Eine DiagnosticReport-Ressource vom 11. Januar 2024, die Hinweise zum „Insulinregime“ enthält, das der Patient befolgen muss.
Standardmäßig wird Ergebnis 1 in den Ergebnissen weiter oben angezeigt, da es sich um ein neueres Dokument handelt. Wenn Sie jedoch nach Relevanz sortieren, wird Ergebnis 2 in den Ergebnissen weiter oben angezeigt. Das liegt daran, dass es für die Suchanfrage insulin relevanter ist.
Suchergebnisse für Gesundheitsinformationen sortieren
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Schwer verständlich","hardToUnderstand","thumb-down"],["Informationen oder Beispielcode falsch","incorrectInformationOrSampleCode","thumb-down"],["Benötigte Informationen/Beispiele nicht gefunden","missingTheInformationSamplesINeed","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2025-09-03 (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"]]