Result Formats
Vital’s API returns results in two different formats.
PDF
JSON
PDF Results
We return the raw results in PDF form, that we receive directly from our partner labs. This can be retrieved as follows:
An example result:
JSON Results
We also return the parsed results in JSON format, so you can use them to generate your own forms.
These results are returned in a structured format, which you can find here.
results
field, according to the spec, can return either a list[BiomarkerResult]
or an untyped dict
. This is due to backwards compatibility, and you can disregard the untyped dict
Result Status
The status
field can be one of the following:
-
ResultStatus.PARTIAL
- The results are partial. Labs can return results before all biomarkers are available. Vital makes these results available to you as soon as we receive them, but does not send a webhook notification forpartial
results.This means that if you probe the API for results, you might get a
partial
result, even if there was no webhook for alabtest.update
event.This is done due to the possibility of critical values in the results.
-
ResultStatus.FINAL
- The results are complete. This means that all biomarkers are available, and the results are final. You will receive alabtest.update
webhook notification for this event.
BiomarkerResult
A BiomarkerResult
has the following definition:
ResultType
Results can fall into one of the following categories:
-
ResultType.NUMERIC
- A numeric result, e.g.1.2
In this case, the
result
field will be a string representation of the number, and thevalue
field will be a float representation of the number. -
ResultType.RANGE
- A range result, e.g.<1.2
In this case, the
result
field will be a string representation of the range value, and thevalue
field will be-1
.Note that you will also find the
<1.2
value in thenotes
field.A range result will always be a value following the pattern
^([<>]=?\d*(\.\d+)?|(\d*(\.\d+)?-\d*(\.\d+)?))$
. -
ResultType.COMMENT
- A text result, e.g.Positive
In this case, the
result
field will be a string representation of the text, and thevalue
field will be-1
.Note that you will also find the
Positive
value in thenotes
field.
value
field in deprecated and will eventually be removed.Interpretation
Interpretation is a string value that can be one of the following:
Interpretation.NORMAL
- The result is within normal parameters.Interpretation.ABNORMAL
- The result is outside of normal parameters.Interpretation.CRITICAL
- The result is outside of critical parameters. In this case, refer to the critical values section.
Standardisation - LOINC
It’s possible to test the same biomarkers across different laboratories. For these to match, we use the LOINC standard.
In the BiomarkerResult
object, you can see two fields loinc_slug
and loinc
. These fields refer to the LOINC standard. Customers should use this standard, so it’s possible to match results across different laboratories.
You can expect that the slug
field is what the laboratory returns to us - and the loinc_slug
is the standardised version.
An example:
Lab | Slug | LOINC | LOINC Slug |
---|---|---|---|
Labcorp | hdl-cholesterol | 2085-9 | cholesterol-in-hdl-mass-vol |
USSL | hdl | 2085-9 | cholesterol-in-hdl-mass-vol |
As you can see, the same biomarker HDL Cholesterol
can have different slugs across different laboratories. However it’s represented by the same LOINC value.
Expected Results
When ordering a lab_test
, you can see which markers
each test orders. These can either be panels
composed of multiple biomarkers
or just individual biomarkers
.
This means that a lab_test
with only one associated marker
, such as Lipid Panel
, can return multiple result markers
. We call these expected results.
Each marker
can thus be composed of multiple expected results
which match to a loinc
.
As an example, here’s the expected results for the Lipid Panel
marker:
You can use this information to verify if the final results are composed of all expected results.
In order to obtain this data, you can use the following endpoints:
-
This allows you to search markers based on laboratory or name.
-
GET /v3/lab_tests/{id}/markers
This allows you to see all markers associated with a lab test and it’s expected results.
Source Markers
As mentioned above, a marker can be composed of one or more results. This means that if you order a Lipid Panel
, there will be no Lipid Panel
result returned, but instead a series of markers that originate from the Lipid Panel
.
Vital identifies the source marker via the source_markers
field.
When Vital cannot identify the source, then this field will be null
, indicating that this is an unsolicited result.
There may also be more than one source
marker, if there are two or more ordered markers that contain the same underlying result, using the same testing method.
Missing Results
At times labs will commit mistakes, and expected results will be missing. Vital identifies these and parses them into a separate structure, named missing_results
.
This data has the following format:
inferred_failure_type
is the Vital assigned error type.
The error type is inferred from the comments received from the lab. They are to help assess possibly root causes of missing results, and aid the customer in identifying issues in aggregate. The way that we infer these error types is subject to change as we continue to refine and achieve more granular understanding of failure modes.
-
quantity_not_sufficient_failure
The lab could not process this result due to an insufficient quantity of collected sample. This could be due to the patient refusing to collect more, the phlebotomist being to unable to collect the proper volume of blood from the sample, or the phlebotomist not collecting all of the sample they were meant to collect.
-
collection_process_failure
This is indicative of potential failures to follow the entirety phlebotomy process, often immediately following the collection. For example, improper centrifugation of the collected sample, improper refrigeration. While these are the most likely causes, there are other reasons for why sample quality may have been degraded.
-
drop_off_failure
This speaks to a specific form of collection process failures. Specifically that the sample was not received by the lab in proper condition. Possible issues correspond to improper freezing, or refrigeration, or was exposed to excessive transport delay.
-
internal_lab_failure
This speaks to failures that are most likely to have happened internal to the lab. This includes issues such as misplacing a collected sample, or errors that could not be best attributed to any external cause.
-
order_entry_failure
The test was not performed because it was not properly ordered at the lab.
-
non_failure
This speaks to a failure that should not impact the patient. For example, it may indicate that a duplicate test was ordered.
-
unknown_failure
This is a failure mode that could not be properly attributed to any specific failure mode. Potentially the results were simply left out and Vital was not provided any additional information.
-
patient_condition_failure
This speaks to a failure to result due to specifics of the patient’s physical condition. For example, the patient may have had some food very high in fats that immediately prior to a collection. It is possible that improper storage and handling can cause samples to fail in ways that appear to be a patient condition failure.
-
missing_result_calc_failure
This failure indicates that a calculated field is missing because the underlying tests required to perform the calculation were either unable to be processed, or yielded a result outside of the allowable parameters to perform the calculation
-
missing_demo_aoe_calc_failure
Some results may require additional information reported in AOE (ask on order entry) in order to yield results, such as age, to be properly calculated.