From ClinicalParameterValue.schema.yaml (cleo/ClinicalParameterValue.schema
)
---
$id: https://skeleton.botmd.io/cleo/ClinicalParameterValue.schema
$schema: http://json-schema.org/draft-07/schema#
title: Clinical Parameter Value
description: Schema to describe how the clinical parameters values will look like.
type: object
additionalProperties: false
anyOf:
- required: [boolean]
- required: [number]
- required: [string]
- required: [string_array]
- required: [file]
- required: [datetime]
- required: [time]
properties:
boolean:
title: Boolean
description: "A boolean scalar (corresponds to `bool` in Python). Note that we are able to convert string values to boolean using the following rule: `value.lower() in ['1', 'true', 'yes', 'ok']`. Other types will be converted using `bool(...)`."
type: boolean
#end boolean
number:
title: Number
description: A numerical scalar (corresponds to `int` or `float` in Python).
type: number
#end number
string:
title: String
description: A single string scalar (corresponds to `str` in Python). For convenience, we will use the first item of a sequence of strings containing exactly 1 item. Instances of `str, int, bool, float` will be converted to strings using `str(...)`. Other types will raise a `TypeError`.
type: string
#end STRING
string_array:
title: String (Array)
description: Array of strings (corresponds to `Sequence[str]` in Python). For convenience, scalars of `str, int, bool, float` will be converted automatically to an array with 1 item using the `list(str(...))`.
type: array
items:
type: string
#end string_array
file:
title: File
description: A file URL to the location containing the file.
type: object
required: [url, name, suffix]
additionalProperties: false
properties:
url:
title: URL
description: The original URL provided by the Onform provider. Can also be `s3://`, `gs://` or Stitch `stitch://upload_id`.
type: string
format: uri
name:
title: Name
description: The filename component from the `url` path.
type: string
minLength: 1
suffix:
title: Suffix
description: The filename suffix component (i.e., file extension) from the `url` path.
type: string
pattern: '^(\.[a-z0-9]+)?$'
#end properties
#end file
datetime:
title: Date-Time
description: The date-time representation in ISO format.
type: string
format: date-time
#end datetime
time:
title: Time
description: A time representation in `%H:%M` ISO format.
type: string
format: time
#end time
#end properties