Commit 6f6d5810 authored by Vladimir Popescu's avatar Vladimir Popescu
Browse files

[schema] First version of the cube: schema and entities, closes #3912377

parent a3ebf73c2448
......@@ -16,3 +16,66 @@
# with this program. If not, see <http://www.gnu.org/licenses/>.
"""cubicweb-clinipath schema"""
from yams.buildobjs import (EntityType, SubjectRelation, String, RichString, Int, Date)
class Biopsy(EntityType):
"""Biopsy attributes"""
biopsy_type = String(maxsize=512)
extraction_date = Date()
size = String(maxsize=128)
tumoral_cell_percent = Float(indexed=True)
necrosis_percent = Float(indexed=True)
has_gene_expression = Boolean()
proliferating_cell_percent = Float()
has_neoangiogenesis = Boolean()
has_necrosis = Boolean()
conclusions = String(maxsize=2056, fulltextindexed=True)
class BiopsySample(EntityType):
size = String(maxsize=128)
tumoral_cell_percent = Float(indexed=True)
necrosis_percent = Float(indexed=True)
has_gene_expression = Boolean()
proliferating_cell_percent = Float()
has_neoangiogenesis = Boolean()
has_necrosis = Boolean()
extracted_from = SubjectRelation('Biopsy', cardinality='1*', inlined=True)
class CellCulture(EntityType):
""" Models cell cultures, with passages for now. Related to a
Biopsy."""
code = Int()
culture_passage = Int()
related_biopsy = SubjectRelation('Biopsy', cardinality='?*',
inlined=True, composite='object')
class BloodSample(EntityType):
""" Blood sample data """
code = Int(required=True)
volume_ml = Int()
sampling_date = Date()
class IHCMeasure(EntityType):
"""An IHC measure."""
measured_on = SubjectRelation(('Biopsy', 'CellCulture'), inlined=True, cardinality='1*')
class IHCResult(EntityType):
""" An IHC result."""
expression_value = Int(indexed=True)
related_measure = SubjectRelation('IHCMeasure', inlined=True, cardinality='1*')
class AnatomicPathologyReport(EntityType):
""" An Anatomic pathology report """
code = Int(required=True)
description = RichString(fulltextindexed=True)
conclusions = RichString(fulltextindexed=True)
report_on = SubjectRelation(('Biopsy', 'CellCulture', 'BloodSample'),
inlined=True, cardinality='1*')
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment