Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Secara default, saat Anda menelusuri data kesehatan, hasil penelusuran akan ditampilkan dalam
urutan kronologis terbalik.
Saat menelusuri jenis resource FHIR berikut yang berisi teks tidak terstruktur, Anda dapat mengurutkan hasil penelusuran berdasarkan relevansinya dengan kueri Anda:
Komposisi
DiagnosticReport
DocumentReference
Contoh skenario
Misalkan Anda menelusuri kata kunci
insulin untuk pasien tertentu dan Anda telah memfilter hasil ke resource
yang berisi teks tidak terstruktur. Di antara hasil lainnya, Anda akan menerima dokumen berikut:
Hasil 1: Resource DocumentReference, tertanggal 24 April 2024, yang berisi catatan tentang tingkat "HbA1c" pasien.
Hasil 2: Resource DiagnosticReport, tertanggal 11 Januari 2024, yang berisi catatan tentang "regimen insulin" yang harus diikuti pasien.
Secara default, Hasil 1 ditampilkan lebih tinggi dalam hasil karena merupakan dokumen yang lebih baru, tetapi saat Anda mengurutkan berdasarkan relevansi, Hasil 2 muncul lebih tinggi dalam hasil. Hal ini karena lebih relevan dengan kueri penelusuran insulin.
Mengatur urutan hasil penelusuran layanan kesehatan
Untuk mengurutkan hasil penelusuran menurut relevansi, selesaikan langkah-langkah berikut:
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-08-19 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"]]