Skip to content

Data Models

This page describes the structure of every object returned by the HappyPathology API.


All dates in the Medical Document are represented as Unix (UTC) timestamps.

"date_of_birth": 1772581386

Operational timestamps, like created_timestamp and updated_timestamp, are represented as Unix Nanoseconds (UTC).

"created_timestamp": 1772581386000000000
"updated_timestamp": 1772581386000000000

The API uses standard HTTP status codes for errors. The status field in the response envelope mirrors the HTTP status code.


Every response from the API wraps its payload in the same envelope:

FieldTypeDescription
statusnumberHTTP status code mirrored in the body
resultsobjectThe response payload (shape varies by endpoint)
debug_info.deltastringServer-side request duration
debug_info.versionstringAPI build version
{
"status": 200,
"results": { },
"debug_info": {
"delta": "102.707189ms",
"version": "happy_api.549.main.02ec7cd"
}
}

Returned inside results.upload_urls when creating a source. Each entry corresponds to one file.

FieldTypeDescription
urlstringSigned GCS URL — PUT your file here directly
file_namestringThe original file name you provided
{
"url": "https://storage.googleapis.com/...",
"file_name": "PatientCases.pdf"
}

Represents a batch of uploaded files being processed into cases.

FieldTypeDescription
idstringSource ID — reference this when polling status and in Step 4
statusstringCurrent processing state (this is NOT the http status code)
expected_file_countnumberNumber of files declared when the source was created
uploaded_file_countnumberNumber of files received so far
case_idsstring[] or nullIDs of extracted cases — populated when status is complete
created_timestampnumberUnix nanoseconds
updated_timestampnumberUnix nanoseconds
account_idstringYour account ID
ValueMeaning
pending_uploadWaiting for files to arrive
processingFiles received, cases being extracted
completeExtraction done — case_ids is populated
failedProcessing failed, you need to start over

Represents a single patient’s case extracted from a source document. One source can produce multiple cases.

FieldTypeDescription
idstringCase ID
source_idstringThe source this case was extracted from
account_idstringYour account ID
statusstringCurrent processing state (this is NOT the http status code)
created_timestampnumberUnix nanoseconds
updated_timestampnumberUnix nanoseconds

The full case contents, including extracted medical data, are returned by the /v1/patient_case/{CASE_ID}/extract endpoint under results.medical_data.


The following is a list of all available fields that HappyPathology can extract from a document.

For each field the values can be in either of the following formats:

FormatDescription
stringText value
number (this is always an int64)Numeric value
Array<string>Array of text values
medical_test_formatObject with value, unit, and reference range

Medical Test Format

Medical Test Format is an object used to represent medical test results, such as CBC tests. The struct has the following fields:

FieldTypeDescription
valuenumberMeasured value
measurement_unitstringUnit of measurement, e.g. "K/uL", "g/dL", "%"
range.minnumberLower bound of the reference range
range.maxnumberUpper bound of the reference range
{
"value": 10.14,
"measurement_unit": "K/uL",
"range": {
"min": 4,
"max": 11
}
}

This is a comprehensive list of fields extracted by HappyPathology from medical documents.

FieldTypeDescription
patient_first_namestring
patient_last_namestring
patient_middle_namestring
patient_suffixstring
patient_mrnstringMedical record number
patient_idstringThis is not MRN, this is other patient identifiers often assigned by the lab
patient_dobnumberUnix timestamp (see Timestamps)
patient_ssnstringSocial Security Number or a subset of it
patient_sexstring
patient_genderstring
patient_address_1string
patient_address_2string
patient_citystring
patient_statestring
patient_zipstring
patient_countrystring
patient_phone_homestring
patient_phone_mobilestring
FieldTypeDescription
patient_clinical_datastring
patient_icd10_codesArray<string>
FieldTypeDescription
specimen_idstring
specimen_typeArray<string>
specimen_ordering_facilitystring
specimen_ordering_physicianstring
specimen_performing_labstring
specimen_collection_datenumberUnix seconds (see Timestamps)
specimen_received_datenumberUnix seconds (see Timestamps)
specimen_reported_datenumberUnix seconds (see Timestamps)
document_printed_datenumberUnix seconds (see Timestamps)
FieldTypeDescription
rbc_countmedical_test_format
wbc_countmedical_test_format
hemoglobinmedical_test_format
hematocritmedical_test_format
mcvmedical_test_format
mchmedical_test_format
mchcmedical_test_format
rdwmedical_test_format
platelet_countmedical_test_format
mpvmedical_test_format
neutrophils_percentmedical_test_format
lymphocytes_percentmedical_test_format
monocytes_percentmedical_test_format
eosinophils_percentmedical_test_format
basophils_percentmedical_test_format
absolute_neutrophilmedical_test_format
absolute_lymphocytemedical_test_format
absolute_monocytemedical_test_format
absolute_eosinophilmedical_test_format
absolute_basophilmedical_test_format
immature_granulocyte_percentmedical_test_format
absolute_immature_granulocytemedical_test_format
nrbc_countmedical_test_format
blast_cell_percentmedical_test_format
promyelocytes_percentmedical_test_format
absolute_promyelocytesmedical_test_format
myelocytes_percentmedical_test_format
absolute_myelocytesmedical_test_format
metamyelocytes_percentmedical_test_format
absolute_metamyelocytesmedical_test_format
bands_percentmedical_test_format
absolute_bandsmedical_test_format
segmented_neutrophils_percentmedical_test_format
reticulocytes_percentmedical_test_format
absolute_reticulocytesmedical_test_format
immature_reticulocyte_fraction_percentmedical_test_format
atypical_lymphocytes_percentmedical_test_format
absolute_atypical_lymphocytesmedical_test_format
plasma_cell_countmedical_test_format
normoblasts_percentmedical_test_format
unclassified_cells_percentmedical_test_format
absolute_unclassified_cellsmedical_test_format
FieldTypeDescription
document_tagArray<string>
FieldTypeDescription
precipio_patient_next_appointment_datetimenumberUnix seconds (see Timestamps)
precipio_patient_clinical_statusstring
precipio_patient_clinical_indicationsArray<string>
precipio_copy_physician_namestring
precipio_tests_requestedArray<string>
precipio_test_idsArray<string>