Urine analysis
Use this category for numeric urine-strip analytes. A strip can produce multiple Observation resources that share a recording time.
Support in @ovok/core
- Category key:
urineAnalysis(urine-analysis) - Read: Supported through the observation mapping.
- Save: Supported through the typed measurement save workflow.
The category key selects a measurement shape. It does not determine the patient, time range, or source device. For the shared React query and save behavior, see Measurements and health data.
Data shape
The base measurement requires measurementTypeKey. Fields marked optional can be omitted when the source did not provide a value.
| Field | Type | Unit or meaning | Read and save behavior |
|---|---|---|---|
uro | number (optional) | Urobilinogen, mg/dL | Saved and mapped as an analyte Observation. |
bil | number (optional) | Bilirubin, mg/dL | Saved and mapped as an analyte Observation. |
ket | number (optional) | Ketones, mg/dL | Saved and mapped as an analyte Observation. |
glu | number (optional) | Glucose, mg/dL | Saved and mapped as an analyte Observation. |
pro | number (optional) | Protein, mg/dL | Saved and mapped as an analyte Observation. |
ph | number (optional) | Urine pH, unitless | Saved and mapped as an analyte Observation. |
bld | number (optional) | Hemoglobin, RBC/µL | Saved and mapped as an analyte Observation. |
nit | number (optional) | Nitrite; qualitative label in unit metadata | The field is numeric in the type and is written as a numeric value. |
leu | number (optional) | Leukocyte esterase, WBC/µL | Saved and mapped as an analyte Observation. |
sg | number (optional) | Specific gravity, unitless | Saved and mapped as an analyte Observation. |
vc | number (optional) | Ascorbate (vitamin C), mg/dL | Saved and mapped as an analyte Observation. |
urineValues | Array of coded values (required) | FHIR CodeableConcept plus an optional string value | Required by the TypeScript shape. Numeric fields drive the current save output; this array is not used to create analyte observations. |
recordedAt | Date (optional) | Strip recording time | Used as the effective time when it is a valid Date; otherwise the current time is used. |
What is written
Each finite numeric analyte field supplied is saved as its own coded Observation. Omitted fields are not written. The exported URINE_ANALYTE_DEFINITIONS table provides the analyte keys, codes, names, and units used by the package.
Analyte codes
These are the coded analytes used by the measurement mapping:
| Field | Analyte | LOINC code | Unit |
|---|---|---|---|
uro | Urobilinogen | 50563-6 | mg/dL |
bld | Hemoglobin | 50559-4 | RBC/µL |
bil | Bilirubin | 53327-3 | mg/dL |
ket | Ketones | 50557-8 | mg/dL |
glu | Glucose | 53328-1 | mg/dL |
pro | Protein | 50561-0 | mg/dL |
ph | Urine pH | 50560-2 | Unitless |
nit | Nitrite | 50558-6 | Qualitative label |
leu | Leukocyte esterase | 60026-2 | WBC/µL |
sg | Specific gravity | 53326-5 | Unitless |
vc | Ascorbate (vitamin C) | 5768-7 | mg/dL |
urineValues is required by the public type, so include an array even when empty. The save workflow uses the numeric fields above and does not serialize arbitrary entries from urineValues. Keep the original FHIR observations if your app needs the complete coded resource representation.
Interpretation
The SDK transports measured values. It does not classify a strip, interpret abnormal results, or provide a diagnosis. Show source labels and units, and keep clinical interpretation in an appropriately reviewed workflow.
Read this category
Select MeasurementTypeKey.urineAnalysis, or use the dedicated useUrineTests() hook when no patient or date filters are needed. The mapper groups analyte observations by recording time and returns available numeric fields. The hook also returns the raw observations.
Use useObservations() in a client-side component below OvokProvider. It returns mapped measurements, original observations, loading, and error. The hook reference describes its filters and state.
Save this category
Supply numeric analyte fields in their listed units and include urineValues. Use a valid recordedAt Date to preserve the strip time. The mapper does not interpret values or derive a result from missing fields.
Pass the measurement to OvokClient.saveMeasurement() or, in React, the function returned by useSaveMeasurement(). Common request fields such as patientId and device are described in the measurement overview.
Example
This example uses the configured OvokClient from the get started guide. Supply values in the units listed above.
import { MeasurementTypeKey } from '@ovok/core';
async function saveUrineAnalysis() {
return client.saveMeasurement({
measurement: {
measurementTypeKey: MeasurementTypeKey.urineAnalysis,
uro: 0.2,
bil: 0,
ket: 0,
glu: 0,
pro: 0,
ph: 6,
bld: 0,
nit: 0,
leu: 0,
sg: 1.015,
vc: 0,
urineValues: [],
recordedAt: new Date(),
},
});
}
When offline queueing is enabled, inspect the returned status. A queued result means the measurement is pending until the queue is flushed; it is not a completed server save.