Stay organized with collections
Save and categorize content based on your preferences.
This page describes how to view the following HL7v2 store metrics:
The number of HL7v2 messages for a given HL7v2 message type, such as ADT or ORU.
The Structured Storage size, in bytes,
of all HL7v2 messages for a given HL7v2 message type.
You can use these metrics to do the following:
Estimate future costs based on current usage.
Track how an HL7v2 store grows and changes over time.
Ensure that the number of HL7v2 messages matches the number
that you imported.
Modifications to HL7v2 data, such as storing, deleting, or editing the data,
are asynchronous. There might be a delay
between when you modify the data and when the modifications are shown
in the HL7v2 store metrics.
The following samples show how to view HL7v2 store metrics.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[[["\u003cp\u003eThis page details how to view HL7v2 store metrics, including the number and storage size of HL7v2 messages for specific types like \u003ccode\u003eADT\u003c/code\u003e or \u003ccode\u003eORU\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThese metrics can help estimate future costs, track HL7v2 store growth, and verify the number of imported HL7v2 messages.\u003c/p\u003e\n"],["\u003cp\u003eYou can view HL7v2 store metrics in the Google Cloud console under the "Metrics" tab on the HL7v2 store's detail page, which displays the total number of message types, messages, and their total size, with filtering options.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003ehl7V2Stores.getHL7v2StoreMetrics\u003c/code\u003e REST method is also available for retrieving metrics, which is demonstrated with examples using \u003ccode\u003ecurl\u003c/code\u003e, PowerShell, and APIs Explorer.\u003c/p\u003e\n"],["\u003cp\u003eModifications to HL7v2 data are asynchronous, so there may be a delay between the modification and the updated display in the HL7v2 store metrics.\u003c/p\u003e\n"]]],[],null,["# View HL7v2 store metrics\n\nThis page describes how to view the following HL7v2 store metrics:\n\n- The number of HL7v2 messages for a given HL7v2 message type, such as `ADT` or `ORU`.\n- The [Structured Storage](/healthcare-api/pricing#data_storage) size, in bytes, of all HL7v2 messages for a given HL7v2 message type.\n\nYou can use these metrics to do the following:\n\n- Estimate future costs based on current usage.\n- Track how an HL7v2 store grows and changes over time.\n- Ensure that the number of HL7v2 messages matches the number that you [imported](/healthcare-api/docs/how-tos/hl7v2-import-export).\n\nModifications to HL7v2 data, such as storing, deleting, or editing the data,\nare asynchronous. There might be a delay\nbetween when you modify the data and when the modifications are shown\nin the HL7v2 store metrics.\n\nThe following samples show how to view HL7v2 store metrics. \n\n### Console\n\n1. In the Google Cloud console, go to the **Datasets** page.\n\n [Go to Datasets](https://console.cloud.google.com/healthcare/browser)\n2. Select the dataset containing the HL7v2 store whose metrics you want to view.\n\n3. In the **Data stores** list, select the HL7v2 store whose metrics you want\n to view. The **Datastore details** page is displayed.\n\n4. Click the **Metrics** tab.\n\n The tab shows the following metrics on a scorecard:\n - **Total number of message types**\n - **Total number of messages**\n - **Total size of messages**\n\n The metrics table contains the following columns:\n\n5. To filter the table data, enter the filter criteria in the **Filter** field.\n\n You can filter using the message type, the number of messages, and the total\n size of a message type. For example, to filter the **Total size** column,\n you can select the filter criteria, select an operator, and enter the filter\n value with the units of the size as they appear in the table.\n Some valid filter criteria to filter according to the total size are\n as follows: `Total size:\u003e 2 MiB` and `Total size:\u003e= 2 GiB`.\n\n### REST\n\nUse the [`hl7V2Stores.getHL7v2StoreMetrics`](/healthcare-api/docs/reference/rest/v1/projects.locations.datasets.hl7V2Stores/getHL7v2StoreMetrics)\nmethod.\n\n\nBefore using any of the request data,\nmake the following replacements:\n\n- \u003cvar class=\"edit\" scope=\"PROJECT_ID\" translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: the ID of your Google Cloud project\n- \u003cvar class=\"edit\" scope=\"LOCATION\" translate=\"no\"\u003eLOCATION\u003c/var\u003e: the dataset location\n- \u003cvar class=\"edit\" scope=\"DATASET_ID\" translate=\"no\"\u003eDATASET_ID\u003c/var\u003e: the HL7v2 store's parent dataset\n- \u003cvar class=\"edit\" scope=\"HL7V2_STORE_ID\" translate=\"no\"\u003eHL7V2_STORE_ID\u003c/var\u003e: the HL7v2 store ID\n\nTo send your request, choose one of these options: \n\n#### curl\n\n| **Note:** The following command assumes that you have logged in to the `gcloud` CLI with your user account by running [`gcloud init`](/sdk/gcloud/reference/init) or [`gcloud auth login`](/sdk/gcloud/reference/auth/login) , or by using [Cloud Shell](/shell/docs), which automatically logs you into the `gcloud` CLI . You can check the currently active account by running [`gcloud auth list`](/sdk/gcloud/reference/auth/list).\n\n\nExecute the following command:\n\n```\ncurl -X GET \\\n -H \"Authorization: Bearer $(gcloud auth print-access-token)\" \\\n \"https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/hl7V2Stores/HL7V2_STORE_ID:getHL7v2StoreMetrics\"\n```\n\n#### PowerShell\n\n| **Note:** The following command assumes that you have logged in to the `gcloud` CLI with your user account by running [`gcloud init`](/sdk/gcloud/reference/init) or [`gcloud auth login`](/sdk/gcloud/reference/auth/login) . You can check the currently active account by running [`gcloud auth list`](/sdk/gcloud/reference/auth/list).\n\n\nExecute the following command:\n\n```\n$cred = gcloud auth print-access-token\n$headers = @{ \"Authorization\" = \"Bearer $cred\" }\n\nInvoke-WebRequest `\n -Method GET `\n -Headers $headers `\n -Uri \"https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/hl7V2Stores/HL7V2_STORE_ID:getHL7v2StoreMetrics\" | Select-Object -Expand Content\n```\n\n#### APIs Explorer\n\n\nOpen the\n\n[method reference page](/healthcare-api/docs/reference/rest/v1/projects.locations.datasets.hl7V2Stores/getHL7v2StoreMetrics).\nThe APIs Explorer panel opens on the right side of the page.\nYou can interact with this tool to send requests.\n\nComplete any required fields and click **Execute**.\n\nYou should receive a JSON response similar to the following:\n\n#### Response\n\n```\n{\n \"name\": \"projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/hl7V2Stores/HL7V2_STORE_ID\",\n \"metrics\": [\n {\n \"messageType\": \"MESSAGE_TYPE\",\n \"count\": \"COUNT\",\n \"structuredStorageSizeBytes\": \"STRUCTURED_STORAGE_BYTES\"\n }\n ]\n}\n```\n\n\u003cbr /\u003e"]]