Skip to main content
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.
  • Example Usage
  • Pattern
{
  "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.
  • Example Usage
  • Pattern
{
  "status": "active",
  "type": "outpatient"
}
Best for: Status values, controlled vocabularies, coded identifiers, filter values

Markdown (markdown)

GitHub Flavored Markdown syntax for rich text content.
  • Example Usage
  • Pattern
{
  "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.
  • Example Usage
  • Pattern
{
  "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.
  • Example Usage
  • Pattern
{
  "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.
  • Example Usage
  • Pattern & Format
{
  "age": 45,
  "bedCount": 250
}

Decimal (decimal)

Rational numbers with implicit precision for financial and measurement data.
  • Example Usage
  • Pattern
{
  "dosage": 2.5,
  "temperature": 98.6,
  "cost": 125.50
}

Temporal Types

Date (date)

Date or partial date without timezone information.
  • Example Usage
  • Pattern
{
  "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.
  • Example Usage
{
  "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.
  • Example Usage
  • Pattern
{
  "openingTime": "08:00:00",
  "procedureTime": "14:30:00.500"
}

Instant (instant)

Precise moment in time, known at least to the second.
  • Example Usage
{
  "timestamp": "2024-08-15T14:30:45.123Z",
  "timestamp_with_timezone_offset": "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.
  • Example Usage
{
  "isActive": true,
  "hasAllergies": false
}

Geopoint (geopoint)

Geographic coordinates for location-based data.
  • Example Usage
{
  "facilityLocation": {
    "latitude": 45.5017,
    "longitude": -73.5673
  }
}

XHTML (xhtml)

Escaped HTML content following XHTML specifications.
  • Example Usage
{
  "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.
  • Profile Definition
  • Usage Example
{
  "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.
  • Profile Definition
  • Resource Example
{
  "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:
{
  "type": "ROOT",
  "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 CategoryTypesSupported OperatorsUse Cases
Text Typessymbol, code, markdowneq, match, any, allFull-text search and exact matching
Numeric Typesinteger, decimaleq, lt, gt, any, allRange queries and numerical comparisons
Temporal Typesdate, datetime, time, instanteq, lt, gtDate range filtering and temporal queries
Geographic TypesgeopointgeoDistanceLocation-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:
ProcessorCompatible TypesPurposeDocumentation
Segmenterssymbol, markdownBreak down large text content into manageable chunks for processingSegmenters →
Vectorizerssymbol, markdown, arrays of symbolTransform text content into vector embeddings for semantic searchVectorizers →
I