Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validation of Primitive Types #1

Open
Panthevm opened this issue Jul 29, 2022 · 0 comments
Open

Validation of Primitive Types #1

Panthevm opened this issue Jul 29, 2022 · 0 comments

Comments

@Panthevm
Copy link
Collaborator

Is it possible to add a description of primitive data to the zen schema?

For example:
https://www.hl7.org/fhir/fhir-base.xsd
https://www.hl7.org/fhir/datatypes.html

FHIR Name Schema
boolean {:type zen/boolean}
integer {:type zen/integer}
string {:type zen/string :minLength 1}
decimal {:type zen/number}
uri {:type zen/string :minLength 1 :regex "\S*"}
url {:type zen/string :minLength 1 :regex "\S*"}
canonical {:type zen/string :minLength 1 :regex "\S*"}
base64Binary {:type zen/string :minLength 1 :regex "(\s*([0-9a-zA-Z\+/=]){4}\s*)+"}
instant {:type zen/string :regex "([0-9]([0-9]([0-9][1-9]|[1-9]0)|[1-9]00)|[1-9]000)-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])T([01][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))"}
date {:type zen/string :regex "([0-9]([0-9]([0-9][1-9]|[1-9]0)|[1-9]00)|[1-9]000)(-(0[1-9]|1[0-2])(-(0[0-9]|[1-2][0-9]|3[0-1]))?)?"}
dateTime {:type zen/string :regex "([0-9]([0-9]([0-9][1-9]|[1-9]0)|[1-9]00)|[1-9]000)(-(0[1-9]|1[0-2])(-(0[0-9]|[1-2][0-9]|3[0-1])(T([01][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00)))?)?)?"}
time {:type zen/string :regex "([01][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\.[0-9]+)?"}
code {:type zen/string :regex "[^\s]+(\s[^\s]+)*"}
oid {:type zen/string :regex "urn:oid:[0-2](\\.(0|[1-9][0-9]*))+"}
id {:type zen/string :regex "[A-Za-z0-9\-\.]{1,64}"}
markdown {:type zen/string :minLength 1 :regex "[ \r\n\t\S]+"}
unsignedInt {:type zen/integer :min 0 :max 2147483647}
positiveInt {:type zen/integer :min 1 :max 2147483647}
uuid {:type zen/string :minLength 1 :regex "urn:uuid:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant