Base Data Types
Explore the primitive and composite types that power Clinia schemas
Clinia defines a comprehensive set of base types that model everything from simple strings to complex nested objects. These primitives guarantee consistent validation, indexing behavior, and processor compatibility across the registry.
Choosing the right base type impacts validation, query performance, and downstream processors. Use the tables and examples below to align schema design with your use cases.
Primitive Types
Primitive types represent atomic values with specific validation patterns and search capabilities.
Text and String Types
Symbol (symbol)
A sequence of Unicode characters for general text content.
{
"name": "Dr. Sarah Wilson",
"description": "Board-certified cardiologist specializing in interventional procedures"
}Best for: Names, descriptions, free-text fields, search content
Code (code)
A string with specific formatting rules—no leading/trailing whitespace, single spaces only.
{
"status": "active",
"type": "outpatient"
}Best for: Status values, controlled vocabularies, coded identifiers, filter values
Markdown (markdown)
GitHub Flavored Markdown syntax for rich text content.
{
"instructions": "## Pre-procedure Instructions\n\n- Fast for **12 hours**\n- Take medications as prescribed"
}Best for: Documentation, clinical notes, formatted instructions
URI (uri)
String used to identify a name or a resource within a namespace.
{
"system": "http://terminology.hl7.org/CodeSystem/v3-ActCode",
"namespace": "urn:uuid:53fefa32-fcbb-4ff8-8a92-55ee120877b7"
}Best for: System identifiers, namespace identifiers, resource identifiers
URL (url)
A URI that is a literal web reference.
{
"profileUrl": "https://example.com/patient-profile",
"resourceLink": "https://clinia.com/resource/1234567890"
}Best for: Web resources, external references, literal resource links
Numerical Types
Integer (integer)
Whole numbers with pattern validation.
{
"age": 45,
"bedCount": 250
}Decimal (decimal)
Rational numbers with implicit precision for financial and measurement data.
{
"dosage": 2.5,
"temperature": 98.6,
"cost": 125.50
}Temporal Types
Date (date)
Date or partial date without timezone information.
{
"birthDate": "1978-03-15",
"appointmentDate": "2024-08"
}Supported formats: Year, year-month, full date (YYYY, YYYY-MM, YYYY-MM-DD)
DateTime (datetime)
Date and time with optional timezone specification.
{
"scheduledTime": "2024-08-15T14:30:00Z",
"createdAt": "2024-08-15T14:30:00-05:00"
}Supports partial dates through full datetime with timezone offsets.
Time (time)
Time of day without date information.
{
"openingTime": "08:00:00",
"procedureTime": "14:30:00.500"
}Instant (instant)
Precise moment in time, known at least to the second.
{
"timestamp": "2024-08-15T14:30:45.123Z",
"timestampWithTimezoneOffset": "2024-08-15T14:30:12-5:00"
}Always include timezone information for absolute precision.
Other Primitive Types
Boolean (boolean)
Simple true/false values for binary states.
{
"isActive": true,
"hasAllergies": false
}Geopoint (geopoint)
Geographic coordinates for location-based data.
{
"facilityLocation": {
"latitude": 45.5017,
"longitude": -73.5673
}
}XHTML (xhtml)
Escaped HTML content following XHTML specifications.
{
"formattedReport": "<p>Patient shows <strong>significant improvement</strong></p>"
}Composite Types
Composite types assemble primitives into reusable structures.
Array (array)
Ordered collections of items of the same type.
{
"specialties": {
"type": "array",
"items": {
"type": "symbol"
}
}
}Best for: Lists of similar items like specialties, tags, or categories.
Object (object)
Custom structures that bundle multiple properties.
{
"vitals": {
"type": "object",
"properties": {
"bloodPressure": {
"type": "object",
"properties": {
"systolic": {"type": "integer"},
"diastolic": {"type": "integer"},
"unit": {"type": "symbol"}
}
},
"heartRate": {"type": "integer"},
"temperature": {"type": "decimal"}
}
}
}When to use: Create custom objects for domain-specific data that is not covered by Clinia’s opinionated complex types.
Type usage in practice
Profile definition
Use base types in profiles to define the shape of your resources:
{
"properties": {
"patientId": {"type": "identifier"},
"birthDate": {"type": "date"},
"address": {
"type": "array",
"items": {"type": "address"}
},
"active": {"type": "boolean"}
}
}Search compatibility
Different types support different search operators:
| Type Category | Types | Supported Operators | Use Cases |
|---|---|---|---|
| Text Types | symbol, code, markdown | eq, match, any, all | Full-text search and exact matching |
| Numeric Types | integer, decimal | eq, lt, gt, any, all | Range queries and numerical comparisons |
| Temporal Types | date, datetime, time, instant | eq, lt, gt | Date range filtering and temporal queries |
| Geographic Types | geopoint | geoDistance | Location-based search and proximity queries |
Arrays inherit operators from their item type. An array of symbol supports text operators (eq, match, any, all), while an array of integer supports numeric operators (eq, lt, gt, any, all).
Processing pipelines
Types determine processor compatibility:
| Processor | Compatible Types | Purpose | Documentation |
|---|---|---|---|
| Vectorizers | symbol, markdown, arrays of symbol | Transform text content into vector embeddings for semantic search | Vectorizers → |