--- title: "Quantivly's built-in metric functions" slug: "quantivlys-built-in-metric-functions" updated: 2026-09-23T22:31:36Z published: 2026-09-23T22:31:36Z canonical: "docs.quantivly.com/quantivlys-built-in-metric-functions" excludeFromExternalSearch: true --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.quantivly.com/llms.txt > Use this file to discover all available pages before exploring further. # Quantivly's built-in metric functions Quantivly provides a rich set of **built-in functions** to calculate common operational metrics such as: - Number of appointments and exams - Schedule utilization and scanner utilization - Exam delays - ... and many more These functions go beyond simple counts: - ✅ Respect configured **operating hours** - ✅ Correctly **clip exams and appointments** at time boundaries - ✅ Handle **overlaps** between appointments - ✅ Account for **patient** Buffer time (pre/post exam) to model the time needed to change patients - ✅ Support calculation of statistics restricted to specified **time blocks** - ✅ Compute everything in your requested **time zone**, accounting for scanners in different time zones Behind the scenes, each function expands into highly optimized SQL (sometimes thousands of lines), validated against diverse synthetic scenarios for accuracy and consistency. All functions live in the `metrics` PostgreSQL namespace. --- **Next:** ➡️ [In-Time Metrics](/v1/docs/in-time-metrics) Schedule utilization is a ratio between your operating time and the total schedule time. It can be calculated for any period of time, for one or many scanners. It requires HL7 to be available. **How are Operating Hours handled?** - Most visualizations take Operating Hours into account, meaning that metrics are only calculated for days that have defined operating hours. Days without defined hours are excluded from the calculation. - In queries, you can choose to’ Ignore operating hours’: each day is treated as a full 24-hour period. Utilization is calculated as `scheduled appointment time ÷ 24 hours` **What about scanner closures?** - Closures remove the scanner's regular operating hours from metric evaluation. No data will be evaluated over that period. **What if there are overlapping appointments?** - Overlapping appointments are not double-counted. - Utilization is calculated as `total unique time with appointments ÷ total operating hours` Related notion : Operating hours **Also known as** : patient change time, patient turnaround time **Definition :** - Buffer time is a number of minutes to include at the beginning and end of an exam, to account for time spent preparing the scanner for patients. This time is counted as part of an exam when calculating metrics like Inter-Exam Gap or Room Utilization. - Buffer time is a parameter, set by users based on their estimates and their observations **Static buffer :** a set value (e.g. 20mn pre+post exam) gets added on before (20mn) and after (20mn) the exams. In the example, it would amount to a total of 40mn of added time. ![](data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGEAAAAiCAYAAABPyrdhAAABW2lDQ1BJQ0MgUHJvZmlsZQAAKJF1kEFLAlEUhc+YIYVFC6EIBWkVYlGjLoKCzCCCFoMWVLtxtDEY7flmovoFLWrhHwgK+gltahFFLVq0C6LW0aJ1YEHZ6z6nUovu43I+DofLfRfweHXGLC+AYsnh6Zmp8OLSctj3hA70oRchBHTDZklNm6MIvrW1qrdQpN4MyVmjA+WDidOPx+uxncvxSkX9m2+pzlzeNkjfqSMG4w6gDBJrGw6TvEkc4LQU8a5k0+V9yVmXj+qZ+XSK+Iq4xyjoOeI74mi2yTebuGitG187yO39+dJChrSbOogMVMQxjRhG6OGfbLyeTWENDFvgWIWJAhyEkSSHwUKeeBYlGBhGlFilaSoS8sa/b9fwzG0gIQBPsOHlLOB4Euh6aXiRB/rGOXDRz3Su/1xUqXrtlZh7d8XPgfZXIZ5DgO8EqHEh3vaEqB0CbffAWfkTdxViZCHf9GIAAABWZVhJZk1NACoAAAAIAAGHaQAEAAAAAQAAABoAAAAAAAOShgAHAAAAEgAAAESgAgAEAAAAAQAAAGGgAwAEAAAAAQAAACIAAAAAQVNDSUkAAABTY3JlZW5zaG90IgDFpAAAAdRpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IlhNUCBDb3JlIDYuMC4wIj4KICAgPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4KICAgICAgPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIKICAgICAgICAgICAgeG1sbnM6ZXhpZj0iaHR0cDovL25zLmFkb2JlLmNvbS9leGlmLzEuMC8iPgogICAgICAgICA8ZXhpZjpQaXhlbFlEaW1lbnNpb24+MzQ8L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