"""
DO NOT EDIT THIS FILE!!
This file is automatically generated by the process_schemas.py program
in the scripts directory. It is not intended to be edited directly. If
you need to update the GEL protocol classes, please run the script
on the appropriate schema version.
"""
from protocols.protocol import ProtocolElement
from protocols.protocol import SearchRequest
from protocols.protocol import SearchResponse
from protocols.protocol import avro_parse

import avro.schema

version = '6.0.2'


class ACMGClassification(object):
    """
    No documentation
    """
    pathogenic_variant = "pathogenic_variant"
    likely_pathogenic_variant = "likely_pathogenic_variant"
    variant_of_unknown_clinical_significance = "variant_of_unknown_clinical_significance"
    likely_benign_variant = "likely_benign_variant"
    benign_variant = "benign_variant"
    not_assessed = "not_assessed"
    na = "na"

    def __hash__(self):
        return str(self).__hash__()


class AcmgEvidence(ProtocolElement):
    """
    AcmgEvidence. This should be buit for each one of the evidences
    assing to a variants following the ACMG guidelines.     An
    AcmgEvidence, should map with one of the criteria defined, i.e,
    PVS1, BA1, PM1...
    """
    _schemaSource = """
{"type": "record", "name": "AcmgEvidence", "namespace": "org.gel.models.report.avro", "doc": "",
"fields": [{"name": "category", "type": {"type": "enum", "name": "AcmgEvidenceCategory", "doc": "",
"symbols": ["population_data", "computational_and_predictive_data", "functional_data",
"segregation_data", "de_novo_data", "allelic_data", "other_database", "other_data"]}, "doc": ""},
{"name": "type", "type": {"type": "enum", "name": "AcmgEvidenceType", "doc": "", "symbols":
["bening", "pathogenic"]}, "doc": ""}, {"name": "weight", "type": {"type": "enum", "name":
"AcmgEvidenceWeight", "doc": "", "symbols": ["stand_alone", "supporting", "moderate", "strong",
"very_strong"]}, "doc": ""}, {"name": "modifier", "type": "int", "doc": ""}, {"name": "description",
"type": ["null", "string"], "doc": ""}]}
"""
    schema = avro_parse(_schemaSource)
    requiredFields = {
        "category",
        "description",
        "modifier",
        "type",
        "weight",
    }

    @classmethod
    def isEmbeddedType(cls, fieldName):
        embeddedTypes = {}
        return fieldName in embeddedTypes

    @classmethod
    def getEmbeddedType(cls, fieldName):
        embeddedTypes = {}

        return embeddedTypes[fieldName]

    __slots__ = [
        'category', 'description', 'modifier', 'type', 'weight'
    ]

    def __init__(self, **kwargs):
        self.category = kwargs.get(
            'category', None)
        self.description = kwargs.get(
            'description', None)
        self.modifier = kwargs.get(
            'modifier', None)
        self.type = kwargs.get(
            'type', None)
        self.weight = kwargs.get(
            'weight', None)


class AcmgEvidenceCategory(object):
    """
    Each ACMG criterion is classified in one of these categories
    """
    population_data = "population_data"
    computational_and_predictive_data = "computational_and_predictive_data"
    functional_data = "functional_data"
    segregation_data = "segregation_data"
    de_novo_data = "de_novo_data"
    allelic_data = "allelic_data"
    other_database = "other_database"
    other_data = "other_data"

    def __hash__(self):
        return str(self).__hash__()


class AcmgEvidenceType(object):
    """
    Each ACMG cirterion will be classifed as bening or pathogenic
    """
    bening = "bening"
    pathogenic = "pathogenic"

    def __hash__(self):
        return str(self).__hash__()


class AcmgEvidenceWeight(object):
    """
    Each ACMG criterion is weighted using the following terms:  *
    `stand_alone`: `A`, stand-alone applied for benign variant
    critieria `(BA1)` * `supporting`: `P`, supporting applied for
    benign variant critieria `(BP1-6)` and pathogenic variant criteria
    `(PP1-5)` * `moderate`: `M`, moderate applied for pathogenic
    variant critieria (PM1-6) * `strong`: `S`, strong applied for
    pathogenic variant critieria (PS1-4) * `very_strong`: `S`, Very
    Stong applied for pathogenic variant critieria (PVS1)
    """
    stand_alone = "stand_alone"
    supporting = "supporting"
    moderate = "moderate"
    strong = "strong"
    very_strong = "very_strong"

    def __hash__(self):
        return str(self).__hash__()


class AcmgVariantClassification(ProtocolElement):
    """
    Full record for the ACMG variant clasiffication, including all
    selectedd evidences and the final classification.
    """
    _schemaSource = """
{"type": "record", "name": "AcmgVariantClassification", "namespace": "org.gel.models.report.avro",
"doc": "", "fields": [{"name": "acmgEvidences", "type": {"type": "array", "items": {"type":
"record", "name": "AcmgEvidence", "doc": "", "fields": [{"name": "category", "type": {"type":
"enum", "name": "AcmgEvidenceCategory", "doc": "", "symbols": ["population_data",
"computational_and_predictive_data", "functional_data", "segregation_data", "de_novo_data",
"allelic_data", "other_database", "other_data"]}, "doc": ""}, {"name": "type", "type": {"type":
"enum", "name": "AcmgEvidenceType", "doc": "", "symbols": ["bening", "pathogenic"]}, "doc": ""},
{"name": "weight", "type": {"type": "enum", "name": "AcmgEvidenceWeight", "doc": "", "symbols":
["stand_alone", "supporting", "moderate", "strong", "very_strong"]}, "doc": ""}, {"name":
"modifier", "type": "int", "doc": ""}, {"name": "description", "type": ["null", "string"], "doc":
""}]}}}, {"name": "clinicalSignificance", "type": {"type": "enum", "name": "ClinicalSignificance",
"symbols": ["benign", "likely_benign", "likely_pathogenic", "pathogenic",
"uncertain_significance"]}}, {"name": "assessment", "type": ["null", "string"]}]}
"""
    schema = avro_parse(_schemaSource)
    requiredFields = {
        "acmgEvidences",
        "assessment",
        "clinicalSignificance",
    }

    @classmethod
    def isEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'acmgEvidences': AcmgEvidence,
        }
        return fieldName in embeddedTypes

    @classmethod
    def getEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'acmgEvidences': AcmgEvidence,
        }

        return embeddedTypes[fieldName]

    __slots__ = [
        'acmgEvidences', 'assessment', 'clinicalSignificance'
    ]

    def __init__(self, **kwargs):
        self.acmgEvidences = kwargs.get(
            'acmgEvidences', None)
        self.assessment = kwargs.get(
            'assessment', None)
        self.clinicalSignificance = kwargs.get(
            'clinicalSignificance', None)


class Actionability(object):
    """
    No documentation
    """
    yes = "yes"
    no = "no"
    not_yet = "not_yet"
    na = "na"

    def __hash__(self):
        return str(self).__hash__()


class Actions(ProtocolElement):
    """
    Clinical actions
    """
    _schemaSource = """
{"type": "record", "name": "Actions", "namespace": "org.gel.models.report.avro", "doc": "",
"fields": [{"name": "trials", "type": ["null", {"type": "array", "items": {"type": "record", "name":
"Trial", "fields": [{"name": "studyUrl", "type": "string", "doc": ""}, {"name": "studyIdentifier",
"type": "string", "doc": ""}, {"name": "startDate", "type": ["null", "string"], "doc": ""}, {"name":
"estimateCompletionDate", "type": ["null", "string"], "doc": ""}, {"name": "title", "type": ["null",
"string"], "doc": ""}, {"name": "phase", "type": ["null", {"type": "enum", "name": "StudyPhase",
"doc": "", "symbols": ["na", "early_phase1", "phase1", "phase1_phase2", "phase2", "phase2_phase3",
"phase3", "phase4"]}], "doc": ""}, {"name": "interventions", "type": ["null", {"type": "array",
"items": {"type": "record", "name": "Intervention", "doc": "", "fields": [{"name":
"interventionType", "type": {"type": "enum", "name": "InterventionType", "doc": "", "symbols":
["drug", "device", "procedure", "biological", "radiation", "behavioral", "genetic",
"dietary_supplement", "combination_product", "diagnostic_test", "other"]}, "doc": ""}, {"name":
"interventionName", "type": "string", "doc": ""}]}}], "doc": ""}, {"name": "conditions", "type":
["null", {"type": "array", "items": "string"}], "doc": ""}, {"name": "primaryPurpose", "type":
["null", {"type": "enum", "name": "PrimaryPurpose", "doc": "", "symbols": ["treatment",
"prevention", "diagnostic", "supportive_care", "screening", "health_services_research",
"basic_science", "device_feasibility", "other"]}], "doc": ""}, {"name": "studyType", "type":
["null", {"type": "enum", "name": "StudyType", "doc": "", "symbols": ["interventional",
"observational", "patient_registry", "expanded_access"]}], "doc": ""}, {"name":
"demogrphicElegibilityCriteria", "type": ["null", {"type": "record", "name":
"DemographicElegibilityCriteria", "fields": [{"name": "sex", "type": {"type": "enum", "name": "Sex",
"namespace": "org.gel.models.participant.avro", "doc": "", "symbols": ["MALE", "FEMALE",
"UNKNOWN"]}}, {"name": "ageRange", "type": ["null", {"type": "record", "name": "AgeRange", "fields":
[{"name": "minimumAge", "type": "int"}, {"name": "maximumAge", "type": "int"}, {"name": "timeunit",
"type": {"type": "enum", "name": "TimeUnit", "symbols": ["years", "months", "weeks", "days",
"hours", "minutes", "na"]}}]}]}]}], "doc": ""}, {"name": "locations", "type": ["null", {"type":
"array", "items": {"type": "record", "name": "TrialLocation", "fields": [{"name": "name", "type":
["null", "string"]}, {"name": "city", "type": ["null", "string"]}, {"name": "country", "type":
["null", "string"]}, {"name": "zip", "type": ["null", "string"]}]}}], "doc": ""}, {"name":
"variantActionable", "type": "boolean", "doc": ""}]}}]}, {"name": "prognosis", "type": ["null",
{"type": "array", "items": {"type": "record", "name": "Prognosis", "fields": [{"name":
"referenceUrl", "type": "string", "doc": ""}, {"name": "prognosis", "type": ["null", {"type":
"enum", "name": "PrognosisClassification", "symbols": ["altered_prognosis", "favourable_prognosis",
"unfavourable_prognosis"]}], "doc": ""}, {"name": "source", "type": ["null", "string"], "doc": ""},
{"name": "references", "type": ["null", {"type": "array", "items": "string"}], "doc": ""}, {"name":
"conditions", "type": ["null", {"type": "array", "items": "string"}], "doc": ""}, {"name":
"description", "type": ["null", "string"], "doc": ""}, {"name": "variantActionable", "type":
"boolean", "doc": ""}]}}]}, {"name": "therapies", "type": ["null", {"type": "array", "items":
{"type": "record", "name": "Therapy", "fields": [{"name": "referenceUrl", "type": "string", "doc":
""}, {"name": "source", "type": ["null", "string"], "doc": ""}, {"name": "references", "type":
["null", {"type": "array", "items": "string"}], "doc": ""}, {"name": "conditions", "type": ["null",
{"type": "array", "items": "string"}], "doc": ""}, {"name": "drugResponse", "type": ["null",
{"type": "array", "items": {"type": "record", "name": "DrugResponse", "fields": [{"name":
"TreatmentAgent", "type": "string", "doc": ""}, {"name": "drugResponseClassification", "type":
{"type": "enum", "name": "DrugResponseClassification", "symbols": ["altered_sensitivity",
"reduced_sensitivity", "increased_sensitivity", "altered_resistance", "increased_resistance",
"reduced_resistance", "increased_risk_of_toxicity", "reduced_risk_of_toxicity", "altered_toxicity",
"adverse_drug_reaction", "indication", "contraindication", "dosing_alteration", "increased_dose",
"reduced_dose", "increased_monitoring", "increased_efficacy", "reduced_efficacy",
"altered_efficacy"]}, "doc": ""}]}}], "doc": ""}, {"name": "otherInterventions", "type": ["null",
{"type": "array", "items": "Intervention"}], "doc": ""}, {"name": "variantActionable", "type":
"boolean", "doc": ""}]}}]}]}
"""
    schema = avro_parse(_schemaSource)
    requiredFields = {
        "prognosis",
        "therapies",
        "trials",
    }

    @classmethod
    def isEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'prognosis': Prognosis,
            'therapies': Therapy,
            'trials': Trial,
        }
        return fieldName in embeddedTypes

    @classmethod
    def getEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'prognosis': Prognosis,
            'therapies': Therapy,
            'trials': Trial,
        }

        return embeddedTypes[fieldName]

    __slots__ = [
        'prognosis', 'therapies', 'trials'
    ]

    def __init__(self, **kwargs):
        self.prognosis = kwargs.get(
            'prognosis', None)
        self.therapies = kwargs.get(
            'therapies', None)
        self.trials = kwargs.get(
            'trials', None)


class AdditionalAnalysisPanel(ProtocolElement):
    """
    A panel of genes and the specific disease that it assesses
    """
    _schemaSource = """
{"type": "record", "name": "AdditionalAnalysisPanel", "namespace": "org.gel.models.report.avro",
"doc": "", "fields": [{"name": "specificDisease", "type": "string"}, {"name": "panel", "type":
{"type": "record", "name": "GenePanel", "doc": "", "fields": [{"name": "panelIdentifier", "type":
["null", "string"], "doc": ""}, {"name": "panelName", "type": ["null", "string"], "doc": ""},
{"name": "panelVersion", "type": ["null", "string"], "doc": ""}, {"name": "source", "type": ["null",
"string"], "doc": ""}]}}]}
"""
    schema = avro_parse(_schemaSource)
    requiredFields = {
        "panel",
        "specificDisease",
    }

    @classmethod
    def isEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'panel': GenePanel,
        }
        return fieldName in embeddedTypes

    @classmethod
    def getEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'panel': GenePanel,
        }

        return embeddedTypes[fieldName]

    __slots__ = [
        'panel', 'specificDisease'
    ]

    def __init__(self, **kwargs):
        self.panel = kwargs.get(
            'panel', GenePanel())
        self.specificDisease = kwargs.get(
            'specificDisease', None)


class AdditionalVariantsQuestions(ProtocolElement):
    """
    No documentation
    """
    _schemaSource = """
{"type": "record", "name": "AdditionalVariantsQuestions", "namespace": "org.gel.models.report.avro",
"fields": [{"name": "typeOfAdditionalFinding", "type": ["null", {"type": "enum", "name":
"TypeOfAdditionalFinding", "symbols": ["domain3", "tier3", "sv_cnv", "mutational_signatures",
"mutational_burden", "other"]}]}, {"name": "findingDescription", "type": ["null", "string"]},
{"name": "variantCoordinates", "type": ["null", {"type": "record", "name": "VariantCoordinates",
"doc": "", "fields": [{"name": "chromosome", "type": "string", "doc": ""}, {"name": "position",
"type": "int", "doc": ""}, {"name": "reference", "type": "string", "doc": ""}, {"name": "alternate",
"type": "string", "doc": ""}, {"name": "assembly", "type": {"type": "enum", "name": "Assembly",
"doc": "", "symbols": ["GRCh38", "GRCh37"]}, "doc": ""}]}], "doc": ""}, {"name":
"variantActionability", "type": {"type": "array", "items": {"type": "enum", "name":
"CancerActionability", "doc": "", "symbols": ["germline_susceptibility",
"predicts_therapeutic_response", "prognostic", "defines_diagnosis_group", "eligibility_for_trial",
"other"]}}, "doc": ""}, {"name": "otherVariantActionability", "type": ["null", "string"]}, {"name":
"variantUsability", "type": {"type": "enum", "name": "CancerUsabilitySomatic", "doc": "", "symbols":
["already_actioned", "actioned_result_of_this_wga", "not_yet_actioned"]}, "doc": ""}, {"name":
"variantTested", "type": {"type": "enum", "name": "CancerTestedAdditional", "doc": "", "symbols":
["not_indicated_for_patient_care", "no_orthologous_test_available", "test_performed_prior_to_wga",
"technical_validation_following_wga", "na"]}, "doc": ""}, {"name": "validationAssayType", "type":
"string", "doc": ""}]}
"""
    schema = avro_parse(_schemaSource)
    requiredFields = {
        "findingDescription",
        "otherVariantActionability",
        "typeOfAdditionalFinding",
        "validationAssayType",
        "variantActionability",
        "variantCoordinates",
        "variantTested",
        "variantUsability",
    }

    @classmethod
    def isEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'variantCoordinates': VariantCoordinates,
        }
        return fieldName in embeddedTypes

    @classmethod
    def getEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'variantCoordinates': VariantCoordinates,
        }

        return embeddedTypes[fieldName]

    __slots__ = [
        'findingDescription', 'otherVariantActionability',
        'typeOfAdditionalFinding', 'validationAssayType',
        'variantActionability', 'variantCoordinates', 'variantTested',
        'variantUsability'
    ]

    def __init__(self, **kwargs):
        self.findingDescription = kwargs.get(
            'findingDescription', None)
        self.otherVariantActionability = kwargs.get(
            'otherVariantActionability', None)
        self.typeOfAdditionalFinding = kwargs.get(
            'typeOfAdditionalFinding', None)
        self.validationAssayType = kwargs.get(
            'validationAssayType', None)
        self.variantActionability = kwargs.get(
            'variantActionability', None)
        self.variantCoordinates = kwargs.get(
            'variantCoordinates', None)
        self.variantTested = kwargs.get(
            'variantTested', None)
        self.variantUsability = kwargs.get(
            'variantUsability', None)


class AdoptedStatus(object):
    """
    adoptedin means adopted into the family     adoptedout means child
    belonged to the family and was adopted out
    """
    notadopted = "notadopted"
    adoptedin = "adoptedin"
    adoptedout = "adoptedout"

    def __hash__(self):
        return str(self).__hash__()


class AffectionStatus(object):
    """
    Affection Status
    """
    UNAFFECTED = "UNAFFECTED"
    AFFECTED = "AFFECTED"
    UNCERTAIN = "UNCERTAIN"

    def __hash__(self):
        return str(self).__hash__()


class AgeOfOnset(object):
    """
    No documentation
    """
    EMBRYONAL_ONSET = "EMBRYONAL_ONSET"
    FETAL_ONSET = "FETAL_ONSET"
    NEONATAL_ONSET = "NEONATAL_ONSET"
    INFANTILE_ONSET = "INFANTILE_ONSET"
    CHILDHOOD_ONSET = "CHILDHOOD_ONSET"
    JUVENILE_ONSET = "JUVENILE_ONSET"
    YOUNG_ADULT_ONSET = "YOUNG_ADULT_ONSET"
    LATE_ONSET = "LATE_ONSET"
    MIDDLE_AGE_ONSET = "MIDDLE_AGE_ONSET"

    def __hash__(self):
        return str(self).__hash__()


class AgeRange(ProtocolElement):
    """
    No documentation
    """
    _schemaSource = """
{"type": "record", "name": "AgeRange", "namespace": "org.gel.models.report.avro", "fields":
[{"name": "minimumAge", "type": "int"}, {"name": "maximumAge", "type": "int"}, {"name": "timeunit",
"type": {"type": "enum", "name": "TimeUnit", "symbols": ["years", "months", "weeks", "days",
"hours", "minutes", "na"]}}]}
"""
    schema = avro_parse(_schemaSource)
    requiredFields = {
        "maximumAge",
        "minimumAge",
        "timeunit",
    }

    @classmethod
    def isEmbeddedType(cls, fieldName):
        embeddedTypes = {}
        return fieldName in embeddedTypes

    @classmethod
    def getEmbeddedType(cls, fieldName):
        embeddedTypes = {}

        return embeddedTypes[fieldName]

    __slots__ = [
        'maximumAge', 'minimumAge', 'timeunit'
    ]

    def __init__(self, **kwargs):
        self.maximumAge = kwargs.get(
            'maximumAge', None)
        self.minimumAge = kwargs.get(
            'minimumAge', None)
        self.timeunit = kwargs.get(
            'timeunit', None)


class AlgorithmBasedVariantClassification(ProtocolElement):
    """
    No documentation
    """
    _schemaSource = """
{"type": "record", "name": "AlgorithmBasedVariantClassification", "namespace":
"org.gel.models.report.avro", "fields": [{"name": "algorithmName", "type": "string", "doc": ""},
{"name": "classification", "type": "string", "doc": ""}, {"name": "rank", "type": ["null", "int"],
"doc": ""}, {"name": "score", "type": ["null", "int"], "doc": ""}]}
"""
    schema = avro_parse(_schemaSource)
    requiredFields = {
        "algorithmName",
        "classification",
        "rank",
        "score",
    }

    @classmethod
    def isEmbeddedType(cls, fieldName):
        embeddedTypes = {}
        return fieldName in embeddedTypes

    @classmethod
    def getEmbeddedType(cls, fieldName):
        embeddedTypes = {}

        return embeddedTypes[fieldName]

    __slots__ = [
        'algorithmName', 'classification', 'rank', 'score'
    ]

    def __init__(self, **kwargs):
        self.algorithmName = kwargs.get(
            'algorithmName', None)
        self.classification = kwargs.get(
            'classification', None)
        self.rank = kwargs.get(
            'rank', None)
        self.score = kwargs.get(
            'score', None)


class AlleleFrequency(ProtocolElement):
    """
    The population allele frequency of a given variant in a given
    study and optionally population
    """
    _schemaSource = """
{"type": "record", "name": "AlleleFrequency", "namespace": "org.gel.models.report.avro", "doc": "",
"fields": [{"name": "study", "type": "string", "doc": ""}, {"name": "population", "type": "string",
"doc": ""}, {"name": "alternateFrequency", "type": "float", "doc": ""}]}
"""
    schema = avro_parse(_schemaSource)
    requiredFields = {
        "alternateFrequency",
        "population",
        "study",
    }

    @classmethod
    def isEmbeddedType(cls, fieldName):
        embeddedTypes = {}
        return fieldName in embeddedTypes

    @classmethod
    def getEmbeddedType(cls, fieldName):
        embeddedTypes = {}

        return embeddedTypes[fieldName]

    __slots__ = [
        'alternateFrequency', 'population', 'study'
    ]

    def __init__(self, **kwargs):
        self.alternateFrequency = kwargs.get(
            'alternateFrequency', None)
        self.population = kwargs.get(
            'population', None)
        self.study = kwargs.get(
            'study', None)


class AlleleOrigin(object):
    """
    Allele origin.  * `SO_0001781`: de novo variant.
    http://purl.obolibrary.org/obo/SO_0001781 * `SO_0001778`: germline
    variant. http://purl.obolibrary.org/obo/SO_0001778 * `SO_0001775`:
    maternal variant. http://purl.obolibrary.org/obo/SO_0001775 *
    `SO_0001776`: paternal variant.
    http://purl.obolibrary.org/obo/SO_0001776 * `SO_0001779`: pedigree
    specific variant. http://purl.obolibrary.org/obo/SO_0001779 *
    `SO_0001780`: population specific variant.
    http://purl.obolibrary.org/obo/SO_0001780 * `SO_0001777`: somatic
    variant. http://purl.obolibrary.org/obo/SO_0001777
    """
    de_novo_variant = "de_novo_variant"
    germline_variant = "germline_variant"
    maternal_variant = "maternal_variant"
    paternal_variant = "paternal_variant"
    pedigree_specific_variant = "pedigree_specific_variant"
    population_specific_variant = "population_specific_variant"
    somatic_variant = "somatic_variant"

    def __hash__(self):
        return str(self).__hash__()


class AmpClincialOrExperimentalEvidence(ProtocolElement):
    """
    Amp Clinical or Experimental Evidence, the level will define the
    overal clasification of the variant together with     the tiering.
    """
    _schemaSource = """
{"type": "record", "name": "AmpClincialOrExperimentalEvidence", "namespace":
"org.gel.models.report.avro", "doc": "", "fields": [{"name": "category", "type": {"type": "enum",
"name": "AmpClinicalOrExperimentalEvidenceCategory", "doc": "", "symbols": ["therapeutic",
"diagnosis", "prognosis"]}, "doc": ""}, {"name": "level", "type": {"type": "enum", "name":
"AmpClinicalOrExperimentalEvidenceLevel", "doc": "", "symbols": ["levelA", "levelB", "levelC",
"levelD"]}, "doc": ""}, {"name": "description", "type": ["null", "string"], "doc": ""}]}
"""
    schema = avro_parse(_schemaSource)
    requiredFields = {
        "category",
        "description",
        "level",
    }

    @classmethod
    def isEmbeddedType(cls, fieldName):
        embeddedTypes = {}
        return fieldName in embeddedTypes

    @classmethod
    def getEmbeddedType(cls, fieldName):
        embeddedTypes = {}

        return embeddedTypes[fieldName]

    __slots__ = [
        'category', 'description', 'level'
    ]

    def __init__(self, **kwargs):
        self.category = kwargs.get(
            'category', None)
        self.description = kwargs.get(
            'description', None)
        self.level = kwargs.get(
            'level', None)


class AmpClinicalOrExperimentalEvidenceCategory(object):
    """
    Categories of Clinical and/or Experimental Evidence as defined in
    AMP guidelines
    """
    therapeutic = "therapeutic"
    diagnosis = "diagnosis"
    prognosis = "prognosis"

    def __hash__(self):
        return str(self).__hash__()


class AmpClinicalOrExperimentalEvidenceLevel(object):
    """
    Levels for categories of Clinical and/or Experimental Evidence as
    defined in AMP guidelines
    """
    levelA = "levelA"
    levelB = "levelB"
    levelC = "levelC"
    levelD = "levelD"

    def __hash__(self):
        return str(self).__hash__()


class AmpEvidence(ProtocolElement):
    """
    Evidences as defined in AMP guidelines, they are composed by a
    evidence type (first column in the evidence table of     the
    guidlines) and a assessment of the evicence, this last one will
    define the streght of the evidence, supporting     the variant to
    be classified as TierI-IV
    """
    _schemaSource = """
{"type": "record", "name": "AmpEvidence", "namespace": "org.gel.models.report.avro", "doc": "",
"fields": [{"name": "type", "type": {"type": "enum", "name": "AmpEvidenceType", "doc": "",
"symbols": ["mutation_type", "therapies", "variant_frequencies", "potential_germline",
"population_database_presence", "germline_database_presence", "somatic_database_presence",
"impact_predictive_software", "pathway_involvement", "publications"]}, "doc": ""}, {"name":
"evidenceAssessment", "type": "string", "doc": ""}]}
"""
    schema = avro_parse(_schemaSource)
    requiredFields = {
        "evidenceAssessment",
        "type",
    }

    @classmethod
    def isEmbeddedType(cls, fieldName):
        embeddedTypes = {}
        return fieldName in embeddedTypes

    @classmethod
    def getEmbeddedType(cls, fieldName):
        embeddedTypes = {}

        return embeddedTypes[fieldName]

    __slots__ = [
        'evidenceAssessment', 'type'
    ]

    def __init__(self, **kwargs):
        self.evidenceAssessment = kwargs.get(
            'evidenceAssessment', None)
        self.type = kwargs.get(
            'type', None)


class AmpEvidenceType(object):
    """
    Type of evidence in tge AMP guideline
    """
    mutation_type = "mutation_type"
    therapies = "therapies"
    variant_frequencies = "variant_frequencies"
    potential_germline = "potential_germline"
    population_database_presence = "population_database_presence"
    germline_database_presence = "germline_database_presence"
    somatic_database_presence = "somatic_database_presence"
    impact_predictive_software = "impact_predictive_software"
    pathway_involvement = "pathway_involvement"
    publications = "publications"

    def __hash__(self):
        return str(self).__hash__()


class AmpTier(object):
    """
    AMP tier: * `TierI`: Variants of Strong Clinical Significance *
    `TierII`: Variants of Potential Clinical Significance * `TierIII`:
    Variants of Unknown Clinical Significance * `TierIV`: Benign or
    Likely Benign Variants
    """
    tierI = "tierI"
    tierII = "tierII"
    tierIII = "tierIII"
    tierIV = "tierIV"

    def __hash__(self):
        return str(self).__hash__()


class AmpVariantClassification(ProtocolElement):
    """
    Full Variant classification acording to AMP guideline, including
    all supporting evidences and the final     assessment
    """
    _schemaSource = """
{"type": "record", "name": "AmpVariantClassification", "namespace": "org.gel.models.report.avro",
"doc": "", "fields": [{"name": "ampEvidences", "type": {"type": "array", "items": {"type": "record",
"name": "AmpEvidence", "doc": "", "fields": [{"name": "type", "type": {"type": "enum", "name":
"AmpEvidenceType", "doc": "", "symbols": ["mutation_type", "therapies", "variant_frequencies",
"potential_germline", "population_database_presence", "germline_database_presence",
"somatic_database_presence", "impact_predictive_software", "pathway_involvement", "publications"]},
"doc": ""}, {"name": "evidenceAssessment", "type": "string", "doc": ""}]}}, "doc": ""}, {"name":
"ampTier", "type": {"type": "enum", "name": "AmpTier", "doc": "", "symbols": ["tierI", "tierII",
"tierIII", "tierIV"]}, "doc": ""}, {"name": "ampClincialOrExperimentalEvidence", "type": ["null",
{"type": "array", "items": {"type": "record", "name": "AmpClincialOrExperimentalEvidence", "doc":
"", "fields": [{"name": "category", "type": {"type": "enum", "name":
"AmpClinicalOrExperimentalEvidenceCategory", "doc": "", "symbols": ["therapeutic", "diagnosis",
"prognosis"]}, "doc": ""}, {"name": "level", "type": {"type": "enum", "name":
"AmpClinicalOrExperimentalEvidenceLevel", "doc": "", "symbols": ["levelA", "levelB", "levelC",
"levelD"]}, "doc": ""}, {"name": "description", "type": ["null", "string"], "doc": ""}]}}], "doc":
""}, {"name": "assessment", "type": ["null", "string"], "doc": ""}]}
"""
    schema = avro_parse(_schemaSource)
    requiredFields = {
        "ampClincialOrExperimentalEvidence",
        "ampEvidences",
        "ampTier",
        "assessment",
    }

    @classmethod
    def isEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'ampClincialOrExperimentalEvidence': AmpClincialOrExperimentalEvidence,
            'ampEvidences': AmpEvidence,
        }
        return fieldName in embeddedTypes

    @classmethod
    def getEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'ampClincialOrExperimentalEvidence': AmpClincialOrExperimentalEvidence,
            'ampEvidences': AmpEvidence,
        }

        return embeddedTypes[fieldName]

    __slots__ = [
        'ampClincialOrExperimentalEvidence', 'ampEvidences',
        'ampTier', 'assessment'
    ]

    def __init__(self, **kwargs):
        self.ampClincialOrExperimentalEvidence = kwargs.get(
            'ampClincialOrExperimentalEvidence', None)
        self.ampEvidences = kwargs.get(
            'ampEvidences', None)
        self.ampTier = kwargs.get(
            'ampTier', None)
        self.assessment = kwargs.get(
            'assessment', None)


class AnalysisPanel(ProtocolElement):
    """
    An analysis panel
    """
    _schemaSource = """
{"type": "record", "name": "AnalysisPanel", "namespace": "org.gel.models.participant.avro", "doc":
"", "fields": [{"name": "specificDisease", "type": "string", "doc": ""}, {"name": "panelName",
"type": "string", "doc": ""}, {"name": "panelVersion", "type": ["null", "string"], "doc": ""},
{"name": "reviewOutcome", "type": "string", "doc": ""}, {"name": "multipleGeneticOrigins", "type":
"string", "doc": ""}]}
"""
    schema = avro_parse(_schemaSource)
    requiredFields = {
        "multipleGeneticOrigins",
        "panelName",
        "panelVersion",
        "reviewOutcome",
        "specificDisease",
    }

    @classmethod
    def isEmbeddedType(cls, fieldName):
        embeddedTypes = {}
        return fieldName in embeddedTypes

    @classmethod
    def getEmbeddedType(cls, fieldName):
        embeddedTypes = {}

        return embeddedTypes[fieldName]

    __slots__ = [
        'multipleGeneticOrigins', 'panelName', 'panelVersion',
        'reviewOutcome', 'specificDisease'
    ]

    def __init__(self, **kwargs):
        self.multipleGeneticOrigins = kwargs.get(
            'multipleGeneticOrigins', None)
        self.panelName = kwargs.get(
            'panelName', None)
        self.panelVersion = kwargs.get(
            'panelVersion', None)
        self.reviewOutcome = kwargs.get(
            'reviewOutcome', None)
        self.specificDisease = kwargs.get(
            'specificDisease', None)


class Ancestries(ProtocolElement):
    """
    Ancestries, defined as Ethnic category(ies) and Chi-square test
    """
    _schemaSource = """
{"type": "record", "name": "Ancestries", "namespace": "org.gel.models.participant.avro", "doc": "",
"fields": [{"name": "mothersEthnicOrigin", "type": ["null", {"type": "enum", "name":
"EthnicCategory", "doc": "", "symbols": ["D", "E", "F", "G", "A", "B", "C", "L", "M", "N", "H", "J",
"K", "P", "S", "R", "Z"]}], "doc": ""}, {"name": "mothersOtherRelevantAncestry", "type": ["null",
"string"], "doc": ""}, {"name": "fathersEthnicOrigin", "type": ["null", "EthnicCategory"], "doc":
""}, {"name": "fathersOtherRelevantAncestry", "type": ["null", "string"], "doc": ""}, {"name":
"chiSquare1KGenomesPhase3Pop", "type": ["null", {"type": "array", "items": {"type": "record",
"name": "ChiSquare1KGenomesPhase3Pop", "doc": "", "fields": [{"name": "kgSuperPopCategory", "type":
{"type": "enum", "name": "KgSuperPopCategory", "doc": "", "symbols": ["AFR", "AMR", "EAS", "EUR",
"SAS"]}, "doc": ""}, {"name": "kgPopCategory", "type": ["null", {"type": "enum", "name":
"KgPopCategory", "doc": "", "symbols": ["ACB", "ASW", "BEB", "CDX", "CEU", "CHB", "CHS", "CLM",
"ESN", "FIN", "GBR", "GIH", "GWD", "IBS", "ITU", "JPT", "KHV", "LWK", "MSL", "MXL", "PEL", "PJL",
"PUR", "STU", "TSI", "YRI"]}], "doc": ""}, {"name": "chiSquare", "type": "double", "doc": ""}]}}],
"doc": ""}]}
"""
    schema = avro_parse(_schemaSource)
    requiredFields = {
        "chiSquare1KGenomesPhase3Pop",
        "fathersEthnicOrigin",
        "fathersOtherRelevantAncestry",
        "mothersEthnicOrigin",
        "mothersOtherRelevantAncestry",
    }

    @classmethod
    def isEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'chiSquare1KGenomesPhase3Pop': ChiSquare1KGenomesPhase3Pop,
        }
        return fieldName in embeddedTypes

    @classmethod
    def getEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'chiSquare1KGenomesPhase3Pop': ChiSquare1KGenomesPhase3Pop,
        }

        return embeddedTypes[fieldName]

    __slots__ = [
        'chiSquare1KGenomesPhase3Pop', 'fathersEthnicOrigin',
        'fathersOtherRelevantAncestry', 'mothersEthnicOrigin',
        'mothersOtherRelevantAncestry'
    ]

    def __init__(self, **kwargs):
        self.chiSquare1KGenomesPhase3Pop = kwargs.get(
            'chiSquare1KGenomesPhase3Pop', None)
        self.fathersEthnicOrigin = kwargs.get(
            'fathersEthnicOrigin', None)
        self.fathersOtherRelevantAncestry = kwargs.get(
            'fathersOtherRelevantAncestry', None)
        self.mothersEthnicOrigin = kwargs.get(
            'mothersEthnicOrigin', None)
        self.mothersOtherRelevantAncestry = kwargs.get(
            'mothersOtherRelevantAncestry', None)


class Aneuploidy(ProtocolElement):
    """
    No documentation
    """
    _schemaSource = """
{"type": "record", "name": "Aneuploidy", "namespace": "org.gel.models.report.avro", "fields":
[{"name": "iscn", "type": ["null", "string"], "doc": ""}, {"name": "assembly", "type": {"type":
"enum", "name": "Assembly", "doc": "", "symbols": ["GRCh38", "GRCh37"]}, "doc": ""}, {"name":
"chromosome", "type": "string", "doc": ""}, {"name": "complete", "type": "boolean", "doc": ""},
{"name": "coordinates", "type": ["null", {"type": "record", "name": "Coordinates", "fields":
[{"name": "assembly", "type": "Assembly"}, {"name": "chromosome", "type": "string"}, {"name":
"start", "type": "int"}, {"name": "end", "type": "int"}, {"name": "ciStart", "type": ["null",
{"type": "record", "name": "ConfidenceInterval", "fields": [{"name": "left", "type": "int"},
{"name": "right", "type": "int"}]}]}, {"name": "ciEnd", "type": ["null", "ConfidenceInterval"]}]}],
"doc": ""}, {"name": "numberOfCopies", "type": "int", "doc": ""}]}
"""
    schema = avro_parse(_schemaSource)
    requiredFields = {
        "assembly",
        "chromosome",
        "complete",
        "coordinates",
        "iscn",
        "numberOfCopies",
    }

    @classmethod
    def isEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'coordinates': Coordinates,
        }
        return fieldName in embeddedTypes

    @classmethod
    def getEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'coordinates': Coordinates,
        }

        return embeddedTypes[fieldName]

    __slots__ = [
        'assembly', 'chromosome', 'complete', 'coordinates', 'iscn',
        'numberOfCopies'
    ]

    def __init__(self, **kwargs):
        self.assembly = kwargs.get(
            'assembly', None)
        self.chromosome = kwargs.get(
            'chromosome', None)
        self.complete = kwargs.get(
            'complete', None)
        self.coordinates = kwargs.get(
            'coordinates', None)
        self.iscn = kwargs.get(
            'iscn', None)
        self.numberOfCopies = kwargs.get(
            'numberOfCopies', None)


class Assembly(object):
    """
    The reference genome assembly
    """
    GRCh38 = "GRCh38"
    GRCh37 = "GRCh37"

    def __hash__(self):
        return str(self).__hash__()


class BreakPoint(ProtocolElement):
    """
    No documentation
    """
    _schemaSource = """
{"type": "record", "name": "BreakPoint", "namespace": "org.gel.models.report.avro", "fields":
[{"name": "coordinates", "type": {"type": "record", "name": "Coordinates", "fields": [{"name":
"assembly", "type": {"type": "enum", "name": "Assembly", "doc": "", "symbols": ["GRCh38",
"GRCh37"]}}, {"name": "chromosome", "type": "string"}, {"name": "start", "type": "int"}, {"name":
"end", "type": "int"}, {"name": "ciStart", "type": ["null", {"type": "record", "name":
"ConfidenceInterval", "fields": [{"name": "left", "type": "int"}, {"name": "right", "type":
"int"}]}]}, {"name": "ciEnd", "type": ["null", "ConfidenceInterval"]}]}}, {"name": "reference",
"type": ["null", "string"]}, {"name": "alternate", "type": ["null", "string"]}, {"name": "info",
"type": ["null", {"type": "map", "values": "string"}]}]}
"""
    schema = avro_parse(_schemaSource)
    requiredFields = {
        "alternate",
        "coordinates",
        "info",
        "reference",
    }

    @classmethod
    def isEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'coordinates': Coordinates,
        }
        return fieldName in embeddedTypes

    @classmethod
    def getEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'coordinates': Coordinates,
        }

        return embeddedTypes[fieldName]

    __slots__ = [
        'alternate', 'coordinates', 'info', 'reference'
    ]

    def __init__(self, **kwargs):
        self.alternate = kwargs.get(
            'alternate', None)
        self.coordinates = kwargs.get(
            'coordinates', Coordinates())
        self.info = kwargs.get(
            'info', None)
        self.reference = kwargs.get(
            'reference', None)


class CancerActionability(object):
    """
    An enumeration Variant Actionability:       *
    `predicts_therapeutic_response`: Predicts therapeutic response
    * `prognostic`: Prognostic       * `defines_diagnosis_group`:
    Defines diagnosis group       * `eligibility_for_trial`:
    Eligibility for trial       * `germline_susceptibility`: Germline
    susceptibility       * `other`:  Other (please specify)
    """
    germline_susceptibility = "germline_susceptibility"
    predicts_therapeutic_response = "predicts_therapeutic_response"
    prognostic = "prognostic"
    defines_diagnosis_group = "defines_diagnosis_group"
    eligibility_for_trial = "eligibility_for_trial"
    other = "other"

    def __hash__(self):
        return str(self).__hash__()


class CancerActionabilityPharmacogenomics(object):
    """
    An enumeration Variant Actionability:       *
    `therapeutic_dosaging_or_toxicity_change`: Predicts therapeutic
    dosing/toxicity
    """
    therapeutic_dosaging_or_toxicity_change = "therapeutic_dosaging_or_toxicity_change"

    def __hash__(self):
        return str(self).__hash__()


class CancerActionabilitySomatic(object):
    """
    The variant actionabilities: * `predicts_therapeutic_response`:
    Predicts therapeutic response * `prognostic`: Prognostic *
    `defines_diagnosis_group`: Defines diagnosis group *
    `eligibility_for_trial`: Eligibility for trial * `other`:  Other
    (please specify)
    """
    predicts_therapeutic_response = "predicts_therapeutic_response"
    prognostic = "prognostic"
    defines_diagnosis_group = "defines_diagnosis_group"
    eligibility_for_trial = "eligibility_for_trial"
    other = "other"

    def __hash__(self):
        return str(self).__hash__()


class CancerActionableVariants(object):
    """
    Are the variants actionable? * `yes`: yes * `no`: no * `na`: Not
    applicable
    """
    yes = "yes"
    no = "no"
    na = "na"

    def __hash__(self):
        return str(self).__hash__()


class CancerCaseLevelQuestions(ProtocolElement):
    """
    The questions for the cancer program exit questionnaire at case
    level
    """
    _schemaSource = """
{"type": "record", "name": "CancerCaseLevelQuestions", "namespace": "org.gel.models.report.avro",
"doc": "", "fields": [{"name": "total_review_time", "type": "double", "doc": ""}, {"name":
"mdt1_time", "type": "double", "doc": ""}, {"name": "mdt2_time", "type": ["null", "double"], "doc":
""}, {"name": "validation_assay_time", "type": ["null", "double"], "doc": ""}, {"name":
"wet_validation_time", "type": ["null", "double"], "doc": ""}, {"name":
"analytical_validation_time", "type": ["null", "double"], "doc": ""}, {"name":
"primary_reporting_time", "type": "double", "doc": ""}, {"name": "primary_authorisation_time",
"type": "double", "doc": ""}, {"name": "report_distribution_time", "type": "double", "doc": ""},
{"name": "total_time", "type": "double", "doc": ""}, {"name": "reviewedInMdtWga", "type": {"type":
"enum", "name": "ReviewedParts", "doc": "", "symbols": ["domain_1", "domain_1_and_2",
"domain_1_2_and_suplementary", "somatic_if_relevant"]}, "doc": ""}, {"name": "actionableVariants",
"type": {"type": "enum", "name": "CancerActionableVariants", "doc": "", "symbols": ["yes", "no",
"na"]}, "doc": ""}]}
"""
    schema = avro_parse(_schemaSource)
    requiredFields = {
        "actionableVariants",
        "analytical_validation_time",
        "mdt1_time",
        "mdt2_time",
        "primary_authorisation_time",
        "primary_reporting_time",
        "report_distribution_time",
        "reviewedInMdtWga",
        "total_review_time",
        "total_time",
        "validation_assay_time",
        "wet_validation_time",
    }

    @classmethod
    def isEmbeddedType(cls, fieldName):
        embeddedTypes = {}
        return fieldName in embeddedTypes

    @classmethod
    def getEmbeddedType(cls, fieldName):
        embeddedTypes = {}

        return embeddedTypes[fieldName]

    __slots__ = [
        'actionableVariants', 'analytical_validation_time',
        'mdt1_time', 'mdt2_time', 'primary_authorisation_time',
        'primary_reporting_time', 'report_distribution_time',
        'reviewedInMdtWga', 'total_review_time', 'total_time',
        'validation_assay_time', 'wet_validation_time'
    ]

    def __init__(self, **kwargs):
        self.actionableVariants = kwargs.get(
            'actionableVariants', None)
        self.analytical_validation_time = kwargs.get(
            'analytical_validation_time', None)
        self.mdt1_time = kwargs.get(
            'mdt1_time', None)
        self.mdt2_time = kwargs.get(
            'mdt2_time', None)
        self.primary_authorisation_time = kwargs.get(
            'primary_authorisation_time', None)
        self.primary_reporting_time = kwargs.get(
            'primary_reporting_time', None)
        self.report_distribution_time = kwargs.get(
            'report_distribution_time', None)
        self.reviewedInMdtWga = kwargs.get(
            'reviewedInMdtWga', None)
        self.total_review_time = kwargs.get(
            'total_review_time', None)
        self.total_time = kwargs.get(
            'total_time', None)
        self.validation_assay_time = kwargs.get(
            'validation_assay_time', None)
        self.wet_validation_time = kwargs.get(
            'wet_validation_time', None)


class CancerExitQuestionnaire(ProtocolElement):
    """
    The cancer program exit questionnaire
    """
    _schemaSource = """
{"type": "record", "name": "CancerExitQuestionnaire", "namespace": "org.gel.models.report.avro",
"doc": "", "fields": [{"name": "eventDate", "type": "string", "doc": ""}, {"name": "reporter",
"type": "string", "doc": ""}, {"name": "caseLevelQuestions", "type": {"type": "record", "name":
"CancerCaseLevelQuestions", "doc": "", "fields": [{"name": "total_review_time", "type": "double",
"doc": ""}, {"name": "mdt1_time", "type": "double", "doc": ""}, {"name": "mdt2_time", "type":
["null", "double"], "doc": ""}, {"name": "validation_assay_time", "type": ["null", "double"], "doc":
""}, {"name": "wet_validation_time", "type": ["null", "double"], "doc": ""}, {"name":
"analytical_validation_time", "type": ["null", "double"], "doc": ""}, {"name":
"primary_reporting_time", "type": "double", "doc": ""}, {"name": "primary_authorisation_time",
"type": "double", "doc": ""}, {"name": "report_distribution_time", "type": "double", "doc": ""},
{"name": "total_time", "type": "double", "doc": ""}, {"name": "reviewedInMdtWga", "type": {"type":
"enum", "name": "ReviewedParts", "doc": "", "symbols": ["domain_1", "domain_1_and_2",
"domain_1_2_and_suplementary", "somatic_if_relevant"]}, "doc": ""}, {"name": "actionableVariants",
"type": {"type": "enum", "name": "CancerActionableVariants", "doc": "", "symbols": ["yes", "no",
"na"]}, "doc": ""}]}, "doc": ""}, {"name": "somaticVariantLevelQuestions", "type": ["null", {"type":
"array", "items": {"type": "record", "name": "CancerSomaticVariantLevelQuestions", "doc": "",
"fields": [{"name": "variantCoordinates", "type": {"type": "record", "name": "VariantCoordinates",
"doc": "", "fields": [{"name": "chromosome", "type": "string", "doc": ""}, {"name": "position",
"type": "int", "doc": ""}, {"name": "reference", "type": "string", "doc": ""}, {"name": "alternate",
"type": "string", "doc": ""}, {"name": "assembly", "type": {"type": "enum", "name": "Assembly",
"doc": "", "symbols": ["GRCh38", "GRCh37"]}, "doc": ""}]}, "doc": ""}, {"name":
"variantActionability", "type": {"type": "array", "items": {"type": "enum", "name":
"CancerActionabilitySomatic", "doc": "", "symbols": ["predicts_therapeutic_response", "prognostic",
"defines_diagnosis_group", "eligibility_for_trial", "other"]}}, "doc": ""}, {"name":
"otherVariantActionability", "type": ["null", "string"], "doc": ""}, {"name": "variantUsability",
"type": {"type": "enum", "name": "CancerUsabilitySomatic", "doc": "", "symbols":
["already_actioned", "actioned_result_of_this_wga", "not_yet_actioned"]}, "doc": ""}, {"name":
"variantTested", "type": {"type": "enum", "name": "CancerTested", "doc": "", "symbols":
["not_indicated_for_patient_care", "no_orthologous_test_available", "test_performed_prior_to_wga",
"technical_validation_following_wga"]}, "doc": ""}, {"name": "validationAssayType", "type":
"string", "doc": ""}]}}], "doc": ""}, {"name": "germlineVariantLevelQuestions", "type": ["null",
{"type": "array", "items": {"type": "record", "name": "CancerGermlineVariantLevelQuestions", "doc":
"", "fields": [{"name": "variantCoordinates", "type": "VariantCoordinates", "doc": ""}, {"name":
"variantActionability", "type": {"type": "array", "items": {"type": "enum", "name":
"CancerActionability", "doc": "", "symbols": ["germline_susceptibility",
"predicts_therapeutic_response", "prognostic", "defines_diagnosis_group", "eligibility_for_trial",
"other"]}}, "doc": ""}, {"name": "otherVariantActionability", "type": ["null", "string"]}, {"name":
"variantUsability", "type": {"type": "enum", "name": "CancerUsabilityGermline", "doc": "",
"symbols": ["already_actioned", "actioned_result_of_this_wga"]}, "doc": ""}, {"name":
"variantTested", "type": "CancerTested", "doc": ""}, {"name": "validationAssayType", "type":
"string", "doc": ""}]}}], "doc": ""}, {"name": "pharmacogenomicsVariantLevelQuestions", "type":
["null", {"type": "array", "items": {"type": "record", "name":
"CancerPharmacogenomicsVariantLevelQuestions", "doc": "", "fields": [{"name": "variantCoordinates",
"type": "VariantCoordinates", "doc": ""}, {"name": "variantActionability", "type": {"type": "array",
"items": {"type": "enum", "name": "CancerActionabilityPharmacogenomics", "doc": "", "symbols":
["therapeutic_dosaging_or_toxicity_change"]}}, "doc": ""}, {"name": "variantUsability", "type":
{"type": "enum", "name": "CancerUsabilityPharmacogenomics", "doc": "", "symbols": ["change_dosing",
"alternative_therapeutic", "na"]}, "doc": ""}, {"name": "variantTested", "type": "CancerTested",
"doc": ""}, {"name": "validationAssayType", "type": "string", "doc": ""}]}}], "doc": ""}, {"name":
"additionalComments", "type": ["null", "string"], "doc": ""}, {"name": "otherActionableVariants",
"type": ["null", {"type": "array", "items": {"type": "record", "name":
"AdditionalVariantsQuestions", "fields": [{"name": "typeOfAdditionalFinding", "type": ["null",
{"type": "enum", "name": "TypeOfAdditionalFinding", "symbols": ["domain3", "tier3", "sv_cnv",
"mutational_signatures", "mutational_burden", "other"]}]}, {"name": "findingDescription", "type":
["null", "string"]}, {"name": "variantCoordinates", "type": ["null", "VariantCoordinates"], "doc":
""}, {"name": "variantActionability", "type": {"type": "array", "items": "CancerActionability"},
"doc": ""}, {"name": "otherVariantActionability", "type": ["null", "string"]}, {"name":
"variantUsability", "type": "CancerUsabilitySomatic", "doc": ""}, {"name": "variantTested", "type":
{"type": "enum", "name": "CancerTestedAdditional", "doc": "", "symbols":
["not_indicated_for_patient_care", "no_orthologous_test_available", "test_performed_prior_to_wga",
"technical_validation_following_wga", "na"]}, "doc": ""}, {"name": "validationAssayType", "type":
"string", "doc": ""}]}}], "doc": ""}]}
"""
    schema = avro_parse(_schemaSource)
    requiredFields = {
        "additionalComments",
        "caseLevelQuestions",
        "eventDate",
        "germlineVariantLevelQuestions",
        "otherActionableVariants",
        "pharmacogenomicsVariantLevelQuestions",
        "reporter",
        "somaticVariantLevelQuestions",
    }

    @classmethod
    def isEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'caseLevelQuestions': CancerCaseLevelQuestions,
            'germlineVariantLevelQuestions': CancerGermlineVariantLevelQuestions,
            'otherActionableVariants': AdditionalVariantsQuestions,
            'pharmacogenomicsVariantLevelQuestions': CancerPharmacogenomicsVariantLevelQuestions,
            'somaticVariantLevelQuestions': CancerSomaticVariantLevelQuestions,
        }
        return fieldName in embeddedTypes

    @classmethod
    def getEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'caseLevelQuestions': CancerCaseLevelQuestions,
            'germlineVariantLevelQuestions': CancerGermlineVariantLevelQuestions,
            'otherActionableVariants': AdditionalVariantsQuestions,
            'pharmacogenomicsVariantLevelQuestions': CancerPharmacogenomicsVariantLevelQuestions,
            'somaticVariantLevelQuestions': CancerSomaticVariantLevelQuestions,
        }

        return embeddedTypes[fieldName]

    __slots__ = [
        'additionalComments', 'caseLevelQuestions', 'eventDate',
        'germlineVariantLevelQuestions', 'otherActionableVariants',
        'pharmacogenomicsVariantLevelQuestions', 'reporter',
        'somaticVariantLevelQuestions'
    ]

    def __init__(self, **kwargs):
        self.additionalComments = kwargs.get(
            'additionalComments', None)
        self.caseLevelQuestions = kwargs.get(
            'caseLevelQuestions', CancerCaseLevelQuestions())
        self.eventDate = kwargs.get(
            'eventDate', None)
        self.germlineVariantLevelQuestions = kwargs.get(
            'germlineVariantLevelQuestions', None)
        self.otherActionableVariants = kwargs.get(
            'otherActionableVariants', None)
        self.pharmacogenomicsVariantLevelQuestions = kwargs.get(
            'pharmacogenomicsVariantLevelQuestions', None)
        self.reporter = kwargs.get(
            'reporter', None)
        self.somaticVariantLevelQuestions = kwargs.get(
            'somaticVariantLevelQuestions', None)


class CancerGermlineVariantLevelQuestions(ProtocolElement):
    """
    The questions for the cancer program exit questionnaire for
    germline variants
    """
    _schemaSource = """
{"type": "record", "name": "CancerGermlineVariantLevelQuestions", "namespace":
"org.gel.models.report.avro", "doc": "", "fields": [{"name": "variantCoordinates", "type": {"type":
"record", "name": "VariantCoordinates", "doc": "", "fields": [{"name": "chromosome", "type":
"string", "doc": ""}, {"name": "position", "type": "int", "doc": ""}, {"name": "reference", "type":
"string", "doc": ""}, {"name": "alternate", "type": "string", "doc": ""}, {"name": "assembly",
"type": {"type": "enum", "name": "Assembly", "doc": "", "symbols": ["GRCh38", "GRCh37"]}, "doc":
""}]}, "doc": ""}, {"name": "variantActionability", "type": {"type": "array", "items": {"type":
"enum", "name": "CancerActionability", "doc": "", "symbols": ["germline_susceptibility",
"predicts_therapeutic_response", "prognostic", "defines_diagnosis_group", "eligibility_for_trial",
"other"]}}, "doc": ""}, {"name": "otherVariantActionability", "type": ["null", "string"]}, {"name":
"variantUsability", "type": {"type": "enum", "name": "CancerUsabilityGermline", "doc": "",
"symbols": ["already_actioned", "actioned_result_of_this_wga"]}, "doc": ""}, {"name":
"variantTested", "type": {"type": "enum", "name": "CancerTested", "doc": "", "symbols":
["not_indicated_for_patient_care", "no_orthologous_test_available", "test_performed_prior_to_wga",
"technical_validation_following_wga"]}, "doc": ""}, {"name": "validationAssayType", "type":
"string", "doc": ""}]}
"""
    schema = avro_parse(_schemaSource)
    requiredFields = {
        "otherVariantActionability",
        "validationAssayType",
        "variantActionability",
        "variantCoordinates",
        "variantTested",
        "variantUsability",
    }

    @classmethod
    def isEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'variantCoordinates': VariantCoordinates,
        }
        return fieldName in embeddedTypes

    @classmethod
    def getEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'variantCoordinates': VariantCoordinates,
        }

        return embeddedTypes[fieldName]

    __slots__ = [
        'otherVariantActionability', 'validationAssayType',
        'variantActionability', 'variantCoordinates', 'variantTested',
        'variantUsability'
    ]

    def __init__(self, **kwargs):
        self.otherVariantActionability = kwargs.get(
            'otherVariantActionability', None)
        self.validationAssayType = kwargs.get(
            'validationAssayType', None)
        self.variantActionability = kwargs.get(
            'variantActionability', None)
        self.variantCoordinates = kwargs.get(
            'variantCoordinates', VariantCoordinates())
        self.variantTested = kwargs.get(
            'variantTested', None)
        self.variantUsability = kwargs.get(
            'variantUsability', None)


class CancerInterpretationRequest(ProtocolElement):
    """
    This record represents basic information for this report
    """
    _schemaSource = """
{"type": "record", "name": "CancerInterpretationRequest", "namespace": "org.gel.models.report.avro",
"doc": "", "fields": [{"name": "versionControl", "type": {"type": "record", "name":
"ReportVersionControl", "fields": [{"name": "gitVersionControl", "type": "string", "doc": "",
"default": "6.0.2"}]}, "doc": ""}, {"name": "interpretationRequestId", "type": "string", "doc": ""},
{"name": "interpretationRequestVersion", "type": "int", "doc": ""}, {"name": "internalStudyId",
"type": "string", "doc": ""}, {"name": "participantInternalId", "type": ["null", "string"], "doc":
""}, {"name": "genomeAssembly", "type": {"type": "enum", "name": "Assembly", "doc": "", "symbols":
["GRCh38", "GRCh37"]}, "doc": ""}, {"name": "workspace", "type": {"type": "array", "items":
"string"}, "doc": ""}, {"name": "bams", "type": ["null", {"type": "array", "items": {"type":
"record", "name": "File", "doc": "", "fields": [{"name": "sampleId", "type": ["null", {"type":
"array", "items": "string"}], "doc": ""}, {"name": "uriFile", "type": "string", "doc": ""}, {"name":
"fileType", "type": {"type": "enum", "name": "FileType", "symbols": ["BAM", "gVCF", "VCF_small",
"VCF_somatic_small", "VCF_CNV", "VCF_somatic_CNV", "VCF_SV", "VCF_somatic_SV", "VCF_SV_CNV", "SVG",
"ANN", "BigWig", "MD5Sum", "ROH", "OTHER", "PARTITION", "VARIANT_FREQUENCIES", "COVERAGE"]}, "doc":
""}, {"name": "md5Sum", "type": ["null", "string"], "doc": ""}]}}], "doc": ""}, {"name": "vcfs",
"type": ["null", {"type": "array", "items": "File"}], "doc": ""}, {"name": "bigWigs", "type":
["null", {"type": "array", "items": "File"}], "doc": ""}, {"name": "annotationFile", "type":
["null", "File"], "doc": ""}, {"name": "otherFiles", "type": ["null", {"type": "map", "values":
"File"}], "doc": ""}, {"name": "cancerParticipant", "type": ["null", {"type": "record", "name":
"CancerParticipant", "namespace": "org.gel.models.participant.avro", "doc": "", "fields": [{"name":
"yearOfBirth", "type": ["null", "int"], "doc": ""}, {"name": "morphology", "type": ["null", {"type":
"array", "items": "string"}], "doc": ""}, {"name": "readyForAnalysis", "type": "boolean", "doc":
""}, {"name": "consentStatus", "type": ["null", {"type": "record", "name": "ConsentStatus", "doc":
"", "fields": [{"name": "programmeConsent", "type": "boolean", "doc": "", "default": false},
{"name": "primaryFindingConsent", "type": "boolean", "doc": "", "default": false}, {"name":
"secondaryFindingConsent", "type": "boolean", "doc": "", "default": false}, {"name":
"carrierStatusConsent", "type": "boolean", "doc": "", "default": false}]}], "doc": ""}, {"name":
"center", "type": ["null", "string"], "doc": ""}, {"name": "individualId", "type": "string", "doc":
""}, {"name": "primaryDiagnosisDisease", "type": ["null", {"type": "array", "items": "string"}],
"doc": ""}, {"name": "primaryDiagnosisSubDisease", "type": ["null", {"type": "array", "items":
"string"}], "doc": ""}, {"name": "sex", "type": {"type": "enum", "name": "Sex", "doc": "",
"symbols": ["MALE", "FEMALE", "UNKNOWN"]}, "doc": ""}, {"name": "additionalInformation", "type":
["null", {"type": "map", "values": "string"}], "doc": ""}, {"name": "assignedICD10", "type":
["null", {"type": "array", "items": "string"}], "doc": ""}, {"name": "tumourSamples", "type":
{"type": "array", "items": {"type": "record", "name": "TumourSample", "doc": "", "fields": [{"name":
"sampleId", "type": "string", "doc": ""}, {"name": "labSampleId", "type": "string", "doc": ""},
{"name": "LDPCode", "type": "string", "doc": ""}, {"name": "tumourId", "type": "string", "doc": ""},
{"name": "programmePhase", "type": ["null", {"type": "enum", "name": "ProgrammePhase", "symbols":
["CRUK", "OXFORD", "CLL", "IIP", "MAIN", "EXPT"]}], "doc": ""}, {"name": "diseaseType", "type":
["null", "string"], "doc": ""}, {"name": "diseaseSubType", "type": ["null", "string"], "doc": ""},
{"name": "clinicalSampleDateTime", "type": ["null", "string"], "doc": ""}, {"name": "tumourType",
"type": ["null", {"type": "enum", "name": "TumourType", "symbols": ["PRIMARY",
"METASTATIC_RECURRENCE", "RECURRENCE_OF_PRIMARY_TUMOUR", "METASTASES"]}], "doc": ""}, {"name":
"tumourContent", "type": ["null", {"type": "enum", "name": "TumourContent", "symbols": ["High",
"Medium", "Low"]}], "doc": ""}, {"name": "source", "type": ["null", {"type": "enum", "name":
"SampleSource", "doc": "", "symbols": ["TUMOUR", "BONE_MARROW_ASPIRATE_TUMOUR_SORTED_CELLS",
"BONE_MARROW_ASPIRATE_TUMOUR_CELLS", "BLOOD", "SALIVA", "FIBROBLAST", "TISSUE"]}], "doc": ""},
{"name": "preparationMethod", "type": ["null", {"type": "enum", "name": "PreparationMethod",
"symbols": ["EDTA", "ORAGENE", "FF", "FFPE", "CD128_SORTED_CELLS", "ASPIRATE"]}], "doc": ""},
{"name": "tissueSource", "type": ["null", {"type": "enum", "name": "TissueSource", "symbols":
["BMA_TUMOUR_SORTED_CELLS", "CT_GUIDED_BIOPSY", "ENDOSCOPIC_BIOPSY",
"ENDOSCOPIC_ULTRASOUND_GUIDED_BIOPSY", "ENDOSCOPIC_ULTRASOUND_GUIDED_FNA", "LAPAROSCOPIC_BIOPSY",
"LAPAROSCOPIC_EXCISION", "MRI_GUIDED_BIOPSY", "NON_GUIDED_BIOPSY", "SURGICAL_RESECTION",
"STEREOTACTICALLY_GUIDED_BIOPSY", "USS_GUIDED_BIOPSY", "NON_STANDARD_BIOPSY", "NOT_SPECIFIED"]}],
"doc": ""}, {"name": "product", "type": ["null", {"type": "enum", "name": "Product", "symbols":
["DNA", "RNA"]}], "doc": ""}, {"name": "morphologyICD", "type": ["null", "string"], "doc": ""},
{"name": "morphologySnomedCT", "type": ["null", "string"], "doc": ""}, {"name":
"morphologySnomedRT", "type": ["null", "string"], "doc": ""}, {"name": "topographyICD", "type":
["null", "string"], "doc": ""}, {"name": "topographySnomedCT", "type": ["null", "string"], "doc":
""}, {"name": "topographySnomedRT", "type": ["null", "string"], "doc": ""}]}}, "doc": ""}, {"name":
"germlineSamples", "type": {"type": "array", "items": {"type": "record", "name": "GermlineSample",
"doc": "", "fields": [{"name": "sampleId", "type": "string", "doc": ""}, {"name": "labSampleId",
"type": "string", "doc": ""}, {"name": "LDPCode", "type": "string", "doc": ""}, {"name": "source",
"type": ["null", "SampleSource"], "doc": ""}, {"name": "product", "type": ["null", "Product"],
"doc": ""}, {"name": "preparationMethod", "type": ["null", "PreparationMethod"], "doc": ""},
{"name": "programmePhase", "type": ["null", "ProgrammePhase"], "doc": ""}, {"name":
"clinicalSampleDateTime", "type": ["null", "string"], "doc": ""}]}}, "doc": ""}, {"name":
"matchedSamples", "type": {"type": "array", "items": {"type": "record", "name": "MatchedSamples",
"doc": "", "fields": [{"name": "germlineSampleId", "type": ["null", "string"], "doc": ""}, {"name":
"tumourSampleId", "type": ["null", "string"], "doc": ""}]}}, "doc": ""}, {"name": "versionControl",
"type": ["null", {"type": "record", "name": "VersionControl", "fields": [{"name":
"GitVersionControl", "type": "string", "doc": "", "default": "1.1.3"}]}], "doc": ""}]}], "doc": ""},
{"name": "otherFamilyHistory", "type": ["null", {"type": "record", "name": "OtherFamilyHistory",
"doc": "", "fields": [{"name": "maternalFamilyHistory", "type": ["null", {"type": "array", "items":
"string"}], "doc": ""}, {"name": "paternalFamilyHistory", "type": ["null", {"type": "array",
"items": "string"}], "doc": ""}]}], "doc": ""}, {"name": "genePanelsCoverage", "type": ["null",
{"type": "map", "values": {"type": "map", "values": {"type": "map", "values": "float"}}}], "doc":
""}, {"name": "interpretationFlags", "type": ["null", {"type": "array", "items": {"type": "record",
"name": "InterpretationFlag", "doc": "", "fields": [{"name": "interpretationFlag", "type": {"type":
"enum", "name": "InterpretationFlags", "doc": "", "symbols": ["mixed_chemistries",
"mixedLab_preparation", "low_tumour_purity", "uniparental_isodisomy", "uniparental_heterodisomy",
"unusual_karyotype", "high_cnv_count", "high_estimate_human_contamination_fraction",
"mixed_recruiting_gmc", "suspected_mosaicism", "low_quality_sample", "ffpe_tumour_sample",
"ff_nano_tumour_sample", "missing_values_for_proband_in_reported_variant", "reissued",
"supplementary_report_errors", "internal_use_only", "high_priority",
"suspected_increased_number_of_false_positive_heterozygous_loss_calls",
"suspected_poor_quality_cnv_calls", "cnv_calls_assumed_xx_karyo", "cnv_calls_assumed_xy_karyo",
"other"]}, "doc": ""}, {"name": "additionalDescription", "type": ["null", "string"], "doc": ""}]}}],
"doc": ""}, {"name": "additionalInfo", "type": ["null", {"type": "map", "values": "string"}], "doc":
""}]}
"""
    schema = avro_parse(_schemaSource)
    requiredFields = {
        "additionalInfo",
        "annotationFile",
        "bams",
        "bigWigs",
        "cancerParticipant",
        "genePanelsCoverage",
        "genomeAssembly",
        "internalStudyId",
        "interpretationFlags",
        "interpretationRequestId",
        "interpretationRequestVersion",
        "otherFamilyHistory",
        "otherFiles",
        "participantInternalId",
        "vcfs",
        "versionControl",
        "workspace",
    }

    @classmethod
    def isEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'annotationFile': File,
            'bams': File,
            'bigWigs': File,
            'cancerParticipant': CancerParticipant,
            'interpretationFlags': InterpretationFlag,
            'otherFamilyHistory': OtherFamilyHistory,
            'otherFiles': File,
            'vcfs': File,
            'versionControl': ReportVersionControl,
        }
        return fieldName in embeddedTypes

    @classmethod
    def getEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'annotationFile': File,
            'bams': File,
            'bigWigs': File,
            'cancerParticipant': CancerParticipant,
            'interpretationFlags': InterpretationFlag,
            'otherFamilyHistory': OtherFamilyHistory,
            'otherFiles': File,
            'vcfs': File,
            'versionControl': ReportVersionControl,
        }

        return embeddedTypes[fieldName]

    __slots__ = [
        'additionalInfo', 'annotationFile', 'bams', 'bigWigs',
        'cancerParticipant', 'genePanelsCoverage', 'genomeAssembly',
        'internalStudyId', 'interpretationFlags',
        'interpretationRequestId', 'interpretationRequestVersion',
        'otherFamilyHistory', 'otherFiles', 'participantInternalId',
        'vcfs', 'versionControl', 'workspace'
    ]

    def __init__(self, **kwargs):
        self.additionalInfo = kwargs.get(
            'additionalInfo', None)
        self.annotationFile = kwargs.get(
            'annotationFile', None)
        self.bams = kwargs.get(
            'bams', None)
        self.bigWigs = kwargs.get(
            'bigWigs', None)
        self.cancerParticipant = kwargs.get(
            'cancerParticipant', None)
        self.genePanelsCoverage = kwargs.get(
            'genePanelsCoverage', None)
        self.genomeAssembly = kwargs.get(
            'genomeAssembly', None)
        self.internalStudyId = kwargs.get(
            'internalStudyId', None)
        self.interpretationFlags = kwargs.get(
            'interpretationFlags', None)
        self.interpretationRequestId = kwargs.get(
            'interpretationRequestId', None)
        self.interpretationRequestVersion = kwargs.get(
            'interpretationRequestVersion', None)
        self.otherFamilyHistory = kwargs.get(
            'otherFamilyHistory', None)
        self.otherFiles = kwargs.get(
            'otherFiles', None)
        self.participantInternalId = kwargs.get(
            'participantInternalId', None)
        self.vcfs = kwargs.get(
            'vcfs', None)
        self.versionControl = kwargs.get(
            'versionControl', ReportVersionControl())
        self.workspace = kwargs.get(
            'workspace', None)


class CancerParticipant(ProtocolElement):
    """
    This defines a Cancer Participant
    """
    _schemaSource = """
{"type": "record", "name": "CancerParticipant", "namespace": "org.gel.models.participant.avro",
"doc": "", "fields": [{"name": "yearOfBirth", "type": ["null", "int"], "doc": ""}, {"name":
"morphology", "type": ["null", {"type": "array", "items": "string"}], "doc": ""}, {"name":
"readyForAnalysis", "type": "boolean", "doc": ""}, {"name": "consentStatus", "type": ["null",
{"type": "record", "name": "ConsentStatus", "doc": "", "fields": [{"name": "programmeConsent",
"type": "boolean", "doc": "", "default": false}, {"name": "primaryFindingConsent", "type":
"boolean", "doc": "", "default": false}, {"name": "secondaryFindingConsent", "type": "boolean",
"doc": "", "default": false}, {"name": "carrierStatusConsent", "type": "boolean", "doc": "",
"default": false}]}], "doc": ""}, {"name": "center", "type": ["null", "string"], "doc": ""},
{"name": "individualId", "type": "string", "doc": ""}, {"name": "primaryDiagnosisDisease", "type":
["null", {"type": "array", "items": "string"}], "doc": ""}, {"name": "primaryDiagnosisSubDisease",
"type": ["null", {"type": "array", "items": "string"}], "doc": ""}, {"name": "sex", "type": {"type":
"enum", "name": "Sex", "doc": "", "symbols": ["MALE", "FEMALE", "UNKNOWN"]}, "doc": ""}, {"name":
"additionalInformation", "type": ["null", {"type": "map", "values": "string"}], "doc": ""}, {"name":
"assignedICD10", "type": ["null", {"type": "array", "items": "string"}], "doc": ""}, {"name":
"tumourSamples", "type": {"type": "array", "items": {"type": "record", "name": "TumourSample",
"doc": "", "fields": [{"name": "sampleId", "type": "string", "doc": ""}, {"name": "labSampleId",
"type": "string", "doc": ""}, {"name": "LDPCode", "type": "string", "doc": ""}, {"name": "tumourId",
"type": "string", "doc": ""}, {"name": "programmePhase", "type": ["null", {"type": "enum", "name":
"ProgrammePhase", "symbols": ["CRUK", "OXFORD", "CLL", "IIP", "MAIN", "EXPT"]}], "doc": ""},
{"name": "diseaseType", "type": ["null", "string"], "doc": ""}, {"name": "diseaseSubType", "type":
["null", "string"], "doc": ""}, {"name": "clinicalSampleDateTime", "type": ["null", "string"],
"doc": ""}, {"name": "tumourType", "type": ["null", {"type": "enum", "name": "TumourType",
"symbols": ["PRIMARY", "METASTATIC_RECURRENCE", "RECURRENCE_OF_PRIMARY_TUMOUR", "METASTASES"]}],
"doc": ""}, {"name": "tumourContent", "type": ["null", {"type": "enum", "name": "TumourContent",
"symbols": ["High", "Medium", "Low"]}], "doc": ""}, {"name": "source", "type": ["null", {"type":
"enum", "name": "SampleSource", "doc": "", "symbols": ["TUMOUR",
"BONE_MARROW_ASPIRATE_TUMOUR_SORTED_CELLS", "BONE_MARROW_ASPIRATE_TUMOUR_CELLS", "BLOOD", "SALIVA",
"FIBROBLAST", "TISSUE"]}], "doc": ""}, {"name": "preparationMethod", "type": ["null", {"type":
"enum", "name": "PreparationMethod", "symbols": ["EDTA", "ORAGENE", "FF", "FFPE",
"CD128_SORTED_CELLS", "ASPIRATE"]}], "doc": ""}, {"name": "tissueSource", "type": ["null", {"type":
"enum", "name": "TissueSource", "symbols": ["BMA_TUMOUR_SORTED_CELLS", "CT_GUIDED_BIOPSY",
"ENDOSCOPIC_BIOPSY", "ENDOSCOPIC_ULTRASOUND_GUIDED_BIOPSY", "ENDOSCOPIC_ULTRASOUND_GUIDED_FNA",
"LAPAROSCOPIC_BIOPSY", "LAPAROSCOPIC_EXCISION", "MRI_GUIDED_BIOPSY", "NON_GUIDED_BIOPSY",
"SURGICAL_RESECTION", "STEREOTACTICALLY_GUIDED_BIOPSY", "USS_GUIDED_BIOPSY", "NON_STANDARD_BIOPSY",
"NOT_SPECIFIED"]}], "doc": ""}, {"name": "product", "type": ["null", {"type": "enum", "name":
"Product", "symbols": ["DNA", "RNA"]}], "doc": ""}, {"name": "morphologyICD", "type": ["null",
"string"], "doc": ""}, {"name": "morphologySnomedCT", "type": ["null", "string"], "doc": ""},
{"name": "morphologySnomedRT", "type": ["null", "string"], "doc": ""}, {"name": "topographyICD",
"type": ["null", "string"], "doc": ""}, {"name": "topographySnomedCT", "type": ["null", "string"],
"doc": ""}, {"name": "topographySnomedRT", "type": ["null", "string"], "doc": ""}]}}, "doc": ""},
{"name": "germlineSamples", "type": {"type": "array", "items": {"type": "record", "name":
"GermlineSample", "doc": "", "fields": [{"name": "sampleId", "type": "string", "doc": ""}, {"name":
"labSampleId", "type": "string", "doc": ""}, {"name": "LDPCode", "type": "string", "doc": ""},
{"name": "source", "type": ["null", "SampleSource"], "doc": ""}, {"name": "product", "type":
["null", "Product"], "doc": ""}, {"name": "preparationMethod", "type": ["null",
"PreparationMethod"], "doc": ""}, {"name": "programmePhase", "type": ["null", "ProgrammePhase"],
"doc": ""}, {"name": "clinicalSampleDateTime", "type": ["null", "string"], "doc": ""}]}}, "doc":
""}, {"name": "matchedSamples", "type": {"type": "array", "items": {"type": "record", "name":
"MatchedSamples", "doc": "", "fields": [{"name": "germlineSampleId", "type": ["null", "string"],
"doc": ""}, {"name": "tumourSampleId", "type": ["null", "string"], "doc": ""}]}}, "doc": ""},
{"name": "versionControl", "type": ["null", {"type": "record", "name": "VersionControl", "fields":
[{"name": "GitVersionControl", "type": "string", "doc": "", "default": "1.1.3"}]}], "doc": ""}]}
"""
    schema = avro_parse(_schemaSource)
    requiredFields = {
        "additionalInformation",
        "assignedICD10",
        "center",
        "consentStatus",
        "germlineSamples",
        "individualId",
        "matchedSamples",
        "morphology",
        "primaryDiagnosisDisease",
        "primaryDiagnosisSubDisease",
        "readyForAnalysis",
        "sex",
        "tumourSamples",
        "versionControl",
        "yearOfBirth",
    }

    @classmethod
    def isEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'consentStatus': ConsentStatus,
            'germlineSamples': GermlineSample,
            'matchedSamples': MatchedSamples,
            'tumourSamples': TumourSample,
            'versionControl': VersionControl,
        }
        return fieldName in embeddedTypes

    @classmethod
    def getEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'consentStatus': ConsentStatus,
            'germlineSamples': GermlineSample,
            'matchedSamples': MatchedSamples,
            'tumourSamples': TumourSample,
            'versionControl': VersionControl,
        }

        return embeddedTypes[fieldName]

    __slots__ = [
        'additionalInformation', 'assignedICD10', 'center',
        'consentStatus', 'germlineSamples', 'individualId',
        'matchedSamples', 'morphology', 'primaryDiagnosisDisease',
        'primaryDiagnosisSubDisease', 'readyForAnalysis', 'sex',
        'tumourSamples', 'versionControl', 'yearOfBirth'
    ]

    def __init__(self, **kwargs):
        self.additionalInformation = kwargs.get(
            'additionalInformation', None)
        self.assignedICD10 = kwargs.get(
            'assignedICD10', None)
        self.center = kwargs.get(
            'center', None)
        self.consentStatus = kwargs.get(
            'consentStatus', None)
        self.germlineSamples = kwargs.get(
            'germlineSamples', None)
        self.individualId = kwargs.get(
            'individualId', None)
        self.matchedSamples = kwargs.get(
            'matchedSamples', None)
        self.morphology = kwargs.get(
            'morphology', None)
        self.primaryDiagnosisDisease = kwargs.get(
            'primaryDiagnosisDisease', None)
        self.primaryDiagnosisSubDisease = kwargs.get(
            'primaryDiagnosisSubDisease', None)
        self.readyForAnalysis = kwargs.get(
            'readyForAnalysis', None)
        self.sex = kwargs.get(
            'sex', None)
        self.tumourSamples = kwargs.get(
            'tumourSamples', None)
        self.versionControl = kwargs.get(
            'versionControl', None)
        self.yearOfBirth = kwargs.get(
            'yearOfBirth', None)


class CancerPharmacogenomicsVariantLevelQuestions(ProtocolElement):
    """
    The questions for the cancer program exit questionnaire for PGX
    variants
    """
    _schemaSource = """
{"type": "record", "name": "CancerPharmacogenomicsVariantLevelQuestions", "namespace":
"org.gel.models.report.avro", "doc": "", "fields": [{"name": "variantCoordinates", "type": {"type":
"record", "name": "VariantCoordinates", "doc": "", "fields": [{"name": "chromosome", "type":
"string", "doc": ""}, {"name": "position", "type": "int", "doc": ""}, {"name": "reference", "type":
"string", "doc": ""}, {"name": "alternate", "type": "string", "doc": ""}, {"name": "assembly",
"type": {"type": "enum", "name": "Assembly", "doc": "", "symbols": ["GRCh38", "GRCh37"]}, "doc":
""}]}, "doc": ""}, {"name": "variantActionability", "type": {"type": "array", "items": {"type":
"enum", "name": "CancerActionabilityPharmacogenomics", "doc": "", "symbols":
["therapeutic_dosaging_or_toxicity_change"]}}, "doc": ""}, {"name": "variantUsability", "type":
{"type": "enum", "name": "CancerUsabilityPharmacogenomics", "doc": "", "symbols": ["change_dosing",
"alternative_therapeutic", "na"]}, "doc": ""}, {"name": "variantTested", "type": {"type": "enum",
"name": "CancerTested", "doc": "", "symbols": ["not_indicated_for_patient_care",
"no_orthologous_test_available", "test_performed_prior_to_wga",
"technical_validation_following_wga"]}, "doc": ""}, {"name": "validationAssayType", "type":
"string", "doc": ""}]}
"""
    schema = avro_parse(_schemaSource)
    requiredFields = {
        "validationAssayType",
        "variantActionability",
        "variantCoordinates",
        "variantTested",
        "variantUsability",
    }

    @classmethod
    def isEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'variantCoordinates': VariantCoordinates,
        }
        return fieldName in embeddedTypes

    @classmethod
    def getEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'variantCoordinates': VariantCoordinates,
        }

        return embeddedTypes[fieldName]

    __slots__ = [
        'validationAssayType', 'variantActionability',
        'variantCoordinates', 'variantTested', 'variantUsability'
    ]

    def __init__(self, **kwargs):
        self.validationAssayType = kwargs.get(
            'validationAssayType', None)
        self.variantActionability = kwargs.get(
            'variantActionability', None)
        self.variantCoordinates = kwargs.get(
            'variantCoordinates', VariantCoordinates())
        self.variantTested = kwargs.get(
            'variantTested', None)
        self.variantUsability = kwargs.get(
            'variantUsability', None)


class CancerSomaticVariantLevelQuestions(ProtocolElement):
    """
    The questions for the cancer program exit questionnaire for
    somatic variants
    """
    _schemaSource = """
{"type": "record", "name": "CancerSomaticVariantLevelQuestions", "namespace":
"org.gel.models.report.avro", "doc": "", "fields": [{"name": "variantCoordinates", "type": {"type":
"record", "name": "VariantCoordinates", "doc": "", "fields": [{"name": "chromosome", "type":
"string", "doc": ""}, {"name": "position", "type": "int", "doc": ""}, {"name": "reference", "type":
"string", "doc": ""}, {"name": "alternate", "type": "string", "doc": ""}, {"name": "assembly",
"type": {"type": "enum", "name": "Assembly", "doc": "", "symbols": ["GRCh38", "GRCh37"]}, "doc":
""}]}, "doc": ""}, {"name": "variantActionability", "type": {"type": "array", "items": {"type":
"enum", "name": "CancerActionabilitySomatic", "doc": "", "symbols":
["predicts_therapeutic_response", "prognostic", "defines_diagnosis_group", "eligibility_for_trial",
"other"]}}, "doc": ""}, {"name": "otherVariantActionability", "type": ["null", "string"], "doc":
""}, {"name": "variantUsability", "type": {"type": "enum", "name": "CancerUsabilitySomatic", "doc":
"", "symbols": ["already_actioned", "actioned_result_of_this_wga", "not_yet_actioned"]}, "doc": ""},
{"name": "variantTested", "type": {"type": "enum", "name": "CancerTested", "doc": "", "symbols":
["not_indicated_for_patient_care", "no_orthologous_test_available", "test_performed_prior_to_wga",
"technical_validation_following_wga"]}, "doc": ""}, {"name": "validationAssayType", "type":
"string", "doc": ""}]}
"""
    schema = avro_parse(_schemaSource)
    requiredFields = {
        "otherVariantActionability",
        "validationAssayType",
        "variantActionability",
        "variantCoordinates",
        "variantTested",
        "variantUsability",
    }

    @classmethod
    def isEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'variantCoordinates': VariantCoordinates,
        }
        return fieldName in embeddedTypes

    @classmethod
    def getEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'variantCoordinates': VariantCoordinates,
        }

        return embeddedTypes[fieldName]

    __slots__ = [
        'otherVariantActionability', 'validationAssayType',
        'variantActionability', 'variantCoordinates', 'variantTested',
        'variantUsability'
    ]

    def __init__(self, **kwargs):
        self.otherVariantActionability = kwargs.get(
            'otherVariantActionability', None)
        self.validationAssayType = kwargs.get(
            'validationAssayType', None)
        self.variantActionability = kwargs.get(
            'variantActionability', None)
        self.variantCoordinates = kwargs.get(
            'variantCoordinates', VariantCoordinates())
        self.variantTested = kwargs.get(
            'variantTested', None)
        self.variantUsability = kwargs.get(
            'variantUsability', None)


class CancerTested(object):
    """
    Was the variant validated with an orthogonal technology? *
    `not_indicated_for_patient_care`: No: not indicated for patient
    care at this time * `no_orthologous_test_available`: No: no
    orthologous test available * `test_performed_prior_to_wga`: Yes:
    test performed prior to receiving WGA (eg using standard-of-care
    assay such as panel testing, or sanger sequencing) *
    `technical_validation_following_WGA`: Yes: technical validation
    performed/planned following receiving this WGA
    """
    not_indicated_for_patient_care = "not_indicated_for_patient_care"
    no_orthologous_test_available = "no_orthologous_test_available"
    test_performed_prior_to_wga = "test_performed_prior_to_wga"
    technical_validation_following_wga = "technical_validation_following_wga"

    def __hash__(self):
        return str(self).__hash__()


class CancerTestedAdditional(object):
    """
    An enumeration Variant tested:       *
    `not_indicated_for_patient_care`: No: not indicated for patient
    care at this time       * `no_orthologous_test_available`: No: no
    orthologous test available       * `test_performed_prior_to_wga`:
    Yes: test performed prior to receiving WGA (eg using
    standard-of-care assay such as panel testing, or sanger
    sequencing)       * `technical_validation_following_wga`: Yes:
    technical validation performed/planned following receiving this
    WGA       * `na`: N/A
    """
    not_indicated_for_patient_care = "not_indicated_for_patient_care"
    no_orthologous_test_available = "no_orthologous_test_available"
    test_performed_prior_to_wga = "test_performed_prior_to_wga"
    technical_validation_following_wga = "technical_validation_following_wga"
    na = "na"

    def __hash__(self):
        return str(self).__hash__()


class CancerUsabilityGermline(object):
    """
    Variant usability for germline variants: * `already_actioned`:
    Already actioned (i.e. prior to receiving this WGA) *
    `actioned_result_of_this_wga`: actioned as a result of receiving
    this WGA
    """
    already_actioned = "already_actioned"
    actioned_result_of_this_wga = "actioned_result_of_this_wga"

    def __hash__(self):
        return str(self).__hash__()


class CancerUsabilityPharmacogenomics(object):
    """
    Variant usability for pgx variants:      * `change_dosing`: Change
    in therapeutic dosing - current or future *
    `alternative_therapeutic`: Alternative therapeutic chosen * `na`:
    Not applicable
    """
    change_dosing = "change_dosing"
    alternative_therapeutic = "alternative_therapeutic"
    na = "na"

    def __hash__(self):
        return str(self).__hash__()


class CancerUsabilitySomatic(object):
    """
    Variant usability for somatic variants: * `already_actioned`:
    Already actioned (i.e. prior to receiving this WGA) *
    `actioned_result_of_this_wga`: actioned as a result of receiving
    this WGA * `not_yet_actioned`: not yet actioned, but potentially
    actionable in the future
    """
    already_actioned = "already_actioned"
    actioned_result_of_this_wga = "actioned_result_of_this_wga"
    not_yet_actioned = "not_yet_actioned"

    def __hash__(self):
        return str(self).__hash__()


class CaseSolvedFamily(object):
    """
    No documentation
    """
    yes = "yes"
    no = "no"
    partially = "partially"
    unknown = "unknown"

    def __hash__(self):
        return str(self).__hash__()


class ChiSquare1KGenomesPhase3Pop(ProtocolElement):
    """
    Chi-square test for goodness of fit of this sample to 1000 Genomes
    Phase 3 populations
    """
    _schemaSource = """
{"type": "record", "name": "ChiSquare1KGenomesPhase3Pop", "namespace":
"org.gel.models.participant.avro", "doc": "", "fields": [{"name": "kgSuperPopCategory", "type":
{"type": "enum", "name": "KgSuperPopCategory", "doc": "", "symbols": ["AFR", "AMR", "EAS", "EUR",
"SAS"]}, "doc": ""}, {"name": "kgPopCategory", "type": ["null", {"type": "enum", "name":
"KgPopCategory", "doc": "", "symbols": ["ACB", "ASW", "BEB", "CDX", "CEU", "CHB", "CHS", "CLM",
"ESN", "FIN", "GBR", "GIH", "GWD", "IBS", "ITU", "JPT", "KHV", "LWK", "MSL", "MXL", "PEL", "PJL",
"PUR", "STU", "TSI", "YRI"]}], "doc": ""}, {"name": "chiSquare", "type": "double", "doc": ""}]}
"""
    schema = avro_parse(_schemaSource)
    requiredFields = {
        "chiSquare",
        "kgPopCategory",
        "kgSuperPopCategory",
    }

    @classmethod
    def isEmbeddedType(cls, fieldName):
        embeddedTypes = {}
        return fieldName in embeddedTypes

    @classmethod
    def getEmbeddedType(cls, fieldName):
        embeddedTypes = {}

        return embeddedTypes[fieldName]

    __slots__ = [
        'chiSquare', 'kgPopCategory', 'kgSuperPopCategory'
    ]

    def __init__(self, **kwargs):
        self.chiSquare = kwargs.get(
            'chiSquare', None)
        self.kgPopCategory = kwargs.get(
            'kgPopCategory', None)
        self.kgSuperPopCategory = kwargs.get(
            'kgSuperPopCategory', None)


class ChromosomalRearrangement(ProtocolElement):
    """
    No documentation
    """
    _schemaSource = """
{"type": "record", "name": "ChromosomalRearrangement", "namespace": "org.gel.models.report.avro",
"fields": [{"name": "breakPoints", "type": ["null", {"type": "array", "items": {"type": "record",
"name": "BreakPoint", "fields": [{"name": "coordinates", "type": {"type": "record", "name":
"Coordinates", "fields": [{"name": "assembly", "type": {"type": "enum", "name": "Assembly", "doc":
"", "symbols": ["GRCh38", "GRCh37"]}}, {"name": "chromosome", "type": "string"}, {"name": "start",
"type": "int"}, {"name": "end", "type": "int"}, {"name": "ciStart", "type": ["null", {"type":
"record", "name": "ConfidenceInterval", "fields": [{"name": "left", "type": "int"}, {"name":
"right", "type": "int"}]}]}, {"name": "ciEnd", "type": ["null", "ConfidenceInterval"]}]}}, {"name":
"reference", "type": ["null", "string"]}, {"name": "alternate", "type": ["null", "string"]},
{"name": "info", "type": ["null", {"type": "map", "values": "string"}]}]}}]}, {"name":
"rearrangements", "type": {"type": "array", "items": {"type": "record", "name": "Rearrangement",
"fields": [{"name": "leftCoordinates", "type": "Coordinates"}, {"name": "rightCoordinates", "type":
"Coordinates"}, {"name": "orientation", "type": {"type": "enum", "name": "Orientation", "symbols":
["start_start", "start_end", "end_end"]}}, {"name": "leftInsSeq", "type": ["null", "string"]},
{"name": "rightInsSeq", "type": ["null", "string"]}]}}}, {"name": "reportEvents", "type": {"type":
"array", "items": {"type": "record", "name": "ReportEvent", "doc": "", "fields": [{"name":
"reportEventId", "type": "string", "doc": ""}, {"name": "phenotypes", "type": {"type": "record",
"name": "Phenotypes", "doc": "", "fields": [{"name": "nonStandardPhenotype", "type": ["null",
{"type": "array", "items": "string"}], "doc": ""}, {"name": "standardPhenotypes", "type": ["null",
{"type": "array", "items": {"type": "record", "name": "StandardPhenotype", "doc": "", "fields":
[{"name": "id", "type": "string"}, {"name": "name", "type": ["null", "string"]}, {"name":
"namespace", "type": ["null", "string"]}, {"name": "definition", "type": ["null", "string"]},
{"name": "comment", "type": ["null", "string"]}, {"name": "alternativeIds", "type": ["null",
"string"]}, {"name": "synonyms", "type": ["null", "string"]}, {"name": "isA", "type": ["null",
"string"]}, {"name": "ontology", "type": {"type": "record", "name": "Ontology", "doc": "", "fields":
[{"name": "name", "type": "string"}, {"name": "version", "type": "string"}]}, "doc": ""}, {"name":
"matchScore", "type": ["null", "float"], "doc": ""}]}}], "doc": ""}]}, "doc": ""}, {"name":
"variantConsequences", "type": {"type": "array", "items": {"type": "record", "name":
"VariantConsequence", "doc": "", "fields": [{"name": "id", "type": "string", "doc": ""}, {"name":
"name", "type": ["null", "string"], "doc": ""}]}}, "doc": ""}, {"name": "genePanel", "type":
["null", {"type": "record", "name": "GenePanel", "doc": "", "fields": [{"name": "panelIdentifier",
"type": ["null", "string"], "doc": ""}, {"name": "panelName", "type": ["null", "string"], "doc":
""}, {"name": "panelVersion", "type": ["null", "string"], "doc": ""}, {"name": "source", "type":
["null", "string"], "doc": ""}]}], "doc": ""}, {"name": "modeOfInheritance", "type": {"type":
"enum", "name": "ModeOfInheritance", "doc": "", "symbols": ["monoallelic",
"monoallelic_not_imprinted", "monoallelic_maternally_imprinted", "monoallelic_paternally_imprinted",
"biallelic", "monoallelic_and_biallelic", "monoallelic_and_more_severe_biallelic",
"xlinked_biallelic", "xlinked_monoallelic", "mitochondrial", "unknown", "na"]}, "doc": ""}, {"name":
"genomicEntities", "type": {"type": "array", "items": {"type": "record", "name": "GenomicEntity",
"doc": "", "fields": [{"name": "type", "type": {"type": "enum", "name": "GenomicEntityType", "doc":
"", "symbols": ["regulatory_region", "gene", "transcript", "intergenic", "gene_fusion",
"genomic_region", "cytobands"]}, "doc": ""}, {"name": "ensemblId", "type": ["null", "string"],
"doc": ""}, {"name": "geneSymbol", "type": ["null", "string"], "doc": ""}, {"name": "otherIds",
"type": ["null", {"type": "array", "items": {"type": "record", "name": "Identifier", "fields":
[{"name": "source", "type": "string", "doc": ""}, {"name": "identifier", "type": "string", "doc":
""}]}}], "doc": ""}]}}, "doc": ""}, {"name": "segregationPattern", "type": ["null", {"type": "enum",
"name": "SegregationPattern", "symbols": ["UniparentalIsodisomy", "SimpleRecessive",
"CompoundHeterozygous", "deNovo", "InheritedAutosomalDominant",
"InheritedAutosomalDominantMaternallyImprinted", "InheritedAutosomalDominantPaternallyImprinted",
"XLinkedCompoundHeterozygous", "XLinkedSimpleRecessive", "XLinkedMonoallelic",
"MitochondrialGenome"]}], "doc": ""}, {"name": "penetrance", "type": ["null", {"type": "enum",
"name": "Penetrance", "namespace": "org.gel.models.participant.avro", "doc": "", "symbols":
["complete", "incomplete"]}], "doc": ""}, {"name": "deNovoQualityScore", "type": ["null", "float"],
"doc": ""}, {"name": "fullyExplainsPhenotype", "type": ["null", "boolean"], "doc": ""}, {"name":
"groupOfVariants", "type": ["null", "int"], "doc": ""}, {"name": "eventJustification", "type":
["null", "string"], "doc": ""}, {"name": "roleInCancer", "type": ["null", {"type": "array", "items":
{"type": "enum", "name": "RoleInCancer", "doc": "", "symbols": ["oncogene", "tumor_suppressor_gene",
"both"]}}], "doc": ""}, {"name": "actions", "type": ["null", {"type": "record", "name": "Actions",
"doc": "", "fields": [{"name": "trials", "type": ["null", {"type": "array", "items": {"type":
"record", "name": "Trial", "fields": [{"name": "studyUrl", "type": "string", "doc": ""}, {"name":
"studyIdentifier", "type": "string", "doc": ""}, {"name": "startDate", "type": ["null", "string"],
"doc": ""}, {"name": "estimateCompletionDate", "type": ["null", "string"], "doc": ""}, {"name":
"title", "type": ["null", "string"], "doc": ""}, {"name": "phase", "type": ["null", {"type": "enum",
"name": "StudyPhase", "doc": "", "symbols": ["na", "early_phase1", "phase1", "phase1_phase2",
"phase2", "phase2_phase3", "phase3", "phase4"]}], "doc": ""}, {"name": "interventions", "type":
["null", {"type": "array", "items": {"type": "record", "name": "Intervention", "doc": "", "fields":
[{"name": "interventionType", "type": {"type": "enum", "name": "InterventionType", "doc": "",
"symbols": ["drug", "device", "procedure", "biological", "radiation", "behavioral", "genetic",
"dietary_supplement", "combination_product", "diagnostic_test", "other"]}, "doc": ""}, {"name":
"interventionName", "type": "string", "doc": ""}]}}], "doc": ""}, {"name": "conditions", "type":
["null", {"type": "array", "items": "string"}], "doc": ""}, {"name": "primaryPurpose", "type":
["null", {"type": "enum", "name": "PrimaryPurpose", "doc": "", "symbols": ["treatment",
"prevention", "diagnostic", "supportive_care", "screening", "health_services_research",
"basic_science", "device_feasibility", "other"]}], "doc": ""}, {"name": "studyType", "type":
["null", {"type": "enum", "name": "StudyType", "doc": "", "symbols": ["interventional",
"observational", "patient_registry", "expanded_access"]}], "doc": ""}, {"name":
"demogrphicElegibilityCriteria", "type": ["null", {"type": "record", "name":
"DemographicElegibilityCriteria", "fields": [{"name": "sex", "type": {"type": "enum", "name": "Sex",
"namespace": "org.gel.models.participant.avro", "doc": "", "symbols": ["MALE", "FEMALE",
"UNKNOWN"]}}, {"name": "ageRange", "type": ["null", {"type": "record", "name": "AgeRange", "fields":
[{"name": "minimumAge", "type": "int"}, {"name": "maximumAge", "type": "int"}, {"name": "timeunit",
"type": {"type": "enum", "name": "TimeUnit", "symbols": ["years", "months", "weeks", "days",
"hours", "minutes", "na"]}}]}]}]}], "doc": ""}, {"name": "locations", "type": ["null", {"type":
"array", "items": {"type": "record", "name": "TrialLocation", "fields": [{"name": "name", "type":
["null", "string"]}, {"name": "city", "type": ["null", "string"]}, {"name": "country", "type":
["null", "string"]}, {"name": "zip", "type": ["null", "string"]}]}}], "doc": ""}, {"name":
"variantActionable", "type": "boolean", "doc": ""}]}}]}, {"name": "prognosis", "type": ["null",
{"type": "array", "items": {"type": "record", "name": "Prognosis", "fields": [{"name":
"referenceUrl", "type": "string", "doc": ""}, {"name": "prognosis", "type": ["null", {"type":
"enum", "name": "PrognosisClassification", "symbols": ["altered_prognosis", "favourable_prognosis",
"unfavourable_prognosis"]}], "doc": ""}, {"name": "source", "type": ["null", "string"], "doc": ""},
{"name": "references", "type": ["null", {"type": "array", "items": "string"}], "doc": ""}, {"name":
"conditions", "type": ["null", {"type": "array", "items": "string"}], "doc": ""}, {"name":
"description", "type": ["null", "string"], "doc": ""}, {"name": "variantActionable", "type":
"boolean", "doc": ""}]}}]}, {"name": "therapies", "type": ["null", {"type": "array", "items":
{"type": "record", "name": "Therapy", "fields": [{"name": "referenceUrl", "type": "string", "doc":
""}, {"name": "source", "type": ["null", "string"], "doc": ""}, {"name": "references", "type":
["null", {"type": "array", "items": "string"}], "doc": ""}, {"name": "conditions", "type": ["null",
{"type": "array", "items": "string"}], "doc": ""}, {"name": "drugResponse", "type": ["null",
{"type": "array", "items": {"type": "record", "name": "DrugResponse", "fields": [{"name":
"TreatmentAgent", "type": "string", "doc": ""}, {"name": "drugResponseClassification", "type":
{"type": "enum", "name": "DrugResponseClassification", "symbols": ["altered_sensitivity",
"reduced_sensitivity", "increased_sensitivity", "altered_resistance", "increased_resistance",
"reduced_resistance", "increased_risk_of_toxicity", "reduced_risk_of_toxicity", "altered_toxicity",
"adverse_drug_reaction", "indication", "contraindication", "dosing_alteration", "increased_dose",
"reduced_dose", "increased_monitoring", "increased_efficacy", "reduced_efficacy",
"altered_efficacy"]}, "doc": ""}]}}], "doc": ""}, {"name": "otherInterventions", "type": ["null",
{"type": "array", "items": "Intervention"}], "doc": ""}, {"name": "variantActionable", "type":
"boolean", "doc": ""}]}}]}]}], "doc": ""}, {"name": "score", "type": ["null", "float"], "doc": ""},
{"name": "vendorSpecificScores", "type": ["null", {"type": "map", "values": "float"}], "doc": ""},
{"name": "variantClassification", "type": ["null", {"type": "record", "name":
"VariantClassification", "doc": "", "fields": [{"name": "clinicalSignificance", "type": ["null",
{"type": "enum", "name": "ClinicalSignificance", "symbols": ["benign", "likely_benign",
"likely_pathogenic", "pathogenic", "uncertain_significance"]}], "doc": ""}, {"name":
"drugResponseClassification", "type": ["null", "DrugResponseClassification"], "doc": ""}, {"name":
"traitAssociation", "type": ["null", {"type": "enum", "name": "TraitAssociation", "symbols":
["established_risk_allele", "likely_risk_allele", "uncertain_risk_allele", "protective"]}], "doc":
""}, {"name": "tumorigenesisClassification", "type": ["null", {"type": "enum", "name":
"TumorigenesisClassification", "symbols": ["driver", "passenger", "modifier"]}], "doc": ""},
{"name": "functionalEffect", "type": ["null", {"type": "enum", "name": "VariantFunctionalEffect",
"symbols": ["dominant_negative_variant", "gain_of_function_variant", "lethal_variant",
"loss_of_function_variant", "loss_of_heterozygosity", "null_variant"]}], "doc": ""}]}], "doc": ""},
{"name": "guidelineBasedVariantClassification", "type": ["null", {"type": "record", "name":
"GuidelineBasedVariantClassification", "doc": "", "fields": [{"name": "acmgVariantClassification",
"type": ["null", {"type": "record", "name": "AcmgVariantClassification", "doc": "", "fields":
[{"name": "acmgEvidences", "type": {"type": "array", "items": {"type": "record", "name":
"AcmgEvidence", "doc": "", "fields": [{"name": "category", "type": {"type": "enum", "name":
"AcmgEvidenceCategory", "doc": "", "symbols": ["population_data",
"computational_and_predictive_data", "functional_data", "segregation_data", "de_novo_data",
"allelic_data", "other_database", "other_data"]}, "doc": ""}, {"name": "type", "type": {"type":
"enum", "name": "AcmgEvidenceType", "doc": "", "symbols": ["bening", "pathogenic"]}, "doc": ""},
{"name": "weight", "type": {"type": "enum", "name": "AcmgEvidenceWeight", "doc": "", "symbols":
["stand_alone", "supporting", "moderate", "strong", "very_strong"]}, "doc": ""}, {"name":
"modifier", "type": "int", "doc": ""}, {"name": "description", "type": ["null", "string"], "doc":
""}]}}}, {"name": "clinicalSignificance", "type": "ClinicalSignificance"}, {"name": "assessment",
"type": ["null", "string"]}]}]}, {"name": "ampVariantClassification", "type": ["null", {"type":
"record", "name": "AmpVariantClassification", "doc": "", "fields": [{"name": "ampEvidences", "type":
{"type": "array", "items": {"type": "record", "name": "AmpEvidence", "doc": "", "fields": [{"name":
"type", "type": {"type": "enum", "name": "AmpEvidenceType", "doc": "", "symbols": ["mutation_type",
"therapies", "variant_frequencies", "potential_germline", "population_database_presence",
"germline_database_presence", "somatic_database_presence", "impact_predictive_software",
"pathway_involvement", "publications"]}, "doc": ""}, {"name": "evidenceAssessment", "type":
"string", "doc": ""}]}}, "doc": ""}, {"name": "ampTier", "type": {"type": "enum", "name": "AmpTier",
"doc": "", "symbols": ["tierI", "tierII", "tierIII", "tierIV"]}, "doc": ""}, {"name":
"ampClincialOrExperimentalEvidence", "type": ["null", {"type": "array", "items": {"type": "record",
"name": "AmpClincialOrExperimentalEvidence", "doc": "", "fields": [{"name": "category", "type":
{"type": "enum", "name": "AmpClinicalOrExperimentalEvidenceCategory", "doc": "", "symbols":
["therapeutic", "diagnosis", "prognosis"]}, "doc": ""}, {"name": "level", "type": {"type": "enum",
"name": "AmpClinicalOrExperimentalEvidenceLevel", "doc": "", "symbols": ["levelA", "levelB",
"levelC", "levelD"]}, "doc": ""}, {"name": "description", "type": ["null", "string"], "doc":
""}]}}], "doc": ""}, {"name": "assessment", "type": ["null", "string"], "doc": ""}]}]}]}], "doc":
""}, {"name": "algorithmBasedVariantClassifications", "type": ["null", {"type": "array", "items":
{"type": "record", "name": "AlgorithmBasedVariantClassification", "fields": [{"name":
"algorithmName", "type": "string", "doc": ""}, {"name": "classification", "type": "string", "doc":
""}, {"name": "rank", "type": ["null", "int"], "doc": ""}, {"name": "score", "type": ["null",
"int"], "doc": ""}]}}], "doc": ""}, {"name": "tier", "type": ["null", {"type": "enum", "name":
"Tier", "doc": "", "symbols": ["NONE", "TIER1", "TIER2", "TIER3", "TIER4", "TIER5", "TIERA",
"TIERB"]}], "doc": ""}, {"name": "domain", "type": ["null", {"type": "enum", "name": "Domain",
"symbols": ["DOMAIN1", "DOMAIN2", "DOMAIN3", "DOMAIN4", "NONE"]}], "doc": ""}]}}}, {"name":
"variantCalls", "type": {"type": "array", "items": {"type": "record", "name": "VariantCall", "doc":
"", "fields": [{"name": "participantId", "type": "string", "doc": ""}, {"name": "sampleId", "type":
"string", "doc": ""}, {"name": "zygosity", "type": {"type": "enum", "name": "Zygosity", "doc": "",
"symbols": ["reference_homozygous", "heterozygous", "alternate_homozygous", "missing",
"half_missing_reference", "half_missing_alternate", "alternate_hemizigous", "reference_hemizigous",
"unk", "na"]}, "doc": ""}, {"name": "phaseGenotype", "type": ["null", {"type": "record", "name":
"PhaseGenotype", "fields": [{"name": "sortedAlleles", "type": {"type": "array", "items": "string"}},
{"name": "phaseSet", "type": "int"}]}], "doc": ""}, {"name": "sampleVariantAlleleFrequency", "type":
["null", "double"], "doc": ""}, {"name": "depthReference", "type": ["null", "int"], "doc": ""},
{"name": "depthAlternate", "type": ["null", "int"], "doc": ""}, {"name": "numberOfCopies", "type":
["null", {"type": "array", "items": {"type": "record", "name": "NumberOfCopies", "fields": [{"name":
"numberOfCopies", "type": "int", "doc": ""}, {"name": "confidenceIntervalMaximum", "type": ["null",
"int"]}, {"name": "confidenceIntervalMinimum", "type": ["null", "int"]}]}}], "doc": ""}, {"name":
"alleleOrigins", "type": ["null", {"type": "array", "items": {"type": "enum", "name":
"AlleleOrigin", "doc": "", "symbols": ["de_novo_variant", "germline_variant", "maternal_variant",
"paternal_variant", "pedigree_specific_variant", "population_specific_variant",
"somatic_variant"]}}], "doc": ""}, {"name": "supportingReadTypes", "type": ["null", {"type":
"array", "items": {"type": "enum", "name": "SupportingReadType", "symbols": ["spanning", "flanking",
"inrepeat"]}}]}]}}, "doc": ""}, {"name": "variantAttributes", "type": ["null", {"type": "record",
"name": "VariantAttributes", "doc": "", "fields": [{"name": "genomicChanges", "type": ["null",
{"type": "array", "items": "string"}], "doc": ""}, {"name": "cdnaChanges", "type": ["null", {"type":
"array", "items": "string"}], "doc": ""}, {"name": "proteinChanges", "type": ["null", {"type":
"array", "items": "string"}], "doc": ""}, {"name": "additionalTextualVariantAnnotations", "type":
["null", {"type": "map", "values": "string"}], "doc": ""}, {"name": "references", "type": ["null",
{"type": "map", "values": "string"}], "doc": ""}, {"name": "variantIdentifiers", "type": ["null",
{"type": "record", "name": "VariantIdentifiers", "fields": [{"name": "dbSnpId", "type": ["null",
"string"], "doc": ""}, {"name": "cosmicIds", "type": ["null", {"type": "array", "items": "string"}],
"doc": ""}, {"name": "clinVarIds", "type": ["null", {"type": "array", "items": "string"}], "doc":
""}, {"name": "otherIds", "type": ["null", {"type": "array", "items": "Identifier"}]}]}]}, {"name":
"alleleFrequencies", "type": ["null", {"type": "array", "items": {"type": "record", "name":
"AlleleFrequency", "doc": "", "fields": [{"name": "study", "type": "string", "doc": ""}, {"name":
"population", "type": "string", "doc": ""}, {"name": "alternateFrequency", "type": "float", "doc":
""}]}}], "doc": ""}, {"name": "additionalNumericVariantAnnotations", "type": ["null", {"type":
"map", "values": "float"}], "doc": ""}, {"name": "comments", "type": ["null", {"type": "array",
"items": "string"}], "doc": ""}, {"name": "alleleOrigins", "type": ["null", {"type": "array",
"items": "AlleleOrigin"}], "doc": ""}, {"name": "ihp", "type": ["null", "int"], "doc": ""}, {"name":
"recurrentlyReported", "type": ["null", "boolean"], "doc": ""}, {"name": "fdp50", "type": ["null",
"float"], "doc": ""}, {"name": "others", "type": ["null", {"type": "map", "values": "string"}],
"doc": ""}]}]}]}
"""
    schema = avro_parse(_schemaSource)
    requiredFields = {
        "breakPoints",
        "rearrangements",
        "reportEvents",
        "variantAttributes",
        "variantCalls",
    }

    @classmethod
    def isEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'breakPoints': BreakPoint,
            'rearrangements': Rearrangement,
            'reportEvents': ReportEvent,
            'variantAttributes': VariantAttributes,
            'variantCalls': VariantCall,
        }
        return fieldName in embeddedTypes

    @classmethod
    def getEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'breakPoints': BreakPoint,
            'rearrangements': Rearrangement,
            'reportEvents': ReportEvent,
            'variantAttributes': VariantAttributes,
            'variantCalls': VariantCall,
        }

        return embeddedTypes[fieldName]

    __slots__ = [
        'breakPoints', 'rearrangements', 'reportEvents',
        'variantAttributes', 'variantCalls'
    ]

    def __init__(self, **kwargs):
        self.breakPoints = kwargs.get(
            'breakPoints', None)
        self.rearrangements = kwargs.get(
            'rearrangements', None)
        self.reportEvents = kwargs.get(
            'reportEvents', None)
        self.variantAttributes = kwargs.get(
            'variantAttributes', None)
        self.variantCalls = kwargs.get(
            'variantCalls', None)


class ClinicalReport(ProtocolElement):
    """
    A clinical report. This holds the list of reported variants by an
    expert together with all     the relevant information that
    identify the case and how these conclusions were reached.
    """
    _schemaSource = """
{"type": "record", "name": "ClinicalReport", "namespace": "org.gel.models.report.avro", "doc": "",
"fields": [{"name": "interpretationRequestId", "type": "string", "doc": ""}, {"name":
"interpretationRequestVersion", "type": "int", "doc": ""}, {"name": "reportingDate", "type":
"string", "doc": ""}, {"name": "user", "type": "string", "doc": ""}, {"name": "variants", "type":
["null", {"type": "array", "items": {"type": "record", "name": "SmallVariant", "doc": "", "fields":
[{"name": "variantCoordinates", "type": {"type": "record", "name": "VariantCoordinates", "doc": "",
"fields": [{"name": "chromosome", "type": "string", "doc": ""}, {"name": "position", "type": "int",
"doc": ""}, {"name": "reference", "type": "string", "doc": ""}, {"name": "alternate", "type":
"string", "doc": ""}, {"name": "assembly", "type": {"type": "enum", "name": "Assembly", "doc": "",
"symbols": ["GRCh38", "GRCh37"]}, "doc": ""}]}, "doc": ""}, {"name": "variantCalls", "type":
{"type": "array", "items": {"type": "record", "name": "VariantCall", "doc": "", "fields": [{"name":
"participantId", "type": "string", "doc": ""}, {"name": "sampleId", "type": "string", "doc": ""},
{"name": "zygosity", "type": {"type": "enum", "name": "Zygosity", "doc": "", "symbols":
["reference_homozygous", "heterozygous", "alternate_homozygous", "missing",
"half_missing_reference", "half_missing_alternate", "alternate_hemizigous", "reference_hemizigous",
"unk", "na"]}, "doc": ""}, {"name": "phaseGenotype", "type": ["null", {"type": "record", "name":
"PhaseGenotype", "fields": [{"name": "sortedAlleles", "type": {"type": "array", "items": "string"}},
{"name": "phaseSet", "type": "int"}]}], "doc": ""}, {"name": "sampleVariantAlleleFrequency", "type":
["null", "double"], "doc": ""}, {"name": "depthReference", "type": ["null", "int"], "doc": ""},
{"name": "depthAlternate", "type": ["null", "int"], "doc": ""}, {"name": "numberOfCopies", "type":
["null", {"type": "array", "items": {"type": "record", "name": "NumberOfCopies", "fields": [{"name":
"numberOfCopies", "type": "int", "doc": ""}, {"name": "confidenceIntervalMaximum", "type": ["null",
"int"]}, {"name": "confidenceIntervalMinimum", "type": ["null", "int"]}]}}], "doc": ""}, {"name":
"alleleOrigins", "type": ["null", {"type": "array", "items": {"type": "enum", "name":
"AlleleOrigin", "doc": "", "symbols": ["de_novo_variant", "germline_variant", "maternal_variant",
"paternal_variant", "pedigree_specific_variant", "population_specific_variant",
"somatic_variant"]}}], "doc": ""}, {"name": "supportingReadTypes", "type": ["null", {"type":
"array", "items": {"type": "enum", "name": "SupportingReadType", "symbols": ["spanning", "flanking",
"inrepeat"]}}]}]}}, "doc": ""}, {"name": "reportEvents", "type": {"type": "array", "items": {"type":
"record", "name": "ReportEvent", "doc": "", "fields": [{"name": "reportEventId", "type": "string",
"doc": ""}, {"name": "phenotypes", "type": {"type": "record", "name": "Phenotypes", "doc": "",
"fields": [{"name": "nonStandardPhenotype", "type": ["null", {"type": "array", "items": "string"}],
"doc": ""}, {"name": "standardPhenotypes", "type": ["null", {"type": "array", "items": {"type":
"record", "name": "StandardPhenotype", "doc": "", "fields": [{"name": "id", "type": "string"},
{"name": "name", "type": ["null", "string"]}, {"name": "namespace", "type": ["null", "string"]},
{"name": "definition", "type": ["null", "string"]}, {"name": "comment", "type": ["null", "string"]},
{"name": "alternativeIds", "type": ["null", "string"]}, {"name": "synonyms", "type": ["null",
"string"]}, {"name": "isA", "type": ["null", "string"]}, {"name": "ontology", "type": {"type":
"record", "name": "Ontology", "doc": "", "fields": [{"name": "name", "type": "string"}, {"name":
"version", "type": "string"}]}, "doc": ""}, {"name": "matchScore", "type": ["null", "float"], "doc":
""}]}}], "doc": ""}]}, "doc": ""}, {"name": "variantConsequences", "type": {"type": "array",
"items": {"type": "record", "name": "VariantConsequence", "doc": "", "fields": [{"name": "id",
"type": "string", "doc": ""}, {"name": "name", "type": ["null", "string"], "doc": ""}]}}, "doc":
""}, {"name": "genePanel", "type": ["null", {"type": "record", "name": "GenePanel", "doc": "",
"fields": [{"name": "panelIdentifier", "type": ["null", "string"], "doc": ""}, {"name": "panelName",
"type": ["null", "string"], "doc": ""}, {"name": "panelVersion", "type": ["null", "string"], "doc":
""}, {"name": "source", "type": ["null", "string"], "doc": ""}]}], "doc": ""}, {"name":
"modeOfInheritance", "type": {"type": "enum", "name": "ModeOfInheritance", "doc": "", "symbols":
["monoallelic", "monoallelic_not_imprinted", "monoallelic_maternally_imprinted",
"monoallelic_paternally_imprinted", "biallelic", "monoallelic_and_biallelic",
"monoallelic_and_more_severe_biallelic", "xlinked_biallelic", "xlinked_monoallelic",
"mitochondrial", "unknown", "na"]}, "doc": ""}, {"name": "genomicEntities", "type": {"type":
"array", "items": {"type": "record", "name": "GenomicEntity", "doc": "", "fields": [{"name": "type",
"type": {"type": "enum", "name": "GenomicEntityType", "doc": "", "symbols": ["regulatory_region",
"gene", "transcript", "intergenic", "gene_fusion", "genomic_region", "cytobands"]}, "doc": ""},
{"name": "ensemblId", "type": ["null", "string"], "doc": ""}, {"name": "geneSymbol", "type":
["null", "string"], "doc": ""}, {"name": "otherIds", "type": ["null", {"type": "array", "items":
{"type": "record", "name": "Identifier", "fields": [{"name": "source", "type": "string", "doc": ""},
{"name": "identifier", "type": "string", "doc": ""}]}}], "doc": ""}]}}, "doc": ""}, {"name":
"segregationPattern", "type": ["null", {"type": "enum", "name": "SegregationPattern", "symbols":
["UniparentalIsodisomy", "SimpleRecessive", "CompoundHeterozygous", "deNovo",
"InheritedAutosomalDominant", "InheritedAutosomalDominantMaternallyImprinted",
"InheritedAutosomalDominantPaternallyImprinted", "XLinkedCompoundHeterozygous",
"XLinkedSimpleRecessive", "XLinkedMonoallelic", "MitochondrialGenome"]}], "doc": ""}, {"name":
"penetrance", "type": ["null", {"type": "enum", "name": "Penetrance", "namespace":
"org.gel.models.participant.avro", "doc": "", "symbols": ["complete", "incomplete"]}], "doc": ""},
{"name": "deNovoQualityScore", "type": ["null", "float"], "doc": ""}, {"name":
"fullyExplainsPhenotype", "type": ["null", "boolean"], "doc": ""}, {"name": "groupOfVariants",
"type": ["null", "int"], "doc": ""}, {"name": "eventJustification", "type": ["null", "string"],
"doc": ""}, {"name": "roleInCancer", "type": ["null", {"type": "array", "items": {"type": "enum",
"name": "RoleInCancer", "doc": "", "symbols": ["oncogene", "tumor_suppressor_gene", "both"]}}],
"doc": ""}, {"name": "actions", "type": ["null", {"type": "record", "name": "Actions", "doc": "",
"fields": [{"name": "trials", "type": ["null", {"type": "array", "items": {"type": "record", "name":
"Trial", "fields": [{"name": "studyUrl", "type": "string", "doc": ""}, {"name": "studyIdentifier",
"type": "string", "doc": ""}, {"name": "startDate", "type": ["null", "string"], "doc": ""}, {"name":
"estimateCompletionDate", "type": ["null", "string"], "doc": ""}, {"name": "title", "type": ["null",
"string"], "doc": ""}, {"name": "phase", "type": ["null", {"type": "enum", "name": "StudyPhase",
"doc": "", "symbols": ["na", "early_phase1", "phase1", "phase1_phase2", "phase2", "phase2_phase3",
"phase3", "phase4"]}], "doc": ""}, {"name": "interventions", "type": ["null", {"type": "array",
"items": {"type": "record", "name": "Intervention", "doc": "", "fields": [{"name":
"interventionType", "type": {"type": "enum", "name": "InterventionType", "doc": "", "symbols":
["drug", "device", "procedure", "biological", "radiation", "behavioral", "genetic",
"dietary_supplement", "combination_product", "diagnostic_test", "other"]}, "doc": ""}, {"name":
"interventionName", "type": "string", "doc": ""}]}}], "doc": ""}, {"name": "conditions", "type":
["null", {"type": "array", "items": "string"}], "doc": ""}, {"name": "primaryPurpose", "type":
["null", {"type": "enum", "name": "PrimaryPurpose", "doc": "", "symbols": ["treatment",
"prevention", "diagnostic", "supportive_care", "screening", "health_services_research",
"basic_science", "device_feasibility", "other"]}], "doc": ""}, {"name": "studyType", "type":
["null", {"type": "enum", "name": "StudyType", "doc": "", "symbols": ["interventional",
"observational", "patient_registry", "expanded_access"]}], "doc": ""}, {"name":
"demogrphicElegibilityCriteria", "type": ["null", {"type": "record", "name":
"DemographicElegibilityCriteria", "fields": [{"name": "sex", "type": {"type": "enum", "name": "Sex",
"namespace": "org.gel.models.participant.avro", "doc": "", "symbols": ["MALE", "FEMALE",
"UNKNOWN"]}}, {"name": "ageRange", "type": ["null", {"type": "record", "name": "AgeRange", "fields":
[{"name": "minimumAge", "type": "int"}, {"name": "maximumAge", "type": "int"}, {"name": "timeunit",
"type": {"type": "enum", "name": "TimeUnit", "symbols": ["years", "months", "weeks", "days",
"hours", "minutes", "na"]}}]}]}]}], "doc": ""}, {"name": "locations", "type": ["null", {"type":
"array", "items": {"type": "record", "name": "TrialLocation", "fields": [{"name": "name", "type":
["null", "string"]}, {"name": "city", "type": ["null", "string"]}, {"name": "country", "type":
["null", "string"]}, {"name": "zip", "type": ["null", "string"]}]}}], "doc": ""}, {"name":
"variantActionable", "type": "boolean", "doc": ""}]}}]}, {"name": "prognosis", "type": ["null",
{"type": "array", "items": {"type": "record", "name": "Prognosis", "fields": [{"name":
"referenceUrl", "type": "string", "doc": ""}, {"name": "prognosis", "type": ["null", {"type":
"enum", "name": "PrognosisClassification", "symbols": ["altered_prognosis", "favourable_prognosis",
"unfavourable_prognosis"]}], "doc": ""}, {"name": "source", "type": ["null", "string"], "doc": ""},
{"name": "references", "type": ["null", {"type": "array", "items": "string"}], "doc": ""}, {"name":
"conditions", "type": ["null", {"type": "array", "items": "string"}], "doc": ""}, {"name":
"description", "type": ["null", "string"], "doc": ""}, {"name": "variantActionable", "type":
"boolean", "doc": ""}]}}]}, {"name": "therapies", "type": ["null", {"type": "array", "items":
{"type": "record", "name": "Therapy", "fields": [{"name": "referenceUrl", "type": "string", "doc":
""}, {"name": "source", "type": ["null", "string"], "doc": ""}, {"name": "references", "type":
["null", {"type": "array", "items": "string"}], "doc": ""}, {"name": "conditions", "type": ["null",
{"type": "array", "items": "string"}], "doc": ""}, {"name": "drugResponse", "type": ["null",
{"type": "array", "items": {"type": "record", "name": "DrugResponse", "fields": [{"name":
"TreatmentAgent", "type": "string", "doc": ""}, {"name": "drugResponseClassification", "type":
{"type": "enum", "name": "DrugResponseClassification", "symbols": ["altered_sensitivity",
"reduced_sensitivity", "increased_sensitivity", "altered_resistance", "increased_resistance",
"reduced_resistance", "increased_risk_of_toxicity", "reduced_risk_of_toxicity", "altered_toxicity",
"adverse_drug_reaction", "indication", "contraindication", "dosing_alteration", "increased_dose",
"reduced_dose", "increased_monitoring", "increased_efficacy", "reduced_efficacy",
"altered_efficacy"]}, "doc": ""}]}}], "doc": ""}, {"name": "otherInterventions", "type": ["null",
{"type": "array", "items": "Intervention"}], "doc": ""}, {"name": "variantActionable", "type":
"boolean", "doc": ""}]}}]}]}], "doc": ""}, {"name": "score", "type": ["null", "float"], "doc": ""},
{"name": "vendorSpecificScores", "type": ["null", {"type": "map", "values": "float"}], "doc": ""},
{"name": "variantClassification", "type": ["null", {"type": "record", "name":
"VariantClassification", "doc": "", "fields": [{"name": "clinicalSignificance", "type": ["null",
{"type": "enum", "name": "ClinicalSignificance", "symbols": ["benign", "likely_benign",
"likely_pathogenic", "pathogenic", "uncertain_significance"]}], "doc": ""}, {"name":
"drugResponseClassification", "type": ["null", "DrugResponseClassification"], "doc": ""}, {"name":
"traitAssociation", "type": ["null", {"type": "enum", "name": "TraitAssociation", "symbols":
["established_risk_allele", "likely_risk_allele", "uncertain_risk_allele", "protective"]}], "doc":
""}, {"name": "tumorigenesisClassification", "type": ["null", {"type": "enum", "name":
"TumorigenesisClassification", "symbols": ["driver", "passenger", "modifier"]}], "doc": ""},
{"name": "functionalEffect", "type": ["null", {"type": "enum", "name": "VariantFunctionalEffect",
"symbols": ["dominant_negative_variant", "gain_of_function_variant", "lethal_variant",
"loss_of_function_variant", "loss_of_heterozygosity", "null_variant"]}], "doc": ""}]}], "doc": ""},
{"name": "guidelineBasedVariantClassification", "type": ["null", {"type": "record", "name":
"GuidelineBasedVariantClassification", "doc": "", "fields": [{"name": "acmgVariantClassification",
"type": ["null", {"type": "record", "name": "AcmgVariantClassification", "doc": "", "fields":
[{"name": "acmgEvidences", "type": {"type": "array", "items": {"type": "record", "name":
"AcmgEvidence", "doc": "", "fields": [{"name": "category", "type": {"type": "enum", "name":
"AcmgEvidenceCategory", "doc": "", "symbols": ["population_data",
"computational_and_predictive_data", "functional_data", "segregation_data", "de_novo_data",
"allelic_data", "other_database", "other_data"]}, "doc": ""}, {"name": "type", "type": {"type":
"enum", "name": "AcmgEvidenceType", "doc": "", "symbols": ["bening", "pathogenic"]}, "doc": ""},
{"name": "weight", "type": {"type": "enum", "name": "AcmgEvidenceWeight", "doc": "", "symbols":
["stand_alone", "supporting", "moderate", "strong", "very_strong"]}, "doc": ""}, {"name":
"modifier", "type": "int", "doc": ""}, {"name": "description", "type": ["null", "string"], "doc":
""}]}}}, {"name": "clinicalSignificance", "type": "ClinicalSignificance"}, {"name": "assessment",
"type": ["null", "string"]}]}]}, {"name": "ampVariantClassification", "type": ["null", {"type":
"record", "name": "AmpVariantClassification", "doc": "", "fields": [{"name": "ampEvidences", "type":
{"type": "array", "items": {"type": "record", "name": "AmpEvidence", "doc": "", "fields": [{"name":
"type", "type": {"type": "enum", "name": "AmpEvidenceType", "doc": "", "symbols": ["mutation_type",
"therapies", "variant_frequencies", "potential_germline", "population_database_presence",
"germline_database_presence", "somatic_database_presence", "impact_predictive_software",
"pathway_involvement", "publications"]}, "doc": ""}, {"name": "evidenceAssessment", "type":
"string", "doc": ""}]}}, "doc": ""}, {"name": "ampTier", "type": {"type": "enum", "name": "AmpTier",
"doc": "", "symbols": ["tierI", "tierII", "tierIII", "tierIV"]}, "doc": ""}, {"name":
"ampClincialOrExperimentalEvidence", "type": ["null", {"type": "array", "items": {"type": "record",
"name": "AmpClincialOrExperimentalEvidence", "doc": "", "fields": [{"name": "category", "type":
{"type": "enum", "name": "AmpClinicalOrExperimentalEvidenceCategory", "doc": "", "symbols":
["therapeutic", "diagnosis", "prognosis"]}, "doc": ""}, {"name": "level", "type": {"type": "enum",
"name": "AmpClinicalOrExperimentalEvidenceLevel", "doc": "", "symbols": ["levelA", "levelB",
"levelC", "levelD"]}, "doc": ""}, {"name": "description", "type": ["null", "string"], "doc":
""}]}}], "doc": ""}, {"name": "assessment", "type": ["null", "string"], "doc": ""}]}]}]}], "doc":
""}, {"name": "algorithmBasedVariantClassifications", "type": ["null", {"type": "array", "items":
{"type": "record", "name": "AlgorithmBasedVariantClassification", "fields": [{"name":
"algorithmName", "type": "string", "doc": ""}, {"name": "classification", "type": "string", "doc":
""}, {"name": "rank", "type": ["null", "int"], "doc": ""}, {"name": "score", "type": ["null",
"int"], "doc": ""}]}}], "doc": ""}, {"name": "tier", "type": ["null", {"type": "enum", "name":
"Tier", "doc": "", "symbols": ["NONE", "TIER1", "TIER2", "TIER3", "TIER4", "TIER5", "TIERA",
"TIERB"]}], "doc": ""}, {"name": "domain", "type": ["null", {"type": "enum", "name": "Domain",
"symbols": ["DOMAIN1", "DOMAIN2", "DOMAIN3", "DOMAIN4", "NONE"]}], "doc": ""}]}}, "doc": ""},
{"name": "variantAttributes", "type": ["null", {"type": "record", "name": "VariantAttributes",
"doc": "", "fields": [{"name": "genomicChanges", "type": ["null", {"type": "array", "items":
"string"}], "doc": ""}, {"name": "cdnaChanges", "type": ["null", {"type": "array", "items":
"string"}], "doc": ""}, {"name": "proteinChanges", "type": ["null", {"type": "array", "items":
"string"}], "doc": ""}, {"name": "additionalTextualVariantAnnotations", "type": ["null", {"type":
"map", "values": "string"}], "doc": ""}, {"name": "references", "type": ["null", {"type": "map",
"values": "string"}], "doc": ""}, {"name": "variantIdentifiers", "type": ["null", {"type": "record",
"name": "VariantIdentifiers", "fields": [{"name": "dbSnpId", "type": ["null", "string"], "doc": ""},
{"name": "cosmicIds", "type": ["null", {"type": "array", "items": "string"}], "doc": ""}, {"name":
"clinVarIds", "type": ["null", {"type": "array", "items": "string"}], "doc": ""}, {"name":
"otherIds", "type": ["null", {"type": "array", "items": "Identifier"}]}]}]}, {"name":
"alleleFrequencies", "type": ["null", {"type": "array", "items": {"type": "record", "name":
"AlleleFrequency", "doc": "", "fields": [{"name": "study", "type": "string", "doc": ""}, {"name":
"population", "type": "string", "doc": ""}, {"name": "alternateFrequency", "type": "float", "doc":
""}]}}], "doc": ""}, {"name": "additionalNumericVariantAnnotations", "type": ["null", {"type":
"map", "values": "float"}], "doc": ""}, {"name": "comments", "type": ["null", {"type": "array",
"items": "string"}], "doc": ""}, {"name": "alleleOrigins", "type": ["null", {"type": "array",
"items": "AlleleOrigin"}], "doc": ""}, {"name": "ihp", "type": ["null", "int"], "doc": ""}, {"name":
"recurrentlyReported", "type": ["null", "boolean"], "doc": ""}, {"name": "fdp50", "type": ["null",
"float"], "doc": ""}, {"name": "others", "type": ["null", {"type": "map", "values": "string"}],
"doc": ""}]}]}]}}], "doc": ""}, {"name": "structuralVariants", "type": ["null", {"type": "array",
"items": {"type": "record", "name": "StructuralVariant", "fields": [{"name": "variantType", "type":
{"type": "enum", "name": "StructuralVariantType", "symbols": ["ins", "dup", "inv", "amplification",
"deletion", "dup_tandem", "del_me", "ins_me"]}, "doc": ""}, {"name": "coordinates", "type": {"type":
"record", "name": "Coordinates", "fields": [{"name": "assembly", "type": "Assembly"}, {"name":
"chromosome", "type": "string"}, {"name": "start", "type": "int"}, {"name": "end", "type": "int"},
{"name": "ciStart", "type": ["null", {"type": "record", "name": "ConfidenceInterval", "fields":
[{"name": "left", "type": "int"}, {"name": "right", "type": "int"}]}]}, {"name": "ciEnd", "type":
["null", "ConfidenceInterval"]}]}}, {"name": "leftInsSeq", "type": ["null", "string"]}, {"name":
"rightInsSeq", "type": ["null", "string"]}, {"name": "reportEvents", "type": {"type": "array",
"items": "ReportEvent"}}, {"name": "variantCalls", "type": {"type": "array", "items":
"VariantCall"}, "doc": ""}, {"name": "variantAttributes", "type": ["null",
"VariantAttributes"]}]}}], "doc": ""}, {"name": "chromosomalRearrangements", "type": ["null",
{"type": "array", "items": {"type": "record", "name": "ChromosomalRearrangement", "fields":
[{"name": "breakPoints", "type": ["null", {"type": "array", "items": {"type": "record", "name":
"BreakPoint", "fields": [{"name": "coordinates", "type": "Coordinates"}, {"name": "reference",
"type": ["null", "string"]}, {"name": "alternate", "type": ["null", "string"]}, {"name": "info",
"type": ["null", {"type": "map", "values": "string"}]}]}}]}, {"name": "rearrangements", "type":
{"type": "array", "items": {"type": "record", "name": "Rearrangement", "fields": [{"name":
"leftCoordinates", "type": "Coordinates"}, {"name": "rightCoordinates", "type": "Coordinates"},
{"name": "orientation", "type": {"type": "enum", "name": "Orientation", "symbols": ["start_start",
"start_end", "end_end"]}}, {"name": "leftInsSeq", "type": ["null", "string"]}, {"name":
"rightInsSeq", "type": ["null", "string"]}]}}}, {"name": "reportEvents", "type": {"type": "array",
"items": "ReportEvent"}}, {"name": "variantCalls", "type": {"type": "array", "items":
"VariantCall"}, "doc": ""}, {"name": "variantAttributes", "type": ["null",
"VariantAttributes"]}]}}], "doc": ""}, {"name": "shortTandemRepeats", "type": ["null", {"type":
"array", "items": {"type": "record", "name": "ShortTandemRepeat", "fields": [{"name": "coordinates",
"type": "Coordinates"}, {"name": "reportEvents", "type": {"type": "array", "items": "ReportEvent"}},
{"name": "variantCalls", "type": {"type": "array", "items": "VariantCall"}, "doc": ""}, {"name":
"variantAttributes", "type": ["null", "VariantAttributes"]}, {"name":
"shortTandemRepeatReferenceData", "type": ["null", {"type": "record", "name":
"ShortTandemRepeatReferenceData", "fields": [{"name": "repeatedSequence", "type": "string"},
{"name": "pathogenic_number_of_repeats_threshold", "type": "int"}, {"name":
"normal_number_of_repeats_threshold", "type": "int"}]}]}]}}], "doc": ""}, {"name":
"uniparentalDisomies", "type": ["null", {"type": "array", "items": {"type": "record", "name":
"UniparentalDisomy", "fields": [{"name": "assembly", "type": "Assembly", "doc": ""}, {"name":
"chromosome", "type": "string", "doc": ""}, {"name": "complete", "type": ["null", "boolean"], "doc":
""}, {"name": "origin", "type": {"type": "enum", "name": "UniparentalDisomyOrigin", "symbols":
["paternal", "maternal", "unknown"]}, "doc": ""}, {"name": "uniparentalDisomyFragments", "type":
["null", {"type": "array", "items": {"type": "record", "name": "UniparentalDisomyFragment",
"fields": [{"name": "coordinates", "type": ["null", "Coordinates"], "doc": ""}, {"name":
"uniparentalDisomyType", "type": {"type": "enum", "name": "UniparentalDisomyType", "symbols":
["isodisomy", "heterodisomy", "both"]}, "doc": ""}]}}], "doc": ""}, {"name": "participantId",
"type": "string", "doc": ""}, {"name": "uniparentalDisomyEvidences", "type": ["null", {"type":
"record", "name": "UniparentalDisomyEvidences", "fields": [{"name": "ibds", "type": ["null",
{"type": "array", "items": {"type": "record", "name": "IdentityByDescent", "fields": [{"name":
"relatedSample", "type": "string"}, {"name": "ibd0", "type": "float"}, {"name": "ibd1", "type":
"float"}, {"name": "ibd2", "type": "float"}, {"name": "pihat", "type": "float"}]}}]}]}], "doc":
""}]}}], "doc": ""}, {"name": "karyotypes", "type": ["null", {"type": "array", "items": {"type":
"record", "name": "Karyotype", "fields": [{"name": "iscn", "type": ["null", "string"], "doc": ""},
{"name": "description", "type": ["null", "string"], "doc": ""}, {"name": "aneuploidies", "type":
["null", {"type": "array", "items": {"type": "record", "name": "Aneuploidy", "fields": [{"name":
"iscn", "type": ["null", "string"], "doc": ""}, {"name": "assembly", "type": "Assembly", "doc": ""},
{"name": "chromosome", "type": "string", "doc": ""}, {"name": "complete", "type": "boolean", "doc":
""}, {"name": "coordinates", "type": ["null", "Coordinates"], "doc": ""}, {"name": "numberOfCopies",
"type": "int", "doc": ""}]}}], "doc": ""}, {"name": "numberOfChromosomes", "type": "int", "doc":
""}, {"name": "personKaryotipicSex", "type": {"type": "enum", "name": "PersonKaryotipicSex",
"namespace": "org.gel.models.participant.avro", "doc": "", "symbols": ["UNKNOWN", "XX", "XY", "XO",
"XXY", "XXX", "XXYY", "XXXY", "XXXX", "XYY", "OTHER"]}, "doc": ""}, {"name": "participantId",
"type": "string", "doc": ""}]}}], "doc": ""}, {"name": "genomicInterpretation", "type": "string",
"doc": ""}, {"name": "additionalAnalysisPanels", "type": ["null", {"type": "array", "items":
{"type": "record", "name": "AdditionalAnalysisPanel", "doc": "", "fields": [{"name":
"specificDisease", "type": "string"}, {"name": "panel", "type": "GenePanel"}]}}], "doc": ""},
{"name": "references", "type": ["null", {"type": "array", "items": "string"}], "doc": ""}, {"name":
"referenceDatabasesVersions", "type": {"type": "map", "values": "string"}, "doc": ""}, {"name":
"softwareVersions", "type": {"type": "map", "values": "string"}, "doc": ""}]}
"""
    schema = avro_parse(_schemaSource)
    requiredFields = {
        "additionalAnalysisPanels",
        "chromosomalRearrangements",
        "genomicInterpretation",
        "interpretationRequestId",
        "interpretationRequestVersion",
        "karyotypes",
        "referenceDatabasesVersions",
        "references",
        "reportingDate",
        "shortTandemRepeats",
        "softwareVersions",
        "structuralVariants",
        "uniparentalDisomies",
        "user",
        "variants",
    }

    @classmethod
    def isEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'additionalAnalysisPanels': AdditionalAnalysisPanel,
            'chromosomalRearrangements': ChromosomalRearrangement,
            'karyotypes': Karyotype,
            'shortTandemRepeats': ShortTandemRepeat,
            'structuralVariants': StructuralVariant,
            'uniparentalDisomies': UniparentalDisomy,
            'variants': SmallVariant,
        }
        return fieldName in embeddedTypes

    @classmethod
    def getEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'additionalAnalysisPanels': AdditionalAnalysisPanel,
            'chromosomalRearrangements': ChromosomalRearrangement,
            'karyotypes': Karyotype,
            'shortTandemRepeats': ShortTandemRepeat,
            'structuralVariants': StructuralVariant,
            'uniparentalDisomies': UniparentalDisomy,
            'variants': SmallVariant,
        }

        return embeddedTypes[fieldName]

    __slots__ = [
        'additionalAnalysisPanels', 'chromosomalRearrangements',
        'genomicInterpretation', 'interpretationRequestId',
        'interpretationRequestVersion', 'karyotypes',
        'referenceDatabasesVersions', 'references', 'reportingDate',
        'shortTandemRepeats', 'softwareVersions',
        'structuralVariants', 'uniparentalDisomies', 'user',
        'variants'
    ]

    def __init__(self, **kwargs):
        self.additionalAnalysisPanels = kwargs.get(
            'additionalAnalysisPanels', None)
        self.chromosomalRearrangements = kwargs.get(
            'chromosomalRearrangements', None)
        self.genomicInterpretation = kwargs.get(
            'genomicInterpretation', None)
        self.interpretationRequestId = kwargs.get(
            'interpretationRequestId', None)
        self.interpretationRequestVersion = kwargs.get(
            'interpretationRequestVersion', None)
        self.karyotypes = kwargs.get(
            'karyotypes', None)
        self.referenceDatabasesVersions = kwargs.get(
            'referenceDatabasesVersions', None)
        self.references = kwargs.get(
            'references', None)
        self.reportingDate = kwargs.get(
            'reportingDate', None)
        self.shortTandemRepeats = kwargs.get(
            'shortTandemRepeats', None)
        self.softwareVersions = kwargs.get(
            'softwareVersions', None)
        self.structuralVariants = kwargs.get(
            'structuralVariants', None)
        self.uniparentalDisomies = kwargs.get(
            'uniparentalDisomies', None)
        self.user = kwargs.get(
            'user', None)
        self.variants = kwargs.get(
            'variants', None)


class ClinicalSignificance(object):
    """
    No documentation
    """
    benign = "benign"
    likely_benign = "likely_benign"
    likely_pathogenic = "likely_pathogenic"
    pathogenic = "pathogenic"
    uncertain_significance = "uncertain_significance"

    def __hash__(self):
        return str(self).__hash__()


class ClinicalUtility(object):
    """
    No documentation
    """
    none = "none"
    change_in_medication = "change_in_medication"
    surgical_option = "surgical_option"
    additional_surveillance_for_proband_or_relatives = "additional_surveillance_for_proband_or_relatives"
    clinical_trial_eligibility = "clinical_trial_eligibility"
    informs_reproductive_choice = "informs_reproductive_choice"
    unknown = "unknown"
    other = "other"

    def __hash__(self):
        return str(self).__hash__()


class ConfidenceInterval(ProtocolElement):
    """
    No documentation
    """
    _schemaSource = """
{"type": "record", "name": "ConfidenceInterval", "namespace": "org.gel.models.report.avro",
"fields": [{"name": "left", "type": "int"}, {"name": "right", "type": "int"}]}
"""
    schema = avro_parse(_schemaSource)
    requiredFields = {
        "left",
        "right",
    }

    @classmethod
    def isEmbeddedType(cls, fieldName):
        embeddedTypes = {}
        return fieldName in embeddedTypes

    @classmethod
    def getEmbeddedType(cls, fieldName):
        embeddedTypes = {}

        return embeddedTypes[fieldName]

    __slots__ = [
        'left', 'right'
    ]

    def __init__(self, **kwargs):
        self.left = kwargs.get(
            'left', None)
        self.right = kwargs.get(
            'right', None)


class ConfirmationDecision(object):
    """
    No documentation
    """
    yes = "yes"
    no = "no"
    na = "na"

    def __hash__(self):
        return str(self).__hash__()


class ConfirmationOutcome(object):
    """
    No documentation
    """
    yes = "yes"
    no = "no"
    na = "na"

    def __hash__(self):
        return str(self).__hash__()


class ConsentStatus(ProtocolElement):
    """
    Consent Status
    """
    _schemaSource = """
{"type": "record", "name": "ConsentStatus", "namespace": "org.gel.models.participant.avro", "doc":
"", "fields": [{"name": "programmeConsent", "type": "boolean", "doc": "", "default": false},
{"name": "primaryFindingConsent", "type": "boolean", "doc": "", "default": false}, {"name":
"secondaryFindingConsent", "type": "boolean", "doc": "", "default": false}, {"name":
"carrierStatusConsent", "type": "boolean", "doc": "", "default": false}]}
"""
    schema = avro_parse(_schemaSource)
    requiredFields = {}

    @classmethod
    def isEmbeddedType(cls, fieldName):
        embeddedTypes = {}
        return fieldName in embeddedTypes

    @classmethod
    def getEmbeddedType(cls, fieldName):
        embeddedTypes = {}

        return embeddedTypes[fieldName]

    __slots__ = [
        'carrierStatusConsent', 'primaryFindingConsent',
        'programmeConsent', 'secondaryFindingConsent'
    ]

    def __init__(self, **kwargs):
        self.carrierStatusConsent = kwargs.get(
            'carrierStatusConsent', False)
        self.primaryFindingConsent = kwargs.get(
            'primaryFindingConsent', False)
        self.programmeConsent = kwargs.get(
            'programmeConsent', False)
        self.secondaryFindingConsent = kwargs.get(
            'secondaryFindingConsent', False)


class Coordinates(ProtocolElement):
    """
    No documentation
    """
    _schemaSource = """
{"type": "record", "name": "Coordinates", "namespace": "org.gel.models.report.avro", "fields":
[{"name": "assembly", "type": {"type": "enum", "name": "Assembly", "doc": "", "symbols": ["GRCh38",
"GRCh37"]}}, {"name": "chromosome", "type": "string"}, {"name": "start", "type": "int"}, {"name":
"end", "type": "int"}, {"name": "ciStart", "type": ["null", {"type": "record", "name":
"ConfidenceInterval", "fields": [{"name": "left", "type": "int"}, {"name": "right", "type":
"int"}]}]}, {"name": "ciEnd", "type": ["null", "ConfidenceInterval"]}]}
"""
    schema = avro_parse(_schemaSource)
    requiredFields = {
        "assembly",
        "chromosome",
        "ciEnd",
        "ciStart",
        "end",
        "start",
    }

    @classmethod
    def isEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'ciEnd': ConfidenceInterval,
            'ciStart': ConfidenceInterval,
        }
        return fieldName in embeddedTypes

    @classmethod
    def getEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'ciEnd': ConfidenceInterval,
            'ciStart': ConfidenceInterval,
        }

        return embeddedTypes[fieldName]

    __slots__ = [
        'assembly', 'chromosome', 'ciEnd', 'ciStart', 'end', 'start'
    ]

    def __init__(self, **kwargs):
        self.assembly = kwargs.get(
            'assembly', None)
        self.chromosome = kwargs.get(
            'chromosome', None)
        self.ciEnd = kwargs.get(
            'ciEnd', None)
        self.ciStart = kwargs.get(
            'ciStart', None)
        self.end = kwargs.get(
            'end', None)
        self.start = kwargs.get(
            'start', None)


class DemographicElegibilityCriteria(ProtocolElement):
    """
    No documentation
    """
    _schemaSource = """
{"type": "record", "name": "DemographicElegibilityCriteria", "namespace":
"org.gel.models.report.avro", "fields": [{"name": "sex", "type": {"type": "enum", "name": "Sex",
"namespace": "org.gel.models.participant.avro", "doc": "", "symbols": ["MALE", "FEMALE",
"UNKNOWN"]}}, {"name": "ageRange", "type": ["null", {"type": "record", "name": "AgeRange", "fields":
[{"name": "minimumAge", "type": "int"}, {"name": "maximumAge", "type": "int"}, {"name": "timeunit",
"type": {"type": "enum", "name": "TimeUnit", "symbols": ["years", "months", "weeks", "days",
"hours", "minutes", "na"]}}]}]}]}
"""
    schema = avro_parse(_schemaSource)
    requiredFields = {
        "ageRange",
        "sex",
    }

    @classmethod
    def isEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'ageRange': AgeRange,
        }
        return fieldName in embeddedTypes

    @classmethod
    def getEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'ageRange': AgeRange,
        }

        return embeddedTypes[fieldName]

    __slots__ = [
        'ageRange', 'sex'
    ]

    def __init__(self, **kwargs):
        self.ageRange = kwargs.get(
            'ageRange', None)
        self.sex = kwargs.get(
            'sex', None)


class DiseasePenetrance(ProtocolElement):
    """
    A disease penetrance definition
    """
    _schemaSource = """
{"type": "record", "name": "DiseasePenetrance", "namespace": "org.gel.models.participant.avro",
"doc": "", "fields": [{"name": "specificDisease", "type": "string", "doc": ""}, {"name":
"penetrance", "type": {"type": "enum", "name": "Penetrance", "doc": "", "symbols": ["complete",
"incomplete"]}, "doc": ""}]}
"""
    schema = avro_parse(_schemaSource)
    requiredFields = {
        "penetrance",
        "specificDisease",
    }

    @classmethod
    def isEmbeddedType(cls, fieldName):
        embeddedTypes = {}
        return fieldName in embeddedTypes

    @classmethod
    def getEmbeddedType(cls, fieldName):
        embeddedTypes = {}

        return embeddedTypes[fieldName]

    __slots__ = [
        'penetrance', 'specificDisease'
    ]

    def __init__(self, **kwargs):
        self.penetrance = kwargs.get(
            'penetrance', None)
        self.specificDisease = kwargs.get(
            'specificDisease', None)


class Disorder(ProtocolElement):
    """
    This is quite GEL specific. This is the way is stored in
    ModelCatalogue and PanelApp.     Currently all specific disease
    titles are assigned to a disease subgroup so really only
    specificDisease needs to be     completed but we add the others
    for generality
    """
    _schemaSource = """
{"type": "record", "name": "Disorder", "namespace": "org.gel.models.participant.avro", "doc": "",
"fields": [{"name": "diseaseGroup", "type": ["null", "string"], "doc": ""}, {"name":
"diseaseSubGroup", "type": ["null", "string"], "doc": ""}, {"name": "specificDisease", "type":
["null", "string"], "doc": ""}, {"name": "ageOfOnset", "type": ["null", "float"], "doc": ""}]}
"""
    schema = avro_parse(_schemaSource)
    requiredFields = {
        "ageOfOnset",
        "diseaseGroup",
        "diseaseSubGroup",
        "specificDisease",
    }

    @classmethod
    def isEmbeddedType(cls, fieldName):
        embeddedTypes = {}
        return fieldName in embeddedTypes

    @classmethod
    def getEmbeddedType(cls, fieldName):
        embeddedTypes = {}

        return embeddedTypes[fieldName]

    __slots__ = [
        'ageOfOnset', 'diseaseGroup', 'diseaseSubGroup',
        'specificDisease'
    ]

    def __init__(self, **kwargs):
        self.ageOfOnset = kwargs.get(
            'ageOfOnset', None)
        self.diseaseGroup = kwargs.get(
            'diseaseGroup', None)
        self.diseaseSubGroup = kwargs.get(
            'diseaseSubGroup', None)
        self.specificDisease = kwargs.get(
            'specificDisease', None)


class Domain(object):
    """
    No documentation
    """
    DOMAIN1 = "DOMAIN1"
    DOMAIN2 = "DOMAIN2"
    DOMAIN3 = "DOMAIN3"
    DOMAIN4 = "DOMAIN4"
    NONE = "NONE"

    def __hash__(self):
        return str(self).__hash__()


class DrugResponse(ProtocolElement):
    """
    No documentation
    """
    _schemaSource = """
{"type": "record", "name": "DrugResponse", "namespace": "org.gel.models.report.avro", "fields":
[{"name": "TreatmentAgent", "type": "string", "doc": ""}, {"name": "drugResponseClassification",
"type": {"type": "enum", "name": "DrugResponseClassification", "symbols": ["altered_sensitivity",
"reduced_sensitivity", "increased_sensitivity", "altered_resistance", "increased_resistance",
"reduced_resistance", "increased_risk_of_toxicity", "reduced_risk_of_toxicity", "altered_toxicity",
"adverse_drug_reaction", "indication", "contraindication", "dosing_alteration", "increased_dose",
"reduced_dose", "increased_monitoring", "increased_efficacy", "reduced_efficacy",
"altered_efficacy"]}, "doc": ""}]}
"""
    schema = avro_parse(_schemaSource)
    requiredFields = {
        "TreatmentAgent",
        "drugResponseClassification",
    }

    @classmethod
    def isEmbeddedType(cls, fieldName):
        embeddedTypes = {}
        return fieldName in embeddedTypes

    @classmethod
    def getEmbeddedType(cls, fieldName):
        embeddedTypes = {}

        return embeddedTypes[fieldName]

    __slots__ = [
        'TreatmentAgent', 'drugResponseClassification'
    ]

    def __init__(self, **kwargs):
        self.TreatmentAgent = kwargs.get(
            'TreatmentAgent', None)
        self.drugResponseClassification = kwargs.get(
            'drugResponseClassification', None)


class DrugResponseClassification(object):
    """
    No documentation
    """
    altered_sensitivity = "altered_sensitivity"
    reduced_sensitivity = "reduced_sensitivity"
    increased_sensitivity = "increased_sensitivity"
    altered_resistance = "altered_resistance"
    increased_resistance = "increased_resistance"
    reduced_resistance = "reduced_resistance"
    increased_risk_of_toxicity = "increased_risk_of_toxicity"
    reduced_risk_of_toxicity = "reduced_risk_of_toxicity"
    altered_toxicity = "altered_toxicity"
    adverse_drug_reaction = "adverse_drug_reaction"
    indication = "indication"
    contraindication = "contraindication"
    dosing_alteration = "dosing_alteration"
    increased_dose = "increased_dose"
    reduced_dose = "reduced_dose"
    increased_monitoring = "increased_monitoring"
    increased_efficacy = "increased_efficacy"
    reduced_efficacy = "reduced_efficacy"
    altered_efficacy = "altered_efficacy"

    def __hash__(self):
        return str(self).__hash__()


class EthnicCategory(object):
    """
    This is the list of ethnicities in ONS16      * `D`:  Mixed: White
    and Black Caribbean     * `E`:  Mixed: White and Black African
    * `F`:  Mixed: White and Asian     * `G`:  Mixed: Any other mixed
    background     * `A`:  White: British     * `B`:  White: Irish
    * `C`:  White: Any other White background     * `L`:  Asian or
    Asian British: Any other Asian background     * `M`:  Black or
    Black British: Caribbean     * `N`:  Black or Black British:
    African     * `H`:  Asian or Asian British: Indian     * `J`:
    Asian or Asian British: Pakistani     * `K`:  Asian or Asian
    British: Bangladeshi     * `P`:  Black or Black British: Any other
    Black background     * `S`:  Other Ethnic Groups: Any other ethnic
    group     * `R`:  Other Ethnic Groups: Chinese     * `Z`:  Not
    stated
    """
    D = "D"
    E = "E"
    F = "F"
    G = "G"
    A = "A"
    B = "B"
    C = "C"
    L = "L"
    M = "M"
    N = "N"
    H = "H"
    J = "J"
    K = "K"
    P = "P"
    S = "S"
    R = "R"
    Z = "Z"

    def __hash__(self):
        return str(self).__hash__()


class FamiliarRelationship(object):
    """
    Familiar relationship from pedrigree
    """
    TwinsMonozygous = "TwinsMonozygous"
    TwinsDizygous = "TwinsDizygous"
    TwinsUnknown = "TwinsUnknown"
    FullSibling = "FullSibling"
    FullSiblingF = "FullSiblingF"
    FullSiblingM = "FullSiblingM"
    Mother = "Mother"
    Father = "Father"
    Son = "Son"
    Daughter = "Daughter"
    ChildOfUnknownSex = "ChildOfUnknownSex"
    MaternalAunt = "MaternalAunt"
    MaternalUncle = "MaternalUncle"
    MaternalUncleOrAunt = "MaternalUncleOrAunt"
    PaternalAunt = "PaternalAunt"
    PaternalUncle = "PaternalUncle"
    PaternalUncleOrAunt = "PaternalUncleOrAunt"
    MaternalGrandmother = "MaternalGrandmother"
    PaternalGrandmother = "PaternalGrandmother"
    MaternalGrandfather = "MaternalGrandfather"
    PaternalGrandfather = "PaternalGrandfather"
    DoubleFirstCousin = "DoubleFirstCousin"
    MaternalCousinSister = "MaternalCousinSister"
    PaternalCousinSister = "PaternalCousinSister"
    MaternalCousinBrother = "MaternalCousinBrother"
    PaternalCousinBrother = "PaternalCousinBrother"
    Cousin = "Cousin"
    Spouse = "Spouse"
    Other = "Other"
    RelationIsNotClear = "RelationIsNotClear"
    Unrelated = "Unrelated"
    Unknown = "Unknown"

    def __hash__(self):
        return str(self).__hash__()


class FamilyLevelQuestions(ProtocolElement):
    """
    The family level questions
    """
    _schemaSource = """
{"type": "record", "name": "FamilyLevelQuestions", "namespace": "org.gel.models.report.avro", "doc":
"", "fields": [{"name": "caseSolvedFamily", "type": {"type": "enum", "name": "CaseSolvedFamily",
"symbols": ["yes", "no", "partially", "unknown"]}, "doc": ""}, {"name": "segregationQuestion",
"type": {"type": "enum", "name": "SegregationQuestion", "symbols": ["yes", "no"]}, "doc": ""},
{"name": "additionalComments", "type": "string", "doc": ""}]}
"""
    schema = avro_parse(_schemaSource)
    requiredFields = {
        "additionalComments",
        "caseSolvedFamily",
        "segregationQuestion",
    }

    @classmethod
    def isEmbeddedType(cls, fieldName):
        embeddedTypes = {}
        return fieldName in embeddedTypes

    @classmethod
    def getEmbeddedType(cls, fieldName):
        embeddedTypes = {}

        return embeddedTypes[fieldName]

    __slots__ = [
        'additionalComments', 'caseSolvedFamily',
        'segregationQuestion'
    ]

    def __init__(self, **kwargs):
        self.additionalComments = kwargs.get(
            'additionalComments', None)
        self.caseSolvedFamily = kwargs.get(
            'caseSolvedFamily', None)
        self.segregationQuestion = kwargs.get(
            'segregationQuestion', None)


class FamilyQCState(object):
    """
    FamilyQCState
    """
    noState = "noState"
    passedMedicalReviewReadyForInterpretation = "passedMedicalReviewReadyForInterpretation"
    passedMedicalReviewNotReadyForInterpretation = "passedMedicalReviewNotReadyForInterpretation"
    queryToGel = "queryToGel"
    queryToGMC = "queryToGMC"
    failed = "failed"

    def __hash__(self):
        return str(self).__hash__()


class File(ProtocolElement):
    """
    This defines a file     This record is uniquely defined by the
    sample identfier and an URI     Currently sample identifier can be
    a single string or a list of strings if multiple samples are
    associated with the same file     *
    """
    _schemaSource = """
{"type": "record", "name": "File", "namespace": "org.gel.models.report.avro", "doc": "", "fields":
[{"name": "sampleId", "type": ["null", {"type": "array", "items": "string"}], "doc": ""}, {"name":
"uriFile", "type": "string", "doc": ""}, {"name": "fileType", "type": {"type": "enum", "name":
"FileType", "symbols": ["BAM", "gVCF", "VCF_small", "VCF_somatic_small", "VCF_CNV",
"VCF_somatic_CNV", "VCF_SV", "VCF_somatic_SV", "VCF_SV_CNV", "SVG", "ANN", "BigWig", "MD5Sum",
"ROH", "OTHER", "PARTITION", "VARIANT_FREQUENCIES", "COVERAGE"]}, "doc": ""}, {"name": "md5Sum",
"type": ["null", "string"], "doc": ""}]}
"""
    schema = avro_parse(_schemaSource)
    requiredFields = {
        "fileType",
        "md5Sum",
        "sampleId",
        "uriFile",
    }

    @classmethod
    def isEmbeddedType(cls, fieldName):
        embeddedTypes = {}
        return fieldName in embeddedTypes

    @classmethod
    def getEmbeddedType(cls, fieldName):
        embeddedTypes = {}

        return embeddedTypes[fieldName]

    __slots__ = [
        'fileType', 'md5Sum', 'sampleId', 'uriFile'
    ]

    def __init__(self, **kwargs):
        self.fileType = kwargs.get(
            'fileType', None)
        self.md5Sum = kwargs.get(
            'md5Sum', None)
        self.sampleId = kwargs.get(
            'sampleId', None)
        self.uriFile = kwargs.get(
            'uriFile', None)


class FileType(object):
    """
    No documentation
    """
    BAM = "BAM"
    gVCF = "gVCF"
    VCF_small = "VCF_small"
    VCF_somatic_small = "VCF_somatic_small"
    VCF_CNV = "VCF_CNV"
    VCF_somatic_CNV = "VCF_somatic_CNV"
    VCF_SV = "VCF_SV"
    VCF_somatic_SV = "VCF_somatic_SV"
    VCF_SV_CNV = "VCF_SV_CNV"
    SVG = "SVG"
    ANN = "ANN"
    BigWig = "BigWig"
    MD5Sum = "MD5Sum"
    ROH = "ROH"
    OTHER = "OTHER"
    PARTITION = "PARTITION"
    VARIANT_FREQUENCIES = "VARIANT_FREQUENCIES"
    COVERAGE = "COVERAGE"

    def __hash__(self):
        return str(self).__hash__()


class GenePanel(ProtocolElement):
    """
    A panel of genes
    """
    _schemaSource = """
{"type": "record", "name": "GenePanel", "namespace": "org.gel.models.report.avro", "doc": "",
"fields": [{"name": "panelIdentifier", "type": ["null", "string"], "doc": ""}, {"name": "panelName",
"type": ["null", "string"], "doc": ""}, {"name": "panelVersion", "type": ["null", "string"], "doc":
""}, {"name": "source", "type": ["null", "string"], "doc": ""}]}
"""
    schema = avro_parse(_schemaSource)
    requiredFields = {
        "panelIdentifier",
        "panelName",
        "panelVersion",
        "source",
    }

    @classmethod
    def isEmbeddedType(cls, fieldName):
        embeddedTypes = {}
        return fieldName in embeddedTypes

    @classmethod
    def getEmbeddedType(cls, fieldName):
        embeddedTypes = {}

        return embeddedTypes[fieldName]

    __slots__ = [
        'panelIdentifier', 'panelName', 'panelVersion', 'source'
    ]

    def __init__(self, **kwargs):
        self.panelIdentifier = kwargs.get(
            'panelIdentifier', None)
        self.panelName = kwargs.get(
            'panelName', None)
        self.panelVersion = kwargs.get(
            'panelVersion', None)
        self.source = kwargs.get(
            'source', None)


class GenomicEntity(ProtocolElement):
    """
    A genomic feature
    """
    _schemaSource = """
{"type": "record", "name": "GenomicEntity", "namespace": "org.gel.models.report.avro", "doc": "",
"fields": [{"name": "type", "type": {"type": "enum", "name": "GenomicEntityType", "doc": "",
"symbols": ["regulatory_region", "gene", "transcript", "intergenic", "gene_fusion",
"genomic_region", "cytobands"]}, "doc": ""}, {"name": "ensemblId", "type": ["null", "string"],
"doc": ""}, {"name": "geneSymbol", "type": ["null", "string"], "doc": ""}, {"name": "otherIds",
"type": ["null", {"type": "array", "items": {"type": "record", "name": "Identifier", "fields":
[{"name": "source", "type": "string", "doc": ""}, {"name": "identifier", "type": "string", "doc":
""}]}}], "doc": ""}]}
"""
    schema = avro_parse(_schemaSource)
    requiredFields = {
        "ensemblId",
        "geneSymbol",
        "otherIds",
        "type",
    }

    @classmethod
    def isEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'otherIds': Identifier,
        }
        return fieldName in embeddedTypes

    @classmethod
    def getEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'otherIds': Identifier,
        }

        return embeddedTypes[fieldName]

    __slots__ = [
        'ensemblId', 'geneSymbol', 'otherIds', 'type'
    ]

    def __init__(self, **kwargs):
        self.ensemblId = kwargs.get(
            'ensemblId', None)
        self.geneSymbol = kwargs.get(
            'geneSymbol', None)
        self.otherIds = kwargs.get(
            'otherIds', None)
        self.type = kwargs.get(
            'type', None)


class GenomicEntityType(object):
    """
    Types of genomic features:  * `regulatory_region`: a regulatory
    region * `gene`: a gene * `transcript`: a transcript *
    `intergenic`: an intergenic region
    """
    regulatory_region = "regulatory_region"
    gene = "gene"
    transcript = "transcript"
    intergenic = "intergenic"
    gene_fusion = "gene_fusion"
    genomic_region = "genomic_region"
    cytobands = "cytobands"

    def __hash__(self):
        return str(self).__hash__()


class GermlineSample(ProtocolElement):
    """
    A germline sample
    """
    _schemaSource = """
{"type": "record", "name": "GermlineSample", "namespace": "org.gel.models.participant.avro", "doc":
"", "fields": [{"name": "sampleId", "type": "string", "doc": ""}, {"name": "labSampleId", "type":
"string", "doc": ""}, {"name": "LDPCode", "type": "string", "doc": ""}, {"name": "source", "type":
["null", {"type": "enum", "name": "SampleSource", "doc": "", "symbols": ["TUMOUR",
"BONE_MARROW_ASPIRATE_TUMOUR_SORTED_CELLS", "BONE_MARROW_ASPIRATE_TUMOUR_CELLS", "BLOOD", "SALIVA",
"FIBROBLAST", "TISSUE"]}], "doc": ""}, {"name": "product", "type": ["null", {"type": "enum", "name":
"Product", "symbols": ["DNA", "RNA"]}], "doc": ""}, {"name": "preparationMethod", "type": ["null",
{"type": "enum", "name": "PreparationMethod", "symbols": ["EDTA", "ORAGENE", "FF", "FFPE",
"CD128_SORTED_CELLS", "ASPIRATE"]}], "doc": ""}, {"name": "programmePhase", "type": ["null",
{"type": "enum", "name": "ProgrammePhase", "symbols": ["CRUK", "OXFORD", "CLL", "IIP", "MAIN",
"EXPT"]}], "doc": ""}, {"name": "clinicalSampleDateTime", "type": ["null", "string"], "doc": ""}]}
"""
    schema = avro_parse(_schemaSource)
    requiredFields = {
        "LDPCode",
        "clinicalSampleDateTime",
        "labSampleId",
        "preparationMethod",
        "product",
        "programmePhase",
        "sampleId",
        "source",
    }

    @classmethod
    def isEmbeddedType(cls, fieldName):
        embeddedTypes = {}
        return fieldName in embeddedTypes

    @classmethod
    def getEmbeddedType(cls, fieldName):
        embeddedTypes = {}

        return embeddedTypes[fieldName]

    __slots__ = [
        'LDPCode', 'clinicalSampleDateTime', 'labSampleId',
        'preparationMethod', 'product', 'programmePhase', 'sampleId',
        'source'
    ]

    def __init__(self, **kwargs):
        self.LDPCode = kwargs.get(
            'LDPCode', None)
        self.clinicalSampleDateTime = kwargs.get(
            'clinicalSampleDateTime', None)
        self.labSampleId = kwargs.get(
            'labSampleId', None)
        self.preparationMethod = kwargs.get(
            'preparationMethod', None)
        self.product = kwargs.get(
            'product', None)
        self.programmePhase = kwargs.get(
            'programmePhase', None)
        self.sampleId = kwargs.get(
            'sampleId', None)
        self.source = kwargs.get(
            'source', None)


class GuidelineBasedVariantClassification(ProtocolElement):
    """
    Variant classification based on guidlines, AMP and ACMG are
    supported
    """
    _schemaSource = """
{"type": "record", "name": "GuidelineBasedVariantClassification", "namespace":
"org.gel.models.report.avro", "doc": "", "fields": [{"name": "acmgVariantClassification", "type":
["null", {"type": "record", "name": "AcmgVariantClassification", "doc": "", "fields": [{"name":
"acmgEvidences", "type": {"type": "array", "items": {"type": "record", "name": "AcmgEvidence",
"doc": "", "fields": [{"name": "category", "type": {"type": "enum", "name": "AcmgEvidenceCategory",
"doc": "", "symbols": ["population_data", "computational_and_predictive_data", "functional_data",
"segregation_data", "de_novo_data", "allelic_data", "other_database", "other_data"]}, "doc": ""},
{"name": "type", "type": {"type": "enum", "name": "AcmgEvidenceType", "doc": "", "symbols":
["bening", "pathogenic"]}, "doc": ""}, {"name": "weight", "type": {"type": "enum", "name":
"AcmgEvidenceWeight", "doc": "", "symbols": ["stand_alone", "supporting", "moderate", "strong",
"very_strong"]}, "doc": ""}, {"name": "modifier", "type": "int", "doc": ""}, {"name": "description",
"type": ["null", "string"], "doc": ""}]}}}, {"name": "clinicalSignificance", "type": {"type":
"enum", "name": "ClinicalSignificance", "symbols": ["benign", "likely_benign", "likely_pathogenic",
"pathogenic", "uncertain_significance"]}}, {"name": "assessment", "type": ["null", "string"]}]}]},
{"name": "ampVariantClassification", "type": ["null", {"type": "record", "name":
"AmpVariantClassification", "doc": "", "fields": [{"name": "ampEvidences", "type": {"type": "array",
"items": {"type": "record", "name": "AmpEvidence", "doc": "", "fields": [{"name": "type", "type":
{"type": "enum", "name": "AmpEvidenceType", "doc": "", "symbols": ["mutation_type", "therapies",
"variant_frequencies", "potential_germline", "population_database_presence",
"germline_database_presence", "somatic_database_presence", "impact_predictive_software",
"pathway_involvement", "publications"]}, "doc": ""}, {"name": "evidenceAssessment", "type":
"string", "doc": ""}]}}, "doc": ""}, {"name": "ampTier", "type": {"type": "enum", "name": "AmpTier",
"doc": "", "symbols": ["tierI", "tierII", "tierIII", "tierIV"]}, "doc": ""}, {"name":
"ampClincialOrExperimentalEvidence", "type": ["null", {"type": "array", "items": {"type": "record",
"name": "AmpClincialOrExperimentalEvidence", "doc": "", "fields": [{"name": "category", "type":
{"type": "enum", "name": "AmpClinicalOrExperimentalEvidenceCategory", "doc": "", "symbols":
["therapeutic", "diagnosis", "prognosis"]}, "doc": ""}, {"name": "level", "type": {"type": "enum",
"name": "AmpClinicalOrExperimentalEvidenceLevel", "doc": "", "symbols": ["levelA", "levelB",
"levelC", "levelD"]}, "doc": ""}, {"name": "description", "type": ["null", "string"], "doc":
""}]}}], "doc": ""}, {"name": "assessment", "type": ["null", "string"], "doc": ""}]}]}]}
"""
    schema = avro_parse(_schemaSource)
    requiredFields = {
        "acmgVariantClassification",
        "ampVariantClassification",
    }

    @classmethod
    def isEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'acmgVariantClassification': AcmgVariantClassification,
            'ampVariantClassification': AmpVariantClassification,
        }
        return fieldName in embeddedTypes

    @classmethod
    def getEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'acmgVariantClassification': AcmgVariantClassification,
            'ampVariantClassification': AmpVariantClassification,
        }

        return embeddedTypes[fieldName]

    __slots__ = [
        'acmgVariantClassification', 'ampVariantClassification'
    ]

    def __init__(self, **kwargs):
        self.acmgVariantClassification = kwargs.get(
            'acmgVariantClassification', None)
        self.ampVariantClassification = kwargs.get(
            'ampVariantClassification', None)


class HpoTerm(ProtocolElement):
    """
    This defines an HPO term and its modifiers (possibly multiple)
    If HPO term presence is unknown we don't have a entry on the list
    """
    _schemaSource = """
{"type": "record", "name": "HpoTerm", "namespace": "org.gel.models.participant.avro", "doc": "",
"fields": [{"name": "term", "type": "string", "doc": ""}, {"name": "termPresence", "type": ["null",
{"type": "enum", "name": "TernaryOption", "doc": "", "symbols": ["yes", "no", "unknown"]}], "doc":
""}, {"name": "hpoBuildNumber", "type": ["null", "string"], "doc": ""}, {"name": "modifiers",
"type": ["null", {"type": "record", "name": "HpoTermModifiers", "fields": [{"name": "laterality",
"type": ["null", {"type": "enum", "name": "Laterality", "symbols": ["RIGHT", "UNILATERAL",
"BILATERAL", "LEFT"]}]}, {"name": "progression", "type": ["null", {"type": "enum", "name":
"Progression", "symbols": ["PROGRESSIVE", "NONPROGRESSIVE"]}]}, {"name": "severity", "type":
["null", {"type": "enum", "name": "Severity", "symbols": ["BORDERLINE", "MILD", "MODERATE",
"SEVERE", "PROFOUND"]}]}, {"name": "spatialPattern", "type": ["null", {"type": "enum", "name":
"SpatialPattern", "symbols": ["DISTAL", "GENERALIZED", "LOCALIZED", "PROXIMAL"]}]}]}], "doc": ""},
{"name": "ageOfOnset", "type": ["null", {"type": "enum", "name": "AgeOfOnset", "symbols":
["EMBRYONAL_ONSET", "FETAL_ONSET", "NEONATAL_ONSET", "INFANTILE_ONSET", "CHILDHOOD_ONSET",
"JUVENILE_ONSET", "YOUNG_ADULT_ONSET", "LATE_ONSET", "MIDDLE_AGE_ONSET"]}], "doc": ""}]}
"""
    schema = avro_parse(_schemaSource)
    requiredFields = {
        "ageOfOnset",
        "hpoBuildNumber",
        "modifiers",
        "term",
        "termPresence",
    }

    @classmethod
    def isEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'modifiers': HpoTermModifiers,
        }
        return fieldName in embeddedTypes

    @classmethod
    def getEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'modifiers': HpoTermModifiers,
        }

        return embeddedTypes[fieldName]

    __slots__ = [
        'ageOfOnset', 'hpoBuildNumber', 'modifiers', 'term',
        'termPresence'
    ]

    def __init__(self, **kwargs):
        self.ageOfOnset = kwargs.get(
            'ageOfOnset', None)
        self.hpoBuildNumber = kwargs.get(
            'hpoBuildNumber', None)
        self.modifiers = kwargs.get(
            'modifiers', None)
        self.term = kwargs.get(
            'term', None)
        self.termPresence = kwargs.get(
            'termPresence', None)


class HpoTermModifiers(ProtocolElement):
    """
    No documentation
    """
    _schemaSource = """
{"type": "record", "name": "HpoTermModifiers", "namespace": "org.gel.models.participant.avro",
"fields": [{"name": "laterality", "type": ["null", {"type": "enum", "name": "Laterality", "symbols":
["RIGHT", "UNILATERAL", "BILATERAL", "LEFT"]}]}, {"name": "progression", "type": ["null", {"type":
"enum", "name": "Progression", "symbols": ["PROGRESSIVE", "NONPROGRESSIVE"]}]}, {"name": "severity",
"type": ["null", {"type": "enum", "name": "Severity", "symbols": ["BORDERLINE", "MILD", "MODERATE",
"SEVERE", "PROFOUND"]}]}, {"name": "spatialPattern", "type": ["null", {"type": "enum", "name":
"SpatialPattern", "symbols": ["DISTAL", "GENERALIZED", "LOCALIZED", "PROXIMAL"]}]}]}
"""
    schema = avro_parse(_schemaSource)
    requiredFields = {
        "laterality",
        "progression",
        "severity",
        "spatialPattern",
    }

    @classmethod
    def isEmbeddedType(cls, fieldName):
        embeddedTypes = {}
        return fieldName in embeddedTypes

    @classmethod
    def getEmbeddedType(cls, fieldName):
        embeddedTypes = {}

        return embeddedTypes[fieldName]

    __slots__ = [
        'laterality', 'progression', 'severity', 'spatialPattern'
    ]

    def __init__(self, **kwargs):
        self.laterality = kwargs.get(
            'laterality', None)
        self.progression = kwargs.get(
            'progression', None)
        self.severity = kwargs.get(
            'severity', None)
        self.spatialPattern = kwargs.get(
            'spatialPattern', None)


class Identifier(ProtocolElement):
    """
    No documentation
    """
    _schemaSource = """
{"type": "record", "name": "Identifier", "namespace": "org.gel.models.report.avro", "fields":
[{"name": "source", "type": "string", "doc": ""}, {"name": "identifier", "type": "string", "doc":
""}]}
"""
    schema = avro_parse(_schemaSource)
    requiredFields = {
        "identifier",
        "source",
    }

    @classmethod
    def isEmbeddedType(cls, fieldName):
        embeddedTypes = {}
        return fieldName in embeddedTypes

    @classmethod
    def getEmbeddedType(cls, fieldName):
        embeddedTypes = {}

        return embeddedTypes[fieldName]

    __slots__ = [
        'identifier', 'source'
    ]

    def __init__(self, **kwargs):
        self.identifier = kwargs.get(
            'identifier', None)
        self.source = kwargs.get(
            'source', None)


class IdentityByDescent(ProtocolElement):
    """
    No documentation
    """
    _schemaSource = """
{"type": "record", "name": "IdentityByDescent", "namespace": "org.gel.models.report.avro", "fields":
[{"name": "relatedSample", "type": "string"}, {"name": "ibd0", "type": "float"}, {"name": "ibd1",
"type": "float"}, {"name": "ibd2", "type": "float"}, {"name": "pihat", "type": "float"}]}
"""
    schema = avro_parse(_schemaSource)
    requiredFields = {
        "ibd0",
        "ibd1",
        "ibd2",
        "pihat",
        "relatedSample",
    }

    @classmethod
    def isEmbeddedType(cls, fieldName):
        embeddedTypes = {}
        return fieldName in embeddedTypes

    @classmethod
    def getEmbeddedType(cls, fieldName):
        embeddedTypes = {}

        return embeddedTypes[fieldName]

    __slots__ = [
        'ibd0', 'ibd1', 'ibd2', 'pihat', 'relatedSample'
    ]

    def __init__(self, **kwargs):
        self.ibd0 = kwargs.get(
            'ibd0', None)
        self.ibd1 = kwargs.get(
            'ibd1', None)
        self.ibd2 = kwargs.get(
            'ibd2', None)
        self.pihat = kwargs.get(
            'pihat', None)
        self.relatedSample = kwargs.get(
            'relatedSample', None)


class InbreedingCoefficient(ProtocolElement):
    """
    Inbreeding coefficient
    """
    _schemaSource = """
{"type": "record", "name": "InbreedingCoefficient", "namespace": "org.gel.models.participant.avro",
"doc": "", "fields": [{"name": "sampleId", "type": "string", "doc": ""}, {"name": "program", "type":
"string", "doc": ""}, {"name": "version", "type": "string", "doc": ""}, {"name": "estimationMethod",
"type": "string", "doc": ""}, {"name": "coefficient", "type": "double", "doc": ""}, {"name":
"standardError", "type": ["null", "double"], "doc": ""}]}
"""
    schema = avro_parse(_schemaSource)
    requiredFields = {
        "coefficient",
        "estimationMethod",
        "program",
        "sampleId",
        "standardError",
        "version",
    }

    @classmethod
    def isEmbeddedType(cls, fieldName):
        embeddedTypes = {}
        return fieldName in embeddedTypes

    @classmethod
    def getEmbeddedType(cls, fieldName):
        embeddedTypes = {}

        return embeddedTypes[fieldName]

    __slots__ = [
        'coefficient', 'estimationMethod', 'program', 'sampleId',
        'standardError', 'version'
    ]

    def __init__(self, **kwargs):
        self.coefficient = kwargs.get(
            'coefficient', None)
        self.estimationMethod = kwargs.get(
            'estimationMethod', None)
        self.program = kwargs.get(
            'program', None)
        self.sampleId = kwargs.get(
            'sampleId', None)
        self.standardError = kwargs.get(
            'standardError', None)
        self.version = kwargs.get(
            'version', None)


class Indel(object):
    """
    No documentation
    """
    insertion = "insertion"
    deletion = "deletion"

    def __hash__(self):
        return str(self).__hash__()


class InterpretationDataCancer(ProtocolElement):
    """
    Represents the set of all interpretation data (excluding file
    contents) to be stored in MDT for one TieringResult. Semantic
    restrictions (not automatically verifiable):  * All
    InterpretedGenomes in interpretationResults refer to the
    TieringResult tieringResult. * All InterpretedGenomes in
    interpretationResults have passed the QC stage and have been
    approved by the originating GMCs
    """
    _schemaSource = """
{"type": "record", "name": "InterpretationDataCancer", "namespace": "org.gel.models.report.avro",
"doc": "", "fields": [{"name": "interpretationMetaData", "type": {"type": "record", "name":
"CancerInterpretationRequest", "doc": "", "fields": [{"name": "versionControl", "type": {"type":
"record", "name": "ReportVersionControl", "fields": [{"name": "gitVersionControl", "type": "string",
"doc": "", "default": "6.0.2"}]}, "doc": ""}, {"name": "interpretationRequestId", "type": "string",
"doc": ""}, {"name": "interpretationRequestVersion", "type": "int", "doc": ""}, {"name":
"internalStudyId", "type": "string", "doc": ""}, {"name": "participantInternalId", "type": ["null",
"string"], "doc": ""}, {"name": "genomeAssembly", "type": {"type": "enum", "name": "Assembly",
"doc": "", "symbols": ["GRCh38", "GRCh37"]}, "doc": ""}, {"name": "workspace", "type": {"type":
"array", "items": "string"}, "doc": ""}, {"name": "bams", "type": ["null", {"type": "array",
"items": {"type": "record", "name": "File", "doc": "", "fields": [{"name": "sampleId", "type":
["null", {"type": "array", "items": "string"}], "doc": ""}, {"name": "uriFile", "type": "string",
"doc": ""}, {"name": "fileType", "type": {"type": "enum", "name": "FileType", "symbols": ["BAM",
"gVCF", "VCF_small", "VCF_somatic_small", "VCF_CNV", "VCF_somatic_CNV", "VCF_SV", "VCF_somatic_SV",
"VCF_SV_CNV", "SVG", "ANN", "BigWig", "MD5Sum", "ROH", "OTHER", "PARTITION", "VARIANT_FREQUENCIES",
"COVERAGE"]}, "doc": ""}, {"name": "md5Sum", "type": ["null", "string"], "doc": ""}]}}], "doc": ""},
{"name": "vcfs", "type": ["null", {"type": "array", "items": "File"}], "doc": ""}, {"name":
"bigWigs", "type": ["null", {"type": "array", "items": "File"}], "doc": ""}, {"name":
"annotationFile", "type": ["null", "File"], "doc": ""}, {"name": "otherFiles", "type": ["null",
{"type": "map", "values": "File"}], "doc": ""}, {"name": "cancerParticipant", "type": ["null",
{"type": "record", "name": "CancerParticipant", "namespace": "org.gel.models.participant.avro",
"doc": "", "fields": [{"name": "yearOfBirth", "type": ["null", "int"], "doc": ""}, {"name":
"morphology", "type": ["null", {"type": "array", "items": "string"}], "doc": ""}, {"name":
"readyForAnalysis", "type": "boolean", "doc": ""}, {"name": "consentStatus", "type": ["null",
{"type": "record", "name": "ConsentStatus", "doc": "", "fields": [{"name": "programmeConsent",
"type": "boolean", "doc": "", "default": false}, {"name": "primaryFindingConsent", "type":
"boolean", "doc": "", "default": false}, {"name": "secondaryFindingConsent", "type": "boolean",
"doc": "", "default": false}, {"name": "carrierStatusConsent", "type": "boolean", "doc": "",
"default": false}]}], "doc": ""}, {"name": "center", "type": ["null", "string"], "doc": ""},
{"name": "individualId", "type": "string", "doc": ""}, {"name": "primaryDiagnosisDisease", "type":
["null", {"type": "array", "items": "string"}], "doc": ""}, {"name": "primaryDiagnosisSubDisease",
"type": ["null", {"type": "array", "items": "string"}], "doc": ""}, {"name": "sex", "type": {"type":
"enum", "name": "Sex", "doc": "", "symbols": ["MALE", "FEMALE", "UNKNOWN"]}, "doc": ""}, {"name":
"additionalInformation", "type": ["null", {"type": "map", "values": "string"}], "doc": ""}, {"name":
"assignedICD10", "type": ["null", {"type": "array", "items": "string"}], "doc": ""}, {"name":
"tumourSamples", "type": {"type": "array", "items": {"type": "record", "name": "TumourSample",
"doc": "", "fields": [{"name": "sampleId", "type": "string", "doc": ""}, {"name": "labSampleId",
"type": "string", "doc": ""}, {"name": "LDPCode", "type": "string", "doc": ""}, {"name": "tumourId",
"type": "string", "doc": ""}, {"name": "programmePhase", "type": ["null", {"type": "enum", "name":
"ProgrammePhase", "symbols": ["CRUK", "OXFORD", "CLL", "IIP", "MAIN", "EXPT"]}], "doc": ""},
{"name": "diseaseType", "type": ["null", "string"], "doc": ""}, {"name": "diseaseSubType", "type":
["null", "string"], "doc": ""}, {"name": "clinicalSampleDateTime", "type": ["null", "string"],
"doc": ""}, {"name": "tumourType", "type": ["null", {"type": "enum", "name": "TumourType",
"symbols": ["PRIMARY", "METASTATIC_RECURRENCE", "RECURRENCE_OF_PRIMARY_TUMOUR", "METASTASES"]}],
"doc": ""}, {"name": "tumourContent", "type": ["null", {"type": "enum", "name": "TumourContent",
"symbols": ["High", "Medium", "Low"]}], "doc": ""}, {"name": "source", "type": ["null", {"type":
"enum", "name": "SampleSource", "doc": "", "symbols": ["TUMOUR",
"BONE_MARROW_ASPIRATE_TUMOUR_SORTED_CELLS", "BONE_MARROW_ASPIRATE_TUMOUR_CELLS", "BLOOD", "SALIVA",
"FIBROBLAST", "TISSUE"]}], "doc": ""}, {"name": "preparationMethod", "type": ["null", {"type":
"enum", "name": "PreparationMethod", "symbols": ["EDTA", "ORAGENE", "FF", "FFPE",
"CD128_SORTED_CELLS", "ASPIRATE"]}], "doc": ""}, {"name": "tissueSource", "type": ["null", {"type":
"enum", "name": "TissueSource", "symbols": ["BMA_TUMOUR_SORTED_CELLS", "CT_GUIDED_BIOPSY",
"ENDOSCOPIC_BIOPSY", "ENDOSCOPIC_ULTRASOUND_GUIDED_BIOPSY", "ENDOSCOPIC_ULTRASOUND_GUIDED_FNA",
"LAPAROSCOPIC_BIOPSY", "LAPAROSCOPIC_EXCISION", "MRI_GUIDED_BIOPSY", "NON_GUIDED_BIOPSY",
"SURGICAL_RESECTION", "STEREOTACTICALLY_GUIDED_BIOPSY", "USS_GUIDED_BIOPSY", "NON_STANDARD_BIOPSY",
"NOT_SPECIFIED"]}], "doc": ""}, {"name": "product", "type": ["null", {"type": "enum", "name":
"Product", "symbols": ["DNA", "RNA"]}], "doc": ""}, {"name": "morphologyICD", "type": ["null",
"string"], "doc": ""}, {"name": "morphologySnomedCT", "type": ["null", "string"], "doc": ""},
{"name": "morphologySnomedRT", "type": ["null", "string"], "doc": ""}, {"name": "topographyICD",
"type": ["null", "string"], "doc": ""}, {"name": "topographySnomedCT", "type": ["null", "string"],
"doc": ""}, {"name": "topographySnomedRT", "type": ["null", "string"], "doc": ""}]}}, "doc": ""},
{"name": "germlineSamples", "type": {"type": "array", "items": {"type": "record", "name":
"GermlineSample", "doc": "", "fields": [{"name": "sampleId", "type": "string", "doc": ""}, {"name":
"labSampleId", "type": "string", "doc": ""}, {"name": "LDPCode", "type": "string", "doc": ""},
{"name": "source", "type": ["null", "SampleSource"], "doc": ""}, {"name": "product", "type":
["null", "Product"], "doc": ""}, {"name": "preparationMethod", "type": ["null",
"PreparationMethod"], "doc": ""}, {"name": "programmePhase", "type": ["null", "ProgrammePhase"],
"doc": ""}, {"name": "clinicalSampleDateTime", "type": ["null", "string"], "doc": ""}]}}, "doc":
""}, {"name": "matchedSamples", "type": {"type": "array", "items": {"type": "record", "name":
"MatchedSamples", "doc": "", "fields": [{"name": "germlineSampleId", "type": ["null", "string"],
"doc": ""}, {"name": "tumourSampleId", "type": ["null", "string"], "doc": ""}]}}, "doc": ""},
{"name": "versionControl", "type": ["null", {"type": "record", "name": "VersionControl", "fields":
[{"name": "GitVersionControl", "type": "string", "doc": "", "default": "1.1.3"}]}], "doc": ""}]}],
"doc": ""}, {"name": "otherFamilyHistory", "type": ["null", {"type": "record", "name":
"OtherFamilyHistory", "doc": "", "fields": [{"name": "maternalFamilyHistory", "type": ["null",
{"type": "array", "items": "string"}], "doc": ""}, {"name": "paternalFamilyHistory", "type":
["null", {"type": "array", "items": "string"}], "doc": ""}]}], "doc": ""}, {"name":
"genePanelsCoverage", "type": ["null", {"type": "map", "values": {"type": "map", "values": {"type":
"map", "values": "float"}}}], "doc": ""}, {"name": "interpretationFlags", "type": ["null", {"type":
"array", "items": {"type": "record", "name": "InterpretationFlag", "doc": "", "fields": [{"name":
"interpretationFlag", "type": {"type": "enum", "name": "InterpretationFlags", "doc": "", "symbols":
["mixed_chemistries", "mixedLab_preparation", "low_tumour_purity", "uniparental_isodisomy",
"uniparental_heterodisomy", "unusual_karyotype", "high_cnv_count",
"high_estimate_human_contamination_fraction", "mixed_recruiting_gmc", "suspected_mosaicism",
"low_quality_sample", "ffpe_tumour_sample", "ff_nano_tumour_sample",
"missing_values_for_proband_in_reported_variant", "reissued", "supplementary_report_errors",
"internal_use_only", "high_priority",
"suspected_increased_number_of_false_positive_heterozygous_loss_calls",
"suspected_poor_quality_cnv_calls", "cnv_calls_assumed_xx_karyo", "cnv_calls_assumed_xy_karyo",
"other"]}, "doc": ""}, {"name": "additionalDescription", "type": ["null", "string"], "doc": ""}]}}],
"doc": ""}, {"name": "additionalInfo", "type": ["null", {"type": "map", "values": "string"}], "doc":
""}]}}, {"name": "tieringResult", "type": ["null", {"type": "record", "name": "InterpretedGenome",
"doc": "", "fields": [{"name": "versionControl", "type": "ReportVersionControl", "doc": ""},
{"name": "interpretationRequestId", "type": "string", "doc": ""}, {"name":
"interpretationRequestVersion", "type": "int", "doc": ""}, {"name": "interpretationService", "type":
"string", "doc": ""}, {"name": "reportUrl", "type": ["null", "string"], "doc": ""}, {"name":
"variants", "type": ["null", {"type": "array", "items": {"type": "record", "name": "SmallVariant",
"doc": "", "fields": [{"name": "variantCoordinates", "type": {"type": "record", "name":
"VariantCoordinates", "doc": "", "fields": [{"name": "chromosome", "type": "string", "doc": ""},
{"name": "position", "type": "int", "doc": ""}, {"name": "reference", "type": "string", "doc": ""},
{"name": "alternate", "type": "string", "doc": ""}, {"name": "assembly", "type": "Assembly", "doc":
""}]}, "doc": ""}, {"name": "variantCalls", "type": {"type": "array", "items": {"type": "record",
"name": "VariantCall", "doc": "", "fields": [{"name": "participantId", "type": "string", "doc": ""},
{"name": "sampleId", "type": "string", "doc": ""}, {"name": "zygosity", "type": {"type": "enum",
"name": "Zygosity", "doc": "", "symbols": ["reference_homozygous", "heterozygous",
"alternate_homozygous", "missing", "half_missing_reference", "half_missing_alternate",
"alternate_hemizigous", "reference_hemizigous", "unk", "na"]}, "doc": ""}, {"name": "phaseGenotype",
"type": ["null", {"type": "record", "name": "PhaseGenotype", "fields": [{"name": "sortedAlleles",
"type": {"type": "array", "items": "string"}}, {"name": "phaseSet", "type": "int"}]}], "doc": ""},
{"name": "sampleVariantAlleleFrequency", "type": ["null", "double"], "doc": ""}, {"name":
"depthReference", "type": ["null", "int"], "doc": ""}, {"name": "depthAlternate", "type": ["null",
"int"], "doc": ""}, {"name": "numberOfCopies", "type": ["null", {"type": "array", "items": {"type":
"record", "name": "NumberOfCopies", "fields": [{"name": "numberOfCopies", "type": "int", "doc": ""},
{"name": "confidenceIntervalMaximum", "type": ["null", "int"]}, {"name":
"confidenceIntervalMinimum", "type": ["null", "int"]}]}}], "doc": ""}, {"name": "alleleOrigins",
"type": ["null", {"type": "array", "items": {"type": "enum", "name": "AlleleOrigin", "doc": "",
"symbols": ["de_novo_variant", "germline_variant", "maternal_variant", "paternal_variant",
"pedigree_specific_variant", "population_specific_variant", "somatic_variant"]}}], "doc": ""},
{"name": "supportingReadTypes", "type": ["null", {"type": "array", "items": {"type": "enum", "name":
"SupportingReadType", "symbols": ["spanning", "flanking", "inrepeat"]}}]}]}}, "doc": ""}, {"name":
"reportEvents", "type": {"type": "array", "items": {"type": "record", "name": "ReportEvent", "doc":
"", "fields": [{"name": "reportEventId", "type": "string", "doc": ""}, {"name": "phenotypes",
"type": {"type": "record", "name": "Phenotypes", "doc": "", "fields": [{"name":
"nonStandardPhenotype", "type": ["null", {"type": "array", "items": "string"}], "doc": ""}, {"name":
"standardPhenotypes", "type": ["null", {"type": "array", "items": {"type": "record", "name":
"StandardPhenotype", "doc": "", "fields": [{"name": "id", "type": "string"}, {"name": "name",
"type": ["null", "string"]}, {"name": "namespace", "type": ["null", "string"]}, {"name":
"definition", "type": ["null", "string"]}, {"name": "comment", "type": ["null", "string"]}, {"name":
"alternativeIds", "type": ["null", "string"]}, {"name": "synonyms", "type": ["null", "string"]},
{"name": "isA", "type": ["null", "string"]}, {"name": "ontology", "type": {"type": "record", "name":
"Ontology", "doc": "", "fields": [{"name": "name", "type": "string"}, {"name": "version", "type":
"string"}]}, "doc": ""}, {"name": "matchScore", "type": ["null", "float"], "doc": ""}]}}], "doc":
""}]}, "doc": ""}, {"name": "variantConsequences", "type": {"type": "array", "items": {"type":
"record", "name": "VariantConsequence", "doc": "", "fields": [{"name": "id", "type": "string",
"doc": ""}, {"name": "name", "type": ["null", "string"], "doc": ""}]}}, "doc": ""}, {"name":
"genePanel", "type": ["null", {"type": "record", "name": "GenePanel", "doc": "", "fields": [{"name":
"panelIdentifier", "type": ["null", "string"], "doc": ""}, {"name": "panelName", "type": ["null",
"string"], "doc": ""}, {"name": "panelVersion", "type": ["null", "string"], "doc": ""}, {"name":
"source", "type": ["null", "string"], "doc": ""}]}], "doc": ""}, {"name": "modeOfInheritance",
"type": {"type": "enum", "name": "ModeOfInheritance", "doc": "", "symbols": ["monoallelic",
"monoallelic_not_imprinted", "monoallelic_maternally_imprinted", "monoallelic_paternally_imprinted",
"biallelic", "monoallelic_and_biallelic", "monoallelic_and_more_severe_biallelic",
"xlinked_biallelic", "xlinked_monoallelic", "mitochondrial", "unknown", "na"]}, "doc": ""}, {"name":
"genomicEntities", "type": {"type": "array", "items": {"type": "record", "name": "GenomicEntity",
"doc": "", "fields": [{"name": "type", "type": {"type": "enum", "name": "GenomicEntityType", "doc":
"", "symbols": ["regulatory_region", "gene", "transcript", "intergenic", "gene_fusion",
"genomic_region", "cytobands"]}, "doc": ""}, {"name": "ensemblId", "type": ["null", "string"],
"doc": ""}, {"name": "geneSymbol", "type": ["null", "string"], "doc": ""}, {"name": "otherIds",
"type": ["null", {"type": "array", "items": {"type": "record", "name": "Identifier", "fields":
[{"name": "source", "type": "string", "doc": ""}, {"name": "identifier", "type": "string", "doc":
""}]}}], "doc": ""}]}}, "doc": ""}, {"name": "segregationPattern", "type": ["null", {"type": "enum",
"name": "SegregationPattern", "symbols": ["UniparentalIsodisomy", "SimpleRecessive",
"CompoundHeterozygous", "deNovo", "InheritedAutosomalDominant",
"InheritedAutosomalDominantMaternallyImprinted", "InheritedAutosomalDominantPaternallyImprinted",
"XLinkedCompoundHeterozygous", "XLinkedSimpleRecessive", "XLinkedMonoallelic",
"MitochondrialGenome"]}], "doc": ""}, {"name": "penetrance", "type": ["null", {"type": "enum",
"name": "Penetrance", "namespace": "org.gel.models.participant.avro", "doc": "", "symbols":
["complete", "incomplete"]}], "doc": ""}, {"name": "deNovoQualityScore", "type": ["null", "float"],
"doc": ""}, {"name": "fullyExplainsPhenotype", "type": ["null", "boolean"], "doc": ""}, {"name":
"groupOfVariants", "type": ["null", "int"], "doc": ""}, {"name": "eventJustification", "type":
["null", "string"], "doc": ""}, {"name": "roleInCancer", "type": ["null", {"type": "array", "items":
{"type": "enum", "name": "RoleInCancer", "doc": "", "symbols": ["oncogene", "tumor_suppressor_gene",
"both"]}}], "doc": ""}, {"name": "actions", "type": ["null", {"type": "record", "name": "Actions",
"doc": "", "fields": [{"name": "trials", "type": ["null", {"type": "array", "items": {"type":
"record", "name": "Trial", "fields": [{"name": "studyUrl", "type": "string", "doc": ""}, {"name":
"studyIdentifier", "type": "string", "doc": ""}, {"name": "startDate", "type": ["null", "string"],
"doc": ""}, {"name": "estimateCompletionDate", "type": ["null", "string"], "doc": ""}, {"name":
"title", "type": ["null", "string"], "doc": ""}, {"name": "phase", "type": ["null", {"type": "enum",
"name": "StudyPhase", "doc": "", "symbols": ["na", "early_phase1", "phase1", "phase1_phase2",
"phase2", "phase2_phase3", "phase3", "phase4"]}], "doc": ""}, {"name": "interventions", "type":
["null", {"type": "array", "items": {"type": "record", "name": "Intervention", "doc": "", "fields":
[{"name": "interventionType", "type": {"type": "enum", "name": "InterventionType", "doc": "",
"symbols": ["drug", "device", "procedure", "biological", "radiation", "behavioral", "genetic",
"dietary_supplement", "combination_product", "diagnostic_test", "other"]}, "doc": ""}, {"name":
"interventionName", "type": "string", "doc": ""}]}}], "doc": ""}, {"name": "conditions", "type":
["null", {"type": "array", "items": "string"}], "doc": ""}, {"name": "primaryPurpose", "type":
["null", {"type": "enum", "name": "PrimaryPurpose", "doc": "", "symbols": ["treatment",
"prevention", "diagnostic", "supportive_care", "screening", "health_services_research",
"basic_science", "device_feasibility", "other"]}], "doc": ""}, {"name": "studyType", "type":
["null", {"type": "enum", "name": "StudyType", "doc": "", "symbols": ["interventional",
"observational", "patient_registry", "expanded_access"]}], "doc": ""}, {"name":
"demogrphicElegibilityCriteria", "type": ["null", {"type": "record", "name":
"DemographicElegibilityCriteria", "fields": [{"name": "sex", "type":
"org.gel.models.participant.avro.Sex"}, {"name": "ageRange", "type": ["null", {"type": "record",
"name": "AgeRange", "fields": [{"name": "minimumAge", "type": "int"}, {"name": "maximumAge", "type":
"int"}, {"name": "timeunit", "type": {"type": "enum", "name": "TimeUnit", "symbols": ["years",
"months", "weeks", "days", "hours", "minutes", "na"]}}]}]}]}], "doc": ""}, {"name": "locations",
"type": ["null", {"type": "array", "items": {"type": "record", "name": "TrialLocation", "fields":
[{"name": "name", "type": ["null", "string"]}, {"name": "city", "type": ["null", "string"]},
{"name": "country", "type": ["null", "string"]}, {"name": "zip", "type": ["null", "string"]}]}}],
"doc": ""}, {"name": "variantActionable", "type": "boolean", "doc": ""}]}}]}, {"name": "prognosis",
"type": ["null", {"type": "array", "items": {"type": "record", "name": "Prognosis", "fields":
[{"name": "referenceUrl", "type": "string", "doc": ""}, {"name": "prognosis", "type": ["null",
{"type": "enum", "name": "PrognosisClassification", "symbols": ["altered_prognosis",
"favourable_prognosis", "unfavourable_prognosis"]}], "doc": ""}, {"name": "source", "type": ["null",
"string"], "doc": ""}, {"name": "references", "type": ["null", {"type": "array", "items":
"string"}], "doc": ""}, {"name": "conditions", "type": ["null", {"type": "array", "items":
"string"}], "doc": ""}, {"name": "description", "type": ["null", "string"], "doc": ""}, {"name":
"variantActionable", "type": "boolean", "doc": ""}]}}]}, {"name": "therapies", "type": ["null",
{"type": "array", "items": {"type": "record", "name": "Therapy", "fields": [{"name": "referenceUrl",
"type": "string", "doc": ""}, {"name": "source", "type": ["null", "string"], "doc": ""}, {"name":
"references", "type": ["null", {"type": "array", "items": "string"}], "doc": ""}, {"name":
"conditions", "type": ["null", {"type": "array", "items": "string"}], "doc": ""}, {"name":
"drugResponse", "type": ["null", {"type": "array", "items": {"type": "record", "name":
"DrugResponse", "fields": [{"name": "TreatmentAgent", "type": "string", "doc": ""}, {"name":
"drugResponseClassification", "type": {"type": "enum", "name": "DrugResponseClassification",
"symbols": ["altered_sensitivity", "reduced_sensitivity", "increased_sensitivity",
"altered_resistance", "increased_resistance", "reduced_resistance", "increased_risk_of_toxicity",
"reduced_risk_of_toxicity", "altered_toxicity", "adverse_drug_reaction", "indication",
"contraindication", "dosing_alteration", "increased_dose", "reduced_dose", "increased_monitoring",
"increased_efficacy", "reduced_efficacy", "altered_efficacy"]}, "doc": ""}]}}], "doc": ""}, {"name":
"otherInterventions", "type": ["null", {"type": "array", "items": "Intervention"}], "doc": ""},
{"name": "variantActionable", "type": "boolean", "doc": ""}]}}]}]}], "doc": ""}, {"name": "score",
"type": ["null", "float"], "doc": ""}, {"name": "vendorSpecificScores", "type": ["null", {"type":
"map", "values": "float"}], "doc": ""}, {"name": "variantClassification", "type": ["null", {"type":
"record", "name": "VariantClassification", "doc": "", "fields": [{"name": "clinicalSignificance",
"type": ["null", {"type": "enum", "name": "ClinicalSignificance", "symbols": ["benign",
"likely_benign", "likely_pathogenic", "pathogenic", "uncertain_significance"]}], "doc": ""},
{"name": "drugResponseClassification", "type": ["null", "DrugResponseClassification"], "doc": ""},
{"name": "traitAssociation", "type": ["null", {"type": "enum", "name": "TraitAssociation",
"symbols": ["established_risk_allele", "likely_risk_allele", "uncertain_risk_allele",
"protective"]}], "doc": ""}, {"name": "tumorigenesisClassification", "type": ["null", {"type":
"enum", "name": "TumorigenesisClassification", "symbols": ["driver", "passenger", "modifier"]}],
"doc": ""}, {"name": "functionalEffect", "type": ["null", {"type": "enum", "name":
"VariantFunctionalEffect", "symbols": ["dominant_negative_variant", "gain_of_function_variant",
"lethal_variant", "loss_of_function_variant", "loss_of_heterozygosity", "null_variant"]}], "doc":
""}]}], "doc": ""}, {"name": "guidelineBasedVariantClassification", "type": ["null", {"type":
"record", "name": "GuidelineBasedVariantClassification", "doc": "", "fields": [{"name":
"acmgVariantClassification", "type": ["null", {"type": "record", "name":
"AcmgVariantClassification", "doc": "", "fields": [{"name": "acmgEvidences", "type": {"type":
"array", "items": {"type": "record", "name": "AcmgEvidence", "doc": "", "fields": [{"name":
"category", "type": {"type": "enum", "name": "AcmgEvidenceCategory", "doc": "", "symbols":
["population_data", "computational_and_predictive_data", "functional_data", "segregation_data",
"de_novo_data", "allelic_data", "other_database", "other_data"]}, "doc": ""}, {"name": "type",
"type": {"type": "enum", "name": "AcmgEvidenceType", "doc": "", "symbols": ["bening",
"pathogenic"]}, "doc": ""}, {"name": "weight", "type": {"type": "enum", "name":
"AcmgEvidenceWeight", "doc": "", "symbols": ["stand_alone", "supporting", "moderate", "strong",
"very_strong"]}, "doc": ""}, {"name": "modifier", "type": "int", "doc": ""}, {"name": "description",
"type": ["null", "string"], "doc": ""}]}}}, {"name": "clinicalSignificance", "type":
"ClinicalSignificance"}, {"name": "assessment", "type": ["null", "string"]}]}]}, {"name":
"ampVariantClassification", "type": ["null", {"type": "record", "name": "AmpVariantClassification",
"doc": "", "fields": [{"name": "ampEvidences", "type": {"type": "array", "items": {"type": "record",
"name": "AmpEvidence", "doc": "", "fields": [{"name": "type", "type": {"type": "enum", "name":
"AmpEvidenceType", "doc": "", "symbols": ["mutation_type", "therapies", "variant_frequencies",
"potential_germline", "population_database_presence", "germline_database_presence",
"somatic_database_presence", "impact_predictive_software", "pathway_involvement", "publications"]},
"doc": ""}, {"name": "evidenceAssessment", "type": "string", "doc": ""}]}}, "doc": ""}, {"name":
"ampTier", "type": {"type": "enum", "name": "AmpTier", "doc": "", "symbols": ["tierI", "tierII",
"tierIII", "tierIV"]}, "doc": ""}, {"name": "ampClincialOrExperimentalEvidence", "type": ["null",
{"type": "array", "items": {"type": "record", "name": "AmpClincialOrExperimentalEvidence", "doc":
"", "fields": [{"name": "category", "type": {"type": "enum", "name":
"AmpClinicalOrExperimentalEvidenceCategory", "doc": "", "symbols": ["therapeutic", "diagnosis",
"prognosis"]}, "doc": ""}, {"name": "level", "type": {"type": "enum", "name":
"AmpClinicalOrExperimentalEvidenceLevel", "doc": "", "symbols": ["levelA", "levelB", "levelC",
"levelD"]}, "doc": ""}, {"name": "description", "type": ["null", "string"], "doc": ""}]}}], "doc":
""}, {"name": "assessment", "type": ["null", "string"], "doc": ""}]}]}]}], "doc": ""}, {"name":
"algorithmBasedVariantClassifications", "type": ["null", {"type": "array", "items": {"type":
"record", "name": "AlgorithmBasedVariantClassification", "fields": [{"name": "algorithmName",
"type": "string", "doc": ""}, {"name": "classification", "type": "string", "doc": ""}, {"name":
"rank", "type": ["null", "int"], "doc": ""}, {"name": "score", "type": ["null", "int"], "doc":
""}]}}], "doc": ""}, {"name": "tier", "type": ["null", {"type": "enum", "name": "Tier", "doc": "",
"symbols": ["NONE", "TIER1", "TIER2", "TIER3", "TIER4", "TIER5", "TIERA", "TIERB"]}], "doc": ""},
{"name": "domain", "type": ["null", {"type": "enum", "name": "Domain", "symbols": ["DOMAIN1",
"DOMAIN2", "DOMAIN3", "DOMAIN4", "NONE"]}], "doc": ""}]}}, "doc": ""}, {"name": "variantAttributes",
"type": ["null", {"type": "record", "name": "VariantAttributes", "doc": "", "fields": [{"name":
"genomicChanges", "type": ["null", {"type": "array", "items": "string"}], "doc": ""}, {"name":
"cdnaChanges", "type": ["null", {"type": "array", "items": "string"}], "doc": ""}, {"name":
"proteinChanges", "type": ["null", {"type": "array", "items": "string"}], "doc": ""}, {"name":
"additionalTextualVariantAnnotations", "type": ["null", {"type": "map", "values": "string"}], "doc":
""}, {"name": "references", "type": ["null", {"type": "map", "values": "string"}], "doc": ""},
{"name": "variantIdentifiers", "type": ["null", {"type": "record", "name": "VariantIdentifiers",
"fields": [{"name": "dbSnpId", "type": ["null", "string"], "doc": ""}, {"name": "cosmicIds", "type":
["null", {"type": "array", "items": "string"}], "doc": ""}, {"name": "clinVarIds", "type": ["null",
{"type": "array", "items": "string"}], "doc": ""}, {"name": "otherIds", "type": ["null", {"type":
"array", "items": "Identifier"}]}]}]}, {"name": "alleleFrequencies", "type": ["null", {"type":
"array", "items": {"type": "record", "name": "AlleleFrequency", "doc": "", "fields": [{"name":
"study", "type": "string", "doc": ""}, {"name": "population", "type": "string", "doc": ""}, {"name":
"alternateFrequency", "type": "float", "doc": ""}]}}], "doc": ""}, {"name":
"additionalNumericVariantAnnotations", "type": ["null", {"type": "map", "values": "float"}], "doc":
""}, {"name": "comments", "type": ["null", {"type": "array", "items": "string"}], "doc": ""},
{"name": "alleleOrigins", "type": ["null", {"type": "array", "items": "AlleleOrigin"}], "doc": ""},
{"name": "ihp", "type": ["null", "int"], "doc": ""}, {"name": "recurrentlyReported", "type":
["null", "boolean"], "doc": ""}, {"name": "fdp50", "type": ["null", "float"], "doc": ""}, {"name":
"others", "type": ["null", {"type": "map", "values": "string"}], "doc": ""}]}]}]}}], "doc": ""},
{"name": "structuralVariants", "type": ["null", {"type": "array", "items": {"type": "record",
"name": "StructuralVariant", "fields": [{"name": "variantType", "type": {"type": "enum", "name":
"StructuralVariantType", "symbols": ["ins", "dup", "inv", "amplification", "deletion", "dup_tandem",
"del_me", "ins_me"]}, "doc": ""}, {"name": "coordinates", "type": {"type": "record", "name":
"Coordinates", "fields": [{"name": "assembly", "type": "Assembly"}, {"name": "chromosome", "type":
"string"}, {"name": "start", "type": "int"}, {"name": "end", "type": "int"}, {"name": "ciStart",
"type": ["null", {"type": "record", "name": "ConfidenceInterval", "fields": [{"name": "left",
"type": "int"}, {"name": "right", "type": "int"}]}]}, {"name": "ciEnd", "type": ["null",
"ConfidenceInterval"]}]}}, {"name": "leftInsSeq", "type": ["null", "string"]}, {"name":
"rightInsSeq", "type": ["null", "string"]}, {"name": "reportEvents", "type": {"type": "array",
"items": "ReportEvent"}}, {"name": "variantCalls", "type": {"type": "array", "items":
"VariantCall"}, "doc": ""}, {"name": "variantAttributes", "type": ["null",
"VariantAttributes"]}]}}], "doc": ""}, {"name": "chromosomalRearrangements", "type": ["null",
{"type": "array", "items": {"type": "record", "name": "ChromosomalRearrangement", "fields":
[{"name": "breakPoints", "type": ["null", {"type": "array", "items": {"type": "record", "name":
"BreakPoint", "fields": [{"name": "coordinates", "type": "Coordinates"}, {"name": "reference",
"type": ["null", "string"]}, {"name": "alternate", "type": ["null", "string"]}, {"name": "info",
"type": ["null", {"type": "map", "values": "string"}]}]}}]}, {"name": "rearrangements", "type":
{"type": "array", "items": {"type": "record", "name": "Rearrangement", "fields": [{"name":
"leftCoordinates", "type": "Coordinates"}, {"name": "rightCoordinates", "type": "Coordinates"},
{"name": "orientation", "type": {"type": "enum", "name": "Orientation", "symbols": ["start_start",
"start_end", "end_end"]}}, {"name": "leftInsSeq", "type": ["null", "string"]}, {"name":
"rightInsSeq", "type": ["null", "string"]}]}}}, {"name": "reportEvents", "type": {"type": "array",
"items": "ReportEvent"}}, {"name": "variantCalls", "type": {"type": "array", "items":
"VariantCall"}, "doc": ""}, {"name": "variantAttributes", "type": ["null",
"VariantAttributes"]}]}}], "doc": ""}, {"name": "shortTandemRepeats", "type": ["null", {"type":
"array", "items": {"type": "record", "name": "ShortTandemRepeat", "fields": [{"name": "coordinates",
"type": "Coordinates"}, {"name": "reportEvents", "type": {"type": "array", "items": "ReportEvent"}},
{"name": "variantCalls", "type": {"type": "array", "items": "VariantCall"}, "doc": ""}, {"name":
"variantAttributes", "type": ["null", "VariantAttributes"]}, {"name":
"shortTandemRepeatReferenceData", "type": ["null", {"type": "record", "name":
"ShortTandemRepeatReferenceData", "fields": [{"name": "repeatedSequence", "type": "string"},
{"name": "pathogenic_number_of_repeats_threshold", "type": "int"}, {"name":
"normal_number_of_repeats_threshold", "type": "int"}]}]}]}}], "doc": ""}, {"name":
"uniparentalDisomies", "type": ["null", {"type": "array", "items": {"type": "record", "name":
"UniparentalDisomy", "fields": [{"name": "assembly", "type": "Assembly", "doc": ""}, {"name":
"chromosome", "type": "string", "doc": ""}, {"name": "complete", "type": ["null", "boolean"], "doc":
""}, {"name": "origin", "type": {"type": "enum", "name": "UniparentalDisomyOrigin", "symbols":
["paternal", "maternal", "unknown"]}, "doc": ""}, {"name": "uniparentalDisomyFragments", "type":
["null", {"type": "array", "items": {"type": "record", "name": "UniparentalDisomyFragment",
"fields": [{"name": "coordinates", "type": ["null", "Coordinates"], "doc": ""}, {"name":
"uniparentalDisomyType", "type": {"type": "enum", "name": "UniparentalDisomyType", "symbols":
["isodisomy", "heterodisomy", "both"]}, "doc": ""}]}}], "doc": ""}, {"name": "participantId",
"type": "string", "doc": ""}, {"name": "uniparentalDisomyEvidences", "type": ["null", {"type":
"record", "name": "UniparentalDisomyEvidences", "fields": [{"name": "ibds", "type": ["null",
{"type": "array", "items": {"type": "record", "name": "IdentityByDescent", "fields": [{"name":
"relatedSample", "type": "string"}, {"name": "ibd0", "type": "float"}, {"name": "ibd1", "type":
"float"}, {"name": "ibd2", "type": "float"}, {"name": "pihat", "type": "float"}]}}]}]}], "doc":
""}]}}], "doc": ""}, {"name": "karyotypes", "type": ["null", {"type": "array", "items": {"type":
"record", "name": "Karyotype", "fields": [{"name": "iscn", "type": ["null", "string"], "doc": ""},
{"name": "description", "type": ["null", "string"], "doc": ""}, {"name": "aneuploidies", "type":
["null", {"type": "array", "items": {"type": "record", "name": "Aneuploidy", "fields": [{"name":
"iscn", "type": ["null", "string"], "doc": ""}, {"name": "assembly", "type": "Assembly", "doc": ""},
{"name": "chromosome", "type": "string", "doc": ""}, {"name": "complete", "type": "boolean", "doc":
""}, {"name": "coordinates", "type": ["null", "Coordinates"], "doc": ""}, {"name": "numberOfCopies",
"type": "int", "doc": ""}]}}], "doc": ""}, {"name": "numberOfChromosomes", "type": "int", "doc":
""}, {"name": "personKaryotipicSex", "type": {"type": "enum", "name": "PersonKaryotipicSex",
"namespace": "org.gel.models.participant.avro", "doc": "", "symbols": ["UNKNOWN", "XX", "XY", "XO",
"XXY", "XXX", "XXYY", "XXXY", "XXXX", "XYY", "OTHER"]}, "doc": ""}, {"name": "participantId",
"type": "string", "doc": ""}]}}], "doc": ""}, {"name": "referenceDatabasesVersions", "type":
{"type": "map", "values": "string"}, "doc": ""}, {"name": "softwareVersions", "type": {"type":
"map", "values": "string"}, "doc": ""}, {"name": "comments", "type": ["null", {"type": "array",
"items": "string"}], "doc": ""}]}]}, {"name": "otherInterpretationResults", "type": ["null",
{"type": "array", "items": "InterpretedGenome"}]}]}
"""
    schema = avro_parse(_schemaSource)
    requiredFields = {
        "interpretationMetaData",
        "otherInterpretationResults",
        "tieringResult",
    }

    @classmethod
    def isEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'interpretationMetaData': CancerInterpretationRequest,
            'otherInterpretationResults': InterpretedGenome,
            'tieringResult': InterpretedGenome,
        }
        return fieldName in embeddedTypes

    @classmethod
    def getEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'interpretationMetaData': CancerInterpretationRequest,
            'otherInterpretationResults': InterpretedGenome,
            'tieringResult': InterpretedGenome,
        }

        return embeddedTypes[fieldName]

    __slots__ = [
        'interpretationMetaData', 'otherInterpretationResults',
        'tieringResult'
    ]

    def __init__(self, **kwargs):
        self.interpretationMetaData = kwargs.get(
            'interpretationMetaData', CancerInterpretationRequest())
        self.otherInterpretationResults = kwargs.get(
            'otherInterpretationResults', None)
        self.tieringResult = kwargs.get(
            'tieringResult', None)


class InterpretationDataRd(ProtocolElement):
    """
    Represents the set of all interpretation data (excluding file
    contents) to be stored in MDT for one TieringResult. Semantic
    restrictions (not automatically verifiable):  * All
    InterpretedGenomes in interpretationResults refer to the
    TieringResult tieringResult. * All InterpretedGenomes in
    interpretationResults have passed the QC stage and have been
    approved by the originating GMCs
    """
    _schemaSource = """
{"type": "record", "name": "InterpretationDataRd", "namespace": "org.gel.models.report.avro", "doc":
"", "fields": [{"name": "interpretationMetaData", "type": {"type": "record", "name":
"InterpretationRequestRD", "doc": "", "fields": [{"name": "versionControl", "type": {"type":
"record", "name": "ReportVersionControl", "fields": [{"name": "gitVersionControl", "type": "string",
"doc": "", "default": "6.0.2"}]}, "doc": ""}, {"name": "interpretationRequestId", "type": "string",
"doc": ""}, {"name": "interpretationRequestVersion", "type": "int", "doc": ""}, {"name":
"internalStudyId", "type": "string", "doc": ""}, {"name": "familyInternalId", "type": ["null",
"string"], "doc": ""}, {"name": "genomeAssembly", "type": {"type": "enum", "name": "Assembly",
"doc": "", "symbols": ["GRCh38", "GRCh37"]}, "doc": ""}, {"name": "workspace", "type": {"type":
"array", "items": "string"}, "doc": ""}, {"name": "bams", "type": ["null", {"type": "array",
"items": {"type": "record", "name": "File", "doc": "", "fields": [{"name": "sampleId", "type":
["null", {"type": "array", "items": "string"}], "doc": ""}, {"name": "uriFile", "type": "string",
"doc": ""}, {"name": "fileType", "type": {"type": "enum", "name": "FileType", "symbols": ["BAM",
"gVCF", "VCF_small", "VCF_somatic_small", "VCF_CNV", "VCF_somatic_CNV", "VCF_SV", "VCF_somatic_SV",
"VCF_SV_CNV", "SVG", "ANN", "BigWig", "MD5Sum", "ROH", "OTHER", "PARTITION", "VARIANT_FREQUENCIES",
"COVERAGE"]}, "doc": ""}, {"name": "md5Sum", "type": ["null", "string"], "doc": ""}]}}], "doc": ""},
{"name": "vcfs", "type": ["null", {"type": "array", "items": "File"}], "doc": ""}, {"name":
"bigWigs", "type": ["null", {"type": "array", "items": "File"}], "doc": ""}, {"name":
"pedigreeDiagram", "type": ["null", "File"], "doc": ""}, {"name": "annotationFile", "type": ["null",
"File"], "doc": ""}, {"name": "otherFiles", "type": ["null", {"type": "map", "values": "File"}],
"doc": ""}, {"name": "pedigree", "type": ["null", {"type": "record", "name": "Pedigree",
"namespace": "org.gel.models.participant.avro", "doc": "", "fields": [{"name": "versionControl",
"type": ["null", {"type": "record", "name": "VersionControl", "fields": [{"name":
"GitVersionControl", "type": "string", "doc": "", "default": "1.1.3"}]}], "doc": ""}, {"name":
"LDPCode", "type": ["null", "string"], "doc": ""}, {"name": "familyId", "type": "string", "doc":
""}, {"name": "members", "type": {"type": "array", "items": {"type": "record", "name":
"PedigreeMember", "doc": "", "fields": [{"name": "pedigreeId", "type": ["null", "int"], "doc": ""},
{"name": "isProband", "type": ["null", "boolean"], "doc": ""}, {"name": "participantId", "type":
["null", "string"], "doc": ""}, {"name": "participantQCState", "type": ["null", {"type": "enum",
"name": "ParticipantQCState", "doc": "", "symbols": ["noState",
"passedMedicalReviewReadyForInterpretation", "passedMedicalReviewNotReadyForInterpretation",
"queryToGel", "queryToGMC", "failed"]}], "doc": ""}, {"name": "gelSuperFamilyId", "type": ["null",
"string"], "doc": ""}, {"name": "sex", "type": {"type": "enum", "name": "Sex", "doc": "", "symbols":
["MALE", "FEMALE", "UNKNOWN"]}, "doc": ""}, {"name": "personKaryotypicSex", "type": ["null",
{"type": "enum", "name": "PersonKaryotipicSex", "doc": "", "symbols": ["UNKNOWN", "XX", "XY", "XO",
"XXY", "XXX", "XXYY", "XXXY", "XXXX", "XYY", "OTHER"]}], "doc": ""}, {"name": "yearOfBirth", "type":
["null", "int"], "doc": ""}, {"name": "fatherId", "type": ["null", "int"], "doc": ""}, {"name":
"motherId", "type": ["null", "int"], "doc": ""}, {"name": "superFatherId", "type": ["null", "int"],
"doc": ""}, {"name": "superMotherId", "type": ["null", "int"], "doc": ""}, {"name": "twinGroup",
"type": ["null", "int"], "doc": ""}, {"name": "monozygotic", "type": ["null", {"type": "enum",
"name": "TernaryOption", "doc": "", "symbols": ["yes", "no", "unknown"]}], "doc": ""}, {"name":
"adoptedStatus", "type": ["null", {"type": "enum", "name": "AdoptedStatus", "doc": "", "symbols":
["notadopted", "adoptedin", "adoptedout"]}], "doc": ""}, {"name": "lifeStatus", "type": ["null",
{"type": "enum", "name": "LifeStatus", "doc": "", "symbols": ["ALIVE", "ABORTED", "DECEASED",
"UNBORN", "STILLBORN", "MISCARRIAGE"]}], "doc": ""}, {"name": "consanguineousParents", "type":
["null", "TernaryOption"], "doc": ""}, {"name": "affectionStatus", "type": ["null", {"type": "enum",
"name": "AffectionStatus", "doc": "", "symbols": ["UNAFFECTED", "AFFECTED", "UNCERTAIN"]}], "doc":
""}, {"name": "disorderList", "type": ["null", {"type": "array", "items": {"type": "record", "name":
"Disorder", "doc": "", "fields": [{"name": "diseaseGroup", "type": ["null", "string"], "doc": ""},
{"name": "diseaseSubGroup", "type": ["null", "string"], "doc": ""}, {"name": "specificDisease",
"type": ["null", "string"], "doc": ""}, {"name": "ageOfOnset", "type": ["null", "float"], "doc":
""}]}}], "doc": ""}, {"name": "hpoTermList", "type": ["null", {"type": "array", "items": {"type":
"record", "name": "HpoTerm", "doc": "", "fields": [{"name": "term", "type": "string", "doc": ""},
{"name": "termPresence", "type": ["null", "TernaryOption"], "doc": ""}, {"name": "hpoBuildNumber",
"type": ["null", "string"], "doc": ""}, {"name": "modifiers", "type": ["null", {"type": "record",
"name": "HpoTermModifiers", "fields": [{"name": "laterality", "type": ["null", {"type": "enum",
"name": "Laterality", "symbols": ["RIGHT", "UNILATERAL", "BILATERAL", "LEFT"]}]}, {"name":
"progression", "type": ["null", {"type": "enum", "name": "Progression", "symbols": ["PROGRESSIVE",
"NONPROGRESSIVE"]}]}, {"name": "severity", "type": ["null", {"type": "enum", "name": "Severity",
"symbols": ["BORDERLINE", "MILD", "MODERATE", "SEVERE", "PROFOUND"]}]}, {"name": "spatialPattern",
"type": ["null", {"type": "enum", "name": "SpatialPattern", "symbols": ["DISTAL", "GENERALIZED",
"LOCALIZED", "PROXIMAL"]}]}]}], "doc": ""}, {"name": "ageOfOnset", "type": ["null", {"type": "enum",
"name": "AgeOfOnset", "symbols": ["EMBRYONAL_ONSET", "FETAL_ONSET", "NEONATAL_ONSET",
"INFANTILE_ONSET", "CHILDHOOD_ONSET", "JUVENILE_ONSET", "YOUNG_ADULT_ONSET", "LATE_ONSET",
"MIDDLE_AGE_ONSET"]}], "doc": ""}]}}], "doc": ""}, {"name": "ancestries", "type": ["null", {"type":
"record", "name": "Ancestries", "doc": "", "fields": [{"name": "mothersEthnicOrigin", "type":
["null", {"type": "enum", "name": "EthnicCategory", "doc": "", "symbols": ["D", "E", "F", "G", "A",
"B", "C", "L", "M", "N", "H", "J", "K", "P", "S", "R", "Z"]}], "doc": ""}, {"name":
"mothersOtherRelevantAncestry", "type": ["null", "string"], "doc": ""}, {"name":
"fathersEthnicOrigin", "type": ["null", "EthnicCategory"], "doc": ""}, {"name":
"fathersOtherRelevantAncestry", "type": ["null", "string"], "doc": ""}, {"name":
"chiSquare1KGenomesPhase3Pop", "type": ["null", {"type": "array", "items": {"type": "record",
"name": "ChiSquare1KGenomesPhase3Pop", "doc": "", "fields": [{"name": "kgSuperPopCategory", "type":
{"type": "enum", "name": "KgSuperPopCategory", "doc": "", "symbols": ["AFR", "AMR", "EAS", "EUR",
"SAS"]}, "doc": ""}, {"name": "kgPopCategory", "type": ["null", {"type": "enum", "name":
"KgPopCategory", "doc": "", "symbols": ["ACB", "ASW", "BEB", "CDX", "CEU", "CHB", "CHS", "CLM",
"ESN", "FIN", "GBR", "GIH", "GWD", "IBS", "ITU", "JPT", "KHV", "LWK", "MSL", "MXL", "PEL", "PJL",
"PUR", "STU", "TSI", "YRI"]}], "doc": ""}, {"name": "chiSquare", "type": "double", "doc": ""}]}}],
"doc": ""}]}], "doc": ""}, {"name": "consentStatus", "type": ["null", {"type": "record", "name":
"ConsentStatus", "doc": "", "fields": [{"name": "programmeConsent", "type": "boolean", "doc": "",
"default": false}, {"name": "primaryFindingConsent", "type": "boolean", "doc": "", "default":
false}, {"name": "secondaryFindingConsent", "type": "boolean", "doc": "", "default": false},
{"name": "carrierStatusConsent", "type": "boolean", "doc": "", "default": false}]}], "doc": ""},
{"name": "samples", "type": ["null", {"type": "array", "items": {"type": "record", "name": "Sample",
"fields": [{"name": "sampleId", "type": "string", "doc": ""}, {"name": "labSampleId", "type":
"string", "doc": ""}, {"name": "source", "type": ["null", {"type": "enum", "name": "SampleSource",
"doc": "", "symbols": ["TUMOUR", "BONE_MARROW_ASPIRATE_TUMOUR_SORTED_CELLS",
"BONE_MARROW_ASPIRATE_TUMOUR_CELLS", "BLOOD", "SALIVA", "FIBROBLAST", "TISSUE"]}], "doc": ""},
{"name": "product", "type": ["null", {"type": "enum", "name": "Product", "symbols": ["DNA",
"RNA"]}], "doc": ""}, {"name": "preparationMethod", "type": ["null", {"type": "enum", "name":
"PreparationMethod", "symbols": ["EDTA", "ORAGENE", "FF", "FFPE", "CD128_SORTED_CELLS",
"ASPIRATE"]}], "doc": ""}]}}], "doc": ""}, {"name": "inbreedingCoefficient", "type": ["null",
{"type": "record", "name": "InbreedingCoefficient", "doc": "", "fields": [{"name": "sampleId",
"type": "string", "doc": ""}, {"name": "program", "type": "string", "doc": ""}, {"name": "version",
"type": "string", "doc": ""}, {"name": "estimationMethod", "type": "string", "doc": ""}, {"name":
"coefficient", "type": "double", "doc": ""}, {"name": "standardError", "type": ["null", "double"],
"doc": ""}]}], "doc": ""}, {"name": "additionalInformation", "type": ["null", {"type": "map",
"values": "string"}], "doc": ""}]}}, "doc": ""}, {"name": "analysisPanels", "type": ["null",
{"type": "array", "items": {"type": "record", "name": "AnalysisPanel", "doc": "", "fields":
[{"name": "specificDisease", "type": "string", "doc": ""}, {"name": "panelName", "type": "string",
"doc": ""}, {"name": "panelVersion", "type": ["null", "string"], "doc": ""}, {"name":
"reviewOutcome", "type": "string", "doc": ""}, {"name": "multipleGeneticOrigins", "type": "string",
"doc": ""}]}}], "doc": ""}, {"name": "diseasePenetrances", "type": ["null", {"type": "array",
"items": {"type": "record", "name": "DiseasePenetrance", "doc": "", "fields": [{"name":
"specificDisease", "type": "string", "doc": ""}, {"name": "penetrance", "type": {"type": "enum",
"name": "Penetrance", "doc": "", "symbols": ["complete", "incomplete"]}, "doc": ""}]}}], "doc": ""},
{"name": "readyForAnalysis", "type": "boolean", "doc": ""}, {"name": "familyQCState", "type":
["null", {"type": "enum", "name": "FamilyQCState", "doc": "", "symbols": ["noState",
"passedMedicalReviewReadyForInterpretation", "passedMedicalReviewNotReadyForInterpretation",
"queryToGel", "queryToGMC", "failed"]}], "doc": ""}]}], "doc": ""}, {"name": "otherFamilyHistory",
"type": ["null", {"type": "record", "name": "OtherFamilyHistory", "doc": "", "fields": [{"name":
"maternalFamilyHistory", "type": ["null", {"type": "array", "items": "string"}], "doc": ""},
{"name": "paternalFamilyHistory", "type": ["null", {"type": "array", "items": "string"}], "doc":
""}]}], "doc": ""}, {"name": "genePanelsCoverage", "type": ["null", {"type": "map", "values":
{"type": "map", "values": {"type": "map", "values": "float"}}}], "doc": ""}, {"name":
"interpretationFlags", "type": ["null", {"type": "array", "items": {"type": "record", "name":
"InterpretationFlag", "doc": "", "fields": [{"name": "interpretationFlag", "type": {"type": "enum",
"name": "InterpretationFlags", "doc": "", "symbols": ["mixed_chemistries", "mixedLab_preparation",
"low_tumour_purity", "uniparental_isodisomy", "uniparental_heterodisomy", "unusual_karyotype",
"high_cnv_count", "high_estimate_human_contamination_fraction", "mixed_recruiting_gmc",
"suspected_mosaicism", "low_quality_sample", "ffpe_tumour_sample", "ff_nano_tumour_sample",
"missing_values_for_proband_in_reported_variant", "reissued", "supplementary_report_errors",
"internal_use_only", "high_priority",
"suspected_increased_number_of_false_positive_heterozygous_loss_calls",
"suspected_poor_quality_cnv_calls", "cnv_calls_assumed_xx_karyo", "cnv_calls_assumed_xy_karyo",
"other"]}, "doc": ""}, {"name": "additionalDescription", "type": ["null", "string"], "doc": ""}]}}],
"doc": ""}, {"name": "additionalInfo", "type": ["null", {"type": "map", "values": "string"}], "doc":
""}]}}, {"name": "tieringResult", "type": ["null", {"type": "record", "name": "InterpretedGenome",
"doc": "", "fields": [{"name": "versionControl", "type": "ReportVersionControl", "doc": ""},
{"name": "interpretationRequestId", "type": "string", "doc": ""}, {"name":
"interpretationRequestVersion", "type": "int", "doc": ""}, {"name": "interpretationService", "type":
"string", "doc": ""}, {"name": "reportUrl", "type": ["null", "string"], "doc": ""}, {"name":
"variants", "type": ["null", {"type": "array", "items": {"type": "record", "name": "SmallVariant",
"doc": "", "fields": [{"name": "variantCoordinates", "type": {"type": "record", "name":
"VariantCoordinates", "doc": "", "fields": [{"name": "chromosome", "type": "string", "doc": ""},
{"name": "position", "type": "int", "doc": ""}, {"name": "reference", "type": "string", "doc": ""},
{"name": "alternate", "type": "string", "doc": ""}, {"name": "assembly", "type": "Assembly", "doc":
""}]}, "doc": ""}, {"name": "variantCalls", "type": {"type": "array", "items": {"type": "record",
"name": "VariantCall", "doc": "", "fields": [{"name": "participantId", "type": "string", "doc": ""},
{"name": "sampleId", "type": "string", "doc": ""}, {"name": "zygosity", "type": {"type": "enum",
"name": "Zygosity", "doc": "", "symbols": ["reference_homozygous", "heterozygous",
"alternate_homozygous", "missing", "half_missing_reference", "half_missing_alternate",
"alternate_hemizigous", "reference_hemizigous", "unk", "na"]}, "doc": ""}, {"name": "phaseGenotype",
"type": ["null", {"type": "record", "name": "PhaseGenotype", "fields": [{"name": "sortedAlleles",
"type": {"type": "array", "items": "string"}}, {"name": "phaseSet", "type": "int"}]}], "doc": ""},
{"name": "sampleVariantAlleleFrequency", "type": ["null", "double"], "doc": ""}, {"name":
"depthReference", "type": ["null", "int"], "doc": ""}, {"name": "depthAlternate", "type": ["null",
"int"], "doc": ""}, {"name": "numberOfCopies", "type": ["null", {"type": "array", "items": {"type":
"record", "name": "NumberOfCopies", "fields": [{"name": "numberOfCopies", "type": "int", "doc": ""},
{"name": "confidenceIntervalMaximum", "type": ["null", "int"]}, {"name":
"confidenceIntervalMinimum", "type": ["null", "int"]}]}}], "doc": ""}, {"name": "alleleOrigins",
"type": ["null", {"type": "array", "items": {"type": "enum", "name": "AlleleOrigin", "doc": "",
"symbols": ["de_novo_variant", "germline_variant", "maternal_variant", "paternal_variant",
"pedigree_specific_variant", "population_specific_variant", "somatic_variant"]}}], "doc": ""},
{"name": "supportingReadTypes", "type": ["null", {"type": "array", "items": {"type": "enum", "name":
"SupportingReadType", "symbols": ["spanning", "flanking", "inrepeat"]}}]}]}}, "doc": ""}, {"name":
"reportEvents", "type": {"type": "array", "items": {"type": "record", "name": "ReportEvent", "doc":
"", "fields": [{"name": "reportEventId", "type": "string", "doc": ""}, {"name": "phenotypes",
"type": {"type": "record", "name": "Phenotypes", "doc": "", "fields": [{"name":
"nonStandardPhenotype", "type": ["null", {"type": "array", "items": "string"}], "doc": ""}, {"name":
"standardPhenotypes", "type": ["null", {"type": "array", "items": {"type": "record", "name":
"StandardPhenotype", "doc": "", "fields": [{"name": "id", "type": "string"}, {"name": "name",
"type": ["null", "string"]}, {"name": "namespace", "type": ["null", "string"]}, {"name":
"definition", "type": ["null", "string"]}, {"name": "comment", "type": ["null", "string"]}, {"name":
"alternativeIds", "type": ["null", "string"]}, {"name": "synonyms", "type": ["null", "string"]},
{"name": "isA", "type": ["null", "string"]}, {"name": "ontology", "type": {"type": "record", "name":
"Ontology", "doc": "", "fields": [{"name": "name", "type": "string"}, {"name": "version", "type":
"string"}]}, "doc": ""}, {"name": "matchScore", "type": ["null", "float"], "doc": ""}]}}], "doc":
""}]}, "doc": ""}, {"name": "variantConsequences", "type": {"type": "array", "items": {"type":
"record", "name": "VariantConsequence", "doc": "", "fields": [{"name": "id", "type": "string",
"doc": ""}, {"name": "name", "type": ["null", "string"], "doc": ""}]}}, "doc": ""}, {"name":
"genePanel", "type": ["null", {"type": "record", "name": "GenePanel", "doc": "", "fields": [{"name":
"panelIdentifier", "type": ["null", "string"], "doc": ""}, {"name": "panelName", "type": ["null",
"string"], "doc": ""}, {"name": "panelVersion", "type": ["null", "string"], "doc": ""}, {"name":
"source", "type": ["null", "string"], "doc": ""}]}], "doc": ""}, {"name": "modeOfInheritance",
"type": {"type": "enum", "name": "ModeOfInheritance", "doc": "", "symbols": ["monoallelic",
"monoallelic_not_imprinted", "monoallelic_maternally_imprinted", "monoallelic_paternally_imprinted",
"biallelic", "monoallelic_and_biallelic", "monoallelic_and_more_severe_biallelic",
"xlinked_biallelic", "xlinked_monoallelic", "mitochondrial", "unknown", "na"]}, "doc": ""}, {"name":
"genomicEntities", "type": {"type": "array", "items": {"type": "record", "name": "GenomicEntity",
"doc": "", "fields": [{"name": "type", "type": {"type": "enum", "name": "GenomicEntityType", "doc":
"", "symbols": ["regulatory_region", "gene", "transcript", "intergenic", "gene_fusion",
"genomic_region", "cytobands"]}, "doc": ""}, {"name": "ensemblId", "type": ["null", "string"],
"doc": ""}, {"name": "geneSymbol", "type": ["null", "string"], "doc": ""}, {"name": "otherIds",
"type": ["null", {"type": "array", "items": {"type": "record", "name": "Identifier", "fields":
[{"name": "source", "type": "string", "doc": ""}, {"name": "identifier", "type": "string", "doc":
""}]}}], "doc": ""}]}}, "doc": ""}, {"name": "segregationPattern", "type": ["null", {"type": "enum",
"name": "SegregationPattern", "symbols": ["UniparentalIsodisomy", "SimpleRecessive",
"CompoundHeterozygous", "deNovo", "InheritedAutosomalDominant",
"InheritedAutosomalDominantMaternallyImprinted", "InheritedAutosomalDominantPaternallyImprinted",
"XLinkedCompoundHeterozygous", "XLinkedSimpleRecessive", "XLinkedMonoallelic",
"MitochondrialGenome"]}], "doc": ""}, {"name": "penetrance", "type": ["null",
"org.gel.models.participant.avro.Penetrance"], "doc": ""}, {"name": "deNovoQualityScore", "type":
["null", "float"], "doc": ""}, {"name": "fullyExplainsPhenotype", "type": ["null", "boolean"],
"doc": ""}, {"name": "groupOfVariants", "type": ["null", "int"], "doc": ""}, {"name":
"eventJustification", "type": ["null", "string"], "doc": ""}, {"name": "roleInCancer", "type":
["null", {"type": "array", "items": {"type": "enum", "name": "RoleInCancer", "doc": "", "symbols":
["oncogene", "tumor_suppressor_gene", "both"]}}], "doc": ""}, {"name": "actions", "type": ["null",
{"type": "record", "name": "Actions", "doc": "", "fields": [{"name": "trials", "type": ["null",
{"type": "array", "items": {"type": "record", "name": "Trial", "fields": [{"name": "studyUrl",
"type": "string", "doc": ""}, {"name": "studyIdentifier", "type": "string", "doc": ""}, {"name":
"startDate", "type": ["null", "string"], "doc": ""}, {"name": "estimateCompletionDate", "type":
["null", "string"], "doc": ""}, {"name": "title", "type": ["null", "string"], "doc": ""}, {"name":
"phase", "type": ["null", {"type": "enum", "name": "StudyPhase", "doc": "", "symbols": ["na",
"early_phase1", "phase1", "phase1_phase2", "phase2", "phase2_phase3", "phase3", "phase4"]}], "doc":
""}, {"name": "interventions", "type": ["null", {"type": "array", "items": {"type": "record",
"name": "Intervention", "doc": "", "fields": [{"name": "interventionType", "type": {"type": "enum",
"name": "InterventionType", "doc": "", "symbols": ["drug", "device", "procedure", "biological",
"radiation", "behavioral", "genetic", "dietary_supplement", "combination_product",
"diagnostic_test", "other"]}, "doc": ""}, {"name": "interventionName", "type": "string", "doc":
""}]}}], "doc": ""}, {"name": "conditions", "type": ["null", {"type": "array", "items": "string"}],
"doc": ""}, {"name": "primaryPurpose", "type": ["null", {"type": "enum", "name": "PrimaryPurpose",
"doc": "", "symbols": ["treatment", "prevention", "diagnostic", "supportive_care", "screening",
"health_services_research", "basic_science", "device_feasibility", "other"]}], "doc": ""}, {"name":
"studyType", "type": ["null", {"type": "enum", "name": "StudyType", "doc": "", "symbols":
["interventional", "observational", "patient_registry", "expanded_access"]}], "doc": ""}, {"name":
"demogrphicElegibilityCriteria", "type": ["null", {"type": "record", "name":
"DemographicElegibilityCriteria", "fields": [{"name": "sex", "type":
"org.gel.models.participant.avro.Sex"}, {"name": "ageRange", "type": ["null", {"type": "record",
"name": "AgeRange", "fields": [{"name": "minimumAge", "type": "int"}, {"name": "maximumAge", "type":
"int"}, {"name": "timeunit", "type": {"type": "enum", "name": "TimeUnit", "symbols": ["years",
"months", "weeks", "days", "hours", "minutes", "na"]}}]}]}]}], "doc": ""}, {"name": "locations",
"type": ["null", {"type": "array", "items": {"type": "record", "name": "TrialLocation", "fields":
[{"name": "name", "type": ["null", "string"]}, {"name": "city", "type": ["null", "string"]},
{"name": "country", "type": ["null", "string"]}, {"name": "zip", "type": ["null", "string"]}]}}],
"doc": ""}, {"name": "variantActionable", "type": "boolean", "doc": ""}]}}]}, {"name": "prognosis",
"type": ["null", {"type": "array", "items": {"type": "record", "name": "Prognosis", "fields":
[{"name": "referenceUrl", "type": "string", "doc": ""}, {"name": "prognosis", "type": ["null",
{"type": "enum", "name": "PrognosisClassification", "symbols": ["altered_prognosis",
"favourable_prognosis", "unfavourable_prognosis"]}], "doc": ""}, {"name": "source", "type": ["null",
"string"], "doc": ""}, {"name": "references", "type": ["null", {"type": "array", "items":
"string"}], "doc": ""}, {"name": "conditions", "type": ["null", {"type": "array", "items":
"string"}], "doc": ""}, {"name": "description", "type": ["null", "string"], "doc": ""}, {"name":
"variantActionable", "type": "boolean", "doc": ""}]}}]}, {"name": "therapies", "type": ["null",
{"type": "array", "items": {"type": "record", "name": "Therapy", "fields": [{"name": "referenceUrl",
"type": "string", "doc": ""}, {"name": "source", "type": ["null", "string"], "doc": ""}, {"name":
"references", "type": ["null", {"type": "array", "items": "string"}], "doc": ""}, {"name":
"conditions", "type": ["null", {"type": "array", "items": "string"}], "doc": ""}, {"name":
"drugResponse", "type": ["null", {"type": "array", "items": {"type": "record", "name":
"DrugResponse", "fields": [{"name": "TreatmentAgent", "type": "string", "doc": ""}, {"name":
"drugResponseClassification", "type": {"type": "enum", "name": "DrugResponseClassification",
"symbols": ["altered_sensitivity", "reduced_sensitivity", "increased_sensitivity",
"altered_resistance", "increased_resistance", "reduced_resistance", "increased_risk_of_toxicity",
"reduced_risk_of_toxicity", "altered_toxicity", "adverse_drug_reaction", "indication",
"contraindication", "dosing_alteration", "increased_dose", "reduced_dose", "increased_monitoring",
"increased_efficacy", "reduced_efficacy", "altered_efficacy"]}, "doc": ""}]}}], "doc": ""}, {"name":
"otherInterventions", "type": ["null", {"type": "array", "items": "Intervention"}], "doc": ""},
{"name": "variantActionable", "type": "boolean", "doc": ""}]}}]}]}], "doc": ""}, {"name": "score",
"type": ["null", "float"], "doc": ""}, {"name": "vendorSpecificScores", "type": ["null", {"type":
"map", "values": "float"}], "doc": ""}, {"name": "variantClassification", "type": ["null", {"type":
"record", "name": "VariantClassification", "doc": "", "fields": [{"name": "clinicalSignificance",
"type": ["null", {"type": "enum", "name": "ClinicalSignificance", "symbols": ["benign",
"likely_benign", "likely_pathogenic", "pathogenic", "uncertain_significance"]}], "doc": ""},
{"name": "drugResponseClassification", "type": ["null", "DrugResponseClassification"], "doc": ""},
{"name": "traitAssociation", "type": ["null", {"type": "enum", "name": "TraitAssociation",
"symbols": ["established_risk_allele", "likely_risk_allele", "uncertain_risk_allele",
"protective"]}], "doc": ""}, {"name": "tumorigenesisClassification", "type": ["null", {"type":
"enum", "name": "TumorigenesisClassification", "symbols": ["driver", "passenger", "modifier"]}],
"doc": ""}, {"name": "functionalEffect", "type": ["null", {"type": "enum", "name":
"VariantFunctionalEffect", "symbols": ["dominant_negative_variant", "gain_of_function_variant",
"lethal_variant", "loss_of_function_variant", "loss_of_heterozygosity", "null_variant"]}], "doc":
""}]}], "doc": ""}, {"name": "guidelineBasedVariantClassification", "type": ["null", {"type":
"record", "name": "GuidelineBasedVariantClassification", "doc": "", "fields": [{"name":
"acmgVariantClassification", "type": ["null", {"type": "record", "name":
"AcmgVariantClassification", "doc": "", "fields": [{"name": "acmgEvidences", "type": {"type":
"array", "items": {"type": "record", "name": "AcmgEvidence", "doc": "", "fields": [{"name":
"category", "type": {"type": "enum", "name": "AcmgEvidenceCategory", "doc": "", "symbols":
["population_data", "computational_and_predictive_data", "functional_data", "segregation_data",
"de_novo_data", "allelic_data", "other_database", "other_data"]}, "doc": ""}, {"name": "type",
"type": {"type": "enum", "name": "AcmgEvidenceType", "doc": "", "symbols": ["bening",
"pathogenic"]}, "doc": ""}, {"name": "weight", "type": {"type": "enum", "name":
"AcmgEvidenceWeight", "doc": "", "symbols": ["stand_alone", "supporting", "moderate", "strong",
"very_strong"]}, "doc": ""}, {"name": "modifier", "type": "int", "doc": ""}, {"name": "description",
"type": ["null", "string"], "doc": ""}]}}}, {"name": "clinicalSignificance", "type":
"ClinicalSignificance"}, {"name": "assessment", "type": ["null", "string"]}]}]}, {"name":
"ampVariantClassification", "type": ["null", {"type": "record", "name": "AmpVariantClassification",
"doc": "", "fields": [{"name": "ampEvidences", "type": {"type": "array", "items": {"type": "record",
"name": "AmpEvidence", "doc": "", "fields": [{"name": "type", "type": {"type": "enum", "name":
"AmpEvidenceType", "doc": "", "symbols": ["mutation_type", "therapies", "variant_frequencies",
"potential_germline", "population_database_presence", "germline_database_presence",
"somatic_database_presence", "impact_predictive_software", "pathway_involvement", "publications"]},
"doc": ""}, {"name": "evidenceAssessment", "type": "string", "doc": ""}]}}, "doc": ""}, {"name":
"ampTier", "type": {"type": "enum", "name": "AmpTier", "doc": "", "symbols": ["tierI", "tierII",
"tierIII", "tierIV"]}, "doc": ""}, {"name": "ampClincialOrExperimentalEvidence", "type": ["null",
{"type": "array", "items": {"type": "record", "name": "AmpClincialOrExperimentalEvidence", "doc":
"", "fields": [{"name": "category", "type": {"type": "enum", "name":
"AmpClinicalOrExperimentalEvidenceCategory", "doc": "", "symbols": ["therapeutic", "diagnosis",
"prognosis"]}, "doc": ""}, {"name": "level", "type": {"type": "enum", "name":
"AmpClinicalOrExperimentalEvidenceLevel", "doc": "", "symbols": ["levelA", "levelB", "levelC",
"levelD"]}, "doc": ""}, {"name": "description", "type": ["null", "string"], "doc": ""}]}}], "doc":
""}, {"name": "assessment", "type": ["null", "string"], "doc": ""}]}]}]}], "doc": ""}, {"name":
"algorithmBasedVariantClassifications", "type": ["null", {"type": "array", "items": {"type":
"record", "name": "AlgorithmBasedVariantClassification", "fields": [{"name": "algorithmName",
"type": "string", "doc": ""}, {"name": "classification", "type": "string", "doc": ""}, {"name":
"rank", "type": ["null", "int"], "doc": ""}, {"name": "score", "type": ["null", "int"], "doc":
""}]}}], "doc": ""}, {"name": "tier", "type": ["null", {"type": "enum", "name": "Tier", "doc": "",
"symbols": ["NONE", "TIER1", "TIER2", "TIER3", "TIER4", "TIER5", "TIERA", "TIERB"]}], "doc": ""},
{"name": "domain", "type": ["null", {"type": "enum", "name": "Domain", "symbols": ["DOMAIN1",
"DOMAIN2", "DOMAIN3", "DOMAIN4", "NONE"]}], "doc": ""}]}}, "doc": ""}, {"name": "variantAttributes",
"type": ["null", {"type": "record", "name": "VariantAttributes", "doc": "", "fields": [{"name":
"genomicChanges", "type": ["null", {"type": "array", "items": "string"}], "doc": ""}, {"name":
"cdnaChanges", "type": ["null", {"type": "array", "items": "string"}], "doc": ""}, {"name":
"proteinChanges", "type": ["null", {"type": "array", "items": "string"}], "doc": ""}, {"name":
"additionalTextualVariantAnnotations", "type": ["null", {"type": "map", "values": "string"}], "doc":
""}, {"name": "references", "type": ["null", {"type": "map", "values": "string"}], "doc": ""},
{"name": "variantIdentifiers", "type": ["null", {"type": "record", "name": "VariantIdentifiers",
"fields": [{"name": "dbSnpId", "type": ["null", "string"], "doc": ""}, {"name": "cosmicIds", "type":
["null", {"type": "array", "items": "string"}], "doc": ""}, {"name": "clinVarIds", "type": ["null",
{"type": "array", "items": "string"}], "doc": ""}, {"name": "otherIds", "type": ["null", {"type":
"array", "items": "Identifier"}]}]}]}, {"name": "alleleFrequencies", "type": ["null", {"type":
"array", "items": {"type": "record", "name": "AlleleFrequency", "doc": "", "fields": [{"name":
"study", "type": "string", "doc": ""}, {"name": "population", "type": "string", "doc": ""}, {"name":
"alternateFrequency", "type": "float", "doc": ""}]}}], "doc": ""}, {"name":
"additionalNumericVariantAnnotations", "type": ["null", {"type": "map", "values": "float"}], "doc":
""}, {"name": "comments", "type": ["null", {"type": "array", "items": "string"}], "doc": ""},
{"name": "alleleOrigins", "type": ["null", {"type": "array", "items": "AlleleOrigin"}], "doc": ""},
{"name": "ihp", "type": ["null", "int"], "doc": ""}, {"name": "recurrentlyReported", "type":
["null", "boolean"], "doc": ""}, {"name": "fdp50", "type": ["null", "float"], "doc": ""}, {"name":
"others", "type": ["null", {"type": "map", "values": "string"}], "doc": ""}]}]}]}}], "doc": ""},
{"name": "structuralVariants", "type": ["null", {"type": "array", "items": {"type": "record",
"name": "StructuralVariant", "fields": [{"name": "variantType", "type": {"type": "enum", "name":
"StructuralVariantType", "symbols": ["ins", "dup", "inv", "amplification", "deletion", "dup_tandem",
"del_me", "ins_me"]}, "doc": ""}, {"name": "coordinates", "type": {"type": "record", "name":
"Coordinates", "fields": [{"name": "assembly", "type": "Assembly"}, {"name": "chromosome", "type":
"string"}, {"name": "start", "type": "int"}, {"name": "end", "type": "int"}, {"name": "ciStart",
"type": ["null", {"type": "record", "name": "ConfidenceInterval", "fields": [{"name": "left",
"type": "int"}, {"name": "right", "type": "int"}]}]}, {"name": "ciEnd", "type": ["null",
"ConfidenceInterval"]}]}}, {"name": "leftInsSeq", "type": ["null", "string"]}, {"name":
"rightInsSeq", "type": ["null", "string"]}, {"name": "reportEvents", "type": {"type": "array",
"items": "ReportEvent"}}, {"name": "variantCalls", "type": {"type": "array", "items":
"VariantCall"}, "doc": ""}, {"name": "variantAttributes", "type": ["null",
"VariantAttributes"]}]}}], "doc": ""}, {"name": "chromosomalRearrangements", "type": ["null",
{"type": "array", "items": {"type": "record", "name": "ChromosomalRearrangement", "fields":
[{"name": "breakPoints", "type": ["null", {"type": "array", "items": {"type": "record", "name":
"BreakPoint", "fields": [{"name": "coordinates", "type": "Coordinates"}, {"name": "reference",
"type": ["null", "string"]}, {"name": "alternate", "type": ["null", "string"]}, {"name": "info",
"type": ["null", {"type": "map", "values": "string"}]}]}}]}, {"name": "rearrangements", "type":
{"type": "array", "items": {"type": "record", "name": "Rearrangement", "fields": [{"name":
"leftCoordinates", "type": "Coordinates"}, {"name": "rightCoordinates", "type": "Coordinates"},
{"name": "orientation", "type": {"type": "enum", "name": "Orientation", "symbols": ["start_start",
"start_end", "end_end"]}}, {"name": "leftInsSeq", "type": ["null", "string"]}, {"name":
"rightInsSeq", "type": ["null", "string"]}]}}}, {"name": "reportEvents", "type": {"type": "array",
"items": "ReportEvent"}}, {"name": "variantCalls", "type": {"type": "array", "items":
"VariantCall"}, "doc": ""}, {"name": "variantAttributes", "type": ["null",
"VariantAttributes"]}]}}], "doc": ""}, {"name": "shortTandemRepeats", "type": ["null", {"type":
"array", "items": {"type": "record", "name": "ShortTandemRepeat", "fields": [{"name": "coordinates",
"type": "Coordinates"}, {"name": "reportEvents", "type": {"type": "array", "items": "ReportEvent"}},
{"name": "variantCalls", "type": {"type": "array", "items": "VariantCall"}, "doc": ""}, {"name":
"variantAttributes", "type": ["null", "VariantAttributes"]}, {"name":
"shortTandemRepeatReferenceData", "type": ["null", {"type": "record", "name":
"ShortTandemRepeatReferenceData", "fields": [{"name": "repeatedSequence", "type": "string"},
{"name": "pathogenic_number_of_repeats_threshold", "type": "int"}, {"name":
"normal_number_of_repeats_threshold", "type": "int"}]}]}]}}], "doc": ""}, {"name":
"uniparentalDisomies", "type": ["null", {"type": "array", "items": {"type": "record", "name":
"UniparentalDisomy", "fields": [{"name": "assembly", "type": "Assembly", "doc": ""}, {"name":
"chromosome", "type": "string", "doc": ""}, {"name": "complete", "type": ["null", "boolean"], "doc":
""}, {"name": "origin", "type": {"type": "enum", "name": "UniparentalDisomyOrigin", "symbols":
["paternal", "maternal", "unknown"]}, "doc": ""}, {"name": "uniparentalDisomyFragments", "type":
["null", {"type": "array", "items": {"type": "record", "name": "UniparentalDisomyFragment",
"fields": [{"name": "coordinates", "type": ["null", "Coordinates"], "doc": ""}, {"name":
"uniparentalDisomyType", "type": {"type": "enum", "name": "UniparentalDisomyType", "symbols":
["isodisomy", "heterodisomy", "both"]}, "doc": ""}]}}], "doc": ""}, {"name": "participantId",
"type": "string", "doc": ""}, {"name": "uniparentalDisomyEvidences", "type": ["null", {"type":
"record", "name": "UniparentalDisomyEvidences", "fields": [{"name": "ibds", "type": ["null",
{"type": "array", "items": {"type": "record", "name": "IdentityByDescent", "fields": [{"name":
"relatedSample", "type": "string"}, {"name": "ibd0", "type": "float"}, {"name": "ibd1", "type":
"float"}, {"name": "ibd2", "type": "float"}, {"name": "pihat", "type": "float"}]}}]}]}], "doc":
""}]}}], "doc": ""}, {"name": "karyotypes", "type": ["null", {"type": "array", "items": {"type":
"record", "name": "Karyotype", "fields": [{"name": "iscn", "type": ["null", "string"], "doc": ""},
{"name": "description", "type": ["null", "string"], "doc": ""}, {"name": "aneuploidies", "type":
["null", {"type": "array", "items": {"type": "record", "name": "Aneuploidy", "fields": [{"name":
"iscn", "type": ["null", "string"], "doc": ""}, {"name": "assembly", "type": "Assembly", "doc": ""},
{"name": "chromosome", "type": "string", "doc": ""}, {"name": "complete", "type": "boolean", "doc":
""}, {"name": "coordinates", "type": ["null", "Coordinates"], "doc": ""}, {"name": "numberOfCopies",
"type": "int", "doc": ""}]}}], "doc": ""}, {"name": "numberOfChromosomes", "type": "int", "doc":
""}, {"name": "personKaryotipicSex", "type": "org.gel.models.participant.avro.PersonKaryotipicSex",
"doc": ""}, {"name": "participantId", "type": "string", "doc": ""}]}}], "doc": ""}, {"name":
"referenceDatabasesVersions", "type": {"type": "map", "values": "string"}, "doc": ""}, {"name":
"softwareVersions", "type": {"type": "map", "values": "string"}, "doc": ""}, {"name": "comments",
"type": ["null", {"type": "array", "items": "string"}], "doc": ""}]}]}, {"name":
"otherInterpretationResults", "type": ["null", {"type": "array", "items": "InterpretedGenome"}]}]}
"""
    schema = avro_parse(_schemaSource)
    requiredFields = {
        "interpretationMetaData",
        "otherInterpretationResults",
        "tieringResult",
    }

    @classmethod
    def isEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'interpretationMetaData': InterpretationRequestRD,
            'otherInterpretationResults': InterpretedGenome,
            'tieringResult': InterpretedGenome,
        }
        return fieldName in embeddedTypes

    @classmethod
    def getEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'interpretationMetaData': InterpretationRequestRD,
            'otherInterpretationResults': InterpretedGenome,
            'tieringResult': InterpretedGenome,
        }

        return embeddedTypes[fieldName]

    __slots__ = [
        'interpretationMetaData', 'otherInterpretationResults',
        'tieringResult'
    ]

    def __init__(self, **kwargs):
        self.interpretationMetaData = kwargs.get(
            'interpretationMetaData', InterpretationRequestRD())
        self.otherInterpretationResults = kwargs.get(
            'otherInterpretationResults', None)
        self.tieringResult = kwargs.get(
            'tieringResult', None)


class InterpretationFlag(ProtocolElement):
    """
    A given interpretation flag together with an optional description
    """
    _schemaSource = """
{"type": "record", "name": "InterpretationFlag", "namespace": "org.gel.models.report.avro", "doc":
"", "fields": [{"name": "interpretationFlag", "type": {"type": "enum", "name":
"InterpretationFlags", "doc": "", "symbols": ["mixed_chemistries", "mixedLab_preparation",
"low_tumour_purity", "uniparental_isodisomy", "uniparental_heterodisomy", "unusual_karyotype",
"high_cnv_count", "high_estimate_human_contamination_fraction", "mixed_recruiting_gmc",
"suspected_mosaicism", "low_quality_sample", "ffpe_tumour_sample", "ff_nano_tumour_sample",
"missing_values_for_proband_in_reported_variant", "reissued", "supplementary_report_errors",
"internal_use_only", "high_priority",
"suspected_increased_number_of_false_positive_heterozygous_loss_calls",
"suspected_poor_quality_cnv_calls", "cnv_calls_assumed_xx_karyo", "cnv_calls_assumed_xy_karyo",
"other"]}, "doc": ""}, {"name": "additionalDescription", "type": ["null", "string"], "doc": ""}]}
"""
    schema = avro_parse(_schemaSource)
    requiredFields = {
        "additionalDescription",
        "interpretationFlag",
    }

    @classmethod
    def isEmbeddedType(cls, fieldName):
        embeddedTypes = {}
        return fieldName in embeddedTypes

    @classmethod
    def getEmbeddedType(cls, fieldName):
        embeddedTypes = {}

        return embeddedTypes[fieldName]

    __slots__ = [
        'additionalDescription', 'interpretationFlag'
    ]

    def __init__(self, **kwargs):
        self.additionalDescription = kwargs.get(
            'additionalDescription', None)
        self.interpretationFlag = kwargs.get(
            'interpretationFlag', None)


class InterpretationFlags(object):
    """
    Some flags relevant to the interpretation of a case
    """
    mixed_chemistries = "mixed_chemistries"
    mixedLab_preparation = "mixedLab_preparation"
    low_tumour_purity = "low_tumour_purity"
    uniparental_isodisomy = "uniparental_isodisomy"
    uniparental_heterodisomy = "uniparental_heterodisomy"
    unusual_karyotype = "unusual_karyotype"
    high_cnv_count = "high_cnv_count"
    high_estimate_human_contamination_fraction = "high_estimate_human_contamination_fraction"
    mixed_recruiting_gmc = "mixed_recruiting_gmc"
    suspected_mosaicism = "suspected_mosaicism"
    low_quality_sample = "low_quality_sample"
    ffpe_tumour_sample = "ffpe_tumour_sample"
    ff_nano_tumour_sample = "ff_nano_tumour_sample"
    missing_values_for_proband_in_reported_variant = "missing_values_for_proband_in_reported_variant"
    reissued = "reissued"
    supplementary_report_errors = "supplementary_report_errors"
    internal_use_only = "internal_use_only"
    high_priority = "high_priority"
    suspected_increased_number_of_false_positive_heterozygous_loss_calls = "suspected_increased_number_of_false_positive_heterozygous_loss_calls"
    suspected_poor_quality_cnv_calls = "suspected_poor_quality_cnv_calls"
    cnv_calls_assumed_xx_karyo = "cnv_calls_assumed_xx_karyo"
    cnv_calls_assumed_xy_karyo = "cnv_calls_assumed_xy_karyo"
    other = "other"

    def __hash__(self):
        return str(self).__hash__()


class InterpretationRequestRD(ProtocolElement):
    """
    This record represents basic information for this report
    """
    _schemaSource = """
{"type": "record", "name": "InterpretationRequestRD", "namespace": "org.gel.models.report.avro",
"doc": "", "fields": [{"name": "versionControl", "type": {"type": "record", "name":
"ReportVersionControl", "fields": [{"name": "gitVersionControl", "type": "string", "doc": "",
"default": "6.0.2"}]}, "doc": ""}, {"name": "interpretationRequestId", "type": "string", "doc": ""},
{"name": "interpretationRequestVersion", "type": "int", "doc": ""}, {"name": "internalStudyId",
"type": "string", "doc": ""}, {"name": "familyInternalId", "type": ["null", "string"], "doc": ""},
{"name": "genomeAssembly", "type": {"type": "enum", "name": "Assembly", "doc": "", "symbols":
["GRCh38", "GRCh37"]}, "doc": ""}, {"name": "workspace", "type": {"type": "array", "items":
"string"}, "doc": ""}, {"name": "bams", "type": ["null", {"type": "array", "items": {"type":
"record", "name": "File", "doc": "", "fields": [{"name": "sampleId", "type": ["null", {"type":
"array", "items": "string"}], "doc": ""}, {"name": "uriFile", "type": "string", "doc": ""}, {"name":
"fileType", "type": {"type": "enum", "name": "FileType", "symbols": ["BAM", "gVCF", "VCF_small",
"VCF_somatic_small", "VCF_CNV", "VCF_somatic_CNV", "VCF_SV", "VCF_somatic_SV", "VCF_SV_CNV", "SVG",
"ANN", "BigWig", "MD5Sum", "ROH", "OTHER", "PARTITION", "VARIANT_FREQUENCIES", "COVERAGE"]}, "doc":
""}, {"name": "md5Sum", "type": ["null", "string"], "doc": ""}]}}], "doc": ""}, {"name": "vcfs",
"type": ["null", {"type": "array", "items": "File"}], "doc": ""}, {"name": "bigWigs", "type":
["null", {"type": "array", "items": "File"}], "doc": ""}, {"name": "pedigreeDiagram", "type":
["null", "File"], "doc": ""}, {"name": "annotationFile", "type": ["null", "File"], "doc": ""},
{"name": "otherFiles", "type": ["null", {"type": "map", "values": "File"}], "doc": ""}, {"name":
"pedigree", "type": ["null", {"type": "record", "name": "Pedigree", "namespace":
"org.gel.models.participant.avro", "doc": "", "fields": [{"name": "versionControl", "type": ["null",
{"type": "record", "name": "VersionControl", "fields": [{"name": "GitVersionControl", "type":
"string", "doc": "", "default": "1.1.3"}]}], "doc": ""}, {"name": "LDPCode", "type": ["null",
"string"], "doc": ""}, {"name": "familyId", "type": "string", "doc": ""}, {"name": "members",
"type": {"type": "array", "items": {"type": "record", "name": "PedigreeMember", "doc": "", "fields":
[{"name": "pedigreeId", "type": ["null", "int"], "doc": ""}, {"name": "isProband", "type": ["null",
"boolean"], "doc": ""}, {"name": "participantId", "type": ["null", "string"], "doc": ""}, {"name":
"participantQCState", "type": ["null", {"type": "enum", "name": "ParticipantQCState", "doc": "",
"symbols": ["noState", "passedMedicalReviewReadyForInterpretation",
"passedMedicalReviewNotReadyForInterpretation", "queryToGel", "queryToGMC", "failed"]}], "doc": ""},
{"name": "gelSuperFamilyId", "type": ["null", "string"], "doc": ""}, {"name": "sex", "type":
{"type": "enum", "name": "Sex", "doc": "", "symbols": ["MALE", "FEMALE", "UNKNOWN"]}, "doc": ""},
{"name": "personKaryotypicSex", "type": ["null", {"type": "enum", "name": "PersonKaryotipicSex",
"doc": "", "symbols": ["UNKNOWN", "XX", "XY", "XO", "XXY", "XXX", "XXYY", "XXXY", "XXXX", "XYY",
"OTHER"]}], "doc": ""}, {"name": "yearOfBirth", "type": ["null", "int"], "doc": ""}, {"name":
"fatherId", "type": ["null", "int"], "doc": ""}, {"name": "motherId", "type": ["null", "int"],
"doc": ""}, {"name": "superFatherId", "type": ["null", "int"], "doc": ""}, {"name": "superMotherId",
"type": ["null", "int"], "doc": ""}, {"name": "twinGroup", "type": ["null", "int"], "doc": ""},
{"name": "monozygotic", "type": ["null", {"type": "enum", "name": "TernaryOption", "doc": "",
"symbols": ["yes", "no", "unknown"]}], "doc": ""}, {"name": "adoptedStatus", "type": ["null",
{"type": "enum", "name": "AdoptedStatus", "doc": "", "symbols": ["notadopted", "adoptedin",
"adoptedout"]}], "doc": ""}, {"name": "lifeStatus", "type": ["null", {"type": "enum", "name":
"LifeStatus", "doc": "", "symbols": ["ALIVE", "ABORTED", "DECEASED", "UNBORN", "STILLBORN",
"MISCARRIAGE"]}], "doc": ""}, {"name": "consanguineousParents", "type": ["null", "TernaryOption"],
"doc": ""}, {"name": "affectionStatus", "type": ["null", {"type": "enum", "name": "AffectionStatus",
"doc": "", "symbols": ["UNAFFECTED", "AFFECTED", "UNCERTAIN"]}], "doc": ""}, {"name":
"disorderList", "type": ["null", {"type": "array", "items": {"type": "record", "name": "Disorder",
"doc": "", "fields": [{"name": "diseaseGroup", "type": ["null", "string"], "doc": ""}, {"name":
"diseaseSubGroup", "type": ["null", "string"], "doc": ""}, {"name": "specificDisease", "type":
["null", "string"], "doc": ""}, {"name": "ageOfOnset", "type": ["null", "float"], "doc": ""}]}}],
"doc": ""}, {"name": "hpoTermList", "type": ["null", {"type": "array", "items": {"type": "record",
"name": "HpoTerm", "doc": "", "fields": [{"name": "term", "type": "string", "doc": ""}, {"name":
"termPresence", "type": ["null", "TernaryOption"], "doc": ""}, {"name": "hpoBuildNumber", "type":
["null", "string"], "doc": ""}, {"name": "modifiers", "type": ["null", {"type": "record", "name":
"HpoTermModifiers", "fields": [{"name": "laterality", "type": ["null", {"type": "enum", "name":
"Laterality", "symbols": ["RIGHT", "UNILATERAL", "BILATERAL", "LEFT"]}]}, {"name": "progression",
"type": ["null", {"type": "enum", "name": "Progression", "symbols": ["PROGRESSIVE",
"NONPROGRESSIVE"]}]}, {"name": "severity", "type": ["null", {"type": "enum", "name": "Severity",
"symbols": ["BORDERLINE", "MILD", "MODERATE", "SEVERE", "PROFOUND"]}]}, {"name": "spatialPattern",
"type": ["null", {"type": "enum", "name": "SpatialPattern", "symbols": ["DISTAL", "GENERALIZED",
"LOCALIZED", "PROXIMAL"]}]}]}], "doc": ""}, {"name": "ageOfOnset", "type": ["null", {"type": "enum",
"name": "AgeOfOnset", "symbols": ["EMBRYONAL_ONSET", "FETAL_ONSET", "NEONATAL_ONSET",
"INFANTILE_ONSET", "CHILDHOOD_ONSET", "JUVENILE_ONSET", "YOUNG_ADULT_ONSET", "LATE_ONSET",
"MIDDLE_AGE_ONSET"]}], "doc": ""}]}}], "doc": ""}, {"name": "ancestries", "type": ["null", {"type":
"record", "name": "Ancestries", "doc": "", "fields": [{"name": "mothersEthnicOrigin", "type":
["null", {"type": "enum", "name": "EthnicCategory", "doc": "", "symbols": ["D", "E", "F", "G", "A",
"B", "C", "L", "M", "N", "H", "J", "K", "P", "S", "R", "Z"]}], "doc": ""}, {"name":
"mothersOtherRelevantAncestry", "type": ["null", "string"], "doc": ""}, {"name":
"fathersEthnicOrigin", "type": ["null", "EthnicCategory"], "doc": ""}, {"name":
"fathersOtherRelevantAncestry", "type": ["null", "string"], "doc": ""}, {"name":
"chiSquare1KGenomesPhase3Pop", "type": ["null", {"type": "array", "items": {"type": "record",
"name": "ChiSquare1KGenomesPhase3Pop", "doc": "", "fields": [{"name": "kgSuperPopCategory", "type":
{"type": "enum", "name": "KgSuperPopCategory", "doc": "", "symbols": ["AFR", "AMR", "EAS", "EUR",
"SAS"]}, "doc": ""}, {"name": "kgPopCategory", "type": ["null", {"type": "enum", "name":
"KgPopCategory", "doc": "", "symbols": ["ACB", "ASW", "BEB", "CDX", "CEU", "CHB", "CHS", "CLM",
"ESN", "FIN", "GBR", "GIH", "GWD", "IBS", "ITU", "JPT", "KHV", "LWK", "MSL", "MXL", "PEL", "PJL",
"PUR", "STU", "TSI", "YRI"]}], "doc": ""}, {"name": "chiSquare", "type": "double", "doc": ""}]}}],
"doc": ""}]}], "doc": ""}, {"name": "consentStatus", "type": ["null", {"type": "record", "name":
"ConsentStatus", "doc": "", "fields": [{"name": "programmeConsent", "type": "boolean", "doc": "",
"default": false}, {"name": "primaryFindingConsent", "type": "boolean", "doc": "", "default":
false}, {"name": "secondaryFindingConsent", "type": "boolean", "doc": "", "default": false},
{"name": "carrierStatusConsent", "type": "boolean", "doc": "", "default": false}]}], "doc": ""},
{"name": "samples", "type": ["null", {"type": "array", "items": {"type": "record", "name": "Sample",
"fields": [{"name": "sampleId", "type": "string", "doc": ""}, {"name": "labSampleId", "type":
"string", "doc": ""}, {"name": "source", "type": ["null", {"type": "enum", "name": "SampleSource",
"doc": "", "symbols": ["TUMOUR", "BONE_MARROW_ASPIRATE_TUMOUR_SORTED_CELLS",
"BONE_MARROW_ASPIRATE_TUMOUR_CELLS", "BLOOD", "SALIVA", "FIBROBLAST", "TISSUE"]}], "doc": ""},
{"name": "product", "type": ["null", {"type": "enum", "name": "Product", "symbols": ["DNA",
"RNA"]}], "doc": ""}, {"name": "preparationMethod", "type": ["null", {"type": "enum", "name":
"PreparationMethod", "symbols": ["EDTA", "ORAGENE", "FF", "FFPE", "CD128_SORTED_CELLS",
"ASPIRATE"]}], "doc": ""}]}}], "doc": ""}, {"name": "inbreedingCoefficient", "type": ["null",
{"type": "record", "name": "InbreedingCoefficient", "doc": "", "fields": [{"name": "sampleId",
"type": "string", "doc": ""}, {"name": "program", "type": "string", "doc": ""}, {"name": "version",
"type": "string", "doc": ""}, {"name": "estimationMethod", "type": "string", "doc": ""}, {"name":
"coefficient", "type": "double", "doc": ""}, {"name": "standardError", "type": ["null", "double"],
"doc": ""}]}], "doc": ""}, {"name": "additionalInformation", "type": ["null", {"type": "map",
"values": "string"}], "doc": ""}]}}, "doc": ""}, {"name": "analysisPanels", "type": ["null",
{"type": "array", "items": {"type": "record", "name": "AnalysisPanel", "doc": "", "fields":
[{"name": "specificDisease", "type": "string", "doc": ""}, {"name": "panelName", "type": "string",
"doc": ""}, {"name": "panelVersion", "type": ["null", "string"], "doc": ""}, {"name":
"reviewOutcome", "type": "string", "doc": ""}, {"name": "multipleGeneticOrigins", "type": "string",
"doc": ""}]}}], "doc": ""}, {"name": "diseasePenetrances", "type": ["null", {"type": "array",
"items": {"type": "record", "name": "DiseasePenetrance", "doc": "", "fields": [{"name":
"specificDisease", "type": "string", "doc": ""}, {"name": "penetrance", "type": {"type": "enum",
"name": "Penetrance", "doc": "", "symbols": ["complete", "incomplete"]}, "doc": ""}]}}], "doc": ""},
{"name": "readyForAnalysis", "type": "boolean", "doc": ""}, {"name": "familyQCState", "type":
["null", {"type": "enum", "name": "FamilyQCState", "doc": "", "symbols": ["noState",
"passedMedicalReviewReadyForInterpretation", "passedMedicalReviewNotReadyForInterpretation",
"queryToGel", "queryToGMC", "failed"]}], "doc": ""}]}], "doc": ""}, {"name": "otherFamilyHistory",
"type": ["null", {"type": "record", "name": "OtherFamilyHistory", "doc": "", "fields": [{"name":
"maternalFamilyHistory", "type": ["null", {"type": "array", "items": "string"}], "doc": ""},
{"name": "paternalFamilyHistory", "type": ["null", {"type": "array", "items": "string"}], "doc":
""}]}], "doc": ""}, {"name": "genePanelsCoverage", "type": ["null", {"type": "map", "values":
{"type": "map", "values": {"type": "map", "values": "float"}}}], "doc": ""}, {"name":
"interpretationFlags", "type": ["null", {"type": "array", "items": {"type": "record", "name":
"InterpretationFlag", "doc": "", "fields": [{"name": "interpretationFlag", "type": {"type": "enum",
"name": "InterpretationFlags", "doc": "", "symbols": ["mixed_chemistries", "mixedLab_preparation",
"low_tumour_purity", "uniparental_isodisomy", "uniparental_heterodisomy", "unusual_karyotype",
"high_cnv_count", "high_estimate_human_contamination_fraction", "mixed_recruiting_gmc",
"suspected_mosaicism", "low_quality_sample", "ffpe_tumour_sample", "ff_nano_tumour_sample",
"missing_values_for_proband_in_reported_variant", "reissued", "supplementary_report_errors",
"internal_use_only", "high_priority",
"suspected_increased_number_of_false_positive_heterozygous_loss_calls",
"suspected_poor_quality_cnv_calls", "cnv_calls_assumed_xx_karyo", "cnv_calls_assumed_xy_karyo",
"other"]}, "doc": ""}, {"name": "additionalDescription", "type": ["null", "string"], "doc": ""}]}}],
"doc": ""}, {"name": "additionalInfo", "type": ["null", {"type": "map", "values": "string"}], "doc":
""}]}
"""
    schema = avro_parse(_schemaSource)
    requiredFields = {
        "additionalInfo",
        "annotationFile",
        "bams",
        "bigWigs",
        "familyInternalId",
        "genePanelsCoverage",
        "genomeAssembly",
        "internalStudyId",
        "interpretationFlags",
        "interpretationRequestId",
        "interpretationRequestVersion",
        "otherFamilyHistory",
        "otherFiles",
        "pedigree",
        "pedigreeDiagram",
        "vcfs",
        "versionControl",
        "workspace",
    }

    @classmethod
    def isEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'annotationFile': File,
            'bams': File,
            'bigWigs': File,
            'interpretationFlags': InterpretationFlag,
            'otherFamilyHistory': OtherFamilyHistory,
            'otherFiles': File,
            'pedigree': Pedigree,
            'pedigreeDiagram': File,
            'vcfs': File,
            'versionControl': ReportVersionControl,
        }
        return fieldName in embeddedTypes

    @classmethod
    def getEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'annotationFile': File,
            'bams': File,
            'bigWigs': File,
            'interpretationFlags': InterpretationFlag,
            'otherFamilyHistory': OtherFamilyHistory,
            'otherFiles': File,
            'pedigree': Pedigree,
            'pedigreeDiagram': File,
            'vcfs': File,
            'versionControl': ReportVersionControl,
        }

        return embeddedTypes[fieldName]

    __slots__ = [
        'additionalInfo', 'annotationFile', 'bams', 'bigWigs',
        'familyInternalId', 'genePanelsCoverage', 'genomeAssembly',
        'internalStudyId', 'interpretationFlags',
        'interpretationRequestId', 'interpretationRequestVersion',
        'otherFamilyHistory', 'otherFiles', 'pedigree',
        'pedigreeDiagram', 'vcfs', 'versionControl', 'workspace'
    ]

    def __init__(self, **kwargs):
        self.additionalInfo = kwargs.get(
            'additionalInfo', None)
        self.annotationFile = kwargs.get(
            'annotationFile', None)
        self.bams = kwargs.get(
            'bams', None)
        self.bigWigs = kwargs.get(
            'bigWigs', None)
        self.familyInternalId = kwargs.get(
            'familyInternalId', None)
        self.genePanelsCoverage = kwargs.get(
            'genePanelsCoverage', None)
        self.genomeAssembly = kwargs.get(
            'genomeAssembly', None)
        self.internalStudyId = kwargs.get(
            'internalStudyId', None)
        self.interpretationFlags = kwargs.get(
            'interpretationFlags', None)
        self.interpretationRequestId = kwargs.get(
            'interpretationRequestId', None)
        self.interpretationRequestVersion = kwargs.get(
            'interpretationRequestVersion', None)
        self.otherFamilyHistory = kwargs.get(
            'otherFamilyHistory', None)
        self.otherFiles = kwargs.get(
            'otherFiles', None)
        self.pedigree = kwargs.get(
            'pedigree', None)
        self.pedigreeDiagram = kwargs.get(
            'pedigreeDiagram', None)
        self.vcfs = kwargs.get(
            'vcfs', None)
        self.versionControl = kwargs.get(
            'versionControl', ReportVersionControl())
        self.workspace = kwargs.get(
            'workspace', None)


class InterpretedGenome(ProtocolElement):
    """
    A interpreted genome for the rare disease program. This holds the
    list of candidate variants reported by an     interpretation
    service together with all the relevant information that identify
    the case and how these conclusions were reached.
    """
    _schemaSource = """
{"type": "record", "name": "InterpretedGenome", "namespace": "org.gel.models.report.avro", "doc":
"", "fields": [{"name": "versionControl", "type": {"type": "record", "name": "ReportVersionControl",
"fields": [{"name": "gitVersionControl", "type": "string", "doc": "", "default": "6.0.2"}]}, "doc":
""}, {"name": "interpretationRequestId", "type": "string", "doc": ""}, {"name":
"interpretationRequestVersion", "type": "int", "doc": ""}, {"name": "interpretationService", "type":
"string", "doc": ""}, {"name": "reportUrl", "type": ["null", "string"], "doc": ""}, {"name":
"variants", "type": ["null", {"type": "array", "items": {"type": "record", "name": "SmallVariant",
"doc": "", "fields": [{"name": "variantCoordinates", "type": {"type": "record", "name":
"VariantCoordinates", "doc": "", "fields": [{"name": "chromosome", "type": "string", "doc": ""},
{"name": "position", "type": "int", "doc": ""}, {"name": "reference", "type": "string", "doc": ""},
{"name": "alternate", "type": "string", "doc": ""}, {"name": "assembly", "type": {"type": "enum",
"name": "Assembly", "doc": "", "symbols": ["GRCh38", "GRCh37"]}, "doc": ""}]}, "doc": ""}, {"name":
"variantCalls", "type": {"type": "array", "items": {"type": "record", "name": "VariantCall", "doc":
"", "fields": [{"name": "participantId", "type": "string", "doc": ""}, {"name": "sampleId", "type":
"string", "doc": ""}, {"name": "zygosity", "type": {"type": "enum", "name": "Zygosity", "doc": "",
"symbols": ["reference_homozygous", "heterozygous", "alternate_homozygous", "missing",
"half_missing_reference", "half_missing_alternate", "alternate_hemizigous", "reference_hemizigous",
"unk", "na"]}, "doc": ""}, {"name": "phaseGenotype", "type": ["null", {"type": "record", "name":
"PhaseGenotype", "fields": [{"name": "sortedAlleles", "type": {"type": "array", "items": "string"}},
{"name": "phaseSet", "type": "int"}]}], "doc": ""}, {"name": "sampleVariantAlleleFrequency", "type":
["null", "double"], "doc": ""}, {"name": "depthReference", "type": ["null", "int"], "doc": ""},
{"name": "depthAlternate", "type": ["null", "int"], "doc": ""}, {"name": "numberOfCopies", "type":
["null", {"type": "array", "items": {"type": "record", "name": "NumberOfCopies", "fields": [{"name":
"numberOfCopies", "type": "int", "doc": ""}, {"name": "confidenceIntervalMaximum", "type": ["null",
"int"]}, {"name": "confidenceIntervalMinimum", "type": ["null", "int"]}]}}], "doc": ""}, {"name":
"alleleOrigins", "type": ["null", {"type": "array", "items": {"type": "enum", "name":
"AlleleOrigin", "doc": "", "symbols": ["de_novo_variant", "germline_variant", "maternal_variant",
"paternal_variant", "pedigree_specific_variant", "population_specific_variant",
"somatic_variant"]}}], "doc": ""}, {"name": "supportingReadTypes", "type": ["null", {"type":
"array", "items": {"type": "enum", "name": "SupportingReadType", "symbols": ["spanning", "flanking",
"inrepeat"]}}]}]}}, "doc": ""}, {"name": "reportEvents", "type": {"type": "array", "items": {"type":
"record", "name": "ReportEvent", "doc": "", "fields": [{"name": "reportEventId", "type": "string",
"doc": ""}, {"name": "phenotypes", "type": {"type": "record", "name": "Phenotypes", "doc": "",
"fields": [{"name": "nonStandardPhenotype", "type": ["null", {"type": "array", "items": "string"}],
"doc": ""}, {"name": "standardPhenotypes", "type": ["null", {"type": "array", "items": {"type":
"record", "name": "StandardPhenotype", "doc": "", "fields": [{"name": "id", "type": "string"},
{"name": "name", "type": ["null", "string"]}, {"name": "namespace", "type": ["null", "string"]},
{"name": "definition", "type": ["null", "string"]}, {"name": "comment", "type": ["null", "string"]},
{"name": "alternativeIds", "type": ["null", "string"]}, {"name": "synonyms", "type": ["null",
"string"]}, {"name": "isA", "type": ["null", "string"]}, {"name": "ontology", "type": {"type":
"record", "name": "Ontology", "doc": "", "fields": [{"name": "name", "type": "string"}, {"name":
"version", "type": "string"}]}, "doc": ""}, {"name": "matchScore", "type": ["null", "float"], "doc":
""}]}}], "doc": ""}]}, "doc": ""}, {"name": "variantConsequences", "type": {"type": "array",
"items": {"type": "record", "name": "VariantConsequence", "doc": "", "fields": [{"name": "id",
"type": "string", "doc": ""}, {"name": "name", "type": ["null", "string"], "doc": ""}]}}, "doc":
""}, {"name": "genePanel", "type": ["null", {"type": "record", "name": "GenePanel", "doc": "",
"fields": [{"name": "panelIdentifier", "type": ["null", "string"], "doc": ""}, {"name": "panelName",
"type": ["null", "string"], "doc": ""}, {"name": "panelVersion", "type": ["null", "string"], "doc":
""}, {"name": "source", "type": ["null", "string"], "doc": ""}]}], "doc": ""}, {"name":
"modeOfInheritance", "type": {"type": "enum", "name": "ModeOfInheritance", "doc": "", "symbols":
["monoallelic", "monoallelic_not_imprinted", "monoallelic_maternally_imprinted",
"monoallelic_paternally_imprinted", "biallelic", "monoallelic_and_biallelic",
"monoallelic_and_more_severe_biallelic", "xlinked_biallelic", "xlinked_monoallelic",
"mitochondrial", "unknown", "na"]}, "doc": ""}, {"name": "genomicEntities", "type": {"type":
"array", "items": {"type": "record", "name": "GenomicEntity", "doc": "", "fields": [{"name": "type",
"type": {"type": "enum", "name": "GenomicEntityType", "doc": "", "symbols": ["regulatory_region",
"gene", "transcript", "intergenic", "gene_fusion", "genomic_region", "cytobands"]}, "doc": ""},
{"name": "ensemblId", "type": ["null", "string"], "doc": ""}, {"name": "geneSymbol", "type":
["null", "string"], "doc": ""}, {"name": "otherIds", "type": ["null", {"type": "array", "items":
{"type": "record", "name": "Identifier", "fields": [{"name": "source", "type": "string", "doc": ""},
{"name": "identifier", "type": "string", "doc": ""}]}}], "doc": ""}]}}, "doc": ""}, {"name":
"segregationPattern", "type": ["null", {"type": "enum", "name": "SegregationPattern", "symbols":
["UniparentalIsodisomy", "SimpleRecessive", "CompoundHeterozygous", "deNovo",
"InheritedAutosomalDominant", "InheritedAutosomalDominantMaternallyImprinted",
"InheritedAutosomalDominantPaternallyImprinted", "XLinkedCompoundHeterozygous",
"XLinkedSimpleRecessive", "XLinkedMonoallelic", "MitochondrialGenome"]}], "doc": ""}, {"name":
"penetrance", "type": ["null", {"type": "enum", "name": "Penetrance", "namespace":
"org.gel.models.participant.avro", "doc": "", "symbols": ["complete", "incomplete"]}], "doc": ""},
{"name": "deNovoQualityScore", "type": ["null", "float"], "doc": ""}, {"name":
"fullyExplainsPhenotype", "type": ["null", "boolean"], "doc": ""}, {"name": "groupOfVariants",
"type": ["null", "int"], "doc": ""}, {"name": "eventJustification", "type": ["null", "string"],
"doc": ""}, {"name": "roleInCancer", "type": ["null", {"type": "array", "items": {"type": "enum",
"name": "RoleInCancer", "doc": "", "symbols": ["oncogene", "tumor_suppressor_gene", "both"]}}],
"doc": ""}, {"name": "actions", "type": ["null", {"type": "record", "name": "Actions", "doc": "",
"fields": [{"name": "trials", "type": ["null", {"type": "array", "items": {"type": "record", "name":
"Trial", "fields": [{"name": "studyUrl", "type": "string", "doc": ""}, {"name": "studyIdentifier",
"type": "string", "doc": ""}, {"name": "startDate", "type": ["null", "string"], "doc": ""}, {"name":
"estimateCompletionDate", "type": ["null", "string"], "doc": ""}, {"name": "title", "type": ["null",
"string"], "doc": ""}, {"name": "phase", "type": ["null", {"type": "enum", "name": "StudyPhase",
"doc": "", "symbols": ["na", "early_phase1", "phase1", "phase1_phase2", "phase2", "phase2_phase3",
"phase3", "phase4"]}], "doc": ""}, {"name": "interventions", "type": ["null", {"type": "array",
"items": {"type": "record", "name": "Intervention", "doc": "", "fields": [{"name":
"interventionType", "type": {"type": "enum", "name": "InterventionType", "doc": "", "symbols":
["drug", "device", "procedure", "biological", "radiation", "behavioral", "genetic",
"dietary_supplement", "combination_product", "diagnostic_test", "other"]}, "doc": ""}, {"name":
"interventionName", "type": "string", "doc": ""}]}}], "doc": ""}, {"name": "conditions", "type":
["null", {"type": "array", "items": "string"}], "doc": ""}, {"name": "primaryPurpose", "type":
["null", {"type": "enum", "name": "PrimaryPurpose", "doc": "", "symbols": ["treatment",
"prevention", "diagnostic", "supportive_care", "screening", "health_services_research",
"basic_science", "device_feasibility", "other"]}], "doc": ""}, {"name": "studyType", "type":
["null", {"type": "enum", "name": "StudyType", "doc": "", "symbols": ["interventional",
"observational", "patient_registry", "expanded_access"]}], "doc": ""}, {"name":
"demogrphicElegibilityCriteria", "type": ["null", {"type": "record", "name":
"DemographicElegibilityCriteria", "fields": [{"name": "sex", "type": {"type": "enum", "name": "Sex",
"namespace": "org.gel.models.participant.avro", "doc": "", "symbols": ["MALE", "FEMALE",
"UNKNOWN"]}}, {"name": "ageRange", "type": ["null", {"type": "record", "name": "AgeRange", "fields":
[{"name": "minimumAge", "type": "int"}, {"name": "maximumAge", "type": "int"}, {"name": "timeunit",
"type": {"type": "enum", "name": "TimeUnit", "symbols": ["years", "months", "weeks", "days",
"hours", "minutes", "na"]}}]}]}]}], "doc": ""}, {"name": "locations", "type": ["null", {"type":
"array", "items": {"type": "record", "name": "TrialLocation", "fields": [{"name": "name", "type":
["null", "string"]}, {"name": "city", "type": ["null", "string"]}, {"name": "country", "type":
["null", "string"]}, {"name": "zip", "type": ["null", "string"]}]}}], "doc": ""}, {"name":
"variantActionable", "type": "boolean", "doc": ""}]}}]}, {"name": "prognosis", "type": ["null",
{"type": "array", "items": {"type": "record", "name": "Prognosis", "fields": [{"name":
"referenceUrl", "type": "string", "doc": ""}, {"name": "prognosis", "type": ["null", {"type":
"enum", "name": "PrognosisClassification", "symbols": ["altered_prognosis", "favourable_prognosis",
"unfavourable_prognosis"]}], "doc": ""}, {"name": "source", "type": ["null", "string"], "doc": ""},
{"name": "references", "type": ["null", {"type": "array", "items": "string"}], "doc": ""}, {"name":
"conditions", "type": ["null", {"type": "array", "items": "string"}], "doc": ""}, {"name":
"description", "type": ["null", "string"], "doc": ""}, {"name": "variantActionable", "type":
"boolean", "doc": ""}]}}]}, {"name": "therapies", "type": ["null", {"type": "array", "items":
{"type": "record", "name": "Therapy", "fields": [{"name": "referenceUrl", "type": "string", "doc":
""}, {"name": "source", "type": ["null", "string"], "doc": ""}, {"name": "references", "type":
["null", {"type": "array", "items": "string"}], "doc": ""}, {"name": "conditions", "type": ["null",
{"type": "array", "items": "string"}], "doc": ""}, {"name": "drugResponse", "type": ["null",
{"type": "array", "items": {"type": "record", "name": "DrugResponse", "fields": [{"name":
"TreatmentAgent", "type": "string", "doc": ""}, {"name": "drugResponseClassification", "type":
{"type": "enum", "name": "DrugResponseClassification", "symbols": ["altered_sensitivity",
"reduced_sensitivity", "increased_sensitivity", "altered_resistance", "increased_resistance",
"reduced_resistance", "increased_risk_of_toxicity", "reduced_risk_of_toxicity", "altered_toxicity",
"adverse_drug_reaction", "indication", "contraindication", "dosing_alteration", "increased_dose",
"reduced_dose", "increased_monitoring", "increased_efficacy", "reduced_efficacy",
"altered_efficacy"]}, "doc": ""}]}}], "doc": ""}, {"name": "otherInterventions", "type": ["null",
{"type": "array", "items": "Intervention"}], "doc": ""}, {"name": "variantActionable", "type":
"boolean", "doc": ""}]}}]}]}], "doc": ""}, {"name": "score", "type": ["null", "float"], "doc": ""},
{"name": "vendorSpecificScores", "type": ["null", {"type": "map", "values": "float"}], "doc": ""},
{"name": "variantClassification", "type": ["null", {"type": "record", "name":
"VariantClassification", "doc": "", "fields": [{"name": "clinicalSignificance", "type": ["null",
{"type": "enum", "name": "ClinicalSignificance", "symbols": ["benign", "likely_benign",
"likely_pathogenic", "pathogenic", "uncertain_significance"]}], "doc": ""}, {"name":
"drugResponseClassification", "type": ["null", "DrugResponseClassification"], "doc": ""}, {"name":
"traitAssociation", "type": ["null", {"type": "enum", "name": "TraitAssociation", "symbols":
["established_risk_allele", "likely_risk_allele", "uncertain_risk_allele", "protective"]}], "doc":
""}, {"name": "tumorigenesisClassification", "type": ["null", {"type": "enum", "name":
"TumorigenesisClassification", "symbols": ["driver", "passenger", "modifier"]}], "doc": ""},
{"name": "functionalEffect", "type": ["null", {"type": "enum", "name": "VariantFunctionalEffect",
"symbols": ["dominant_negative_variant", "gain_of_function_variant", "lethal_variant",
"loss_of_function_variant", "loss_of_heterozygosity", "null_variant"]}], "doc": ""}]}], "doc": ""},
{"name": "guidelineBasedVariantClassification", "type": ["null", {"type": "record", "name":
"GuidelineBasedVariantClassification", "doc": "", "fields": [{"name": "acmgVariantClassification",
"type": ["null", {"type": "record", "name": "AcmgVariantClassification", "doc": "", "fields":
[{"name": "acmgEvidences", "type": {"type": "array", "items": {"type": "record", "name":
"AcmgEvidence", "doc": "", "fields": [{"name": "category", "type": {"type": "enum", "name":
"AcmgEvidenceCategory", "doc": "", "symbols": ["population_data",
"computational_and_predictive_data", "functional_data", "segregation_data", "de_novo_data",
"allelic_data", "other_database", "other_data"]}, "doc": ""}, {"name": "type", "type": {"type":
"enum", "name": "AcmgEvidenceType", "doc": "", "symbols": ["bening", "pathogenic"]}, "doc": ""},
{"name": "weight", "type": {"type": "enum", "name": "AcmgEvidenceWeight", "doc": "", "symbols":
["stand_alone", "supporting", "moderate", "strong", "very_strong"]}, "doc": ""}, {"name":
"modifier", "type": "int", "doc": ""}, {"name": "description", "type": ["null", "string"], "doc":
""}]}}}, {"name": "clinicalSignificance", "type": "ClinicalSignificance"}, {"name": "assessment",
"type": ["null", "string"]}]}]}, {"name": "ampVariantClassification", "type": ["null", {"type":
"record", "name": "AmpVariantClassification", "doc": "", "fields": [{"name": "ampEvidences", "type":
{"type": "array", "items": {"type": "record", "name": "AmpEvidence", "doc": "", "fields": [{"name":
"type", "type": {"type": "enum", "name": "AmpEvidenceType", "doc": "", "symbols": ["mutation_type",
"therapies", "variant_frequencies", "potential_germline", "population_database_presence",
"germline_database_presence", "somatic_database_presence", "impact_predictive_software",
"pathway_involvement", "publications"]}, "doc": ""}, {"name": "evidenceAssessment", "type":
"string", "doc": ""}]}}, "doc": ""}, {"name": "ampTier", "type": {"type": "enum", "name": "AmpTier",
"doc": "", "symbols": ["tierI", "tierII", "tierIII", "tierIV"]}, "doc": ""}, {"name":
"ampClincialOrExperimentalEvidence", "type": ["null", {"type": "array", "items": {"type": "record",
"name": "AmpClincialOrExperimentalEvidence", "doc": "", "fields": [{"name": "category", "type":
{"type": "enum", "name": "AmpClinicalOrExperimentalEvidenceCategory", "doc": "", "symbols":
["therapeutic", "diagnosis", "prognosis"]}, "doc": ""}, {"name": "level", "type": {"type": "enum",
"name": "AmpClinicalOrExperimentalEvidenceLevel", "doc": "", "symbols": ["levelA", "levelB",
"levelC", "levelD"]}, "doc": ""}, {"name": "description", "type": ["null", "string"], "doc":
""}]}}], "doc": ""}, {"name": "assessment", "type": ["null", "string"], "doc": ""}]}]}]}], "doc":
""}, {"name": "algorithmBasedVariantClassifications", "type": ["null", {"type": "array", "items":
{"type": "record", "name": "AlgorithmBasedVariantClassification", "fields": [{"name":
"algorithmName", "type": "string", "doc": ""}, {"name": "classification", "type": "string", "doc":
""}, {"name": "rank", "type": ["null", "int"], "doc": ""}, {"name": "score", "type": ["null",
"int"], "doc": ""}]}}], "doc": ""}, {"name": "tier", "type": ["null", {"type": "enum", "name":
"Tier", "doc": "", "symbols": ["NONE", "TIER1", "TIER2", "TIER3", "TIER4", "TIER5", "TIERA",
"TIERB"]}], "doc": ""}, {"name": "domain", "type": ["null", {"type": "enum", "name": "Domain",
"symbols": ["DOMAIN1", "DOMAIN2", "DOMAIN3", "DOMAIN4", "NONE"]}], "doc": ""}]}}, "doc": ""},
{"name": "variantAttributes", "type": ["null", {"type": "record", "name": "VariantAttributes",
"doc": "", "fields": [{"name": "genomicChanges", "type": ["null", {"type": "array", "items":
"string"}], "doc": ""}, {"name": "cdnaChanges", "type": ["null", {"type": "array", "items":
"string"}], "doc": ""}, {"name": "proteinChanges", "type": ["null", {"type": "array", "items":
"string"}], "doc": ""}, {"name": "additionalTextualVariantAnnotations", "type": ["null", {"type":
"map", "values": "string"}], "doc": ""}, {"name": "references", "type": ["null", {"type": "map",
"values": "string"}], "doc": ""}, {"name": "variantIdentifiers", "type": ["null", {"type": "record",
"name": "VariantIdentifiers", "fields": [{"name": "dbSnpId", "type": ["null", "string"], "doc": ""},
{"name": "cosmicIds", "type": ["null", {"type": "array", "items": "string"}], "doc": ""}, {"name":
"clinVarIds", "type": ["null", {"type": "array", "items": "string"}], "doc": ""}, {"name":
"otherIds", "type": ["null", {"type": "array", "items": "Identifier"}]}]}]}, {"name":
"alleleFrequencies", "type": ["null", {"type": "array", "items": {"type": "record", "name":
"AlleleFrequency", "doc": "", "fields": [{"name": "study", "type": "string", "doc": ""}, {"name":
"population", "type": "string", "doc": ""}, {"name": "alternateFrequency", "type": "float", "doc":
""}]}}], "doc": ""}, {"name": "additionalNumericVariantAnnotations", "type": ["null", {"type":
"map", "values": "float"}], "doc": ""}, {"name": "comments", "type": ["null", {"type": "array",
"items": "string"}], "doc": ""}, {"name": "alleleOrigins", "type": ["null", {"type": "array",
"items": "AlleleOrigin"}], "doc": ""}, {"name": "ihp", "type": ["null", "int"], "doc": ""}, {"name":
"recurrentlyReported", "type": ["null", "boolean"], "doc": ""}, {"name": "fdp50", "type": ["null",
"float"], "doc": ""}, {"name": "others", "type": ["null", {"type": "map", "values": "string"}],
"doc": ""}]}]}]}}], "doc": ""}, {"name": "structuralVariants", "type": ["null", {"type": "array",
"items": {"type": "record", "name": "StructuralVariant", "fields": [{"name": "variantType", "type":
{"type": "enum", "name": "StructuralVariantType", "symbols": ["ins", "dup", "inv", "amplification",
"deletion", "dup_tandem", "del_me", "ins_me"]}, "doc": ""}, {"name": "coordinates", "type": {"type":
"record", "name": "Coordinates", "fields": [{"name": "assembly", "type": "Assembly"}, {"name":
"chromosome", "type": "string"}, {"name": "start", "type": "int"}, {"name": "end", "type": "int"},
{"name": "ciStart", "type": ["null", {"type": "record", "name": "ConfidenceInterval", "fields":
[{"name": "left", "type": "int"}, {"name": "right", "type": "int"}]}]}, {"name": "ciEnd", "type":
["null", "ConfidenceInterval"]}]}}, {"name": "leftInsSeq", "type": ["null", "string"]}, {"name":
"rightInsSeq", "type": ["null", "string"]}, {"name": "reportEvents", "type": {"type": "array",
"items": "ReportEvent"}}, {"name": "variantCalls", "type": {"type": "array", "items":
"VariantCall"}, "doc": ""}, {"name": "variantAttributes", "type": ["null",
"VariantAttributes"]}]}}], "doc": ""}, {"name": "chromosomalRearrangements", "type": ["null",
{"type": "array", "items": {"type": "record", "name": "ChromosomalRearrangement", "fields":
[{"name": "breakPoints", "type": ["null", {"type": "array", "items": {"type": "record", "name":
"BreakPoint", "fields": [{"name": "coordinates", "type": "Coordinates"}, {"name": "reference",
"type": ["null", "string"]}, {"name": "alternate", "type": ["null", "string"]}, {"name": "info",
"type": ["null", {"type": "map", "values": "string"}]}]}}]}, {"name": "rearrangements", "type":
{"type": "array", "items": {"type": "record", "name": "Rearrangement", "fields": [{"name":
"leftCoordinates", "type": "Coordinates"}, {"name": "rightCoordinates", "type": "Coordinates"},
{"name": "orientation", "type": {"type": "enum", "name": "Orientation", "symbols": ["start_start",
"start_end", "end_end"]}}, {"name": "leftInsSeq", "type": ["null", "string"]}, {"name":
"rightInsSeq", "type": ["null", "string"]}]}}}, {"name": "reportEvents", "type": {"type": "array",
"items": "ReportEvent"}}, {"name": "variantCalls", "type": {"type": "array", "items":
"VariantCall"}, "doc": ""}, {"name": "variantAttributes", "type": ["null",
"VariantAttributes"]}]}}], "doc": ""}, {"name": "shortTandemRepeats", "type": ["null", {"type":
"array", "items": {"type": "record", "name": "ShortTandemRepeat", "fields": [{"name": "coordinates",
"type": "Coordinates"}, {"name": "reportEvents", "type": {"type": "array", "items": "ReportEvent"}},
{"name": "variantCalls", "type": {"type": "array", "items": "VariantCall"}, "doc": ""}, {"name":
"variantAttributes", "type": ["null", "VariantAttributes"]}, {"name":
"shortTandemRepeatReferenceData", "type": ["null", {"type": "record", "name":
"ShortTandemRepeatReferenceData", "fields": [{"name": "repeatedSequence", "type": "string"},
{"name": "pathogenic_number_of_repeats_threshold", "type": "int"}, {"name":
"normal_number_of_repeats_threshold", "type": "int"}]}]}]}}], "doc": ""}, {"name":
"uniparentalDisomies", "type": ["null", {"type": "array", "items": {"type": "record", "name":
"UniparentalDisomy", "fields": [{"name": "assembly", "type": "Assembly", "doc": ""}, {"name":
"chromosome", "type": "string", "doc": ""}, {"name": "complete", "type": ["null", "boolean"], "doc":
""}, {"name": "origin", "type": {"type": "enum", "name": "UniparentalDisomyOrigin", "symbols":
["paternal", "maternal", "unknown"]}, "doc": ""}, {"name": "uniparentalDisomyFragments", "type":
["null", {"type": "array", "items": {"type": "record", "name": "UniparentalDisomyFragment",
"fields": [{"name": "coordinates", "type": ["null", "Coordinates"], "doc": ""}, {"name":
"uniparentalDisomyType", "type": {"type": "enum", "name": "UniparentalDisomyType", "symbols":
["isodisomy", "heterodisomy", "both"]}, "doc": ""}]}}], "doc": ""}, {"name": "participantId",
"type": "string", "doc": ""}, {"name": "uniparentalDisomyEvidences", "type": ["null", {"type":
"record", "name": "UniparentalDisomyEvidences", "fields": [{"name": "ibds", "type": ["null",
{"type": "array", "items": {"type": "record", "name": "IdentityByDescent", "fields": [{"name":
"relatedSample", "type": "string"}, {"name": "ibd0", "type": "float"}, {"name": "ibd1", "type":
"float"}, {"name": "ibd2", "type": "float"}, {"name": "pihat", "type": "float"}]}}]}]}], "doc":
""}]}}], "doc": ""}, {"name": "karyotypes", "type": ["null", {"type": "array", "items": {"type":
"record", "name": "Karyotype", "fields": [{"name": "iscn", "type": ["null", "string"], "doc": ""},
{"name": "description", "type": ["null", "string"], "doc": ""}, {"name": "aneuploidies", "type":
["null", {"type": "array", "items": {"type": "record", "name": "Aneuploidy", "fields": [{"name":
"iscn", "type": ["null", "string"], "doc": ""}, {"name": "assembly", "type": "Assembly", "doc": ""},
{"name": "chromosome", "type": "string", "doc": ""}, {"name": "complete", "type": "boolean", "doc":
""}, {"name": "coordinates", "type": ["null", "Coordinates"], "doc": ""}, {"name": "numberOfCopies",
"type": "int", "doc": ""}]}}], "doc": ""}, {"name": "numberOfChromosomes", "type": "int", "doc":
""}, {"name": "personKaryotipicSex", "type": {"type": "enum", "name": "PersonKaryotipicSex",
"namespace": "org.gel.models.participant.avro", "doc": "", "symbols": ["UNKNOWN", "XX", "XY", "XO",
"XXY", "XXX", "XXYY", "XXXY", "XXXX", "XYY", "OTHER"]}, "doc": ""}, {"name": "participantId",
"type": "string", "doc": ""}]}}], "doc": ""}, {"name": "referenceDatabasesVersions", "type":
{"type": "map", "values": "string"}, "doc": ""}, {"name": "softwareVersions", "type": {"type":
"map", "values": "string"}, "doc": ""}, {"name": "comments", "type": ["null", {"type": "array",
"items": "string"}], "doc": ""}]}
"""
    schema = avro_parse(_schemaSource)
    requiredFields = {
        "chromosomalRearrangements",
        "comments",
        "interpretationRequestId",
        "interpretationRequestVersion",
        "interpretationService",
        "karyotypes",
        "referenceDatabasesVersions",
        "reportUrl",
        "shortTandemRepeats",
        "softwareVersions",
        "structuralVariants",
        "uniparentalDisomies",
        "variants",
        "versionControl",
    }

    @classmethod
    def isEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'chromosomalRearrangements': ChromosomalRearrangement,
            'karyotypes': Karyotype,
            'shortTandemRepeats': ShortTandemRepeat,
            'structuralVariants': StructuralVariant,
            'uniparentalDisomies': UniparentalDisomy,
            'variants': SmallVariant,
            'versionControl': ReportVersionControl,
        }
        return fieldName in embeddedTypes

    @classmethod
    def getEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'chromosomalRearrangements': ChromosomalRearrangement,
            'karyotypes': Karyotype,
            'shortTandemRepeats': ShortTandemRepeat,
            'structuralVariants': StructuralVariant,
            'uniparentalDisomies': UniparentalDisomy,
            'variants': SmallVariant,
            'versionControl': ReportVersionControl,
        }

        return embeddedTypes[fieldName]

    __slots__ = [
        'chromosomalRearrangements', 'comments',
        'interpretationRequestId', 'interpretationRequestVersion',
        'interpretationService', 'karyotypes',
        'referenceDatabasesVersions', 'reportUrl',
        'shortTandemRepeats', 'softwareVersions',
        'structuralVariants', 'uniparentalDisomies', 'variants',
        'versionControl'
    ]

    def __init__(self, **kwargs):
        self.chromosomalRearrangements = kwargs.get(
            'chromosomalRearrangements', None)
        self.comments = kwargs.get(
            'comments', None)
        self.interpretationRequestId = kwargs.get(
            'interpretationRequestId', None)
        self.interpretationRequestVersion = kwargs.get(
            'interpretationRequestVersion', None)
        self.interpretationService = kwargs.get(
            'interpretationService', None)
        self.karyotypes = kwargs.get(
            'karyotypes', None)
        self.referenceDatabasesVersions = kwargs.get(
            'referenceDatabasesVersions', None)
        self.reportUrl = kwargs.get(
            'reportUrl', None)
        self.shortTandemRepeats = kwargs.get(
            'shortTandemRepeats', None)
        self.softwareVersions = kwargs.get(
            'softwareVersions', None)
        self.structuralVariants = kwargs.get(
            'structuralVariants', None)
        self.uniparentalDisomies = kwargs.get(
            'uniparentalDisomies', None)
        self.variants = kwargs.get(
            'variants', None)
        self.versionControl = kwargs.get(
            'versionControl', ReportVersionControl())


class Intervention(ProtocolElement):
    """
    A process or action that is the focus of a clinical study.
    Ref. https://prsinfo.clinicaltrials.gov/definitions.html
    """
    _schemaSource = """
{"type": "record", "name": "Intervention", "namespace": "org.gel.models.report.avro", "doc": "",
"fields": [{"name": "interventionType", "type": {"type": "enum", "name": "InterventionType", "doc":
"", "symbols": ["drug", "device", "procedure", "biological", "radiation", "behavioral", "genetic",
"dietary_supplement", "combination_product", "diagnostic_test", "other"]}, "doc": ""}, {"name":
"interventionName", "type": "string", "doc": ""}]}
"""
    schema = avro_parse(_schemaSource)
    requiredFields = {
        "interventionName",
        "interventionType",
    }

    @classmethod
    def isEmbeddedType(cls, fieldName):
        embeddedTypes = {}
        return fieldName in embeddedTypes

    @classmethod
    def getEmbeddedType(cls, fieldName):
        embeddedTypes = {}

        return embeddedTypes[fieldName]

    __slots__ = [
        'interventionName', 'interventionType'
    ]

    def __init__(self, **kwargs):
        self.interventionName = kwargs.get(
            'interventionName', None)
        self.interventionType = kwargs.get(
            'interventionType', None)


class InterventionType(object):
    """
    For each intervention studied in the clinical study, the general
    type of intervention  * `drug`: Including placebo * `device`:
    Including sham * `biological`: Vaccine * `procedure`: Surgery *
    `radiation` * `behavioral`: For example, psychotherapy, lifestyle
    counselling * `genetic`: Including gene transfer, stem cell and
    recombinant DNA * `dietary_supplement`: For example, vitamins,
    minerals * `combination_product`: Combining a drug and device, a
    biological product and device; a drug and biological product; or a
    drug, biological product, and device * `diagnostic_test`: For
    example, imaging, in-vitro * `other`      Ref.
    https://prsinfo.clinicaltrials.gov/definitions.htm
    """
    drug = "drug"
    device = "device"
    procedure = "procedure"
    biological = "biological"
    radiation = "radiation"
    behavioral = "behavioral"
    genetic = "genetic"
    dietary_supplement = "dietary_supplement"
    combination_product = "combination_product"
    diagnostic_test = "diagnostic_test"
    other = "other"

    def __hash__(self):
        return str(self).__hash__()


class Karyotype(ProtocolElement):
    """
    No documentation
    """
    _schemaSource = """
{"type": "record", "name": "Karyotype", "namespace": "org.gel.models.report.avro", "fields":
[{"name": "iscn", "type": ["null", "string"], "doc": ""}, {"name": "description", "type": ["null",
"string"], "doc": ""}, {"name": "aneuploidies", "type": ["null", {"type": "array", "items": {"type":
"record", "name": "Aneuploidy", "fields": [{"name": "iscn", "type": ["null", "string"], "doc": ""},
{"name": "assembly", "type": {"type": "enum", "name": "Assembly", "doc": "", "symbols": ["GRCh38",
"GRCh37"]}, "doc": ""}, {"name": "chromosome", "type": "string", "doc": ""}, {"name": "complete",
"type": "boolean", "doc": ""}, {"name": "coordinates", "type": ["null", {"type": "record", "name":
"Coordinates", "fields": [{"name": "assembly", "type": "Assembly"}, {"name": "chromosome", "type":
"string"}, {"name": "start", "type": "int"}, {"name": "end", "type": "int"}, {"name": "ciStart",
"type": ["null", {"type": "record", "name": "ConfidenceInterval", "fields": [{"name": "left",
"type": "int"}, {"name": "right", "type": "int"}]}]}, {"name": "ciEnd", "type": ["null",
"ConfidenceInterval"]}]}], "doc": ""}, {"name": "numberOfCopies", "type": "int", "doc": ""}]}}],
"doc": ""}, {"name": "numberOfChromosomes", "type": "int", "doc": ""}, {"name":
"personKaryotipicSex", "type": {"type": "enum", "name": "PersonKaryotipicSex", "namespace":
"org.gel.models.participant.avro", "doc": "", "symbols": ["UNKNOWN", "XX", "XY", "XO", "XXY", "XXX",
"XXYY", "XXXY", "XXXX", "XYY", "OTHER"]}, "doc": ""}, {"name": "participantId", "type": "string",
"doc": ""}]}
"""
    schema = avro_parse(_schemaSource)
    requiredFields = {
        "aneuploidies",
        "description",
        "iscn",
        "numberOfChromosomes",
        "participantId",
        "personKaryotipicSex",
    }

    @classmethod
    def isEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'aneuploidies': Aneuploidy,
        }
        return fieldName in embeddedTypes

    @classmethod
    def getEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'aneuploidies': Aneuploidy,
        }

        return embeddedTypes[fieldName]

    __slots__ = [
        'aneuploidies', 'description', 'iscn', 'numberOfChromosomes',
        'participantId', 'personKaryotipicSex'
    ]

    def __init__(self, **kwargs):
        self.aneuploidies = kwargs.get(
            'aneuploidies', None)
        self.description = kwargs.get(
            'description', None)
        self.iscn = kwargs.get(
            'iscn', None)
        self.numberOfChromosomes = kwargs.get(
            'numberOfChromosomes', None)
        self.participantId = kwargs.get(
            'participantId', None)
        self.personKaryotipicSex = kwargs.get(
            'personKaryotipicSex', None)


class KgPopCategory(object):
    """
    1K Genomes project populations
    """
    ACB = "ACB"
    ASW = "ASW"
    BEB = "BEB"
    CDX = "CDX"
    CEU = "CEU"
    CHB = "CHB"
    CHS = "CHS"
    CLM = "CLM"
    ESN = "ESN"
    FIN = "FIN"
    GBR = "GBR"
    GIH = "GIH"
    GWD = "GWD"
    IBS = "IBS"
    ITU = "ITU"
    JPT = "JPT"
    KHV = "KHV"
    LWK = "LWK"
    MSL = "MSL"
    MXL = "MXL"
    PEL = "PEL"
    PJL = "PJL"
    PUR = "PUR"
    STU = "STU"
    TSI = "TSI"
    YRI = "YRI"

    def __hash__(self):
        return str(self).__hash__()


class KgSuperPopCategory(object):
    """
    1K Genomes project super populations
    """
    AFR = "AFR"
    AMR = "AMR"
    EAS = "EAS"
    EUR = "EUR"
    SAS = "SAS"

    def __hash__(self):
        return str(self).__hash__()


class Laterality(object):
    """
    No documentation
    """
    RIGHT = "RIGHT"
    UNILATERAL = "UNILATERAL"
    BILATERAL = "BILATERAL"
    LEFT = "LEFT"

    def __hash__(self):
        return str(self).__hash__()


class LifeStatus(object):
    """
    Life Status
    """
    ALIVE = "ALIVE"
    ABORTED = "ABORTED"
    DECEASED = "DECEASED"
    UNBORN = "UNBORN"
    STILLBORN = "STILLBORN"
    MISCARRIAGE = "MISCARRIAGE"

    def __hash__(self):
        return str(self).__hash__()


class MatchedSamples(ProtocolElement):
    """
    This defines a pair of germline and tumor, this pair should/must
    be analyzed together
    """
    _schemaSource = """
{"type": "record", "name": "MatchedSamples", "namespace": "org.gel.models.participant.avro", "doc":
"", "fields": [{"name": "germlineSampleId", "type": ["null", "string"], "doc": ""}, {"name":
"tumourSampleId", "type": ["null", "string"], "doc": ""}]}
"""
    schema = avro_parse(_schemaSource)
    requiredFields = {
        "germlineSampleId",
        "tumourSampleId",
    }

    @classmethod
    def isEmbeddedType(cls, fieldName):
        embeddedTypes = {}
        return fieldName in embeddedTypes

    @classmethod
    def getEmbeddedType(cls, fieldName):
        embeddedTypes = {}

        return embeddedTypes[fieldName]

    __slots__ = [
        'germlineSampleId', 'tumourSampleId'
    ]

    def __init__(self, **kwargs):
        self.germlineSampleId = kwargs.get(
            'germlineSampleId', None)
        self.tumourSampleId = kwargs.get(
            'tumourSampleId', None)


class Method(object):
    """
    No documentation
    """
    RESECTION = "RESECTION"
    BIOPSY = "BIOPSY"
    BLOOD = "BLOOD"

    def __hash__(self):
        return str(self).__hash__()


class ModeOfInheritance(object):
    """
    An enumeration for the different mode of inheritances:  *
    `monoallelic_not_imprinted`: MONOALLELIC, autosomal or
    pseudoautosomal, not imprinted *
    `monoallelic_maternally_imprinted`: MONOALLELIC, autosomal or
    pseudoautosomal, maternally imprinted (paternal allele expressed)
    * `monoallelic_paternally_imprinted`: MONOALLELIC, autosomal or
    pseudoautosomal, paternally imprinted (maternal allele expressed)
    * `monoallelic`: MONOALLELIC, autosomal or pseudoautosomal,
    imprinted status unknown * `biallelic`: BIALLELIC, autosomal or
    pseudoautosomal * `monoallelic_and_biallelic`: BOTH monoallelic
    and biallelic, autosomal or pseudoautosomal *
    `monoallelic_and_more_severe_biallelic`: BOTH monoallelic and
    biallelic, autosomal or pseudoautosomal (but BIALLELIC mutations
    cause a more SEVERE disease form), autosomal or pseudoautosomal *
    `xlinked_biallelic`: X-LINKED: hemizygous mutation in males,
    biallelic mutations in females * `xlinked_monoallelic`: X linked:
    hemizygous mutation in males, monoallelic mutations in females may
    cause disease (may be less severe, later onset than males) *
    `mitochondrial`: MITOCHONDRIAL * `unknown`: Unknown
    """
    monoallelic = "monoallelic"
    monoallelic_not_imprinted = "monoallelic_not_imprinted"
    monoallelic_maternally_imprinted = "monoallelic_maternally_imprinted"
    monoallelic_paternally_imprinted = "monoallelic_paternally_imprinted"
    biallelic = "biallelic"
    monoallelic_and_biallelic = "monoallelic_and_biallelic"
    monoallelic_and_more_severe_biallelic = "monoallelic_and_more_severe_biallelic"
    xlinked_biallelic = "xlinked_biallelic"
    xlinked_monoallelic = "xlinked_monoallelic"
    mitochondrial = "mitochondrial"
    unknown = "unknown"
    na = "na"

    def __hash__(self):
        return str(self).__hash__()


class NumberOfCopies(ProtocolElement):
    """
    No documentation
    """
    _schemaSource = """
{"type": "record", "name": "NumberOfCopies", "namespace": "org.gel.models.report.avro", "fields":
[{"name": "numberOfCopies", "type": "int", "doc": ""}, {"name": "confidenceIntervalMaximum", "type":
["null", "int"]}, {"name": "confidenceIntervalMinimum", "type": ["null", "int"]}]}
"""
    schema = avro_parse(_schemaSource)
    requiredFields = {
        "confidenceIntervalMaximum",
        "confidenceIntervalMinimum",
        "numberOfCopies",
    }

    @classmethod
    def isEmbeddedType(cls, fieldName):
        embeddedTypes = {}
        return fieldName in embeddedTypes

    @classmethod
    def getEmbeddedType(cls, fieldName):
        embeddedTypes = {}

        return embeddedTypes[fieldName]

    __slots__ = [
        'confidenceIntervalMaximum', 'confidenceIntervalMinimum',
        'numberOfCopies'
    ]

    def __init__(self, **kwargs):
        self.confidenceIntervalMaximum = kwargs.get(
            'confidenceIntervalMaximum', None)
        self.confidenceIntervalMinimum = kwargs.get(
            'confidenceIntervalMinimum', None)
        self.numberOfCopies = kwargs.get(
            'numberOfCopies', None)


class Ontology(ProtocolElement):
    """
    The ontology to which a standard term belongs
    """
    _schemaSource = """
{"type": "record", "name": "Ontology", "namespace": "org.gel.models.report.avro", "doc": "",
"fields": [{"name": "name", "type": "string"}, {"name": "version", "type": "string"}]}
"""
    schema = avro_parse(_schemaSource)
    requiredFields = {
        "name",
        "version",
    }

    @classmethod
    def isEmbeddedType(cls, fieldName):
        embeddedTypes = {}
        return fieldName in embeddedTypes

    @classmethod
    def getEmbeddedType(cls, fieldName):
        embeddedTypes = {}

        return embeddedTypes[fieldName]

    __slots__ = [
        'name', 'version'
    ]

    def __init__(self, **kwargs):
        self.name = kwargs.get(
            'name', None)
        self.version = kwargs.get(
            'version', None)


class Orientation(object):
    """
    No documentation
    """
    start_start = "start_start"
    start_end = "start_end"
    end_end = "end_end"

    def __hash__(self):
        return str(self).__hash__()


class OtherFamilyHistory(ProtocolElement):
    """
    Family history for secondary findings.     Arrays of strings
    describing discrete family history phenotypes.     Usually:
    `EndocrineTumours`, `colorectal`, `BreastOvarian` and `HDOrStroke`
    but can be others
    """
    _schemaSource = """
{"type": "record", "name": "OtherFamilyHistory", "namespace": "org.gel.models.report.avro", "doc":
"", "fields": [{"name": "maternalFamilyHistory", "type": ["null", {"type": "array", "items":
"string"}], "doc": ""}, {"name": "paternalFamilyHistory", "type": ["null", {"type": "array",
"items": "string"}], "doc": ""}]}
"""
    schema = avro_parse(_schemaSource)
    requiredFields = {
        "maternalFamilyHistory",
        "paternalFamilyHistory",
    }

    @classmethod
    def isEmbeddedType(cls, fieldName):
        embeddedTypes = {}
        return fieldName in embeddedTypes

    @classmethod
    def getEmbeddedType(cls, fieldName):
        embeddedTypes = {}

        return embeddedTypes[fieldName]

    __slots__ = [
        'maternalFamilyHistory', 'paternalFamilyHistory'
    ]

    def __init__(self, **kwargs):
        self.maternalFamilyHistory = kwargs.get(
            'maternalFamilyHistory', None)
        self.paternalFamilyHistory = kwargs.get(
            'paternalFamilyHistory', None)


class ParticipantQCState(object):
    """
    QCState Status
    """
    noState = "noState"
    passedMedicalReviewReadyForInterpretation = "passedMedicalReviewReadyForInterpretation"
    passedMedicalReviewNotReadyForInterpretation = "passedMedicalReviewNotReadyForInterpretation"
    queryToGel = "queryToGel"
    queryToGMC = "queryToGMC"
    failed = "failed"

    def __hash__(self):
        return str(self).__hash__()


class Pedigree(ProtocolElement):
    """
    This is the concept of a family with associated phenotypes as
    present in the record RDParticipant
    """
    _schemaSource = """
{"type": "record", "name": "Pedigree", "namespace": "org.gel.models.participant.avro", "doc": "",
"fields": [{"name": "versionControl", "type": ["null", {"type": "record", "name": "VersionControl",
"fields": [{"name": "GitVersionControl", "type": "string", "doc": "", "default": "1.1.3"}]}], "doc":
""}, {"name": "LDPCode", "type": ["null", "string"], "doc": ""}, {"name": "familyId", "type":
"string", "doc": ""}, {"name": "members", "type": {"type": "array", "items": {"type": "record",
"name": "PedigreeMember", "doc": "", "fields": [{"name": "pedigreeId", "type": ["null", "int"],
"doc": ""}, {"name": "isProband", "type": ["null", "boolean"], "doc": ""}, {"name": "participantId",
"type": ["null", "string"], "doc": ""}, {"name": "participantQCState", "type": ["null", {"type":
"enum", "name": "ParticipantQCState", "doc": "", "symbols": ["noState",
"passedMedicalReviewReadyForInterpretation", "passedMedicalReviewNotReadyForInterpretation",
"queryToGel", "queryToGMC", "failed"]}], "doc": ""}, {"name": "gelSuperFamilyId", "type": ["null",
"string"], "doc": ""}, {"name": "sex", "type": {"type": "enum", "name": "Sex", "doc": "", "symbols":
["MALE", "FEMALE", "UNKNOWN"]}, "doc": ""}, {"name": "personKaryotypicSex", "type": ["null",
{"type": "enum", "name": "PersonKaryotipicSex", "doc": "", "symbols": ["UNKNOWN", "XX", "XY", "XO",
"XXY", "XXX", "XXYY", "XXXY", "XXXX", "XYY", "OTHER"]}], "doc": ""}, {"name": "yearOfBirth", "type":
["null", "int"], "doc": ""}, {"name": "fatherId", "type": ["null", "int"], "doc": ""}, {"name":
"motherId", "type": ["null", "int"], "doc": ""}, {"name": "superFatherId", "type": ["null", "int"],
"doc": ""}, {"name": "superMotherId", "type": ["null", "int"], "doc": ""}, {"name": "twinGroup",
"type": ["null", "int"], "doc": ""}, {"name": "monozygotic", "type": ["null", {"type": "enum",
"name": "TernaryOption", "doc": "", "symbols": ["yes", "no", "unknown"]}], "doc": ""}, {"name":
"adoptedStatus", "type": ["null", {"type": "enum", "name": "AdoptedStatus", "doc": "", "symbols":
["notadopted", "adoptedin", "adoptedout"]}], "doc": ""}, {"name": "lifeStatus", "type": ["null",
{"type": "enum", "name": "LifeStatus", "doc": "", "symbols": ["ALIVE", "ABORTED", "DECEASED",
"UNBORN", "STILLBORN", "MISCARRIAGE"]}], "doc": ""}, {"name": "consanguineousParents", "type":
["null", "TernaryOption"], "doc": ""}, {"name": "affectionStatus", "type": ["null", {"type": "enum",
"name": "AffectionStatus", "doc": "", "symbols": ["UNAFFECTED", "AFFECTED", "UNCERTAIN"]}], "doc":
""}, {"name": "disorderList", "type": ["null", {"type": "array", "items": {"type": "record", "name":
"Disorder", "doc": "", "fields": [{"name": "diseaseGroup", "type": ["null", "string"], "doc": ""},
{"name": "diseaseSubGroup", "type": ["null", "string"], "doc": ""}, {"name": "specificDisease",
"type": ["null", "string"], "doc": ""}, {"name": "ageOfOnset", "type": ["null", "float"], "doc":
""}]}}], "doc": ""}, {"name": "hpoTermList", "type": ["null", {"type": "array", "items": {"type":
"record", "name": "HpoTerm", "doc": "", "fields": [{"name": "term", "type": "string", "doc": ""},
{"name": "termPresence", "type": ["null", "TernaryOption"], "doc": ""}, {"name": "hpoBuildNumber",
"type": ["null", "string"], "doc": ""}, {"name": "modifiers", "type": ["null", {"type": "record",
"name": "HpoTermModifiers", "fields": [{"name": "laterality", "type": ["null", {"type": "enum",
"name": "Laterality", "symbols": ["RIGHT", "UNILATERAL", "BILATERAL", "LEFT"]}]}, {"name":
"progression", "type": ["null", {"type": "enum", "name": "Progression", "symbols": ["PROGRESSIVE",
"NONPROGRESSIVE"]}]}, {"name": "severity", "type": ["null", {"type": "enum", "name": "Severity",
"symbols": ["BORDERLINE", "MILD", "MODERATE", "SEVERE", "PROFOUND"]}]}, {"name": "spatialPattern",
"type": ["null", {"type": "enum", "name": "SpatialPattern", "symbols": ["DISTAL", "GENERALIZED",
"LOCALIZED", "PROXIMAL"]}]}]}], "doc": ""}, {"name": "ageOfOnset", "type": ["null", {"type": "enum",
"name": "AgeOfOnset", "symbols": ["EMBRYONAL_ONSET", "FETAL_ONSET", "NEONATAL_ONSET",
"INFANTILE_ONSET", "CHILDHOOD_ONSET", "JUVENILE_ONSET", "YOUNG_ADULT_ONSET", "LATE_ONSET",
"MIDDLE_AGE_ONSET"]}], "doc": ""}]}}], "doc": ""}, {"name": "ancestries", "type": ["null", {"type":
"record", "name": "Ancestries", "doc": "", "fields": [{"name": "mothersEthnicOrigin", "type":
["null", {"type": "enum", "name": "EthnicCategory", "doc": "", "symbols": ["D", "E", "F", "G", "A",
"B", "C", "L", "M", "N", "H", "J", "K", "P", "S", "R", "Z"]}], "doc": ""}, {"name":
"mothersOtherRelevantAncestry", "type": ["null", "string"], "doc": ""}, {"name":
"fathersEthnicOrigin", "type": ["null", "EthnicCategory"], "doc": ""}, {"name":
"fathersOtherRelevantAncestry", "type": ["null", "string"], "doc": ""}, {"name":
"chiSquare1KGenomesPhase3Pop", "type": ["null", {"type": "array", "items": {"type": "record",
"name": "ChiSquare1KGenomesPhase3Pop", "doc": "", "fields": [{"name": "kgSuperPopCategory", "type":
{"type": "enum", "name": "KgSuperPopCategory", "doc": "", "symbols": ["AFR", "AMR", "EAS", "EUR",
"SAS"]}, "doc": ""}, {"name": "kgPopCategory", "type": ["null", {"type": "enum", "name":
"KgPopCategory", "doc": "", "symbols": ["ACB", "ASW", "BEB", "CDX", "CEU", "CHB", "CHS", "CLM",
"ESN", "FIN", "GBR", "GIH", "GWD", "IBS", "ITU", "JPT", "KHV", "LWK", "MSL", "MXL", "PEL", "PJL",
"PUR", "STU", "TSI", "YRI"]}], "doc": ""}, {"name": "chiSquare", "type": "double", "doc": ""}]}}],
"doc": ""}]}], "doc": ""}, {"name": "consentStatus", "type": ["null", {"type": "record", "name":
"ConsentStatus", "doc": "", "fields": [{"name": "programmeConsent", "type": "boolean", "doc": "",
"default": false}, {"name": "primaryFindingConsent", "type": "boolean", "doc": "", "default":
false}, {"name": "secondaryFindingConsent", "type": "boolean", "doc": "", "default": false},
{"name": "carrierStatusConsent", "type": "boolean", "doc": "", "default": false}]}], "doc": ""},
{"name": "samples", "type": ["null", {"type": "array", "items": {"type": "record", "name": "Sample",
"fields": [{"name": "sampleId", "type": "string", "doc": ""}, {"name": "labSampleId", "type":
"string", "doc": ""}, {"name": "source", "type": ["null", {"type": "enum", "name": "SampleSource",
"doc": "", "symbols": ["TUMOUR", "BONE_MARROW_ASPIRATE_TUMOUR_SORTED_CELLS",
"BONE_MARROW_ASPIRATE_TUMOUR_CELLS", "BLOOD", "SALIVA", "FIBROBLAST", "TISSUE"]}], "doc": ""},
{"name": "product", "type": ["null", {"type": "enum", "name": "Product", "symbols": ["DNA",
"RNA"]}], "doc": ""}, {"name": "preparationMethod", "type": ["null", {"type": "enum", "name":
"PreparationMethod", "symbols": ["EDTA", "ORAGENE", "FF", "FFPE", "CD128_SORTED_CELLS",
"ASPIRATE"]}], "doc": ""}]}}], "doc": ""}, {"name": "inbreedingCoefficient", "type": ["null",
{"type": "record", "name": "InbreedingCoefficient", "doc": "", "fields": [{"name": "sampleId",
"type": "string", "doc": ""}, {"name": "program", "type": "string", "doc": ""}, {"name": "version",
"type": "string", "doc": ""}, {"name": "estimationMethod", "type": "string", "doc": ""}, {"name":
"coefficient", "type": "double", "doc": ""}, {"name": "standardError", "type": ["null", "double"],
"doc": ""}]}], "doc": ""}, {"name": "additionalInformation", "type": ["null", {"type": "map",
"values": "string"}], "doc": ""}]}}, "doc": ""}, {"name": "analysisPanels", "type": ["null",
{"type": "array", "items": {"type": "record", "name": "AnalysisPanel", "doc": "", "fields":
[{"name": "specificDisease", "type": "string", "doc": ""}, {"name": "panelName", "type": "string",
"doc": ""}, {"name": "panelVersion", "type": ["null", "string"], "doc": ""}, {"name":
"reviewOutcome", "type": "string", "doc": ""}, {"name": "multipleGeneticOrigins", "type": "string",
"doc": ""}]}}], "doc": ""}, {"name": "diseasePenetrances", "type": ["null", {"type": "array",
"items": {"type": "record", "name": "DiseasePenetrance", "doc": "", "fields": [{"name":
"specificDisease", "type": "string", "doc": ""}, {"name": "penetrance", "type": {"type": "enum",
"name": "Penetrance", "doc": "", "symbols": ["complete", "incomplete"]}, "doc": ""}]}}], "doc": ""},
{"name": "readyForAnalysis", "type": "boolean", "doc": ""}, {"name": "familyQCState", "type":
["null", {"type": "enum", "name": "FamilyQCState", "doc": "", "symbols": ["noState",
"passedMedicalReviewReadyForInterpretation", "passedMedicalReviewNotReadyForInterpretation",
"queryToGel", "queryToGMC", "failed"]}], "doc": ""}]}
"""
    schema = avro_parse(_schemaSource)
    requiredFields = {
        "LDPCode",
        "analysisPanels",
        "diseasePenetrances",
        "familyId",
        "familyQCState",
        "members",
        "readyForAnalysis",
        "versionControl",
    }

    @classmethod
    def isEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'analysisPanels': AnalysisPanel,
            'diseasePenetrances': DiseasePenetrance,
            'members': PedigreeMember,
            'versionControl': VersionControl,
        }
        return fieldName in embeddedTypes

    @classmethod
    def getEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'analysisPanels': AnalysisPanel,
            'diseasePenetrances': DiseasePenetrance,
            'members': PedigreeMember,
            'versionControl': VersionControl,
        }

        return embeddedTypes[fieldName]

    __slots__ = [
        'LDPCode', 'analysisPanels', 'diseasePenetrances', 'familyId',
        'familyQCState', 'members', 'readyForAnalysis',
        'versionControl'
    ]

    def __init__(self, **kwargs):
        self.LDPCode = kwargs.get(
            'LDPCode', None)
        self.analysisPanels = kwargs.get(
            'analysisPanels', None)
        self.diseasePenetrances = kwargs.get(
            'diseasePenetrances', None)
        self.familyId = kwargs.get(
            'familyId', None)
        self.familyQCState = kwargs.get(
            'familyQCState', None)
        self.members = kwargs.get(
            'members', None)
        self.readyForAnalysis = kwargs.get(
            'readyForAnalysis', None)
        self.versionControl = kwargs.get(
            'versionControl', None)


class PedigreeMember(ProtocolElement):
    """
    This defines a RD Participant (demographics and pedigree
    information)
    """
    _schemaSource = """
{"type": "record", "name": "PedigreeMember", "namespace": "org.gel.models.participant.avro", "doc":
"", "fields": [{"name": "pedigreeId", "type": ["null", "int"], "doc": ""}, {"name": "isProband",
"type": ["null", "boolean"], "doc": ""}, {"name": "participantId", "type": ["null", "string"],
"doc": ""}, {"name": "participantQCState", "type": ["null", {"type": "enum", "name":
"ParticipantQCState", "doc": "", "symbols": ["noState", "passedMedicalReviewReadyForInterpretation",
"passedMedicalReviewNotReadyForInterpretation", "queryToGel", "queryToGMC", "failed"]}], "doc": ""},
{"name": "gelSuperFamilyId", "type": ["null", "string"], "doc": ""}, {"name": "sex", "type":
{"type": "enum", "name": "Sex", "doc": "", "symbols": ["MALE", "FEMALE", "UNKNOWN"]}, "doc": ""},
{"name": "personKaryotypicSex", "type": ["null", {"type": "enum", "name": "PersonKaryotipicSex",
"doc": "", "symbols": ["UNKNOWN", "XX", "XY", "XO", "XXY", "XXX", "XXYY", "XXXY", "XXXX", "XYY",
"OTHER"]}], "doc": ""}, {"name": "yearOfBirth", "type": ["null", "int"], "doc": ""}, {"name":
"fatherId", "type": ["null", "int"], "doc": ""}, {"name": "motherId", "type": ["null", "int"],
"doc": ""}, {"name": "superFatherId", "type": ["null", "int"], "doc": ""}, {"name": "superMotherId",
"type": ["null", "int"], "doc": ""}, {"name": "twinGroup", "type": ["null", "int"], "doc": ""},
{"name": "monozygotic", "type": ["null", {"type": "enum", "name": "TernaryOption", "doc": "",
"symbols": ["yes", "no", "unknown"]}], "doc": ""}, {"name": "adoptedStatus", "type": ["null",
{"type": "enum", "name": "AdoptedStatus", "doc": "", "symbols": ["notadopted", "adoptedin",
"adoptedout"]}], "doc": ""}, {"name": "lifeStatus", "type": ["null", {"type": "enum", "name":
"LifeStatus", "doc": "", "symbols": ["ALIVE", "ABORTED", "DECEASED", "UNBORN", "STILLBORN",
"MISCARRIAGE"]}], "doc": ""}, {"name": "consanguineousParents", "type": ["null", "TernaryOption"],
"doc": ""}, {"name": "affectionStatus", "type": ["null", {"type": "enum", "name": "AffectionStatus",
"doc": "", "symbols": ["UNAFFECTED", "AFFECTED", "UNCERTAIN"]}], "doc": ""}, {"name":
"disorderList", "type": ["null", {"type": "array", "items": {"type": "record", "name": "Disorder",
"doc": "", "fields": [{"name": "diseaseGroup", "type": ["null", "string"], "doc": ""}, {"name":
"diseaseSubGroup", "type": ["null", "string"], "doc": ""}, {"name": "specificDisease", "type":
["null", "string"], "doc": ""}, {"name": "ageOfOnset", "type": ["null", "float"], "doc": ""}]}}],
"doc": ""}, {"name": "hpoTermList", "type": ["null", {"type": "array", "items": {"type": "record",
"name": "HpoTerm", "doc": "", "fields": [{"name": "term", "type": "string", "doc": ""}, {"name":
"termPresence", "type": ["null", "TernaryOption"], "doc": ""}, {"name": "hpoBuildNumber", "type":
["null", "string"], "doc": ""}, {"name": "modifiers", "type": ["null", {"type": "record", "name":
"HpoTermModifiers", "fields": [{"name": "laterality", "type": ["null", {"type": "enum", "name":
"Laterality", "symbols": ["RIGHT", "UNILATERAL", "BILATERAL", "LEFT"]}]}, {"name": "progression",
"type": ["null", {"type": "enum", "name": "Progression", "symbols": ["PROGRESSIVE",
"NONPROGRESSIVE"]}]}, {"name": "severity", "type": ["null", {"type": "enum", "name": "Severity",
"symbols": ["BORDERLINE", "MILD", "MODERATE", "SEVERE", "PROFOUND"]}]}, {"name": "spatialPattern",
"type": ["null", {"type": "enum", "name": "SpatialPattern", "symbols": ["DISTAL", "GENERALIZED",
"LOCALIZED", "PROXIMAL"]}]}]}], "doc": ""}, {"name": "ageOfOnset", "type": ["null", {"type": "enum",
"name": "AgeOfOnset", "symbols": ["EMBRYONAL_ONSET", "FETAL_ONSET", "NEONATAL_ONSET",
"INFANTILE_ONSET", "CHILDHOOD_ONSET", "JUVENILE_ONSET", "YOUNG_ADULT_ONSET", "LATE_ONSET",
"MIDDLE_AGE_ONSET"]}], "doc": ""}]}}], "doc": ""}, {"name": "ancestries", "type": ["null", {"type":
"record", "name": "Ancestries", "doc": "", "fields": [{"name": "mothersEthnicOrigin", "type":
["null", {"type": "enum", "name": "EthnicCategory", "doc": "", "symbols": ["D", "E", "F", "G", "A",
"B", "C", "L", "M", "N", "H", "J", "K", "P", "S", "R", "Z"]}], "doc": ""}, {"name":
"mothersOtherRelevantAncestry", "type": ["null", "string"], "doc": ""}, {"name":
"fathersEthnicOrigin", "type": ["null", "EthnicCategory"], "doc": ""}, {"name":
"fathersOtherRelevantAncestry", "type": ["null", "string"], "doc": ""}, {"name":
"chiSquare1KGenomesPhase3Pop", "type": ["null", {"type": "array", "items": {"type": "record",
"name": "ChiSquare1KGenomesPhase3Pop", "doc": "", "fields": [{"name": "kgSuperPopCategory", "type":
{"type": "enum", "name": "KgSuperPopCategory", "doc": "", "symbols": ["AFR", "AMR", "EAS", "EUR",
"SAS"]}, "doc": ""}, {"name": "kgPopCategory", "type": ["null", {"type": "enum", "name":
"KgPopCategory", "doc": "", "symbols": ["ACB", "ASW", "BEB", "CDX", "CEU", "CHB", "CHS", "CLM",
"ESN", "FIN", "GBR", "GIH", "GWD", "IBS", "ITU", "JPT", "KHV", "LWK", "MSL", "MXL", "PEL", "PJL",
"PUR", "STU", "TSI", "YRI"]}], "doc": ""}, {"name": "chiSquare", "type": "double", "doc": ""}]}}],
"doc": ""}]}], "doc": ""}, {"name": "consentStatus", "type": ["null", {"type": "record", "name":
"ConsentStatus", "doc": "", "fields": [{"name": "programmeConsent", "type": "boolean", "doc": "",
"default": false}, {"name": "primaryFindingConsent", "type": "boolean", "doc": "", "default":
false}, {"name": "secondaryFindingConsent", "type": "boolean", "doc": "", "default": false},
{"name": "carrierStatusConsent", "type": "boolean", "doc": "", "default": false}]}], "doc": ""},
{"name": "samples", "type": ["null", {"type": "array", "items": {"type": "record", "name": "Sample",
"fields": [{"name": "sampleId", "type": "string", "doc": ""}, {"name": "labSampleId", "type":
"string", "doc": ""}, {"name": "source", "type": ["null", {"type": "enum", "name": "SampleSource",
"doc": "", "symbols": ["TUMOUR", "BONE_MARROW_ASPIRATE_TUMOUR_SORTED_CELLS",
"BONE_MARROW_ASPIRATE_TUMOUR_CELLS", "BLOOD", "SALIVA", "FIBROBLAST", "TISSUE"]}], "doc": ""},
{"name": "product", "type": ["null", {"type": "enum", "name": "Product", "symbols": ["DNA",
"RNA"]}], "doc": ""}, {"name": "preparationMethod", "type": ["null", {"type": "enum", "name":
"PreparationMethod", "symbols": ["EDTA", "ORAGENE", "FF", "FFPE", "CD128_SORTED_CELLS",
"ASPIRATE"]}], "doc": ""}]}}], "doc": ""}, {"name": "inbreedingCoefficient", "type": ["null",
{"type": "record", "name": "InbreedingCoefficient", "doc": "", "fields": [{"name": "sampleId",
"type": "string", "doc": ""}, {"name": "program", "type": "string", "doc": ""}, {"name": "version",
"type": "string", "doc": ""}, {"name": "estimationMethod", "type": "string", "doc": ""}, {"name":
"coefficient", "type": "double", "doc": ""}, {"name": "standardError", "type": ["null", "double"],
"doc": ""}]}], "doc": ""}, {"name": "additionalInformation", "type": ["null", {"type": "map",
"values": "string"}], "doc": ""}]}
"""
    schema = avro_parse(_schemaSource)
    requiredFields = {
        "additionalInformation",
        "adoptedStatus",
        "affectionStatus",
        "ancestries",
        "consanguineousParents",
        "consentStatus",
        "disorderList",
        "fatherId",
        "gelSuperFamilyId",
        "hpoTermList",
        "inbreedingCoefficient",
        "isProband",
        "lifeStatus",
        "monozygotic",
        "motherId",
        "participantId",
        "participantQCState",
        "pedigreeId",
        "personKaryotypicSex",
        "samples",
        "sex",
        "superFatherId",
        "superMotherId",
        "twinGroup",
        "yearOfBirth",
    }

    @classmethod
    def isEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'ancestries': Ancestries,
            'consentStatus': ConsentStatus,
            'disorderList': Disorder,
            'hpoTermList': HpoTerm,
            'inbreedingCoefficient': InbreedingCoefficient,
            'samples': Sample,
        }
        return fieldName in embeddedTypes

    @classmethod
    def getEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'ancestries': Ancestries,
            'consentStatus': ConsentStatus,
            'disorderList': Disorder,
            'hpoTermList': HpoTerm,
            'inbreedingCoefficient': InbreedingCoefficient,
            'samples': Sample,
        }

        return embeddedTypes[fieldName]

    __slots__ = [
        'additionalInformation', 'adoptedStatus', 'affectionStatus',
        'ancestries', 'consanguineousParents', 'consentStatus',
        'disorderList', 'fatherId', 'gelSuperFamilyId', 'hpoTermList',
        'inbreedingCoefficient', 'isProband', 'lifeStatus',
        'monozygotic', 'motherId', 'participantId',
        'participantQCState', 'pedigreeId', 'personKaryotypicSex',
        'samples', 'sex', 'superFatherId', 'superMotherId',
        'twinGroup', 'yearOfBirth'
    ]

    def __init__(self, **kwargs):
        self.additionalInformation = kwargs.get(
            'additionalInformation', None)
        self.adoptedStatus = kwargs.get(
            'adoptedStatus', None)
        self.affectionStatus = kwargs.get(
            'affectionStatus', None)
        self.ancestries = kwargs.get(
            'ancestries', None)
        self.consanguineousParents = kwargs.get(
            'consanguineousParents', None)
        self.consentStatus = kwargs.get(
            'consentStatus', None)
        self.disorderList = kwargs.get(
            'disorderList', None)
        self.fatherId = kwargs.get(
            'fatherId', None)
        self.gelSuperFamilyId = kwargs.get(
            'gelSuperFamilyId', None)
        self.hpoTermList = kwargs.get(
            'hpoTermList', None)
        self.inbreedingCoefficient = kwargs.get(
            'inbreedingCoefficient', None)
        self.isProband = kwargs.get(
            'isProband', None)
        self.lifeStatus = kwargs.get(
            'lifeStatus', None)
        self.monozygotic = kwargs.get(
            'monozygotic', None)
        self.motherId = kwargs.get(
            'motherId', None)
        self.participantId = kwargs.get(
            'participantId', None)
        self.participantQCState = kwargs.get(
            'participantQCState', None)
        self.pedigreeId = kwargs.get(
            'pedigreeId', None)
        self.personKaryotypicSex = kwargs.get(
            'personKaryotypicSex', None)
        self.samples = kwargs.get(
            'samples', None)
        self.sex = kwargs.get(
            'sex', None)
        self.superFatherId = kwargs.get(
            'superFatherId', None)
        self.superMotherId = kwargs.get(
            'superMotherId', None)
        self.twinGroup = kwargs.get(
            'twinGroup', None)
        self.yearOfBirth = kwargs.get(
            'yearOfBirth', None)


class Penetrance(object):
    """
    Penetrance assumed in the analysis
    """
    complete = "complete"
    incomplete = "incomplete"

    def __hash__(self):
        return str(self).__hash__()


class PersonKaryotipicSex(object):
    """
    Karyotipic Sex
    """
    UNKNOWN = "UNKNOWN"
    XX = "XX"
    XY = "XY"
    XO = "XO"
    XXY = "XXY"
    XXX = "XXX"
    XXYY = "XXYY"
    XXXY = "XXXY"
    XXXX = "XXXX"
    XYY = "XYY"
    OTHER = "OTHER"

    def __hash__(self):
        return str(self).__hash__()


class PhaseGenotype(ProtocolElement):
    """
    No documentation
    """
    _schemaSource = """
{"type": "record", "name": "PhaseGenotype", "namespace": "org.gel.models.report.avro", "fields":
[{"name": "sortedAlleles", "type": {"type": "array", "items": "string"}}, {"name": "phaseSet",
"type": "int"}]}
"""
    schema = avro_parse(_schemaSource)
    requiredFields = {
        "phaseSet",
        "sortedAlleles",
    }

    @classmethod
    def isEmbeddedType(cls, fieldName):
        embeddedTypes = {}
        return fieldName in embeddedTypes

    @classmethod
    def getEmbeddedType(cls, fieldName):
        embeddedTypes = {}

        return embeddedTypes[fieldName]

    __slots__ = [
        'phaseSet', 'sortedAlleles'
    ]

    def __init__(self, **kwargs):
        self.phaseSet = kwargs.get(
            'phaseSet', None)
        self.sortedAlleles = kwargs.get(
            'sortedAlleles', None)


class Phenotypes(ProtocolElement):
    """
    Oontology term based on the OBO format (see an example here
    http://snapshot.geneontology.org/ontology/go-basic.obo)
    """
    _schemaSource = """
{"type": "record", "name": "Phenotypes", "namespace": "org.gel.models.report.avro", "doc": "",
"fields": [{"name": "nonStandardPhenotype", "type": ["null", {"type": "array", "items": "string"}],
"doc": ""}, {"name": "standardPhenotypes", "type": ["null", {"type": "array", "items": {"type":
"record", "name": "StandardPhenotype", "doc": "", "fields": [{"name": "id", "type": "string"},
{"name": "name", "type": ["null", "string"]}, {"name": "namespace", "type": ["null", "string"]},
{"name": "definition", "type": ["null", "string"]}, {"name": "comment", "type": ["null", "string"]},
{"name": "alternativeIds", "type": ["null", "string"]}, {"name": "synonyms", "type": ["null",
"string"]}, {"name": "isA", "type": ["null", "string"]}, {"name": "ontology", "type": {"type":
"record", "name": "Ontology", "doc": "", "fields": [{"name": "name", "type": "string"}, {"name":
"version", "type": "string"}]}, "doc": ""}, {"name": "matchScore", "type": ["null", "float"], "doc":
""}]}}], "doc": ""}]}
"""
    schema = avro_parse(_schemaSource)
    requiredFields = {
        "nonStandardPhenotype",
        "standardPhenotypes",
    }

    @classmethod
    def isEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'standardPhenotypes': StandardPhenotype,
        }
        return fieldName in embeddedTypes

    @classmethod
    def getEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'standardPhenotypes': StandardPhenotype,
        }

        return embeddedTypes[fieldName]

    __slots__ = [
        'nonStandardPhenotype', 'standardPhenotypes'
    ]

    def __init__(self, **kwargs):
        self.nonStandardPhenotype = kwargs.get(
            'nonStandardPhenotype', None)
        self.standardPhenotypes = kwargs.get(
            'standardPhenotypes', None)


class PhenotypesSolved(object):
    """
    No documentation
    """
    yes = "yes"
    no = "no"
    partially = "partially"
    unknown = "unknown"

    def __hash__(self):
        return str(self).__hash__()


class PreparationMethod(object):
    """
    No documentation
    """
    EDTA = "EDTA"
    ORAGENE = "ORAGENE"
    FF = "FF"
    FFPE = "FFPE"
    CD128_SORTED_CELLS = "CD128_SORTED_CELLS"
    ASPIRATE = "ASPIRATE"

    def __hash__(self):
        return str(self).__hash__()


class PrimaryPurpose(object):
    """
    Treatment: One or more interventions are being evaluated for
    treating a disease, syndrome, or condition.     Prevention: One or
    more interventions are being assessed for preventing the
    development of a specific disease or health condition.
    Diagnostic: One or more interventions are being evaluated for
    identifying a disease or health condition.     Supportive Care:
    One or more interventions are evaluated for maximizing comfort,
    minimizing side effects, or mitigating against a decline in the
    participant's health or function.     Screening: One or more
    interventions are assessed or examined for identifying a
    condition, or risk factors for a condition, in people who are not
    yet known to have the condition or risk factor.     Health
    Services Research: One or more interventions for evaluating the
    delivery, processes, management, organization, or financing of
    healthcare.     Basic Science: One or more interventions for
    examining the basic mechanism of action (for example, physiology
    or biomechanics of an intervention).     Device Feasibility: An
    intervention of a device product is being evaluated in a small
    clinical trial (generally fewer than 10 participants) to determine
    the feasibility of the product; or a clinical trial to test a
    prototype device for feasibility and not health outcomes. Such
    studies are conducted to confirm the design and operating
    specifications of a device before beginning a full clinical trial.
    Other: None of the other options applies.      Ref.
    https://prsinfo.clinicaltrials.gov/definitions.htm
    """
    treatment = "treatment"
    prevention = "prevention"
    diagnostic = "diagnostic"
    supportive_care = "supportive_care"
    screening = "screening"
    health_services_research = "health_services_research"
    basic_science = "basic_science"
    device_feasibility = "device_feasibility"
    other = "other"

    def __hash__(self):
        return str(self).__hash__()


class Product(object):
    """
    No documentation
    """
    DNA = "DNA"
    RNA = "RNA"

    def __hash__(self):
        return str(self).__hash__()


class Prognosis(ProtocolElement):
    """
    No documentation
    """
    _schemaSource = """
{"type": "record", "name": "Prognosis", "namespace": "org.gel.models.report.avro", "fields":
[{"name": "referenceUrl", "type": "string", "doc": ""}, {"name": "prognosis", "type": ["null",
{"type": "enum", "name": "PrognosisClassification", "symbols": ["altered_prognosis",
"favourable_prognosis", "unfavourable_prognosis"]}], "doc": ""}, {"name": "source", "type": ["null",
"string"], "doc": ""}, {"name": "references", "type": ["null", {"type": "array", "items":
"string"}], "doc": ""}, {"name": "conditions", "type": ["null", {"type": "array", "items":
"string"}], "doc": ""}, {"name": "description", "type": ["null", "string"], "doc": ""}, {"name":
"variantActionable", "type": "boolean", "doc": ""}]}
"""
    schema = avro_parse(_schemaSource)
    requiredFields = {
        "conditions",
        "description",
        "prognosis",
        "referenceUrl",
        "references",
        "source",
        "variantActionable",
    }

    @classmethod
    def isEmbeddedType(cls, fieldName):
        embeddedTypes = {}
        return fieldName in embeddedTypes

    @classmethod
    def getEmbeddedType(cls, fieldName):
        embeddedTypes = {}

        return embeddedTypes[fieldName]

    __slots__ = [
        'conditions', 'description', 'prognosis', 'referenceUrl',
        'references', 'source', 'variantActionable'
    ]

    def __init__(self, **kwargs):
        self.conditions = kwargs.get(
            'conditions', None)
        self.description = kwargs.get(
            'description', None)
        self.prognosis = kwargs.get(
            'prognosis', None)
        self.referenceUrl = kwargs.get(
            'referenceUrl', None)
        self.references = kwargs.get(
            'references', None)
        self.source = kwargs.get(
            'source', None)
        self.variantActionable = kwargs.get(
            'variantActionable', None)


class PrognosisClassification(object):
    """
    No documentation
    """
    altered_prognosis = "altered_prognosis"
    favourable_prognosis = "favourable_prognosis"
    unfavourable_prognosis = "unfavourable_prognosis"

    def __hash__(self):
        return str(self).__hash__()


class Program(object):
    """
    The Genomics England program
    """
    cancer = "cancer"
    rare_disease = "rare_disease"

    def __hash__(self):
        return str(self).__hash__()


class ProgrammePhase(object):
    """
    No documentation
    """
    CRUK = "CRUK"
    OXFORD = "OXFORD"
    CLL = "CLL"
    IIP = "IIP"
    MAIN = "MAIN"
    EXPT = "EXPT"

    def __hash__(self):
        return str(self).__hash__()


class Progression(object):
    """
    No documentation
    """
    PROGRESSIVE = "PROGRESSIVE"
    NONPROGRESSIVE = "NONPROGRESSIVE"

    def __hash__(self):
        return str(self).__hash__()


class RDFamilyChange(ProtocolElement):
    """
    No documentation
    """
    _schemaSource = """
{"type": "record", "name": "RDFamilyChange", "namespace": "org.gel.models.participant.avro",
"fields": [{"name": "FamilyId", "type": "string", "doc": ""}, {"name": "code", "type": {"type":
"enum", "name": "RDFamilyChangeCode", "doc": "", "symbols": ["FamilyAdded", "FamilyDeleted",
"ProbandChanged", "ParticipantAdded", "ParticipantRemoved", "ConsentStatusChanged",
"AffectionStatusChanged", "PanelAssignmentChanged", "SexChanged", "SampleChanged"]}, "doc": ""},
{"name": "Family", "type": {"type": "record", "name": "Pedigree", "doc": "", "fields": [{"name":
"versionControl", "type": ["null", {"type": "record", "name": "VersionControl", "fields": [{"name":
"GitVersionControl", "type": "string", "doc": "", "default": "1.1.3"}]}], "doc": ""}, {"name":
"LDPCode", "type": ["null", "string"], "doc": ""}, {"name": "familyId", "type": "string", "doc":
""}, {"name": "members", "type": {"type": "array", "items": {"type": "record", "name":
"PedigreeMember", "doc": "", "fields": [{"name": "pedigreeId", "type": ["null", "int"], "doc": ""},
{"name": "isProband", "type": ["null", "boolean"], "doc": ""}, {"name": "participantId", "type":
["null", "string"], "doc": ""}, {"name": "participantQCState", "type": ["null", {"type": "enum",
"name": "ParticipantQCState", "doc": "", "symbols": ["noState",
"passedMedicalReviewReadyForInterpretation", "passedMedicalReviewNotReadyForInterpretation",
"queryToGel", "queryToGMC", "failed"]}], "doc": ""}, {"name": "gelSuperFamilyId", "type": ["null",
"string"], "doc": ""}, {"name": "sex", "type": {"type": "enum", "name": "Sex", "doc": "", "symbols":
["MALE", "FEMALE", "UNKNOWN"]}, "doc": ""}, {"name": "personKaryotypicSex", "type": ["null",
{"type": "enum", "name": "PersonKaryotipicSex", "doc": "", "symbols": ["UNKNOWN", "XX", "XY", "XO",
"XXY", "XXX", "XXYY", "XXXY", "XXXX", "XYY", "OTHER"]}], "doc": ""}, {"name": "yearOfBirth", "type":
["null", "int"], "doc": ""}, {"name": "fatherId", "type": ["null", "int"], "doc": ""}, {"name":
"motherId", "type": ["null", "int"], "doc": ""}, {"name": "superFatherId", "type": ["null", "int"],
"doc": ""}, {"name": "superMotherId", "type": ["null", "int"], "doc": ""}, {"name": "twinGroup",
"type": ["null", "int"], "doc": ""}, {"name": "monozygotic", "type": ["null", {"type": "enum",
"name": "TernaryOption", "doc": "", "symbols": ["yes", "no", "unknown"]}], "doc": ""}, {"name":
"adoptedStatus", "type": ["null", {"type": "enum", "name": "AdoptedStatus", "doc": "", "symbols":
["notadopted", "adoptedin", "adoptedout"]}], "doc": ""}, {"name": "lifeStatus", "type": ["null",
{"type": "enum", "name": "LifeStatus", "doc": "", "symbols": ["ALIVE", "ABORTED", "DECEASED",
"UNBORN", "STILLBORN", "MISCARRIAGE"]}], "doc": ""}, {"name": "consanguineousParents", "type":
["null", "TernaryOption"], "doc": ""}, {"name": "affectionStatus", "type": ["null", {"type": "enum",
"name": "AffectionStatus", "doc": "", "symbols": ["UNAFFECTED", "AFFECTED", "UNCERTAIN"]}], "doc":
""}, {"name": "disorderList", "type": ["null", {"type": "array", "items": {"type": "record", "name":
"Disorder", "doc": "", "fields": [{"name": "diseaseGroup", "type": ["null", "string"], "doc": ""},
{"name": "diseaseSubGroup", "type": ["null", "string"], "doc": ""}, {"name": "specificDisease",
"type": ["null", "string"], "doc": ""}, {"name": "ageOfOnset", "type": ["null", "float"], "doc":
""}]}}], "doc": ""}, {"name": "hpoTermList", "type": ["null", {"type": "array", "items": {"type":
"record", "name": "HpoTerm", "doc": "", "fields": [{"name": "term", "type": "string", "doc": ""},
{"name": "termPresence", "type": ["null", "TernaryOption"], "doc": ""}, {"name": "hpoBuildNumber",
"type": ["null", "string"], "doc": ""}, {"name": "modifiers", "type": ["null", {"type": "record",
"name": "HpoTermModifiers", "fields": [{"name": "laterality", "type": ["null", {"type": "enum",
"name": "Laterality", "symbols": ["RIGHT", "UNILATERAL", "BILATERAL", "LEFT"]}]}, {"name":
"progression", "type": ["null", {"type": "enum", "name": "Progression", "symbols": ["PROGRESSIVE",
"NONPROGRESSIVE"]}]}, {"name": "severity", "type": ["null", {"type": "enum", "name": "Severity",
"symbols": ["BORDERLINE", "MILD", "MODERATE", "SEVERE", "PROFOUND"]}]}, {"name": "spatialPattern",
"type": ["null", {"type": "enum", "name": "SpatialPattern", "symbols": ["DISTAL", "GENERALIZED",
"LOCALIZED", "PROXIMAL"]}]}]}], "doc": ""}, {"name": "ageOfOnset", "type": ["null", {"type": "enum",
"name": "AgeOfOnset", "symbols": ["EMBRYONAL_ONSET", "FETAL_ONSET", "NEONATAL_ONSET",
"INFANTILE_ONSET", "CHILDHOOD_ONSET", "JUVENILE_ONSET", "YOUNG_ADULT_ONSET", "LATE_ONSET",
"MIDDLE_AGE_ONSET"]}], "doc": ""}]}}], "doc": ""}, {"name": "ancestries", "type": ["null", {"type":
"record", "name": "Ancestries", "doc": "", "fields": [{"name": "mothersEthnicOrigin", "type":
["null", {"type": "enum", "name": "EthnicCategory", "doc": "", "symbols": ["D", "E", "F", "G", "A",
"B", "C", "L", "M", "N", "H", "J", "K", "P", "S", "R", "Z"]}], "doc": ""}, {"name":
"mothersOtherRelevantAncestry", "type": ["null", "string"], "doc": ""}, {"name":
"fathersEthnicOrigin", "type": ["null", "EthnicCategory"], "doc": ""}, {"name":
"fathersOtherRelevantAncestry", "type": ["null", "string"], "doc": ""}, {"name":
"chiSquare1KGenomesPhase3Pop", "type": ["null", {"type": "array", "items": {"type": "record",
"name": "ChiSquare1KGenomesPhase3Pop", "doc": "", "fields": [{"name": "kgSuperPopCategory", "type":
{"type": "enum", "name": "KgSuperPopCategory", "doc": "", "symbols": ["AFR", "AMR", "EAS", "EUR",
"SAS"]}, "doc": ""}, {"name": "kgPopCategory", "type": ["null", {"type": "enum", "name":
"KgPopCategory", "doc": "", "symbols": ["ACB", "ASW", "BEB", "CDX", "CEU", "CHB", "CHS", "CLM",
"ESN", "FIN", "GBR", "GIH", "GWD", "IBS", "ITU", "JPT", "KHV", "LWK", "MSL", "MXL", "PEL", "PJL",
"PUR", "STU", "TSI", "YRI"]}], "doc": ""}, {"name": "chiSquare", "type": "double", "doc": ""}]}}],
"doc": ""}]}], "doc": ""}, {"name": "consentStatus", "type": ["null", {"type": "record", "name":
"ConsentStatus", "doc": "", "fields": [{"name": "programmeConsent", "type": "boolean", "doc": "",
"default": false}, {"name": "primaryFindingConsent", "type": "boolean", "doc": "", "default":
false}, {"name": "secondaryFindingConsent", "type": "boolean", "doc": "", "default": false},
{"name": "carrierStatusConsent", "type": "boolean", "doc": "", "default": false}]}], "doc": ""},
{"name": "samples", "type": ["null", {"type": "array", "items": {"type": "record", "name": "Sample",
"fields": [{"name": "sampleId", "type": "string", "doc": ""}, {"name": "labSampleId", "type":
"string", "doc": ""}, {"name": "source", "type": ["null", {"type": "enum", "name": "SampleSource",
"doc": "", "symbols": ["TUMOUR", "BONE_MARROW_ASPIRATE_TUMOUR_SORTED_CELLS",
"BONE_MARROW_ASPIRATE_TUMOUR_CELLS", "BLOOD", "SALIVA", "FIBROBLAST", "TISSUE"]}], "doc": ""},
{"name": "product", "type": ["null", {"type": "enum", "name": "Product", "symbols": ["DNA",
"RNA"]}], "doc": ""}, {"name": "preparationMethod", "type": ["null", {"type": "enum", "name":
"PreparationMethod", "symbols": ["EDTA", "ORAGENE", "FF", "FFPE", "CD128_SORTED_CELLS",
"ASPIRATE"]}], "doc": ""}]}}], "doc": ""}, {"name": "inbreedingCoefficient", "type": ["null",
{"type": "record", "name": "InbreedingCoefficient", "doc": "", "fields": [{"name": "sampleId",
"type": "string", "doc": ""}, {"name": "program", "type": "string", "doc": ""}, {"name": "version",
"type": "string", "doc": ""}, {"name": "estimationMethod", "type": "string", "doc": ""}, {"name":
"coefficient", "type": "double", "doc": ""}, {"name": "standardError", "type": ["null", "double"],
"doc": ""}]}], "doc": ""}, {"name": "additionalInformation", "type": ["null", {"type": "map",
"values": "string"}], "doc": ""}]}}, "doc": ""}, {"name": "analysisPanels", "type": ["null",
{"type": "array", "items": {"type": "record", "name": "AnalysisPanel", "doc": "", "fields":
[{"name": "specificDisease", "type": "string", "doc": ""}, {"name": "panelName", "type": "string",
"doc": ""}, {"name": "panelVersion", "type": ["null", "string"], "doc": ""}, {"name":
"reviewOutcome", "type": "string", "doc": ""}, {"name": "multipleGeneticOrigins", "type": "string",
"doc": ""}]}}], "doc": ""}, {"name": "diseasePenetrances", "type": ["null", {"type": "array",
"items": {"type": "record", "name": "DiseasePenetrance", "doc": "", "fields": [{"name":
"specificDisease", "type": "string", "doc": ""}, {"name": "penetrance", "type": {"type": "enum",
"name": "Penetrance", "doc": "", "symbols": ["complete", "incomplete"]}, "doc": ""}]}}], "doc": ""},
{"name": "readyForAnalysis", "type": "boolean", "doc": ""}, {"name": "familyQCState", "type":
["null", {"type": "enum", "name": "FamilyQCState", "doc": "", "symbols": ["noState",
"passedMedicalReviewReadyForInterpretation", "passedMedicalReviewNotReadyForInterpretation",
"queryToGel", "queryToGMC", "failed"]}], "doc": ""}]}, "doc": ""}]}
"""
    schema = avro_parse(_schemaSource)
    requiredFields = {
        "Family",
        "FamilyId",
        "code",
    }

    @classmethod
    def isEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'Family': Pedigree,
        }
        return fieldName in embeddedTypes

    @classmethod
    def getEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'Family': Pedigree,
        }

        return embeddedTypes[fieldName]

    __slots__ = [
        'Family', 'FamilyId', 'code'
    ]

    def __init__(self, **kwargs):
        self.Family = kwargs.get(
            'Family', Pedigree())
        self.FamilyId = kwargs.get(
            'FamilyId', None)
        self.code = kwargs.get(
            'code', None)


class RDFamilyChangeCode(object):
    """
    This code define the change type:      * `FamilyAdded`: This is a
    new family.     * `FamilyDeleted`: This family should be removed.
    * `ProbandChanged`: The proband participant is now a different
    member of the family.     * `ParticipantAdded`: A new participant
    has been sequenced and added to the family.     *
    `ParticipantRemoved`: A participant has been removed.     *
    `ConsentStatusChanged`: One or more participant in this family has
    a different consent status.     * `AffectionStatusChanged`:
    HPOterms or Disorder changed in one or more participants in this
    family.     * `PanelAssignmentChanged`: Gene Panels has changed in
    this family.     * `SexChanged`: Sex has changed for one or more
    participants in this family.     * `SampleChanged`: The sample/s
    associated to one or more participant in this family has changed.
    """
    FamilyAdded = "FamilyAdded"
    FamilyDeleted = "FamilyDeleted"
    ProbandChanged = "ProbandChanged"
    ParticipantAdded = "ParticipantAdded"
    ParticipantRemoved = "ParticipantRemoved"
    ConsentStatusChanged = "ConsentStatusChanged"
    AffectionStatusChanged = "AffectionStatusChanged"
    PanelAssignmentChanged = "PanelAssignmentChanged"
    SexChanged = "SexChanged"
    SampleChanged = "SampleChanged"

    def __hash__(self):
        return str(self).__hash__()


class RareDiseaseExitQuestionnaire(ProtocolElement):
    """
    The rare disease program exit questionnaire
    """
    _schemaSource = """
{"type": "record", "name": "RareDiseaseExitQuestionnaire", "namespace":
"org.gel.models.report.avro", "doc": "", "fields": [{"name": "eventDate", "type": "string", "doc":
""}, {"name": "reporter", "type": "string", "doc": ""}, {"name": "familyLevelQuestions", "type":
{"type": "record", "name": "FamilyLevelQuestions", "doc": "", "fields": [{"name":
"caseSolvedFamily", "type": {"type": "enum", "name": "CaseSolvedFamily", "symbols": ["yes", "no",
"partially", "unknown"]}, "doc": ""}, {"name": "segregationQuestion", "type": {"type": "enum",
"name": "SegregationQuestion", "symbols": ["yes", "no"]}, "doc": ""}, {"name": "additionalComments",
"type": "string", "doc": ""}]}, "doc": ""}, {"name": "variantGroupLevelQuestions", "type": {"type":
"array", "items": {"type": "record", "name": "VariantGroupLevelQuestions", "doc": "", "fields":
[{"name": "variantGroup", "type": "int", "doc": ""}, {"name": "variantLevelQuestions", "type":
["null", {"type": "array", "items": {"type": "record", "name": "VariantLevelQuestions", "doc": "",
"fields": [{"name": "variantCoordinates", "type": {"type": "record", "name": "VariantCoordinates",
"doc": "", "fields": [{"name": "chromosome", "type": "string", "doc": ""}, {"name": "position",
"type": "int", "doc": ""}, {"name": "reference", "type": "string", "doc": ""}, {"name": "alternate",
"type": "string", "doc": ""}, {"name": "assembly", "type": {"type": "enum", "name": "Assembly",
"doc": "", "symbols": ["GRCh38", "GRCh37"]}, "doc": ""}]}, "doc": ""}, {"name":
"confirmationDecision", "type": {"type": "enum", "name": "ConfirmationDecision", "symbols": ["yes",
"no", "na"]}, "doc": ""}, {"name": "confirmationOutcome", "type": {"type": "enum", "name":
"ConfirmationOutcome", "symbols": ["yes", "no", "na"]}, "doc": ""}, {"name": "reportingQuestion",
"type": {"type": "enum", "name": "ReportingQuestion", "symbols": ["yes", "no", "na"]}, "doc": ""},
{"name": "acmgClassification", "type": {"type": "enum", "name": "ACMGClassification", "symbols":
["pathogenic_variant", "likely_pathogenic_variant", "variant_of_unknown_clinical_significance",
"likely_benign_variant", "benign_variant", "not_assessed", "na"]}, "doc": ""}, {"name":
"publications", "type": "string", "doc": ""}]}}], "doc": ""}, {"name":
"shortTandemRepeatLevelQuestions", "type": ["null", {"type": "array", "items": {"type": "record",
"name": "ShortTandemRepeatLevelQuestions", "doc": "", "fields": [{"name": "coordinates", "type":
{"type": "record", "name": "Coordinates", "fields": [{"name": "assembly", "type": "Assembly"},
{"name": "chromosome", "type": "string"}, {"name": "start", "type": "int"}, {"name": "end", "type":
"int"}, {"name": "ciStart", "type": ["null", {"type": "record", "name": "ConfidenceInterval",
"fields": [{"name": "left", "type": "int"}, {"name": "right", "type": "int"}]}]}, {"name": "ciEnd",
"type": ["null", "ConfidenceInterval"]}]}, "doc": ""}, {"name": "confirmationDecision", "type":
"ConfirmationDecision", "doc": ""}, {"name": "confirmationOutcome", "type": "ConfirmationOutcome",
"doc": ""}, {"name": "reportingQuestion", "type": "ReportingQuestion", "doc": ""}, {"name":
"acmgClassification", "type": "ACMGClassification", "doc": ""}, {"name": "publications", "type":
"string", "doc": ""}]}}], "doc": ""}, {"name": "structuralVariantLevelQuestions", "type": ["null",
{"type": "array", "items": {"type": "record", "name": "StructuralVariantLevelQuestions", "doc": "",
"fields": [{"name": "variantType", "type": {"type": "enum", "name": "StructuralVariantType",
"symbols": ["ins", "dup", "inv", "amplification", "deletion", "dup_tandem", "del_me", "ins_me"]},
"doc": ""}, {"name": "coordinates", "type": "Coordinates", "doc": ""}, {"name":
"confirmationDecision", "type": "ConfirmationDecision", "doc": ""}, {"name": "confirmationOutcome",
"type": "ConfirmationOutcome", "doc": ""}, {"name": "reportingQuestion", "type":
"ReportingQuestion", "doc": ""}, {"name": "acmgClassification", "type": "ACMGClassification", "doc":
""}, {"name": "publications", "type": "string", "doc": ""}]}}], "doc": ""}, {"name":
"actionability", "type": {"type": "enum", "name": "Actionability", "symbols": ["yes", "no",
"not_yet", "na"]}, "doc": ""}, {"name": "clinicalUtility", "type": {"type": "array", "items":
{"type": "enum", "name": "ClinicalUtility", "symbols": ["none", "change_in_medication",
"surgical_option", "additional_surveillance_for_proband_or_relatives", "clinical_trial_eligibility",
"informs_reproductive_choice", "unknown", "other"]}}, "doc": ""}, {"name": "phenotypesSolved",
"type": {"type": "enum", "name": "PhenotypesSolved", "symbols": ["yes", "no", "partially",
"unknown"]}, "doc": ""}, {"name": "phenotypesExplained", "type": ["null", {"type": "array", "items":
"string"}], "doc": ""}]}}, "doc": ""}]}
"""
    schema = avro_parse(_schemaSource)
    requiredFields = {
        "eventDate",
        "familyLevelQuestions",
        "reporter",
        "variantGroupLevelQuestions",
    }

    @classmethod
    def isEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'familyLevelQuestions': FamilyLevelQuestions,
            'variantGroupLevelQuestions': VariantGroupLevelQuestions,
        }
        return fieldName in embeddedTypes

    @classmethod
    def getEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'familyLevelQuestions': FamilyLevelQuestions,
            'variantGroupLevelQuestions': VariantGroupLevelQuestions,
        }

        return embeddedTypes[fieldName]

    __slots__ = [
        'eventDate', 'familyLevelQuestions', 'reporter',
        'variantGroupLevelQuestions'
    ]

    def __init__(self, **kwargs):
        self.eventDate = kwargs.get(
            'eventDate', None)
        self.familyLevelQuestions = kwargs.get(
            'familyLevelQuestions', FamilyLevelQuestions())
        self.reporter = kwargs.get(
            'reporter', None)
        self.variantGroupLevelQuestions = kwargs.get(
            'variantGroupLevelQuestions', None)


class Rearrangement(ProtocolElement):
    """
    No documentation
    """
    _schemaSource = """
{"type": "record", "name": "Rearrangement", "namespace": "org.gel.models.report.avro", "fields":
[{"name": "leftCoordinates", "type": {"type": "record", "name": "Coordinates", "fields": [{"name":
"assembly", "type": {"type": "enum", "name": "Assembly", "doc": "", "symbols": ["GRCh38",
"GRCh37"]}}, {"name": "chromosome", "type": "string"}, {"name": "start", "type": "int"}, {"name":
"end", "type": "int"}, {"name": "ciStart", "type": ["null", {"type": "record", "name":
"ConfidenceInterval", "fields": [{"name": "left", "type": "int"}, {"name": "right", "type":
"int"}]}]}, {"name": "ciEnd", "type": ["null", "ConfidenceInterval"]}]}}, {"name":
"rightCoordinates", "type": "Coordinates"}, {"name": "orientation", "type": {"type": "enum", "name":
"Orientation", "symbols": ["start_start", "start_end", "end_end"]}}, {"name": "leftInsSeq", "type":
["null", "string"]}, {"name": "rightInsSeq", "type": ["null", "string"]}]}
"""
    schema = avro_parse(_schemaSource)
    requiredFields = {
        "leftCoordinates",
        "leftInsSeq",
        "orientation",
        "rightCoordinates",
        "rightInsSeq",
    }

    @classmethod
    def isEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'leftCoordinates': Coordinates,
            'rightCoordinates': Coordinates,
        }
        return fieldName in embeddedTypes

    @classmethod
    def getEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'leftCoordinates': Coordinates,
            'rightCoordinates': Coordinates,
        }

        return embeddedTypes[fieldName]

    __slots__ = [
        'leftCoordinates', 'leftInsSeq', 'orientation',
        'rightCoordinates', 'rightInsSeq'
    ]

    def __init__(self, **kwargs):
        self.leftCoordinates = kwargs.get(
            'leftCoordinates', Coordinates())
        self.leftInsSeq = kwargs.get(
            'leftInsSeq', None)
        self.orientation = kwargs.get(
            'orientation', None)
        self.rightCoordinates = kwargs.get(
            'rightCoordinates', Coordinates())
        self.rightInsSeq = kwargs.get(
            'rightInsSeq', None)


class ReportEvent(ProtocolElement):
    """
    A report event holds all the information about why a given variant
    is relevant to report. The same variant may have     several
    report events. For instance, we may have two report events from
    the tiering process when two panels are     analysed, a positive
    report from a Genomic Medicine Centre (GMC) will correspond to an
    additional report event.
    """
    _schemaSource = """
{"type": "record", "name": "ReportEvent", "namespace": "org.gel.models.report.avro", "doc": "",
"fields": [{"name": "reportEventId", "type": "string", "doc": ""}, {"name": "phenotypes", "type":
{"type": "record", "name": "Phenotypes", "doc": "", "fields": [{"name": "nonStandardPhenotype",
"type": ["null", {"type": "array", "items": "string"}], "doc": ""}, {"name": "standardPhenotypes",
"type": ["null", {"type": "array", "items": {"type": "record", "name": "StandardPhenotype", "doc":
"", "fields": [{"name": "id", "type": "string"}, {"name": "name", "type": ["null", "string"]},
{"name": "namespace", "type": ["null", "string"]}, {"name": "definition", "type": ["null",
"string"]}, {"name": "comment", "type": ["null", "string"]}, {"name": "alternativeIds", "type":
["null", "string"]}, {"name": "synonyms", "type": ["null", "string"]}, {"name": "isA", "type":
["null", "string"]}, {"name": "ontology", "type": {"type": "record", "name": "Ontology", "doc": "",
"fields": [{"name": "name", "type": "string"}, {"name": "version", "type": "string"}]}, "doc": ""},
{"name": "matchScore", "type": ["null", "float"], "doc": ""}]}}], "doc": ""}]}, "doc": ""}, {"name":
"variantConsequences", "type": {"type": "array", "items": {"type": "record", "name":
"VariantConsequence", "doc": "", "fields": [{"name": "id", "type": "string", "doc": ""}, {"name":
"name", "type": ["null", "string"], "doc": ""}]}}, "doc": ""}, {"name": "genePanel", "type":
["null", {"type": "record", "name": "GenePanel", "doc": "", "fields": [{"name": "panelIdentifier",
"type": ["null", "string"], "doc": ""}, {"name": "panelName", "type": ["null", "string"], "doc":
""}, {"name": "panelVersion", "type": ["null", "string"], "doc": ""}, {"name": "source", "type":
["null", "string"], "doc": ""}]}], "doc": ""}, {"name": "modeOfInheritance", "type": {"type":
"enum", "name": "ModeOfInheritance", "doc": "", "symbols": ["monoallelic",
"monoallelic_not_imprinted", "monoallelic_maternally_imprinted", "monoallelic_paternally_imprinted",
"biallelic", "monoallelic_and_biallelic", "monoallelic_and_more_severe_biallelic",
"xlinked_biallelic", "xlinked_monoallelic", "mitochondrial", "unknown", "na"]}, "doc": ""}, {"name":
"genomicEntities", "type": {"type": "array", "items": {"type": "record", "name": "GenomicEntity",
"doc": "", "fields": [{"name": "type", "type": {"type": "enum", "name": "GenomicEntityType", "doc":
"", "symbols": ["regulatory_region", "gene", "transcript", "intergenic", "gene_fusion",
"genomic_region", "cytobands"]}, "doc": ""}, {"name": "ensemblId", "type": ["null", "string"],
"doc": ""}, {"name": "geneSymbol", "type": ["null", "string"], "doc": ""}, {"name": "otherIds",
"type": ["null", {"type": "array", "items": {"type": "record", "name": "Identifier", "fields":
[{"name": "source", "type": "string", "doc": ""}, {"name": "identifier", "type": "string", "doc":
""}]}}], "doc": ""}]}}, "doc": ""}, {"name": "segregationPattern", "type": ["null", {"type": "enum",
"name": "SegregationPattern", "symbols": ["UniparentalIsodisomy", "SimpleRecessive",
"CompoundHeterozygous", "deNovo", "InheritedAutosomalDominant",
"InheritedAutosomalDominantMaternallyImprinted", "InheritedAutosomalDominantPaternallyImprinted",
"XLinkedCompoundHeterozygous", "XLinkedSimpleRecessive", "XLinkedMonoallelic",
"MitochondrialGenome"]}], "doc": ""}, {"name": "penetrance", "type": ["null", {"type": "enum",
"name": "Penetrance", "namespace": "org.gel.models.participant.avro", "doc": "", "symbols":
["complete", "incomplete"]}], "doc": ""}, {"name": "deNovoQualityScore", "type": ["null", "float"],
"doc": ""}, {"name": "fullyExplainsPhenotype", "type": ["null", "boolean"], "doc": ""}, {"name":
"groupOfVariants", "type": ["null", "int"], "doc": ""}, {"name": "eventJustification", "type":
["null", "string"], "doc": ""}, {"name": "roleInCancer", "type": ["null", {"type": "array", "items":
{"type": "enum", "name": "RoleInCancer", "doc": "", "symbols": ["oncogene", "tumor_suppressor_gene",
"both"]}}], "doc": ""}, {"name": "actions", "type": ["null", {"type": "record", "name": "Actions",
"doc": "", "fields": [{"name": "trials", "type": ["null", {"type": "array", "items": {"type":
"record", "name": "Trial", "fields": [{"name": "studyUrl", "type": "string", "doc": ""}, {"name":
"studyIdentifier", "type": "string", "doc": ""}, {"name": "startDate", "type": ["null", "string"],
"doc": ""}, {"name": "estimateCompletionDate", "type": ["null", "string"], "doc": ""}, {"name":
"title", "type": ["null", "string"], "doc": ""}, {"name": "phase", "type": ["null", {"type": "enum",
"name": "StudyPhase", "doc": "", "symbols": ["na", "early_phase1", "phase1", "phase1_phase2",
"phase2", "phase2_phase3", "phase3", "phase4"]}], "doc": ""}, {"name": "interventions", "type":
["null", {"type": "array", "items": {"type": "record", "name": "Intervention", "doc": "", "fields":
[{"name": "interventionType", "type": {"type": "enum", "name": "InterventionType", "doc": "",
"symbols": ["drug", "device", "procedure", "biological", "radiation", "behavioral", "genetic",
"dietary_supplement", "combination_product", "diagnostic_test", "other"]}, "doc": ""}, {"name":
"interventionName", "type": "string", "doc": ""}]}}], "doc": ""}, {"name": "conditions", "type":
["null", {"type": "array", "items": "string"}], "doc": ""}, {"name": "primaryPurpose", "type":
["null", {"type": "enum", "name": "PrimaryPurpose", "doc": "", "symbols": ["treatment",
"prevention", "diagnostic", "supportive_care", "screening", "health_services_research",
"basic_science", "device_feasibility", "other"]}], "doc": ""}, {"name": "studyType", "type":
["null", {"type": "enum", "name": "StudyType", "doc": "", "symbols": ["interventional",
"observational", "patient_registry", "expanded_access"]}], "doc": ""}, {"name":
"demogrphicElegibilityCriteria", "type": ["null", {"type": "record", "name":
"DemographicElegibilityCriteria", "fields": [{"name": "sex", "type": {"type": "enum", "name": "Sex",
"namespace": "org.gel.models.participant.avro", "doc": "", "symbols": ["MALE", "FEMALE",
"UNKNOWN"]}}, {"name": "ageRange", "type": ["null", {"type": "record", "name": "AgeRange", "fields":
[{"name": "minimumAge", "type": "int"}, {"name": "maximumAge", "type": "int"}, {"name": "timeunit",
"type": {"type": "enum", "name": "TimeUnit", "symbols": ["years", "months", "weeks", "days",
"hours", "minutes", "na"]}}]}]}]}], "doc": ""}, {"name": "locations", "type": ["null", {"type":
"array", "items": {"type": "record", "name": "TrialLocation", "fields": [{"name": "name", "type":
["null", "string"]}, {"name": "city", "type": ["null", "string"]}, {"name": "country", "type":
["null", "string"]}, {"name": "zip", "type": ["null", "string"]}]}}], "doc": ""}, {"name":
"variantActionable", "type": "boolean", "doc": ""}]}}]}, {"name": "prognosis", "type": ["null",
{"type": "array", "items": {"type": "record", "name": "Prognosis", "fields": [{"name":
"referenceUrl", "type": "string", "doc": ""}, {"name": "prognosis", "type": ["null", {"type":
"enum", "name": "PrognosisClassification", "symbols": ["altered_prognosis", "favourable_prognosis",
"unfavourable_prognosis"]}], "doc": ""}, {"name": "source", "type": ["null", "string"], "doc": ""},
{"name": "references", "type": ["null", {"type": "array", "items": "string"}], "doc": ""}, {"name":
"conditions", "type": ["null", {"type": "array", "items": "string"}], "doc": ""}, {"name":
"description", "type": ["null", "string"], "doc": ""}, {"name": "variantActionable", "type":
"boolean", "doc": ""}]}}]}, {"name": "therapies", "type": ["null", {"type": "array", "items":
{"type": "record", "name": "Therapy", "fields": [{"name": "referenceUrl", "type": "string", "doc":
""}, {"name": "source", "type": ["null", "string"], "doc": ""}, {"name": "references", "type":
["null", {"type": "array", "items": "string"}], "doc": ""}, {"name": "conditions", "type": ["null",
{"type": "array", "items": "string"}], "doc": ""}, {"name": "drugResponse", "type": ["null",
{"type": "array", "items": {"type": "record", "name": "DrugResponse", "fields": [{"name":
"TreatmentAgent", "type": "string", "doc": ""}, {"name": "drugResponseClassification", "type":
{"type": "enum", "name": "DrugResponseClassification", "symbols": ["altered_sensitivity",
"reduced_sensitivity", "increased_sensitivity", "altered_resistance", "increased_resistance",
"reduced_resistance", "increased_risk_of_toxicity", "reduced_risk_of_toxicity", "altered_toxicity",
"adverse_drug_reaction", "indication", "contraindication", "dosing_alteration", "increased_dose",
"reduced_dose", "increased_monitoring", "increased_efficacy", "reduced_efficacy",
"altered_efficacy"]}, "doc": ""}]}}], "doc": ""}, {"name": "otherInterventions", "type": ["null",
{"type": "array", "items": "Intervention"}], "doc": ""}, {"name": "variantActionable", "type":
"boolean", "doc": ""}]}}]}]}], "doc": ""}, {"name": "score", "type": ["null", "float"], "doc": ""},
{"name": "vendorSpecificScores", "type": ["null", {"type": "map", "values": "float"}], "doc": ""},
{"name": "variantClassification", "type": ["null", {"type": "record", "name":
"VariantClassification", "doc": "", "fields": [{"name": "clinicalSignificance", "type": ["null",
{"type": "enum", "name": "ClinicalSignificance", "symbols": ["benign", "likely_benign",
"likely_pathogenic", "pathogenic", "uncertain_significance"]}], "doc": ""}, {"name":
"drugResponseClassification", "type": ["null", "DrugResponseClassification"], "doc": ""}, {"name":
"traitAssociation", "type": ["null", {"type": "enum", "name": "TraitAssociation", "symbols":
["established_risk_allele", "likely_risk_allele", "uncertain_risk_allele", "protective"]}], "doc":
""}, {"name": "tumorigenesisClassification", "type": ["null", {"type": "enum", "name":
"TumorigenesisClassification", "symbols": ["driver", "passenger", "modifier"]}], "doc": ""},
{"name": "functionalEffect", "type": ["null", {"type": "enum", "name": "VariantFunctionalEffect",
"symbols": ["dominant_negative_variant", "gain_of_function_variant", "lethal_variant",
"loss_of_function_variant", "loss_of_heterozygosity", "null_variant"]}], "doc": ""}]}], "doc": ""},
{"name": "guidelineBasedVariantClassification", "type": ["null", {"type": "record", "name":
"GuidelineBasedVariantClassification", "doc": "", "fields": [{"name": "acmgVariantClassification",
"type": ["null", {"type": "record", "name": "AcmgVariantClassification", "doc": "", "fields":
[{"name": "acmgEvidences", "type": {"type": "array", "items": {"type": "record", "name":
"AcmgEvidence", "doc": "", "fields": [{"name": "category", "type": {"type": "enum", "name":
"AcmgEvidenceCategory", "doc": "", "symbols": ["population_data",
"computational_and_predictive_data", "functional_data", "segregation_data", "de_novo_data",
"allelic_data", "other_database", "other_data"]}, "doc": ""}, {"name": "type", "type": {"type":
"enum", "name": "AcmgEvidenceType", "doc": "", "symbols": ["bening", "pathogenic"]}, "doc": ""},
{"name": "weight", "type": {"type": "enum", "name": "AcmgEvidenceWeight", "doc": "", "symbols":
["stand_alone", "supporting", "moderate", "strong", "very_strong"]}, "doc": ""}, {"name":
"modifier", "type": "int", "doc": ""}, {"name": "description", "type": ["null", "string"], "doc":
""}]}}}, {"name": "clinicalSignificance", "type": "ClinicalSignificance"}, {"name": "assessment",
"type": ["null", "string"]}]}]}, {"name": "ampVariantClassification", "type": ["null", {"type":
"record", "name": "AmpVariantClassification", "doc": "", "fields": [{"name": "ampEvidences", "type":
{"type": "array", "items": {"type": "record", "name": "AmpEvidence", "doc": "", "fields": [{"name":
"type", "type": {"type": "enum", "name": "AmpEvidenceType", "doc": "", "symbols": ["mutation_type",
"therapies", "variant_frequencies", "potential_germline", "population_database_presence",
"germline_database_presence", "somatic_database_presence", "impact_predictive_software",
"pathway_involvement", "publications"]}, "doc": ""}, {"name": "evidenceAssessment", "type":
"string", "doc": ""}]}}, "doc": ""}, {"name": "ampTier", "type": {"type": "enum", "name": "AmpTier",
"doc": "", "symbols": ["tierI", "tierII", "tierIII", "tierIV"]}, "doc": ""}, {"name":
"ampClincialOrExperimentalEvidence", "type": ["null", {"type": "array", "items": {"type": "record",
"name": "AmpClincialOrExperimentalEvidence", "doc": "", "fields": [{"name": "category", "type":
{"type": "enum", "name": "AmpClinicalOrExperimentalEvidenceCategory", "doc": "", "symbols":
["therapeutic", "diagnosis", "prognosis"]}, "doc": ""}, {"name": "level", "type": {"type": "enum",
"name": "AmpClinicalOrExperimentalEvidenceLevel", "doc": "", "symbols": ["levelA", "levelB",
"levelC", "levelD"]}, "doc": ""}, {"name": "description", "type": ["null", "string"], "doc":
""}]}}], "doc": ""}, {"name": "assessment", "type": ["null", "string"], "doc": ""}]}]}]}], "doc":
""}, {"name": "algorithmBasedVariantClassifications", "type": ["null", {"type": "array", "items":
{"type": "record", "name": "AlgorithmBasedVariantClassification", "fields": [{"name":
"algorithmName", "type": "string", "doc": ""}, {"name": "classification", "type": "string", "doc":
""}, {"name": "rank", "type": ["null", "int"], "doc": ""}, {"name": "score", "type": ["null",
"int"], "doc": ""}]}}], "doc": ""}, {"name": "tier", "type": ["null", {"type": "enum", "name":
"Tier", "doc": "", "symbols": ["NONE", "TIER1", "TIER2", "TIER3", "TIER4", "TIER5", "TIERA",
"TIERB"]}], "doc": ""}, {"name": "domain", "type": ["null", {"type": "enum", "name": "Domain",
"symbols": ["DOMAIN1", "DOMAIN2", "DOMAIN3", "DOMAIN4", "NONE"]}], "doc": ""}]}
"""
    schema = avro_parse(_schemaSource)
    requiredFields = {
        "actions",
        "algorithmBasedVariantClassifications",
        "deNovoQualityScore",
        "domain",
        "eventJustification",
        "fullyExplainsPhenotype",
        "genePanel",
        "genomicEntities",
        "groupOfVariants",
        "guidelineBasedVariantClassification",
        "modeOfInheritance",
        "penetrance",
        "phenotypes",
        "reportEventId",
        "roleInCancer",
        "score",
        "segregationPattern",
        "tier",
        "variantClassification",
        "variantConsequences",
        "vendorSpecificScores",
    }

    @classmethod
    def isEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'actions': Actions,
            'algorithmBasedVariantClassifications': AlgorithmBasedVariantClassification,
            'genePanel': GenePanel,
            'genomicEntities': GenomicEntity,
            'guidelineBasedVariantClassification': GuidelineBasedVariantClassification,
            'phenotypes': Phenotypes,
            'variantClassification': VariantClassification,
            'variantConsequences': VariantConsequence,
        }
        return fieldName in embeddedTypes

    @classmethod
    def getEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'actions': Actions,
            'algorithmBasedVariantClassifications': AlgorithmBasedVariantClassification,
            'genePanel': GenePanel,
            'genomicEntities': GenomicEntity,
            'guidelineBasedVariantClassification': GuidelineBasedVariantClassification,
            'phenotypes': Phenotypes,
            'variantClassification': VariantClassification,
            'variantConsequences': VariantConsequence,
        }

        return embeddedTypes[fieldName]

    __slots__ = [
        'actions', 'algorithmBasedVariantClassifications',
        'deNovoQualityScore', 'domain', 'eventJustification',
        'fullyExplainsPhenotype', 'genePanel', 'genomicEntities',
        'groupOfVariants', 'guidelineBasedVariantClassification',
        'modeOfInheritance', 'penetrance', 'phenotypes',
        'reportEventId', 'roleInCancer', 'score',
        'segregationPattern', 'tier', 'variantClassification',
        'variantConsequences', 'vendorSpecificScores'
    ]

    def __init__(self, **kwargs):
        self.actions = kwargs.get(
            'actions', None)
        self.algorithmBasedVariantClassifications = kwargs.get(
            'algorithmBasedVariantClassifications', None)
        self.deNovoQualityScore = kwargs.get(
            'deNovoQualityScore', None)
        self.domain = kwargs.get(
            'domain', None)
        self.eventJustification = kwargs.get(
            'eventJustification', None)
        self.fullyExplainsPhenotype = kwargs.get(
            'fullyExplainsPhenotype', None)
        self.genePanel = kwargs.get(
            'genePanel', None)
        self.genomicEntities = kwargs.get(
            'genomicEntities', None)
        self.groupOfVariants = kwargs.get(
            'groupOfVariants', None)
        self.guidelineBasedVariantClassification = kwargs.get(
            'guidelineBasedVariantClassification', None)
        self.modeOfInheritance = kwargs.get(
            'modeOfInheritance', None)
        self.penetrance = kwargs.get(
            'penetrance', None)
        self.phenotypes = kwargs.get(
            'phenotypes', Phenotypes())
        self.reportEventId = kwargs.get(
            'reportEventId', None)
        self.roleInCancer = kwargs.get(
            'roleInCancer', None)
        self.score = kwargs.get(
            'score', None)
        self.segregationPattern = kwargs.get(
            'segregationPattern', None)
        self.tier = kwargs.get(
            'tier', None)
        self.variantClassification = kwargs.get(
            'variantClassification', None)
        self.variantConsequences = kwargs.get(
            'variantConsequences', None)
        self.vendorSpecificScores = kwargs.get(
            'vendorSpecificScores', None)


class ReportVersionControl(ProtocolElement):
    """
    No documentation
    """
    _schemaSource = """
{"type": "record", "name": "ReportVersionControl", "namespace": "org.gel.models.report.avro",
"fields": [{"name": "gitVersionControl", "type": "string", "doc": "", "default": "6.0.2"}]}
"""
    schema = avro_parse(_schemaSource)
    requiredFields = {}

    @classmethod
    def isEmbeddedType(cls, fieldName):
        embeddedTypes = {}
        return fieldName in embeddedTypes

    @classmethod
    def getEmbeddedType(cls, fieldName):
        embeddedTypes = {}

        return embeddedTypes[fieldName]

    __slots__ = [
        'gitVersionControl'
    ]

    def __init__(self, **kwargs):
        self.gitVersionControl = kwargs.get(
            'gitVersionControl', '6.0.2')


class ReportingQuestion(object):
    """
    No documentation
    """
    yes = "yes"
    no = "no"
    na = "na"

    def __hash__(self):
        return str(self).__hash__()


class ReviewedParts(object):
    """
    An enumeration for Which parts of the WGA were reviewed?: *
    `domain_1`: Domain 1 only * `domain_1_and_2`: Domains 1 and 2 *
    `domain_1_2_and_suplementary`: Domains 1, 2 and supplementary
    analysis * `somatic_if_relevant`: Somatic WGA results to be
    reviewed when/if clinically relevant
    """
    domain_1 = "domain_1"
    domain_1_and_2 = "domain_1_and_2"
    domain_1_2_and_suplementary = "domain_1_2_and_suplementary"
    somatic_if_relevant = "somatic_if_relevant"

    def __hash__(self):
        return str(self).__hash__()


class RoleInCancer(object):
    """
    The role of a given genomic feature in cancer  * `NCIT_C16936`:
    oncogene. A gene that is a mutated (changed) form of a gene
    involved in normal cell growth. Oncogenes may cause the growth of
    cancer cells. Mutations in genes that become oncogenes can be
    inherited or caused by being exposed to substances in the
    environment that cause cancer.
    http://purl.obolibrary.org/obo/NCIT_C16936 * `NCIT_C17362`:
    tumor_suppressor_gene. A type of gene that makes a protein called
    a tumor suppressor protein that helps control cell growth.
    Mutations (changes in DNA) in antioncogenes may lead to cancer.
    http://purl.obolibrary.org/obo/NCIT_C17362
    """
    oncogene = "oncogene"
    tumor_suppressor_gene = "tumor_suppressor_gene"
    both = "both"

    def __hash__(self):
        return str(self).__hash__()


class Sample(ProtocolElement):
    """
    No documentation
    """
    _schemaSource = """
{"type": "record", "name": "Sample", "namespace": "org.gel.models.participant.avro", "fields":
[{"name": "sampleId", "type": "string", "doc": ""}, {"name": "labSampleId", "type": "string", "doc":
""}, {"name": "source", "type": ["null", {"type": "enum", "name": "SampleSource", "doc": "",
"symbols": ["TUMOUR", "BONE_MARROW_ASPIRATE_TUMOUR_SORTED_CELLS",
"BONE_MARROW_ASPIRATE_TUMOUR_CELLS", "BLOOD", "SALIVA", "FIBROBLAST", "TISSUE"]}], "doc": ""},
{"name": "product", "type": ["null", {"type": "enum", "name": "Product", "symbols": ["DNA",
"RNA"]}], "doc": ""}, {"name": "preparationMethod", "type": ["null", {"type": "enum", "name":
"PreparationMethod", "symbols": ["EDTA", "ORAGENE", "FF", "FFPE", "CD128_SORTED_CELLS",
"ASPIRATE"]}], "doc": ""}]}
"""
    schema = avro_parse(_schemaSource)
    requiredFields = {
        "labSampleId",
        "preparationMethod",
        "product",
        "sampleId",
        "source",
    }

    @classmethod
    def isEmbeddedType(cls, fieldName):
        embeddedTypes = {}
        return fieldName in embeddedTypes

    @classmethod
    def getEmbeddedType(cls, fieldName):
        embeddedTypes = {}

        return embeddedTypes[fieldName]

    __slots__ = [
        'labSampleId', 'preparationMethod', 'product', 'sampleId',
        'source'
    ]

    def __init__(self, **kwargs):
        self.labSampleId = kwargs.get(
            'labSampleId', None)
        self.preparationMethod = kwargs.get(
            'preparationMethod', None)
        self.product = kwargs.get(
            'product', None)
        self.sampleId = kwargs.get(
            'sampleId', None)
        self.source = kwargs.get(
            'source', None)


class SampleSource(object):
    """
    The source of the sample
    """
    TUMOUR = "TUMOUR"
    BONE_MARROW_ASPIRATE_TUMOUR_SORTED_CELLS = "BONE_MARROW_ASPIRATE_TUMOUR_SORTED_CELLS"
    BONE_MARROW_ASPIRATE_TUMOUR_CELLS = "BONE_MARROW_ASPIRATE_TUMOUR_CELLS"
    BLOOD = "BLOOD"
    SALIVA = "SALIVA"
    FIBROBLAST = "FIBROBLAST"
    TISSUE = "TISSUE"

    def __hash__(self):
        return str(self).__hash__()


class SegregationPattern(object):
    """
    No documentation
    """
    UniparentalIsodisomy = "UniparentalIsodisomy"
    SimpleRecessive = "SimpleRecessive"
    CompoundHeterozygous = "CompoundHeterozygous"
    deNovo = "deNovo"
    InheritedAutosomalDominant = "InheritedAutosomalDominant"
    InheritedAutosomalDominantMaternallyImprinted = "InheritedAutosomalDominantMaternallyImprinted"
    InheritedAutosomalDominantPaternallyImprinted = "InheritedAutosomalDominantPaternallyImprinted"
    XLinkedCompoundHeterozygous = "XLinkedCompoundHeterozygous"
    XLinkedSimpleRecessive = "XLinkedSimpleRecessive"
    XLinkedMonoallelic = "XLinkedMonoallelic"
    MitochondrialGenome = "MitochondrialGenome"

    def __hash__(self):
        return str(self).__hash__()


class SegregationQuestion(object):
    """
    No documentation
    """
    yes = "yes"
    no = "no"

    def __hash__(self):
        return str(self).__hash__()


class SensitiveInformation(ProtocolElement):
    """
    No documentation
    """
    _schemaSource = """
{"type": "record", "name": "SensitiveInformation", "namespace": "org.gel.models.participant.avro",
"fields": [{"name": "versionControl", "type": {"type": "record", "name": "VersionControl", "fields":
[{"name": "GitVersionControl", "type": "string", "doc": "", "default": "1.1.3"}]}, "doc": ""},
{"name": "gelID", "type": "string"}, {"name": "externalIds", "type": ["null", {"type": "array",
"items": "string"}]}, {"name": "genomicMedicineCenter", "type": ["null", "string"]}, {"name":
"fullNameOfResponsibleConsultant", "type": ["null", "string"]}, {"name": "contactNumber", "type":
["null", "string"]}, {"name": "hospitalOfResponsibleConsultant", "type": ["null", "string"]},
{"name": "centerSampleId", "type": ["null", "string"]}, {"name": "originatingCenter", "type":
["null", "string"]}, {"name": "centerPatientId", "type": ["null", "string"]}]}
"""
    schema = avro_parse(_schemaSource)
    requiredFields = {
        "centerPatientId",
        "centerSampleId",
        "contactNumber",
        "externalIds",
        "fullNameOfResponsibleConsultant",
        "gelID",
        "genomicMedicineCenter",
        "hospitalOfResponsibleConsultant",
        "originatingCenter",
        "versionControl",
    }

    @classmethod
    def isEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'versionControl': VersionControl,
        }
        return fieldName in embeddedTypes

    @classmethod
    def getEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'versionControl': VersionControl,
        }

        return embeddedTypes[fieldName]

    __slots__ = [
        'centerPatientId', 'centerSampleId', 'contactNumber',
        'externalIds', 'fullNameOfResponsibleConsultant', 'gelID',
        'genomicMedicineCenter', 'hospitalOfResponsibleConsultant',
        'originatingCenter', 'versionControl'
    ]

    def __init__(self, **kwargs):
        self.centerPatientId = kwargs.get(
            'centerPatientId', None)
        self.centerSampleId = kwargs.get(
            'centerSampleId', None)
        self.contactNumber = kwargs.get(
            'contactNumber', None)
        self.externalIds = kwargs.get(
            'externalIds', None)
        self.fullNameOfResponsibleConsultant = kwargs.get(
            'fullNameOfResponsibleConsultant', None)
        self.gelID = kwargs.get(
            'gelID', None)
        self.genomicMedicineCenter = kwargs.get(
            'genomicMedicineCenter', None)
        self.hospitalOfResponsibleConsultant = kwargs.get(
            'hospitalOfResponsibleConsultant', None)
        self.originatingCenter = kwargs.get(
            'originatingCenter', None)
        self.versionControl = kwargs.get(
            'versionControl', VersionControl())


class Severity(object):
    """
    No documentation
    """
    BORDERLINE = "BORDERLINE"
    MILD = "MILD"
    MODERATE = "MODERATE"
    SEVERE = "SEVERE"
    PROFOUND = "PROFOUND"

    def __hash__(self):
        return str(self).__hash__()


class Sex(object):
    """
    Sex
    """
    MALE = "MALE"
    FEMALE = "FEMALE"
    UNKNOWN = "UNKNOWN"

    def __hash__(self):
        return str(self).__hash__()


class ShortTandemRepeat(ProtocolElement):
    """
    No documentation
    """
    _schemaSource = """
{"type": "record", "name": "ShortTandemRepeat", "namespace": "org.gel.models.report.avro", "fields":
[{"name": "coordinates", "type": {"type": "record", "name": "Coordinates", "fields": [{"name":
"assembly", "type": {"type": "enum", "name": "Assembly", "doc": "", "symbols": ["GRCh38",
"GRCh37"]}}, {"name": "chromosome", "type": "string"}, {"name": "start", "type": "int"}, {"name":
"end", "type": "int"}, {"name": "ciStart", "type": ["null", {"type": "record", "name":
"ConfidenceInterval", "fields": [{"name": "left", "type": "int"}, {"name": "right", "type":
"int"}]}]}, {"name": "ciEnd", "type": ["null", "ConfidenceInterval"]}]}}, {"name": "reportEvents",
"type": {"type": "array", "items": {"type": "record", "name": "ReportEvent", "doc": "", "fields":
[{"name": "reportEventId", "type": "string", "doc": ""}, {"name": "phenotypes", "type": {"type":
"record", "name": "Phenotypes", "doc": "", "fields": [{"name": "nonStandardPhenotype", "type":
["null", {"type": "array", "items": "string"}], "doc": ""}, {"name": "standardPhenotypes", "type":
["null", {"type": "array", "items": {"type": "record", "name": "StandardPhenotype", "doc": "",
"fields": [{"name": "id", "type": "string"}, {"name": "name", "type": ["null", "string"]}, {"name":
"namespace", "type": ["null", "string"]}, {"name": "definition", "type": ["null", "string"]},
{"name": "comment", "type": ["null", "string"]}, {"name": "alternativeIds", "type": ["null",
"string"]}, {"name": "synonyms", "type": ["null", "string"]}, {"name": "isA", "type": ["null",
"string"]}, {"name": "ontology", "type": {"type": "record", "name": "Ontology", "doc": "", "fields":
[{"name": "name", "type": "string"}, {"name": "version", "type": "string"}]}, "doc": ""}, {"name":
"matchScore", "type": ["null", "float"], "doc": ""}]}}], "doc": ""}]}, "doc": ""}, {"name":
"variantConsequences", "type": {"type": "array", "items": {"type": "record", "name":
"VariantConsequence", "doc": "", "fields": [{"name": "id", "type": "string", "doc": ""}, {"name":
"name", "type": ["null", "string"], "doc": ""}]}}, "doc": ""}, {"name": "genePanel", "type":
["null", {"type": "record", "name": "GenePanel", "doc": "", "fields": [{"name": "panelIdentifier",
"type": ["null", "string"], "doc": ""}, {"name": "panelName", "type": ["null", "string"], "doc":
""}, {"name": "panelVersion", "type": ["null", "string"], "doc": ""}, {"name": "source", "type":
["null", "string"], "doc": ""}]}], "doc": ""}, {"name": "modeOfInheritance", "type": {"type":
"enum", "name": "ModeOfInheritance", "doc": "", "symbols": ["monoallelic",
"monoallelic_not_imprinted", "monoallelic_maternally_imprinted", "monoallelic_paternally_imprinted",
"biallelic", "monoallelic_and_biallelic", "monoallelic_and_more_severe_biallelic",
"xlinked_biallelic", "xlinked_monoallelic", "mitochondrial", "unknown", "na"]}, "doc": ""}, {"name":
"genomicEntities", "type": {"type": "array", "items": {"type": "record", "name": "GenomicEntity",
"doc": "", "fields": [{"name": "type", "type": {"type": "enum", "name": "GenomicEntityType", "doc":
"", "symbols": ["regulatory_region", "gene", "transcript", "intergenic", "gene_fusion",
"genomic_region", "cytobands"]}, "doc": ""}, {"name": "ensemblId", "type": ["null", "string"],
"doc": ""}, {"name": "geneSymbol", "type": ["null", "string"], "doc": ""}, {"name": "otherIds",
"type": ["null", {"type": "array", "items": {"type": "record", "name": "Identifier", "fields":
[{"name": "source", "type": "string", "doc": ""}, {"name": "identifier", "type": "string", "doc":
""}]}}], "doc": ""}]}}, "doc": ""}, {"name": "segregationPattern", "type": ["null", {"type": "enum",
"name": "SegregationPattern", "symbols": ["UniparentalIsodisomy", "SimpleRecessive",
"CompoundHeterozygous", "deNovo", "InheritedAutosomalDominant",
"InheritedAutosomalDominantMaternallyImprinted", "InheritedAutosomalDominantPaternallyImprinted",
"XLinkedCompoundHeterozygous", "XLinkedSimpleRecessive", "XLinkedMonoallelic",
"MitochondrialGenome"]}], "doc": ""}, {"name": "penetrance", "type": ["null", {"type": "enum",
"name": "Penetrance", "namespace": "org.gel.models.participant.avro", "doc": "", "symbols":
["complete", "incomplete"]}], "doc": ""}, {"name": "deNovoQualityScore", "type": ["null", "float"],
"doc": ""}, {"name": "fullyExplainsPhenotype", "type": ["null", "boolean"], "doc": ""}, {"name":
"groupOfVariants", "type": ["null", "int"], "doc": ""}, {"name": "eventJustification", "type":
["null", "string"], "doc": ""}, {"name": "roleInCancer", "type": ["null", {"type": "array", "items":
{"type": "enum", "name": "RoleInCancer", "doc": "", "symbols": ["oncogene", "tumor_suppressor_gene",
"both"]}}], "doc": ""}, {"name": "actions", "type": ["null", {"type": "record", "name": "Actions",
"doc": "", "fields": [{"name": "trials", "type": ["null", {"type": "array", "items": {"type":
"record", "name": "Trial", "fields": [{"name": "studyUrl", "type": "string", "doc": ""}, {"name":
"studyIdentifier", "type": "string", "doc": ""}, {"name": "startDate", "type": ["null", "string"],
"doc": ""}, {"name": "estimateCompletionDate", "type": ["null", "string"], "doc": ""}, {"name":
"title", "type": ["null", "string"], "doc": ""}, {"name": "phase", "type": ["null", {"type": "enum",
"name": "StudyPhase", "doc": "", "symbols": ["na", "early_phase1", "phase1", "phase1_phase2",
"phase2", "phase2_phase3", "phase3", "phase4"]}], "doc": ""}, {"name": "interventions", "type":
["null", {"type": "array", "items": {"type": "record", "name": "Intervention", "doc": "", "fields":
[{"name": "interventionType", "type": {"type": "enum", "name": "InterventionType", "doc": "",
"symbols": ["drug", "device", "procedure", "biological", "radiation", "behavioral", "genetic",
"dietary_supplement", "combination_product", "diagnostic_test", "other"]}, "doc": ""}, {"name":
"interventionName", "type": "string", "doc": ""}]}}], "doc": ""}, {"name": "conditions", "type":
["null", {"type": "array", "items": "string"}], "doc": ""}, {"name": "primaryPurpose", "type":
["null", {"type": "enum", "name": "PrimaryPurpose", "doc": "", "symbols": ["treatment",
"prevention", "diagnostic", "supportive_care", "screening", "health_services_research",
"basic_science", "device_feasibility", "other"]}], "doc": ""}, {"name": "studyType", "type":
["null", {"type": "enum", "name": "StudyType", "doc": "", "symbols": ["interventional",
"observational", "patient_registry", "expanded_access"]}], "doc": ""}, {"name":
"demogrphicElegibilityCriteria", "type": ["null", {"type": "record", "name":
"DemographicElegibilityCriteria", "fields": [{"name": "sex", "type": {"type": "enum", "name": "Sex",
"namespace": "org.gel.models.participant.avro", "doc": "", "symbols": ["MALE", "FEMALE",
"UNKNOWN"]}}, {"name": "ageRange", "type": ["null", {"type": "record", "name": "AgeRange", "fields":
[{"name": "minimumAge", "type": "int"}, {"name": "maximumAge", "type": "int"}, {"name": "timeunit",
"type": {"type": "enum", "name": "TimeUnit", "symbols": ["years", "months", "weeks", "days",
"hours", "minutes", "na"]}}]}]}]}], "doc": ""}, {"name": "locations", "type": ["null", {"type":
"array", "items": {"type": "record", "name": "TrialLocation", "fields": [{"name": "name", "type":
["null", "string"]}, {"name": "city", "type": ["null", "string"]}, {"name": "country", "type":
["null", "string"]}, {"name": "zip", "type": ["null", "string"]}]}}], "doc": ""}, {"name":
"variantActionable", "type": "boolean", "doc": ""}]}}]}, {"name": "prognosis", "type": ["null",
{"type": "array", "items": {"type": "record", "name": "Prognosis", "fields": [{"name":
"referenceUrl", "type": "string", "doc": ""}, {"name": "prognosis", "type": ["null", {"type":
"enum", "name": "PrognosisClassification", "symbols": ["altered_prognosis", "favourable_prognosis",
"unfavourable_prognosis"]}], "doc": ""}, {"name": "source", "type": ["null", "string"], "doc": ""},
{"name": "references", "type": ["null", {"type": "array", "items": "string"}], "doc": ""}, {"name":
"conditions", "type": ["null", {"type": "array", "items": "string"}], "doc": ""}, {"name":
"description", "type": ["null", "string"], "doc": ""}, {"name": "variantActionable", "type":
"boolean", "doc": ""}]}}]}, {"name": "therapies", "type": ["null", {"type": "array", "items":
{"type": "record", "name": "Therapy", "fields": [{"name": "referenceUrl", "type": "string", "doc":
""}, {"name": "source", "type": ["null", "string"], "doc": ""}, {"name": "references", "type":
["null", {"type": "array", "items": "string"}], "doc": ""}, {"name": "conditions", "type": ["null",
{"type": "array", "items": "string"}], "doc": ""}, {"name": "drugResponse", "type": ["null",
{"type": "array", "items": {"type": "record", "name": "DrugResponse", "fields": [{"name":
"TreatmentAgent", "type": "string", "doc": ""}, {"name": "drugResponseClassification", "type":
{"type": "enum", "name": "DrugResponseClassification", "symbols": ["altered_sensitivity",
"reduced_sensitivity", "increased_sensitivity", "altered_resistance", "increased_resistance",
"reduced_resistance", "increased_risk_of_toxicity", "reduced_risk_of_toxicity", "altered_toxicity",
"adverse_drug_reaction", "indication", "contraindication", "dosing_alteration", "increased_dose",
"reduced_dose", "increased_monitoring", "increased_efficacy", "reduced_efficacy",
"altered_efficacy"]}, "doc": ""}]}}], "doc": ""}, {"name": "otherInterventions", "type": ["null",
{"type": "array", "items": "Intervention"}], "doc": ""}, {"name": "variantActionable", "type":
"boolean", "doc": ""}]}}]}]}], "doc": ""}, {"name": "score", "type": ["null", "float"], "doc": ""},
{"name": "vendorSpecificScores", "type": ["null", {"type": "map", "values": "float"}], "doc": ""},
{"name": "variantClassification", "type": ["null", {"type": "record", "name":
"VariantClassification", "doc": "", "fields": [{"name": "clinicalSignificance", "type": ["null",
{"type": "enum", "name": "ClinicalSignificance", "symbols": ["benign", "likely_benign",
"likely_pathogenic", "pathogenic", "uncertain_significance"]}], "doc": ""}, {"name":
"drugResponseClassification", "type": ["null", "DrugResponseClassification"], "doc": ""}, {"name":
"traitAssociation", "type": ["null", {"type": "enum", "name": "TraitAssociation", "symbols":
["established_risk_allele", "likely_risk_allele", "uncertain_risk_allele", "protective"]}], "doc":
""}, {"name": "tumorigenesisClassification", "type": ["null", {"type": "enum", "name":
"TumorigenesisClassification", "symbols": ["driver", "passenger", "modifier"]}], "doc": ""},
{"name": "functionalEffect", "type": ["null", {"type": "enum", "name": "VariantFunctionalEffect",
"symbols": ["dominant_negative_variant", "gain_of_function_variant", "lethal_variant",
"loss_of_function_variant", "loss_of_heterozygosity", "null_variant"]}], "doc": ""}]}], "doc": ""},
{"name": "guidelineBasedVariantClassification", "type": ["null", {"type": "record", "name":
"GuidelineBasedVariantClassification", "doc": "", "fields": [{"name": "acmgVariantClassification",
"type": ["null", {"type": "record", "name": "AcmgVariantClassification", "doc": "", "fields":
[{"name": "acmgEvidences", "type": {"type": "array", "items": {"type": "record", "name":
"AcmgEvidence", "doc": "", "fields": [{"name": "category", "type": {"type": "enum", "name":
"AcmgEvidenceCategory", "doc": "", "symbols": ["population_data",
"computational_and_predictive_data", "functional_data", "segregation_data", "de_novo_data",
"allelic_data", "other_database", "other_data"]}, "doc": ""}, {"name": "type", "type": {"type":
"enum", "name": "AcmgEvidenceType", "doc": "", "symbols": ["bening", "pathogenic"]}, "doc": ""},
{"name": "weight", "type": {"type": "enum", "name": "AcmgEvidenceWeight", "doc": "", "symbols":
["stand_alone", "supporting", "moderate", "strong", "very_strong"]}, "doc": ""}, {"name":
"modifier", "type": "int", "doc": ""}, {"name": "description", "type": ["null", "string"], "doc":
""}]}}}, {"name": "clinicalSignificance", "type": "ClinicalSignificance"}, {"name": "assessment",
"type": ["null", "string"]}]}]}, {"name": "ampVariantClassification", "type": ["null", {"type":
"record", "name": "AmpVariantClassification", "doc": "", "fields": [{"name": "ampEvidences", "type":
{"type": "array", "items": {"type": "record", "name": "AmpEvidence", "doc": "", "fields": [{"name":
"type", "type": {"type": "enum", "name": "AmpEvidenceType", "doc": "", "symbols": ["mutation_type",
"therapies", "variant_frequencies", "potential_germline", "population_database_presence",
"germline_database_presence", "somatic_database_presence", "impact_predictive_software",
"pathway_involvement", "publications"]}, "doc": ""}, {"name": "evidenceAssessment", "type":
"string", "doc": ""}]}}, "doc": ""}, {"name": "ampTier", "type": {"type": "enum", "name": "AmpTier",
"doc": "", "symbols": ["tierI", "tierII", "tierIII", "tierIV"]}, "doc": ""}, {"name":
"ampClincialOrExperimentalEvidence", "type": ["null", {"type": "array", "items": {"type": "record",
"name": "AmpClincialOrExperimentalEvidence", "doc": "", "fields": [{"name": "category", "type":
{"type": "enum", "name": "AmpClinicalOrExperimentalEvidenceCategory", "doc": "", "symbols":
["therapeutic", "diagnosis", "prognosis"]}, "doc": ""}, {"name": "level", "type": {"type": "enum",
"name": "AmpClinicalOrExperimentalEvidenceLevel", "doc": "", "symbols": ["levelA", "levelB",
"levelC", "levelD"]}, "doc": ""}, {"name": "description", "type": ["null", "string"], "doc":
""}]}}], "doc": ""}, {"name": "assessment", "type": ["null", "string"], "doc": ""}]}]}]}], "doc":
""}, {"name": "algorithmBasedVariantClassifications", "type": ["null", {"type": "array", "items":
{"type": "record", "name": "AlgorithmBasedVariantClassification", "fields": [{"name":
"algorithmName", "type": "string", "doc": ""}, {"name": "classification", "type": "string", "doc":
""}, {"name": "rank", "type": ["null", "int"], "doc": ""}, {"name": "score", "type": ["null",
"int"], "doc": ""}]}}], "doc": ""}, {"name": "tier", "type": ["null", {"type": "enum", "name":
"Tier", "doc": "", "symbols": ["NONE", "TIER1", "TIER2", "TIER3", "TIER4", "TIER5", "TIERA",
"TIERB"]}], "doc": ""}, {"name": "domain", "type": ["null", {"type": "enum", "name": "Domain",
"symbols": ["DOMAIN1", "DOMAIN2", "DOMAIN3", "DOMAIN4", "NONE"]}], "doc": ""}]}}}, {"name":
"variantCalls", "type": {"type": "array", "items": {"type": "record", "name": "VariantCall", "doc":
"", "fields": [{"name": "participantId", "type": "string", "doc": ""}, {"name": "sampleId", "type":
"string", "doc": ""}, {"name": "zygosity", "type": {"type": "enum", "name": "Zygosity", "doc": "",
"symbols": ["reference_homozygous", "heterozygous", "alternate_homozygous", "missing",
"half_missing_reference", "half_missing_alternate", "alternate_hemizigous", "reference_hemizigous",
"unk", "na"]}, "doc": ""}, {"name": "phaseGenotype", "type": ["null", {"type": "record", "name":
"PhaseGenotype", "fields": [{"name": "sortedAlleles", "type": {"type": "array", "items": "string"}},
{"name": "phaseSet", "type": "int"}]}], "doc": ""}, {"name": "sampleVariantAlleleFrequency", "type":
["null", "double"], "doc": ""}, {"name": "depthReference", "type": ["null", "int"], "doc": ""},
{"name": "depthAlternate", "type": ["null", "int"], "doc": ""}, {"name": "numberOfCopies", "type":
["null", {"type": "array", "items": {"type": "record", "name": "NumberOfCopies", "fields": [{"name":
"numberOfCopies", "type": "int", "doc": ""}, {"name": "confidenceIntervalMaximum", "type": ["null",
"int"]}, {"name": "confidenceIntervalMinimum", "type": ["null", "int"]}]}}], "doc": ""}, {"name":
"alleleOrigins", "type": ["null", {"type": "array", "items": {"type": "enum", "name":
"AlleleOrigin", "doc": "", "symbols": ["de_novo_variant", "germline_variant", "maternal_variant",
"paternal_variant", "pedigree_specific_variant", "population_specific_variant",
"somatic_variant"]}}], "doc": ""}, {"name": "supportingReadTypes", "type": ["null", {"type":
"array", "items": {"type": "enum", "name": "SupportingReadType", "symbols": ["spanning", "flanking",
"inrepeat"]}}]}]}}, "doc": ""}, {"name": "variantAttributes", "type": ["null", {"type": "record",
"name": "VariantAttributes", "doc": "", "fields": [{"name": "genomicChanges", "type": ["null",
{"type": "array", "items": "string"}], "doc": ""}, {"name": "cdnaChanges", "type": ["null", {"type":
"array", "items": "string"}], "doc": ""}, {"name": "proteinChanges", "type": ["null", {"type":
"array", "items": "string"}], "doc": ""}, {"name": "additionalTextualVariantAnnotations", "type":
["null", {"type": "map", "values": "string"}], "doc": ""}, {"name": "references", "type": ["null",
{"type": "map", "values": "string"}], "doc": ""}, {"name": "variantIdentifiers", "type": ["null",
{"type": "record", "name": "VariantIdentifiers", "fields": [{"name": "dbSnpId", "type": ["null",
"string"], "doc": ""}, {"name": "cosmicIds", "type": ["null", {"type": "array", "items": "string"}],
"doc": ""}, {"name": "clinVarIds", "type": ["null", {"type": "array", "items": "string"}], "doc":
""}, {"name": "otherIds", "type": ["null", {"type": "array", "items": "Identifier"}]}]}]}, {"name":
"alleleFrequencies", "type": ["null", {"type": "array", "items": {"type": "record", "name":
"AlleleFrequency", "doc": "", "fields": [{"name": "study", "type": "string", "doc": ""}, {"name":
"population", "type": "string", "doc": ""}, {"name": "alternateFrequency", "type": "float", "doc":
""}]}}], "doc": ""}, {"name": "additionalNumericVariantAnnotations", "type": ["null", {"type":
"map", "values": "float"}], "doc": ""}, {"name": "comments", "type": ["null", {"type": "array",
"items": "string"}], "doc": ""}, {"name": "alleleOrigins", "type": ["null", {"type": "array",
"items": "AlleleOrigin"}], "doc": ""}, {"name": "ihp", "type": ["null", "int"], "doc": ""}, {"name":
"recurrentlyReported", "type": ["null", "boolean"], "doc": ""}, {"name": "fdp50", "type": ["null",
"float"], "doc": ""}, {"name": "others", "type": ["null", {"type": "map", "values": "string"}],
"doc": ""}]}]}, {"name": "shortTandemRepeatReferenceData", "type": ["null", {"type": "record",
"name": "ShortTandemRepeatReferenceData", "fields": [{"name": "repeatedSequence", "type": "string"},
{"name": "pathogenic_number_of_repeats_threshold", "type": "int"}, {"name":
"normal_number_of_repeats_threshold", "type": "int"}]}]}]}
"""
    schema = avro_parse(_schemaSource)
    requiredFields = {
        "coordinates",
        "reportEvents",
        "shortTandemRepeatReferenceData",
        "variantAttributes",
        "variantCalls",
    }

    @classmethod
    def isEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'coordinates': Coordinates,
            'reportEvents': ReportEvent,
            'shortTandemRepeatReferenceData': ShortTandemRepeatReferenceData,
            'variantAttributes': VariantAttributes,
            'variantCalls': VariantCall,
        }
        return fieldName in embeddedTypes

    @classmethod
    def getEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'coordinates': Coordinates,
            'reportEvents': ReportEvent,
            'shortTandemRepeatReferenceData': ShortTandemRepeatReferenceData,
            'variantAttributes': VariantAttributes,
            'variantCalls': VariantCall,
        }

        return embeddedTypes[fieldName]

    __slots__ = [
        'coordinates', 'reportEvents',
        'shortTandemRepeatReferenceData', 'variantAttributes',
        'variantCalls'
    ]

    def __init__(self, **kwargs):
        self.coordinates = kwargs.get(
            'coordinates', Coordinates())
        self.reportEvents = kwargs.get(
            'reportEvents', None)
        self.shortTandemRepeatReferenceData = kwargs.get(
            'shortTandemRepeatReferenceData', None)
        self.variantAttributes = kwargs.get(
            'variantAttributes', None)
        self.variantCalls = kwargs.get(
            'variantCalls', None)


class ShortTandemRepeatLevelQuestions(ProtocolElement):
    """
    The variant level questions
    """
    _schemaSource = """
{"type": "record", "name": "ShortTandemRepeatLevelQuestions", "namespace":
"org.gel.models.report.avro", "doc": "", "fields": [{"name": "coordinates", "type": {"type":
"record", "name": "Coordinates", "fields": [{"name": "assembly", "type": {"type": "enum", "name":
"Assembly", "doc": "", "symbols": ["GRCh38", "GRCh37"]}}, {"name": "chromosome", "type": "string"},
{"name": "start", "type": "int"}, {"name": "end", "type": "int"}, {"name": "ciStart", "type":
["null", {"type": "record", "name": "ConfidenceInterval", "fields": [{"name": "left", "type":
"int"}, {"name": "right", "type": "int"}]}]}, {"name": "ciEnd", "type": ["null",
"ConfidenceInterval"]}]}, "doc": ""}, {"name": "confirmationDecision", "type": {"type": "enum",
"name": "ConfirmationDecision", "symbols": ["yes", "no", "na"]}, "doc": ""}, {"name":
"confirmationOutcome", "type": {"type": "enum", "name": "ConfirmationOutcome", "symbols": ["yes",
"no", "na"]}, "doc": ""}, {"name": "reportingQuestion", "type": {"type": "enum", "name":
"ReportingQuestion", "symbols": ["yes", "no", "na"]}, "doc": ""}, {"name": "acmgClassification",
"type": {"type": "enum", "name": "ACMGClassification", "symbols": ["pathogenic_variant",
"likely_pathogenic_variant", "variant_of_unknown_clinical_significance", "likely_benign_variant",
"benign_variant", "not_assessed", "na"]}, "doc": ""}, {"name": "publications", "type": "string",
"doc": ""}]}
"""
    schema = avro_parse(_schemaSource)
    requiredFields = {
        "acmgClassification",
        "confirmationDecision",
        "confirmationOutcome",
        "coordinates",
        "publications",
        "reportingQuestion",
    }

    @classmethod
    def isEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'coordinates': Coordinates,
        }
        return fieldName in embeddedTypes

    @classmethod
    def getEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'coordinates': Coordinates,
        }

        return embeddedTypes[fieldName]

    __slots__ = [
        'acmgClassification', 'confirmationDecision',
        'confirmationOutcome', 'coordinates', 'publications',
        'reportingQuestion'
    ]

    def __init__(self, **kwargs):
        self.acmgClassification = kwargs.get(
            'acmgClassification', None)
        self.confirmationDecision = kwargs.get(
            'confirmationDecision', None)
        self.confirmationOutcome = kwargs.get(
            'confirmationOutcome', None)
        self.coordinates = kwargs.get(
            'coordinates', Coordinates())
        self.publications = kwargs.get(
            'publications', None)
        self.reportingQuestion = kwargs.get(
            'reportingQuestion', None)


class ShortTandemRepeatReferenceData(ProtocolElement):
    """
    No documentation
    """
    _schemaSource = """
{"type": "record", "name": "ShortTandemRepeatReferenceData", "namespace":
"org.gel.models.report.avro", "fields": [{"name": "repeatedSequence", "type": "string"}, {"name":
"pathogenic_number_of_repeats_threshold", "type": "int"}, {"name":
"normal_number_of_repeats_threshold", "type": "int"}]}
"""
    schema = avro_parse(_schemaSource)
    requiredFields = {
        "normal_number_of_repeats_threshold",
        "pathogenic_number_of_repeats_threshold",
        "repeatedSequence",
    }

    @classmethod
    def isEmbeddedType(cls, fieldName):
        embeddedTypes = {}
        return fieldName in embeddedTypes

    @classmethod
    def getEmbeddedType(cls, fieldName):
        embeddedTypes = {}

        return embeddedTypes[fieldName]

    __slots__ = [
        'normal_number_of_repeats_threshold',
        'pathogenic_number_of_repeats_threshold', 'repeatedSequence'
    ]

    def __init__(self, **kwargs):
        self.normal_number_of_repeats_threshold = kwargs.get(
            'normal_number_of_repeats_threshold', None)
        self.pathogenic_number_of_repeats_threshold = kwargs.get(
            'pathogenic_number_of_repeats_threshold', None)
        self.repeatedSequence = kwargs.get(
            'repeatedSequence', None)


class SmallVariant(ProtocolElement):
    """
    A reported variant
    """
    _schemaSource = """
{"type": "record", "name": "SmallVariant", "namespace": "org.gel.models.report.avro", "doc": "",
"fields": [{"name": "variantCoordinates", "type": {"type": "record", "name": "VariantCoordinates",
"doc": "", "fields": [{"name": "chromosome", "type": "string", "doc": ""}, {"name": "position",
"type": "int", "doc": ""}, {"name": "reference", "type": "string", "doc": ""}, {"name": "alternate",
"type": "string", "doc": ""}, {"name": "assembly", "type": {"type": "enum", "name": "Assembly",
"doc": "", "symbols": ["GRCh38", "GRCh37"]}, "doc": ""}]}, "doc": ""}, {"name": "variantCalls",
"type": {"type": "array", "items": {"type": "record", "name": "VariantCall", "doc": "", "fields":
[{"name": "participantId", "type": "string", "doc": ""}, {"name": "sampleId", "type": "string",
"doc": ""}, {"name": "zygosity", "type": {"type": "enum", "name": "Zygosity", "doc": "", "symbols":
["reference_homozygous", "heterozygous", "alternate_homozygous", "missing",
"half_missing_reference", "half_missing_alternate", "alternate_hemizigous", "reference_hemizigous",
"unk", "na"]}, "doc": ""}, {"name": "phaseGenotype", "type": ["null", {"type": "record", "name":
"PhaseGenotype", "fields": [{"name": "sortedAlleles", "type": {"type": "array", "items": "string"}},
{"name": "phaseSet", "type": "int"}]}], "doc": ""}, {"name": "sampleVariantAlleleFrequency", "type":
["null", "double"], "doc": ""}, {"name": "depthReference", "type": ["null", "int"], "doc": ""},
{"name": "depthAlternate", "type": ["null", "int"], "doc": ""}, {"name": "numberOfCopies", "type":
["null", {"type": "array", "items": {"type": "record", "name": "NumberOfCopies", "fields": [{"name":
"numberOfCopies", "type": "int", "doc": ""}, {"name": "confidenceIntervalMaximum", "type": ["null",
"int"]}, {"name": "confidenceIntervalMinimum", "type": ["null", "int"]}]}}], "doc": ""}, {"name":
"alleleOrigins", "type": ["null", {"type": "array", "items": {"type": "enum", "name":
"AlleleOrigin", "doc": "", "symbols": ["de_novo_variant", "germline_variant", "maternal_variant",
"paternal_variant", "pedigree_specific_variant", "population_specific_variant",
"somatic_variant"]}}], "doc": ""}, {"name": "supportingReadTypes", "type": ["null", {"type":
"array", "items": {"type": "enum", "name": "SupportingReadType", "symbols": ["spanning", "flanking",
"inrepeat"]}}]}]}}, "doc": ""}, {"name": "reportEvents", "type": {"type": "array", "items": {"type":
"record", "name": "ReportEvent", "doc": "", "fields": [{"name": "reportEventId", "type": "string",
"doc": ""}, {"name": "phenotypes", "type": {"type": "record", "name": "Phenotypes", "doc": "",
"fields": [{"name": "nonStandardPhenotype", "type": ["null", {"type": "array", "items": "string"}],
"doc": ""}, {"name": "standardPhenotypes", "type": ["null", {"type": "array", "items": {"type":
"record", "name": "StandardPhenotype", "doc": "", "fields": [{"name": "id", "type": "string"},
{"name": "name", "type": ["null", "string"]}, {"name": "namespace", "type": ["null", "string"]},
{"name": "definition", "type": ["null", "string"]}, {"name": "comment", "type": ["null", "string"]},
{"name": "alternativeIds", "type": ["null", "string"]}, {"name": "synonyms", "type": ["null",
"string"]}, {"name": "isA", "type": ["null", "string"]}, {"name": "ontology", "type": {"type":
"record", "name": "Ontology", "doc": "", "fields": [{"name": "name", "type": "string"}, {"name":
"version", "type": "string"}]}, "doc": ""}, {"name": "matchScore", "type": ["null", "float"], "doc":
""}]}}], "doc": ""}]}, "doc": ""}, {"name": "variantConsequences", "type": {"type": "array",
"items": {"type": "record", "name": "VariantConsequence", "doc": "", "fields": [{"name": "id",
"type": "string", "doc": ""}, {"name": "name", "type": ["null", "string"], "doc": ""}]}}, "doc":
""}, {"name": "genePanel", "type": ["null", {"type": "record", "name": "GenePanel", "doc": "",
"fields": [{"name": "panelIdentifier", "type": ["null", "string"], "doc": ""}, {"name": "panelName",
"type": ["null", "string"], "doc": ""}, {"name": "panelVersion", "type": ["null", "string"], "doc":
""}, {"name": "source", "type": ["null", "string"], "doc": ""}]}], "doc": ""}, {"name":
"modeOfInheritance", "type": {"type": "enum", "name": "ModeOfInheritance", "doc": "", "symbols":
["monoallelic", "monoallelic_not_imprinted", "monoallelic_maternally_imprinted",
"monoallelic_paternally_imprinted", "biallelic", "monoallelic_and_biallelic",
"monoallelic_and_more_severe_biallelic", "xlinked_biallelic", "xlinked_monoallelic",
"mitochondrial", "unknown", "na"]}, "doc": ""}, {"name": "genomicEntities", "type": {"type":
"array", "items": {"type": "record", "name": "GenomicEntity", "doc": "", "fields": [{"name": "type",
"type": {"type": "enum", "name": "GenomicEntityType", "doc": "", "symbols": ["regulatory_region",
"gene", "transcript", "intergenic", "gene_fusion", "genomic_region", "cytobands"]}, "doc": ""},
{"name": "ensemblId", "type": ["null", "string"], "doc": ""}, {"name": "geneSymbol", "type":
["null", "string"], "doc": ""}, {"name": "otherIds", "type": ["null", {"type": "array", "items":
{"type": "record", "name": "Identifier", "fields": [{"name": "source", "type": "string", "doc": ""},
{"name": "identifier", "type": "string", "doc": ""}]}}], "doc": ""}]}}, "doc": ""}, {"name":
"segregationPattern", "type": ["null", {"type": "enum", "name": "SegregationPattern", "symbols":
["UniparentalIsodisomy", "SimpleRecessive", "CompoundHeterozygous", "deNovo",
"InheritedAutosomalDominant", "InheritedAutosomalDominantMaternallyImprinted",
"InheritedAutosomalDominantPaternallyImprinted", "XLinkedCompoundHeterozygous",
"XLinkedSimpleRecessive", "XLinkedMonoallelic", "MitochondrialGenome"]}], "doc": ""}, {"name":
"penetrance", "type": ["null", {"type": "enum", "name": "Penetrance", "namespace":
"org.gel.models.participant.avro", "doc": "", "symbols": ["complete", "incomplete"]}], "doc": ""},
{"name": "deNovoQualityScore", "type": ["null", "float"], "doc": ""}, {"name":
"fullyExplainsPhenotype", "type": ["null", "boolean"], "doc": ""}, {"name": "groupOfVariants",
"type": ["null", "int"], "doc": ""}, {"name": "eventJustification", "type": ["null", "string"],
"doc": ""}, {"name": "roleInCancer", "type": ["null", {"type": "array", "items": {"type": "enum",
"name": "RoleInCancer", "doc": "", "symbols": ["oncogene", "tumor_suppressor_gene", "both"]}}],
"doc": ""}, {"name": "actions", "type": ["null", {"type": "record", "name": "Actions", "doc": "",
"fields": [{"name": "trials", "type": ["null", {"type": "array", "items": {"type": "record", "name":
"Trial", "fields": [{"name": "studyUrl", "type": "string", "doc": ""}, {"name": "studyIdentifier",
"type": "string", "doc": ""}, {"name": "startDate", "type": ["null", "string"], "doc": ""}, {"name":
"estimateCompletionDate", "type": ["null", "string"], "doc": ""}, {"name": "title", "type": ["null",
"string"], "doc": ""}, {"name": "phase", "type": ["null", {"type": "enum", "name": "StudyPhase",
"doc": "", "symbols": ["na", "early_phase1", "phase1", "phase1_phase2", "phase2", "phase2_phase3",
"phase3", "phase4"]}], "doc": ""}, {"name": "interventions", "type": ["null", {"type": "array",
"items": {"type": "record", "name": "Intervention", "doc": "", "fields": [{"name":
"interventionType", "type": {"type": "enum", "name": "InterventionType", "doc": "", "symbols":
["drug", "device", "procedure", "biological", "radiation", "behavioral", "genetic",
"dietary_supplement", "combination_product", "diagnostic_test", "other"]}, "doc": ""}, {"name":
"interventionName", "type": "string", "doc": ""}]}}], "doc": ""}, {"name": "conditions", "type":
["null", {"type": "array", "items": "string"}], "doc": ""}, {"name": "primaryPurpose", "type":
["null", {"type": "enum", "name": "PrimaryPurpose", "doc": "", "symbols": ["treatment",
"prevention", "diagnostic", "supportive_care", "screening", "health_services_research",
"basic_science", "device_feasibility", "other"]}], "doc": ""}, {"name": "studyType", "type":
["null", {"type": "enum", "name": "StudyType", "doc": "", "symbols": ["interventional",
"observational", "patient_registry", "expanded_access"]}], "doc": ""}, {"name":
"demogrphicElegibilityCriteria", "type": ["null", {"type": "record", "name":
"DemographicElegibilityCriteria", "fields": [{"name": "sex", "type": {"type": "enum", "name": "Sex",
"namespace": "org.gel.models.participant.avro", "doc": "", "symbols": ["MALE", "FEMALE",
"UNKNOWN"]}}, {"name": "ageRange", "type": ["null", {"type": "record", "name": "AgeRange", "fields":
[{"name": "minimumAge", "type": "int"}, {"name": "maximumAge", "type": "int"}, {"name": "timeunit",
"type": {"type": "enum", "name": "TimeUnit", "symbols": ["years", "months", "weeks", "days",
"hours", "minutes", "na"]}}]}]}]}], "doc": ""}, {"name": "locations", "type": ["null", {"type":
"array", "items": {"type": "record", "name": "TrialLocation", "fields": [{"name": "name", "type":
["null", "string"]}, {"name": "city", "type": ["null", "string"]}, {"name": "country", "type":
["null", "string"]}, {"name": "zip", "type": ["null", "string"]}]}}], "doc": ""}, {"name":
"variantActionable", "type": "boolean", "doc": ""}]}}]}, {"name": "prognosis", "type": ["null",
{"type": "array", "items": {"type": "record", "name": "Prognosis", "fields": [{"name":
"referenceUrl", "type": "string", "doc": ""}, {"name": "prognosis", "type": ["null", {"type":
"enum", "name": "PrognosisClassification", "symbols": ["altered_prognosis", "favourable_prognosis",
"unfavourable_prognosis"]}], "doc": ""}, {"name": "source", "type": ["null", "string"], "doc": ""},
{"name": "references", "type": ["null", {"type": "array", "items": "string"}], "doc": ""}, {"name":
"conditions", "type": ["null", {"type": "array", "items": "string"}], "doc": ""}, {"name":
"description", "type": ["null", "string"], "doc": ""}, {"name": "variantActionable", "type":
"boolean", "doc": ""}]}}]}, {"name": "therapies", "type": ["null", {"type": "array", "items":
{"type": "record", "name": "Therapy", "fields": [{"name": "referenceUrl", "type": "string", "doc":
""}, {"name": "source", "type": ["null", "string"], "doc": ""}, {"name": "references", "type":
["null", {"type": "array", "items": "string"}], "doc": ""}, {"name": "conditions", "type": ["null",
{"type": "array", "items": "string"}], "doc": ""}, {"name": "drugResponse", "type": ["null",
{"type": "array", "items": {"type": "record", "name": "DrugResponse", "fields": [{"name":
"TreatmentAgent", "type": "string", "doc": ""}, {"name": "drugResponseClassification", "type":
{"type": "enum", "name": "DrugResponseClassification", "symbols": ["altered_sensitivity",
"reduced_sensitivity", "increased_sensitivity", "altered_resistance", "increased_resistance",
"reduced_resistance", "increased_risk_of_toxicity", "reduced_risk_of_toxicity", "altered_toxicity",
"adverse_drug_reaction", "indication", "contraindication", "dosing_alteration", "increased_dose",
"reduced_dose", "increased_monitoring", "increased_efficacy", "reduced_efficacy",
"altered_efficacy"]}, "doc": ""}]}}], "doc": ""}, {"name": "otherInterventions", "type": ["null",
{"type": "array", "items": "Intervention"}], "doc": ""}, {"name": "variantActionable", "type":
"boolean", "doc": ""}]}}]}]}], "doc": ""}, {"name": "score", "type": ["null", "float"], "doc": ""},
{"name": "vendorSpecificScores", "type": ["null", {"type": "map", "values": "float"}], "doc": ""},
{"name": "variantClassification", "type": ["null", {"type": "record", "name":
"VariantClassification", "doc": "", "fields": [{"name": "clinicalSignificance", "type": ["null",
{"type": "enum", "name": "ClinicalSignificance", "symbols": ["benign", "likely_benign",
"likely_pathogenic", "pathogenic", "uncertain_significance"]}], "doc": ""}, {"name":
"drugResponseClassification", "type": ["null", "DrugResponseClassification"], "doc": ""}, {"name":
"traitAssociation", "type": ["null", {"type": "enum", "name": "TraitAssociation", "symbols":
["established_risk_allele", "likely_risk_allele", "uncertain_risk_allele", "protective"]}], "doc":
""}, {"name": "tumorigenesisClassification", "type": ["null", {"type": "enum", "name":
"TumorigenesisClassification", "symbols": ["driver", "passenger", "modifier"]}], "doc": ""},
{"name": "functionalEffect", "type": ["null", {"type": "enum", "name": "VariantFunctionalEffect",
"symbols": ["dominant_negative_variant", "gain_of_function_variant", "lethal_variant",
"loss_of_function_variant", "loss_of_heterozygosity", "null_variant"]}], "doc": ""}]}], "doc": ""},
{"name": "guidelineBasedVariantClassification", "type": ["null", {"type": "record", "name":
"GuidelineBasedVariantClassification", "doc": "", "fields": [{"name": "acmgVariantClassification",
"type": ["null", {"type": "record", "name": "AcmgVariantClassification", "doc": "", "fields":
[{"name": "acmgEvidences", "type": {"type": "array", "items": {"type": "record", "name":
"AcmgEvidence", "doc": "", "fields": [{"name": "category", "type": {"type": "enum", "name":
"AcmgEvidenceCategory", "doc": "", "symbols": ["population_data",
"computational_and_predictive_data", "functional_data", "segregation_data", "de_novo_data",
"allelic_data", "other_database", "other_data"]}, "doc": ""}, {"name": "type", "type": {"type":
"enum", "name": "AcmgEvidenceType", "doc": "", "symbols": ["bening", "pathogenic"]}, "doc": ""},
{"name": "weight", "type": {"type": "enum", "name": "AcmgEvidenceWeight", "doc": "", "symbols":
["stand_alone", "supporting", "moderate", "strong", "very_strong"]}, "doc": ""}, {"name":
"modifier", "type": "int", "doc": ""}, {"name": "description", "type": ["null", "string"], "doc":
""}]}}}, {"name": "clinicalSignificance", "type": "ClinicalSignificance"}, {"name": "assessment",
"type": ["null", "string"]}]}]}, {"name": "ampVariantClassification", "type": ["null", {"type":
"record", "name": "AmpVariantClassification", "doc": "", "fields": [{"name": "ampEvidences", "type":
{"type": "array", "items": {"type": "record", "name": "AmpEvidence", "doc": "", "fields": [{"name":
"type", "type": {"type": "enum", "name": "AmpEvidenceType", "doc": "", "symbols": ["mutation_type",
"therapies", "variant_frequencies", "potential_germline", "population_database_presence",
"germline_database_presence", "somatic_database_presence", "impact_predictive_software",
"pathway_involvement", "publications"]}, "doc": ""}, {"name": "evidenceAssessment", "type":
"string", "doc": ""}]}}, "doc": ""}, {"name": "ampTier", "type": {"type": "enum", "name": "AmpTier",
"doc": "", "symbols": ["tierI", "tierII", "tierIII", "tierIV"]}, "doc": ""}, {"name":
"ampClincialOrExperimentalEvidence", "type": ["null", {"type": "array", "items": {"type": "record",
"name": "AmpClincialOrExperimentalEvidence", "doc": "", "fields": [{"name": "category", "type":
{"type": "enum", "name": "AmpClinicalOrExperimentalEvidenceCategory", "doc": "", "symbols":
["therapeutic", "diagnosis", "prognosis"]}, "doc": ""}, {"name": "level", "type": {"type": "enum",
"name": "AmpClinicalOrExperimentalEvidenceLevel", "doc": "", "symbols": ["levelA", "levelB",
"levelC", "levelD"]}, "doc": ""}, {"name": "description", "type": ["null", "string"], "doc":
""}]}}], "doc": ""}, {"name": "assessment", "type": ["null", "string"], "doc": ""}]}]}]}], "doc":
""}, {"name": "algorithmBasedVariantClassifications", "type": ["null", {"type": "array", "items":
{"type": "record", "name": "AlgorithmBasedVariantClassification", "fields": [{"name":
"algorithmName", "type": "string", "doc": ""}, {"name": "classification", "type": "string", "doc":
""}, {"name": "rank", "type": ["null", "int"], "doc": ""}, {"name": "score", "type": ["null",
"int"], "doc": ""}]}}], "doc": ""}, {"name": "tier", "type": ["null", {"type": "enum", "name":
"Tier", "doc": "", "symbols": ["NONE", "TIER1", "TIER2", "TIER3", "TIER4", "TIER5", "TIERA",
"TIERB"]}], "doc": ""}, {"name": "domain", "type": ["null", {"type": "enum", "name": "Domain",
"symbols": ["DOMAIN1", "DOMAIN2", "DOMAIN3", "DOMAIN4", "NONE"]}], "doc": ""}]}}, "doc": ""},
{"name": "variantAttributes", "type": ["null", {"type": "record", "name": "VariantAttributes",
"doc": "", "fields": [{"name": "genomicChanges", "type": ["null", {"type": "array", "items":
"string"}], "doc": ""}, {"name": "cdnaChanges", "type": ["null", {"type": "array", "items":
"string"}], "doc": ""}, {"name": "proteinChanges", "type": ["null", {"type": "array", "items":
"string"}], "doc": ""}, {"name": "additionalTextualVariantAnnotations", "type": ["null", {"type":
"map", "values": "string"}], "doc": ""}, {"name": "references", "type": ["null", {"type": "map",
"values": "string"}], "doc": ""}, {"name": "variantIdentifiers", "type": ["null", {"type": "record",
"name": "VariantIdentifiers", "fields": [{"name": "dbSnpId", "type": ["null", "string"], "doc": ""},
{"name": "cosmicIds", "type": ["null", {"type": "array", "items": "string"}], "doc": ""}, {"name":
"clinVarIds", "type": ["null", {"type": "array", "items": "string"}], "doc": ""}, {"name":
"otherIds", "type": ["null", {"type": "array", "items": "Identifier"}]}]}]}, {"name":
"alleleFrequencies", "type": ["null", {"type": "array", "items": {"type": "record", "name":
"AlleleFrequency", "doc": "", "fields": [{"name": "study", "type": "string", "doc": ""}, {"name":
"population", "type": "string", "doc": ""}, {"name": "alternateFrequency", "type": "float", "doc":
""}]}}], "doc": ""}, {"name": "additionalNumericVariantAnnotations", "type": ["null", {"type":
"map", "values": "float"}], "doc": ""}, {"name": "comments", "type": ["null", {"type": "array",
"items": "string"}], "doc": ""}, {"name": "alleleOrigins", "type": ["null", {"type": "array",
"items": "AlleleOrigin"}], "doc": ""}, {"name": "ihp", "type": ["null", "int"], "doc": ""}, {"name":
"recurrentlyReported", "type": ["null", "boolean"], "doc": ""}, {"name": "fdp50", "type": ["null",
"float"], "doc": ""}, {"name": "others", "type": ["null", {"type": "map", "values": "string"}],
"doc": ""}]}]}]}
"""
    schema = avro_parse(_schemaSource)
    requiredFields = {
        "reportEvents",
        "variantAttributes",
        "variantCalls",
        "variantCoordinates",
    }

    @classmethod
    def isEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'reportEvents': ReportEvent,
            'variantAttributes': VariantAttributes,
            'variantCalls': VariantCall,
            'variantCoordinates': VariantCoordinates,
        }
        return fieldName in embeddedTypes

    @classmethod
    def getEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'reportEvents': ReportEvent,
            'variantAttributes': VariantAttributes,
            'variantCalls': VariantCall,
            'variantCoordinates': VariantCoordinates,
        }

        return embeddedTypes[fieldName]

    __slots__ = [
        'reportEvents', 'variantAttributes', 'variantCalls',
        'variantCoordinates'
    ]

    def __init__(self, **kwargs):
        self.reportEvents = kwargs.get(
            'reportEvents', None)
        self.variantAttributes = kwargs.get(
            'variantAttributes', None)
        self.variantCalls = kwargs.get(
            'variantCalls', None)
        self.variantCoordinates = kwargs.get(
            'variantCoordinates', VariantCoordinates())


class SpatialPattern(object):
    """
    No documentation
    """
    DISTAL = "DISTAL"
    GENERALIZED = "GENERALIZED"
    LOCALIZED = "LOCALIZED"
    PROXIMAL = "PROXIMAL"

    def __hash__(self):
        return str(self).__hash__()


class StandardPhenotype(ProtocolElement):
    """
    Standard phenotype term based on the OBO format (see an example
    here http://snapshot.geneontology.org/ontology/go-basic.obo)
    """
    _schemaSource = """
{"type": "record", "name": "StandardPhenotype", "namespace": "org.gel.models.report.avro", "doc":
"", "fields": [{"name": "id", "type": "string"}, {"name": "name", "type": ["null", "string"]},
{"name": "namespace", "type": ["null", "string"]}, {"name": "definition", "type": ["null",
"string"]}, {"name": "comment", "type": ["null", "string"]}, {"name": "alternativeIds", "type":
["null", "string"]}, {"name": "synonyms", "type": ["null", "string"]}, {"name": "isA", "type":
["null", "string"]}, {"name": "ontology", "type": {"type": "record", "name": "Ontology", "doc": "",
"fields": [{"name": "name", "type": "string"}, {"name": "version", "type": "string"}]}, "doc": ""},
{"name": "matchScore", "type": ["null", "float"], "doc": ""}]}
"""
    schema = avro_parse(_schemaSource)
    requiredFields = {
        "alternativeIds",
        "comment",
        "definition",
        "id",
        "isA",
        "matchScore",
        "name",
        "namespace",
        "ontology",
        "synonyms",
    }

    @classmethod
    def isEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'ontology': Ontology,
        }
        return fieldName in embeddedTypes

    @classmethod
    def getEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'ontology': Ontology,
        }

        return embeddedTypes[fieldName]

    __slots__ = [
        'alternativeIds', 'comment', 'definition', 'id', 'isA',
        'matchScore', 'name', 'namespace', 'ontology', 'synonyms'
    ]

    def __init__(self, **kwargs):
        self.alternativeIds = kwargs.get(
            'alternativeIds', None)
        self.comment = kwargs.get(
            'comment', None)
        self.definition = kwargs.get(
            'definition', None)
        self.id = kwargs.get(
            'id', None)
        self.isA = kwargs.get(
            'isA', None)
        self.matchScore = kwargs.get(
            'matchScore', None)
        self.name = kwargs.get(
            'name', None)
        self.namespace = kwargs.get(
            'namespace', None)
        self.ontology = kwargs.get(
            'ontology', Ontology())
        self.synonyms = kwargs.get(
            'synonyms', None)


class StructuralVariant(ProtocolElement):
    """
    No documentation
    """
    _schemaSource = """
{"type": "record", "name": "StructuralVariant", "namespace": "org.gel.models.report.avro", "fields":
[{"name": "variantType", "type": {"type": "enum", "name": "StructuralVariantType", "symbols":
["ins", "dup", "inv", "amplification", "deletion", "dup_tandem", "del_me", "ins_me"]}, "doc": ""},
{"name": "coordinates", "type": {"type": "record", "name": "Coordinates", "fields": [{"name":
"assembly", "type": {"type": "enum", "name": "Assembly", "doc": "", "symbols": ["GRCh38",
"GRCh37"]}}, {"name": "chromosome", "type": "string"}, {"name": "start", "type": "int"}, {"name":
"end", "type": "int"}, {"name": "ciStart", "type": ["null", {"type": "record", "name":
"ConfidenceInterval", "fields": [{"name": "left", "type": "int"}, {"name": "right", "type":
"int"}]}]}, {"name": "ciEnd", "type": ["null", "ConfidenceInterval"]}]}}, {"name": "leftInsSeq",
"type": ["null", "string"]}, {"name": "rightInsSeq", "type": ["null", "string"]}, {"name":
"reportEvents", "type": {"type": "array", "items": {"type": "record", "name": "ReportEvent", "doc":
"", "fields": [{"name": "reportEventId", "type": "string", "doc": ""}, {"name": "phenotypes",
"type": {"type": "record", "name": "Phenotypes", "doc": "", "fields": [{"name":
"nonStandardPhenotype", "type": ["null", {"type": "array", "items": "string"}], "doc": ""}, {"name":
"standardPhenotypes", "type": ["null", {"type": "array", "items": {"type": "record", "name":
"StandardPhenotype", "doc": "", "fields": [{"name": "id", "type": "string"}, {"name": "name",
"type": ["null", "string"]}, {"name": "namespace", "type": ["null", "string"]}, {"name":
"definition", "type": ["null", "string"]}, {"name": "comment", "type": ["null", "string"]}, {"name":
"alternativeIds", "type": ["null", "string"]}, {"name": "synonyms", "type": ["null", "string"]},
{"name": "isA", "type": ["null", "string"]}, {"name": "ontology", "type": {"type": "record", "name":
"Ontology", "doc": "", "fields": [{"name": "name", "type": "string"}, {"name": "version", "type":
"string"}]}, "doc": ""}, {"name": "matchScore", "type": ["null", "float"], "doc": ""}]}}], "doc":
""}]}, "doc": ""}, {"name": "variantConsequences", "type": {"type": "array", "items": {"type":
"record", "name": "VariantConsequence", "doc": "", "fields": [{"name": "id", "type": "string",
"doc": ""}, {"name": "name", "type": ["null", "string"], "doc": ""}]}}, "doc": ""}, {"name":
"genePanel", "type": ["null", {"type": "record", "name": "GenePanel", "doc": "", "fields": [{"name":
"panelIdentifier", "type": ["null", "string"], "doc": ""}, {"name": "panelName", "type": ["null",
"string"], "doc": ""}, {"name": "panelVersion", "type": ["null", "string"], "doc": ""}, {"name":
"source", "type": ["null", "string"], "doc": ""}]}], "doc": ""}, {"name": "modeOfInheritance",
"type": {"type": "enum", "name": "ModeOfInheritance", "doc": "", "symbols": ["monoallelic",
"monoallelic_not_imprinted", "monoallelic_maternally_imprinted", "monoallelic_paternally_imprinted",
"biallelic", "monoallelic_and_biallelic", "monoallelic_and_more_severe_biallelic",
"xlinked_biallelic", "xlinked_monoallelic", "mitochondrial", "unknown", "na"]}, "doc": ""}, {"name":
"genomicEntities", "type": {"type": "array", "items": {"type": "record", "name": "GenomicEntity",
"doc": "", "fields": [{"name": "type", "type": {"type": "enum", "name": "GenomicEntityType", "doc":
"", "symbols": ["regulatory_region", "gene", "transcript", "intergenic", "gene_fusion",
"genomic_region", "cytobands"]}, "doc": ""}, {"name": "ensemblId", "type": ["null", "string"],
"doc": ""}, {"name": "geneSymbol", "type": ["null", "string"], "doc": ""}, {"name": "otherIds",
"type": ["null", {"type": "array", "items": {"type": "record", "name": "Identifier", "fields":
[{"name": "source", "type": "string", "doc": ""}, {"name": "identifier", "type": "string", "doc":
""}]}}], "doc": ""}]}}, "doc": ""}, {"name": "segregationPattern", "type": ["null", {"type": "enum",
"name": "SegregationPattern", "symbols": ["UniparentalIsodisomy", "SimpleRecessive",
"CompoundHeterozygous", "deNovo", "InheritedAutosomalDominant",
"InheritedAutosomalDominantMaternallyImprinted", "InheritedAutosomalDominantPaternallyImprinted",
"XLinkedCompoundHeterozygous", "XLinkedSimpleRecessive", "XLinkedMonoallelic",
"MitochondrialGenome"]}], "doc": ""}, {"name": "penetrance", "type": ["null", {"type": "enum",
"name": "Penetrance", "namespace": "org.gel.models.participant.avro", "doc": "", "symbols":
["complete", "incomplete"]}], "doc": ""}, {"name": "deNovoQualityScore", "type": ["null", "float"],
"doc": ""}, {"name": "fullyExplainsPhenotype", "type": ["null", "boolean"], "doc": ""}, {"name":
"groupOfVariants", "type": ["null", "int"], "doc": ""}, {"name": "eventJustification", "type":
["null", "string"], "doc": ""}, {"name": "roleInCancer", "type": ["null", {"type": "array", "items":
{"type": "enum", "name": "RoleInCancer", "doc": "", "symbols": ["oncogene", "tumor_suppressor_gene",
"both"]}}], "doc": ""}, {"name": "actions", "type": ["null", {"type": "record", "name": "Actions",
"doc": "", "fields": [{"name": "trials", "type": ["null", {"type": "array", "items": {"type":
"record", "name": "Trial", "fields": [{"name": "studyUrl", "type": "string", "doc": ""}, {"name":
"studyIdentifier", "type": "string", "doc": ""}, {"name": "startDate", "type": ["null", "string"],
"doc": ""}, {"name": "estimateCompletionDate", "type": ["null", "string"], "doc": ""}, {"name":
"title", "type": ["null", "string"], "doc": ""}, {"name": "phase", "type": ["null", {"type": "enum",
"name": "StudyPhase", "doc": "", "symbols": ["na", "early_phase1", "phase1", "phase1_phase2",
"phase2", "phase2_phase3", "phase3", "phase4"]}], "doc": ""}, {"name": "interventions", "type":
["null", {"type": "array", "items": {"type": "record", "name": "Intervention", "doc": "", "fields":
[{"name": "interventionType", "type": {"type": "enum", "name": "InterventionType", "doc": "",
"symbols": ["drug", "device", "procedure", "biological", "radiation", "behavioral", "genetic",
"dietary_supplement", "combination_product", "diagnostic_test", "other"]}, "doc": ""}, {"name":
"interventionName", "type": "string", "doc": ""}]}}], "doc": ""}, {"name": "conditions", "type":
["null", {"type": "array", "items": "string"}], "doc": ""}, {"name": "primaryPurpose", "type":
["null", {"type": "enum", "name": "PrimaryPurpose", "doc": "", "symbols": ["treatment",
"prevention", "diagnostic", "supportive_care", "screening", "health_services_research",
"basic_science", "device_feasibility", "other"]}], "doc": ""}, {"name": "studyType", "type":
["null", {"type": "enum", "name": "StudyType", "doc": "", "symbols": ["interventional",
"observational", "patient_registry", "expanded_access"]}], "doc": ""}, {"name":
"demogrphicElegibilityCriteria", "type": ["null", {"type": "record", "name":
"DemographicElegibilityCriteria", "fields": [{"name": "sex", "type": {"type": "enum", "name": "Sex",
"namespace": "org.gel.models.participant.avro", "doc": "", "symbols": ["MALE", "FEMALE",
"UNKNOWN"]}}, {"name": "ageRange", "type": ["null", {"type": "record", "name": "AgeRange", "fields":
[{"name": "minimumAge", "type": "int"}, {"name": "maximumAge", "type": "int"}, {"name": "timeunit",
"type": {"type": "enum", "name": "TimeUnit", "symbols": ["years", "months", "weeks", "days",
"hours", "minutes", "na"]}}]}]}]}], "doc": ""}, {"name": "locations", "type": ["null", {"type":
"array", "items": {"type": "record", "name": "TrialLocation", "fields": [{"name": "name", "type":
["null", "string"]}, {"name": "city", "type": ["null", "string"]}, {"name": "country", "type":
["null", "string"]}, {"name": "zip", "type": ["null", "string"]}]}}], "doc": ""}, {"name":
"variantActionable", "type": "boolean", "doc": ""}]}}]}, {"name": "prognosis", "type": ["null",
{"type": "array", "items": {"type": "record", "name": "Prognosis", "fields": [{"name":
"referenceUrl", "type": "string", "doc": ""}, {"name": "prognosis", "type": ["null", {"type":
"enum", "name": "PrognosisClassification", "symbols": ["altered_prognosis", "favourable_prognosis",
"unfavourable_prognosis"]}], "doc": ""}, {"name": "source", "type": ["null", "string"], "doc": ""},
{"name": "references", "type": ["null", {"type": "array", "items": "string"}], "doc": ""}, {"name":
"conditions", "type": ["null", {"type": "array", "items": "string"}], "doc": ""}, {"name":
"description", "type": ["null", "string"], "doc": ""}, {"name": "variantActionable", "type":
"boolean", "doc": ""}]}}]}, {"name": "therapies", "type": ["null", {"type": "array", "items":
{"type": "record", "name": "Therapy", "fields": [{"name": "referenceUrl", "type": "string", "doc":
""}, {"name": "source", "type": ["null", "string"], "doc": ""}, {"name": "references", "type":
["null", {"type": "array", "items": "string"}], "doc": ""}, {"name": "conditions", "type": ["null",
{"type": "array", "items": "string"}], "doc": ""}, {"name": "drugResponse", "type": ["null",
{"type": "array", "items": {"type": "record", "name": "DrugResponse", "fields": [{"name":
"TreatmentAgent", "type": "string", "doc": ""}, {"name": "drugResponseClassification", "type":
{"type": "enum", "name": "DrugResponseClassification", "symbols": ["altered_sensitivity",
"reduced_sensitivity", "increased_sensitivity", "altered_resistance", "increased_resistance",
"reduced_resistance", "increased_risk_of_toxicity", "reduced_risk_of_toxicity", "altered_toxicity",
"adverse_drug_reaction", "indication", "contraindication", "dosing_alteration", "increased_dose",
"reduced_dose", "increased_monitoring", "increased_efficacy", "reduced_efficacy",
"altered_efficacy"]}, "doc": ""}]}}], "doc": ""}, {"name": "otherInterventions", "type": ["null",
{"type": "array", "items": "Intervention"}], "doc": ""}, {"name": "variantActionable", "type":
"boolean", "doc": ""}]}}]}]}], "doc": ""}, {"name": "score", "type": ["null", "float"], "doc": ""},
{"name": "vendorSpecificScores", "type": ["null", {"type": "map", "values": "float"}], "doc": ""},
{"name": "variantClassification", "type": ["null", {"type": "record", "name":
"VariantClassification", "doc": "", "fields": [{"name": "clinicalSignificance", "type": ["null",
{"type": "enum", "name": "ClinicalSignificance", "symbols": ["benign", "likely_benign",
"likely_pathogenic", "pathogenic", "uncertain_significance"]}], "doc": ""}, {"name":
"drugResponseClassification", "type": ["null", "DrugResponseClassification"], "doc": ""}, {"name":
"traitAssociation", "type": ["null", {"type": "enum", "name": "TraitAssociation", "symbols":
["established_risk_allele", "likely_risk_allele", "uncertain_risk_allele", "protective"]}], "doc":
""}, {"name": "tumorigenesisClassification", "type": ["null", {"type": "enum", "name":
"TumorigenesisClassification", "symbols": ["driver", "passenger", "modifier"]}], "doc": ""},
{"name": "functionalEffect", "type": ["null", {"type": "enum", "name": "VariantFunctionalEffect",
"symbols": ["dominant_negative_variant", "gain_of_function_variant", "lethal_variant",
"loss_of_function_variant", "loss_of_heterozygosity", "null_variant"]}], "doc": ""}]}], "doc": ""},
{"name": "guidelineBasedVariantClassification", "type": ["null", {"type": "record", "name":
"GuidelineBasedVariantClassification", "doc": "", "fields": [{"name": "acmgVariantClassification",
"type": ["null", {"type": "record", "name": "AcmgVariantClassification", "doc": "", "fields":
[{"name": "acmgEvidences", "type": {"type": "array", "items": {"type": "record", "name":
"AcmgEvidence", "doc": "", "fields": [{"name": "category", "type": {"type": "enum", "name":
"AcmgEvidenceCategory", "doc": "", "symbols": ["population_data",
"computational_and_predictive_data", "functional_data", "segregation_data", "de_novo_data",
"allelic_data", "other_database", "other_data"]}, "doc": ""}, {"name": "type", "type": {"type":
"enum", "name": "AcmgEvidenceType", "doc": "", "symbols": ["bening", "pathogenic"]}, "doc": ""},
{"name": "weight", "type": {"type": "enum", "name": "AcmgEvidenceWeight", "doc": "", "symbols":
["stand_alone", "supporting", "moderate", "strong", "very_strong"]}, "doc": ""}, {"name":
"modifier", "type": "int", "doc": ""}, {"name": "description", "type": ["null", "string"], "doc":
""}]}}}, {"name": "clinicalSignificance", "type": "ClinicalSignificance"}, {"name": "assessment",
"type": ["null", "string"]}]}]}, {"name": "ampVariantClassification", "type": ["null", {"type":
"record", "name": "AmpVariantClassification", "doc": "", "fields": [{"name": "ampEvidences", "type":
{"type": "array", "items": {"type": "record", "name": "AmpEvidence", "doc": "", "fields": [{"name":
"type", "type": {"type": "enum", "name": "AmpEvidenceType", "doc": "", "symbols": ["mutation_type",
"therapies", "variant_frequencies", "potential_germline", "population_database_presence",
"germline_database_presence", "somatic_database_presence", "impact_predictive_software",
"pathway_involvement", "publications"]}, "doc": ""}, {"name": "evidenceAssessment", "type":
"string", "doc": ""}]}}, "doc": ""}, {"name": "ampTier", "type": {"type": "enum", "name": "AmpTier",
"doc": "", "symbols": ["tierI", "tierII", "tierIII", "tierIV"]}, "doc": ""}, {"name":
"ampClincialOrExperimentalEvidence", "type": ["null", {"type": "array", "items": {"type": "record",
"name": "AmpClincialOrExperimentalEvidence", "doc": "", "fields": [{"name": "category", "type":
{"type": "enum", "name": "AmpClinicalOrExperimentalEvidenceCategory", "doc": "", "symbols":
["therapeutic", "diagnosis", "prognosis"]}, "doc": ""}, {"name": "level", "type": {"type": "enum",
"name": "AmpClinicalOrExperimentalEvidenceLevel", "doc": "", "symbols": ["levelA", "levelB",
"levelC", "levelD"]}, "doc": ""}, {"name": "description", "type": ["null", "string"], "doc":
""}]}}], "doc": ""}, {"name": "assessment", "type": ["null", "string"], "doc": ""}]}]}]}], "doc":
""}, {"name": "algorithmBasedVariantClassifications", "type": ["null", {"type": "array", "items":
{"type": "record", "name": "AlgorithmBasedVariantClassification", "fields": [{"name":
"algorithmName", "type": "string", "doc": ""}, {"name": "classification", "type": "string", "doc":
""}, {"name": "rank", "type": ["null", "int"], "doc": ""}, {"name": "score", "type": ["null",
"int"], "doc": ""}]}}], "doc": ""}, {"name": "tier", "type": ["null", {"type": "enum", "name":
"Tier", "doc": "", "symbols": ["NONE", "TIER1", "TIER2", "TIER3", "TIER4", "TIER5", "TIERA",
"TIERB"]}], "doc": ""}, {"name": "domain", "type": ["null", {"type": "enum", "name": "Domain",
"symbols": ["DOMAIN1", "DOMAIN2", "DOMAIN3", "DOMAIN4", "NONE"]}], "doc": ""}]}}}, {"name":
"variantCalls", "type": {"type": "array", "items": {"type": "record", "name": "VariantCall", "doc":
"", "fields": [{"name": "participantId", "type": "string", "doc": ""}, {"name": "sampleId", "type":
"string", "doc": ""}, {"name": "zygosity", "type": {"type": "enum", "name": "Zygosity", "doc": "",
"symbols": ["reference_homozygous", "heterozygous", "alternate_homozygous", "missing",
"half_missing_reference", "half_missing_alternate", "alternate_hemizigous", "reference_hemizigous",
"unk", "na"]}, "doc": ""}, {"name": "phaseGenotype", "type": ["null", {"type": "record", "name":
"PhaseGenotype", "fields": [{"name": "sortedAlleles", "type": {"type": "array", "items": "string"}},
{"name": "phaseSet", "type": "int"}]}], "doc": ""}, {"name": "sampleVariantAlleleFrequency", "type":
["null", "double"], "doc": ""}, {"name": "depthReference", "type": ["null", "int"], "doc": ""},
{"name": "depthAlternate", "type": ["null", "int"], "doc": ""}, {"name": "numberOfCopies", "type":
["null", {"type": "array", "items": {"type": "record", "name": "NumberOfCopies", "fields": [{"name":
"numberOfCopies", "type": "int", "doc": ""}, {"name": "confidenceIntervalMaximum", "type": ["null",
"int"]}, {"name": "confidenceIntervalMinimum", "type": ["null", "int"]}]}}], "doc": ""}, {"name":
"alleleOrigins", "type": ["null", {"type": "array", "items": {"type": "enum", "name":
"AlleleOrigin", "doc": "", "symbols": ["de_novo_variant", "germline_variant", "maternal_variant",
"paternal_variant", "pedigree_specific_variant", "population_specific_variant",
"somatic_variant"]}}], "doc": ""}, {"name": "supportingReadTypes", "type": ["null", {"type":
"array", "items": {"type": "enum", "name": "SupportingReadType", "symbols": ["spanning", "flanking",
"inrepeat"]}}]}]}}, "doc": ""}, {"name": "variantAttributes", "type": ["null", {"type": "record",
"name": "VariantAttributes", "doc": "", "fields": [{"name": "genomicChanges", "type": ["null",
{"type": "array", "items": "string"}], "doc": ""}, {"name": "cdnaChanges", "type": ["null", {"type":
"array", "items": "string"}], "doc": ""}, {"name": "proteinChanges", "type": ["null", {"type":
"array", "items": "string"}], "doc": ""}, {"name": "additionalTextualVariantAnnotations", "type":
["null", {"type": "map", "values": "string"}], "doc": ""}, {"name": "references", "type": ["null",
{"type": "map", "values": "string"}], "doc": ""}, {"name": "variantIdentifiers", "type": ["null",
{"type": "record", "name": "VariantIdentifiers", "fields": [{"name": "dbSnpId", "type": ["null",
"string"], "doc": ""}, {"name": "cosmicIds", "type": ["null", {"type": "array", "items": "string"}],
"doc": ""}, {"name": "clinVarIds", "type": ["null", {"type": "array", "items": "string"}], "doc":
""}, {"name": "otherIds", "type": ["null", {"type": "array", "items": "Identifier"}]}]}]}, {"name":
"alleleFrequencies", "type": ["null", {"type": "array", "items": {"type": "record", "name":
"AlleleFrequency", "doc": "", "fields": [{"name": "study", "type": "string", "doc": ""}, {"name":
"population", "type": "string", "doc": ""}, {"name": "alternateFrequency", "type": "float", "doc":
""}]}}], "doc": ""}, {"name": "additionalNumericVariantAnnotations", "type": ["null", {"type":
"map", "values": "float"}], "doc": ""}, {"name": "comments", "type": ["null", {"type": "array",
"items": "string"}], "doc": ""}, {"name": "alleleOrigins", "type": ["null", {"type": "array",
"items": "AlleleOrigin"}], "doc": ""}, {"name": "ihp", "type": ["null", "int"], "doc": ""}, {"name":
"recurrentlyReported", "type": ["null", "boolean"], "doc": ""}, {"name": "fdp50", "type": ["null",
"float"], "doc": ""}, {"name": "others", "type": ["null", {"type": "map", "values": "string"}],
"doc": ""}]}]}]}
"""
    schema = avro_parse(_schemaSource)
    requiredFields = {
        "coordinates",
        "leftInsSeq",
        "reportEvents",
        "rightInsSeq",
        "variantAttributes",
        "variantCalls",
        "variantType",
    }

    @classmethod
    def isEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'coordinates': Coordinates,
            'reportEvents': ReportEvent,
            'variantAttributes': VariantAttributes,
            'variantCalls': VariantCall,
        }
        return fieldName in embeddedTypes

    @classmethod
    def getEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'coordinates': Coordinates,
            'reportEvents': ReportEvent,
            'variantAttributes': VariantAttributes,
            'variantCalls': VariantCall,
        }

        return embeddedTypes[fieldName]

    __slots__ = [
        'coordinates', 'leftInsSeq', 'reportEvents', 'rightInsSeq',
        'variantAttributes', 'variantCalls', 'variantType'
    ]

    def __init__(self, **kwargs):
        self.coordinates = kwargs.get(
            'coordinates', Coordinates())
        self.leftInsSeq = kwargs.get(
            'leftInsSeq', None)
        self.reportEvents = kwargs.get(
            'reportEvents', None)
        self.rightInsSeq = kwargs.get(
            'rightInsSeq', None)
        self.variantAttributes = kwargs.get(
            'variantAttributes', None)
        self.variantCalls = kwargs.get(
            'variantCalls', None)
        self.variantType = kwargs.get(
            'variantType', None)


class StructuralVariantLevelQuestions(ProtocolElement):
    """
    Structural variant level questions
    """
    _schemaSource = """
{"type": "record", "name": "StructuralVariantLevelQuestions", "namespace":
"org.gel.models.report.avro", "doc": "", "fields": [{"name": "variantType", "type": {"type": "enum",
"name": "StructuralVariantType", "symbols": ["ins", "dup", "inv", "amplification", "deletion",
"dup_tandem", "del_me", "ins_me"]}, "doc": ""}, {"name": "coordinates", "type": {"type": "record",
"name": "Coordinates", "fields": [{"name": "assembly", "type": {"type": "enum", "name": "Assembly",
"doc": "", "symbols": ["GRCh38", "GRCh37"]}}, {"name": "chromosome", "type": "string"}, {"name":
"start", "type": "int"}, {"name": "end", "type": "int"}, {"name": "ciStart", "type": ["null",
{"type": "record", "name": "ConfidenceInterval", "fields": [{"name": "left", "type": "int"},
{"name": "right", "type": "int"}]}]}, {"name": "ciEnd", "type": ["null", "ConfidenceInterval"]}]},
"doc": ""}, {"name": "confirmationDecision", "type": {"type": "enum", "name":
"ConfirmationDecision", "symbols": ["yes", "no", "na"]}, "doc": ""}, {"name": "confirmationOutcome",
"type": {"type": "enum", "name": "ConfirmationOutcome", "symbols": ["yes", "no", "na"]}, "doc": ""},
{"name": "reportingQuestion", "type": {"type": "enum", "name": "ReportingQuestion", "symbols":
["yes", "no", "na"]}, "doc": ""}, {"name": "acmgClassification", "type": {"type": "enum", "name":
"ACMGClassification", "symbols": ["pathogenic_variant", "likely_pathogenic_variant",
"variant_of_unknown_clinical_significance", "likely_benign_variant", "benign_variant",
"not_assessed", "na"]}, "doc": ""}, {"name": "publications", "type": "string", "doc": ""}]}
"""
    schema = avro_parse(_schemaSource)
    requiredFields = {
        "acmgClassification",
        "confirmationDecision",
        "confirmationOutcome",
        "coordinates",
        "publications",
        "reportingQuestion",
        "variantType",
    }

    @classmethod
    def isEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'coordinates': Coordinates,
        }
        return fieldName in embeddedTypes

    @classmethod
    def getEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'coordinates': Coordinates,
        }

        return embeddedTypes[fieldName]

    __slots__ = [
        'acmgClassification', 'confirmationDecision',
        'confirmationOutcome', 'coordinates', 'publications',
        'reportingQuestion', 'variantType'
    ]

    def __init__(self, **kwargs):
        self.acmgClassification = kwargs.get(
            'acmgClassification', None)
        self.confirmationDecision = kwargs.get(
            'confirmationDecision', None)
        self.confirmationOutcome = kwargs.get(
            'confirmationOutcome', None)
        self.coordinates = kwargs.get(
            'coordinates', Coordinates())
        self.publications = kwargs.get(
            'publications', None)
        self.reportingQuestion = kwargs.get(
            'reportingQuestion', None)
        self.variantType = kwargs.get(
            'variantType', None)


class StructuralVariantType(object):
    """
    No documentation
    """
    ins = "ins"
    dup = "dup"
    inv = "inv"
    amplification = "amplification"
    deletion = "deletion"
    dup_tandem = "dup_tandem"
    del_me = "del_me"
    ins_me = "ins_me"

    def __hash__(self):
        return str(self).__hash__()


class StudyPhase(object):
    """
    N/A: Trials without phases (for example, studies of devices or
    behavioural interventions).     Early Phase 1 (Formerly listed as
    "Phase 0"): Exploratory trials, involving very limited human
    exposure, with no therapeutic or diagnostic intent (e.g.,
    screening studies, microdose studies). See FDA guidance on
    exploratory IND studies for more information.     Phase 1:
    Includes initial studies to determine the metabolism and
    pharmacologic actions of drugs in humans, the side effects
    associated with increasing doses, and to gain early evidence of
    effectiveness; may include healthy participants and/or patients.
    Phase 1/Phase 2: Trials that are a combination of phases 1 and 2.
    Phase 2: Includes controlled clinical studies conducted to
    evaluate the effectiveness of the drug for a particular indication
    or indications in participants with the disease or condition under
    study and to determine the common short-term side effects and
    risks.     Phase 2/Phase 3: Trials that are a combination of
    phases 2 and 3.     Phase 3: Includes trials conducted after
    preliminary evidence suggesting effectiveness of the drug has been
    obtained, and are intended to gather additional information to
    evaluate the overall benefit-risk relationship of the drug.
    Phase 4: Studies of FDA-approved drugs to delineate additional
    information including the drug's risks, benefits, and optimal use.
    """
    na = "na"
    early_phase1 = "early_phase1"
    phase1 = "phase1"
    phase1_phase2 = "phase1_phase2"
    phase2 = "phase2"
    phase2_phase3 = "phase2_phase3"
    phase3 = "phase3"
    phase4 = "phase4"

    def __hash__(self):
        return str(self).__hash__()


class StudyType(object):
    """
    * `Interventional (clinical trial)`: Participants are assigned
    prospectively to an intervention or interventions according to a
    protocol to evaluate the effect of the intervention(s) on
    biomedical or other health related outcomes. * `Observational`:
    Studies in human beings in which biomedical and/or health outcomes
    are assessed in pre-defined groups of individuals. Participants in
    the study may receive diagnostic, therapeutic, or other
    interventions, but the investigator does not assign specific
    interventions to the study participants. This includes when
    participants receive interventions as part of routine medical
    care, and a researcher studies the effect of the intervention. *
    `Expanded Access`: An investigational drug product (including
    biological product) available through expanded access for patients
    who do not qualify for enrollment in a clinical trial. Expanded
    Access includes all expanded access types under section 561 of the
    Federal Food, Drug, and Cosmetic Act: (1) for individual patients,
    including emergency use; (2) for intermediate-size patient
    populations; and (3) under a treatment IND or treatment protocol.
    (For more information on data requirements for this Study Type,
    see Expanded Access Data Element Definitions).
    """
    interventional = "interventional"
    observational = "observational"
    patient_registry = "patient_registry"
    expanded_access = "expanded_access"

    def __hash__(self):
        return str(self).__hash__()


class SupportingReadType(object):
    """
    No documentation
    """
    spanning = "spanning"
    flanking = "flanking"
    inrepeat = "inrepeat"

    def __hash__(self):
        return str(self).__hash__()


class TernaryOption(object):
    """
    This defines a yes/no/unknown case
    """
    yes = "yes"
    no = "no"
    unknown = "unknown"

    def __hash__(self):
        return str(self).__hash__()


class Therapy(ProtocolElement):
    """
    No documentation
    """
    _schemaSource = """
{"type": "record", "name": "Therapy", "namespace": "org.gel.models.report.avro", "fields": [{"name":
"referenceUrl", "type": "string", "doc": ""}, {"name": "source", "type": ["null", "string"], "doc":
""}, {"name": "references", "type": ["null", {"type": "array", "items": "string"}], "doc": ""},
{"name": "conditions", "type": ["null", {"type": "array", "items": "string"}], "doc": ""}, {"name":
"drugResponse", "type": ["null", {"type": "array", "items": {"type": "record", "name":
"DrugResponse", "fields": [{"name": "TreatmentAgent", "type": "string", "doc": ""}, {"name":
"drugResponseClassification", "type": {"type": "enum", "name": "DrugResponseClassification",
"symbols": ["altered_sensitivity", "reduced_sensitivity", "increased_sensitivity",
"altered_resistance", "increased_resistance", "reduced_resistance", "increased_risk_of_toxicity",
"reduced_risk_of_toxicity", "altered_toxicity", "adverse_drug_reaction", "indication",
"contraindication", "dosing_alteration", "increased_dose", "reduced_dose", "increased_monitoring",
"increased_efficacy", "reduced_efficacy", "altered_efficacy"]}, "doc": ""}]}}], "doc": ""}, {"name":
"otherInterventions", "type": ["null", {"type": "array", "items": {"type": "record", "name":
"Intervention", "doc": "", "fields": [{"name": "interventionType", "type": {"type": "enum", "name":
"InterventionType", "doc": "", "symbols": ["drug", "device", "procedure", "biological", "radiation",
"behavioral", "genetic", "dietary_supplement", "combination_product", "diagnostic_test", "other"]},
"doc": ""}, {"name": "interventionName", "type": "string", "doc": ""}]}}], "doc": ""}, {"name":
"variantActionable", "type": "boolean", "doc": ""}]}
"""
    schema = avro_parse(_schemaSource)
    requiredFields = {
        "conditions",
        "drugResponse",
        "otherInterventions",
        "referenceUrl",
        "references",
        "source",
        "variantActionable",
    }

    @classmethod
    def isEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'drugResponse': DrugResponse,
            'otherInterventions': Intervention,
        }
        return fieldName in embeddedTypes

    @classmethod
    def getEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'drugResponse': DrugResponse,
            'otherInterventions': Intervention,
        }

        return embeddedTypes[fieldName]

    __slots__ = [
        'conditions', 'drugResponse', 'otherInterventions',
        'referenceUrl', 'references', 'source', 'variantActionable'
    ]

    def __init__(self, **kwargs):
        self.conditions = kwargs.get(
            'conditions', None)
        self.drugResponse = kwargs.get(
            'drugResponse', None)
        self.otherInterventions = kwargs.get(
            'otherInterventions', None)
        self.referenceUrl = kwargs.get(
            'referenceUrl', None)
        self.references = kwargs.get(
            'references', None)
        self.source = kwargs.get(
            'source', None)
        self.variantActionable = kwargs.get(
            'variantActionable', None)


class Tier(object):
    """
    Variant tiers as defined by Genomics England
    """
    NONE = "NONE"
    TIER1 = "TIER1"
    TIER2 = "TIER2"
    TIER3 = "TIER3"
    TIER4 = "TIER4"
    TIER5 = "TIER5"
    TIERA = "TIERA"
    TIERB = "TIERB"

    def __hash__(self):
        return str(self).__hash__()


class TimeUnit(object):
    """
    No documentation
    """
    years = "years"
    months = "months"
    weeks = "weeks"
    days = "days"
    hours = "hours"
    minutes = "minutes"
    na = "na"

    def __hash__(self):
        return str(self).__hash__()


class TissueSource(object):
    """
    No documentation
    """
    BMA_TUMOUR_SORTED_CELLS = "BMA_TUMOUR_SORTED_CELLS"
    CT_GUIDED_BIOPSY = "CT_GUIDED_BIOPSY"
    ENDOSCOPIC_BIOPSY = "ENDOSCOPIC_BIOPSY"
    ENDOSCOPIC_ULTRASOUND_GUIDED_BIOPSY = "ENDOSCOPIC_ULTRASOUND_GUIDED_BIOPSY"
    ENDOSCOPIC_ULTRASOUND_GUIDED_FNA = "ENDOSCOPIC_ULTRASOUND_GUIDED_FNA"
    LAPAROSCOPIC_BIOPSY = "LAPAROSCOPIC_BIOPSY"
    LAPAROSCOPIC_EXCISION = "LAPAROSCOPIC_EXCISION"
    MRI_GUIDED_BIOPSY = "MRI_GUIDED_BIOPSY"
    NON_GUIDED_BIOPSY = "NON_GUIDED_BIOPSY"
    SURGICAL_RESECTION = "SURGICAL_RESECTION"
    STEREOTACTICALLY_GUIDED_BIOPSY = "STEREOTACTICALLY_GUIDED_BIOPSY"
    USS_GUIDED_BIOPSY = "USS_GUIDED_BIOPSY"
    NON_STANDARD_BIOPSY = "NON_STANDARD_BIOPSY"
    NOT_SPECIFIED = "NOT_SPECIFIED"

    def __hash__(self):
        return str(self).__hash__()


class TraitAssociation(object):
    """
    No documentation
    """
    established_risk_allele = "established_risk_allele"
    likely_risk_allele = "likely_risk_allele"
    uncertain_risk_allele = "uncertain_risk_allele"
    protective = "protective"

    def __hash__(self):
        return str(self).__hash__()


class Trial(ProtocolElement):
    """
    No documentation
    """
    _schemaSource = """
{"type": "record", "name": "Trial", "namespace": "org.gel.models.report.avro", "fields": [{"name":
"studyUrl", "type": "string", "doc": ""}, {"name": "studyIdentifier", "type": "string", "doc": ""},
{"name": "startDate", "type": ["null", "string"], "doc": ""}, {"name": "estimateCompletionDate",
"type": ["null", "string"], "doc": ""}, {"name": "title", "type": ["null", "string"], "doc": ""},
{"name": "phase", "type": ["null", {"type": "enum", "name": "StudyPhase", "doc": "", "symbols":
["na", "early_phase1", "phase1", "phase1_phase2", "phase2", "phase2_phase3", "phase3", "phase4"]}],
"doc": ""}, {"name": "interventions", "type": ["null", {"type": "array", "items": {"type": "record",
"name": "Intervention", "doc": "", "fields": [{"name": "interventionType", "type": {"type": "enum",
"name": "InterventionType", "doc": "", "symbols": ["drug", "device", "procedure", "biological",
"radiation", "behavioral", "genetic", "dietary_supplement", "combination_product",
"diagnostic_test", "other"]}, "doc": ""}, {"name": "interventionName", "type": "string", "doc":
""}]}}], "doc": ""}, {"name": "conditions", "type": ["null", {"type": "array", "items": "string"}],
"doc": ""}, {"name": "primaryPurpose", "type": ["null", {"type": "enum", "name": "PrimaryPurpose",
"doc": "", "symbols": ["treatment", "prevention", "diagnostic", "supportive_care", "screening",
"health_services_research", "basic_science", "device_feasibility", "other"]}], "doc": ""}, {"name":
"studyType", "type": ["null", {"type": "enum", "name": "StudyType", "doc": "", "symbols":
["interventional", "observational", "patient_registry", "expanded_access"]}], "doc": ""}, {"name":
"demogrphicElegibilityCriteria", "type": ["null", {"type": "record", "name":
"DemographicElegibilityCriteria", "fields": [{"name": "sex", "type": {"type": "enum", "name": "Sex",
"namespace": "org.gel.models.participant.avro", "doc": "", "symbols": ["MALE", "FEMALE",
"UNKNOWN"]}}, {"name": "ageRange", "type": ["null", {"type": "record", "name": "AgeRange", "fields":
[{"name": "minimumAge", "type": "int"}, {"name": "maximumAge", "type": "int"}, {"name": "timeunit",
"type": {"type": "enum", "name": "TimeUnit", "symbols": ["years", "months", "weeks", "days",
"hours", "minutes", "na"]}}]}]}]}], "doc": ""}, {"name": "locations", "type": ["null", {"type":
"array", "items": {"type": "record", "name": "TrialLocation", "fields": [{"name": "name", "type":
["null", "string"]}, {"name": "city", "type": ["null", "string"]}, {"name": "country", "type":
["null", "string"]}, {"name": "zip", "type": ["null", "string"]}]}}], "doc": ""}, {"name":
"variantActionable", "type": "boolean", "doc": ""}]}
"""
    schema = avro_parse(_schemaSource)
    requiredFields = {
        "conditions",
        "demogrphicElegibilityCriteria",
        "estimateCompletionDate",
        "interventions",
        "locations",
        "phase",
        "primaryPurpose",
        "startDate",
        "studyIdentifier",
        "studyType",
        "studyUrl",
        "title",
        "variantActionable",
    }

    @classmethod
    def isEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'demogrphicElegibilityCriteria': DemographicElegibilityCriteria,
            'interventions': Intervention,
            'locations': TrialLocation,
        }
        return fieldName in embeddedTypes

    @classmethod
    def getEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'demogrphicElegibilityCriteria': DemographicElegibilityCriteria,
            'interventions': Intervention,
            'locations': TrialLocation,
        }

        return embeddedTypes[fieldName]

    __slots__ = [
        'conditions', 'demogrphicElegibilityCriteria',
        'estimateCompletionDate', 'interventions', 'locations',
        'phase', 'primaryPurpose', 'startDate', 'studyIdentifier',
        'studyType', 'studyUrl', 'title', 'variantActionable'
    ]

    def __init__(self, **kwargs):
        self.conditions = kwargs.get(
            'conditions', None)
        self.demogrphicElegibilityCriteria = kwargs.get(
            'demogrphicElegibilityCriteria', None)
        self.estimateCompletionDate = kwargs.get(
            'estimateCompletionDate', None)
        self.interventions = kwargs.get(
            'interventions', None)
        self.locations = kwargs.get(
            'locations', None)
        self.phase = kwargs.get(
            'phase', None)
        self.primaryPurpose = kwargs.get(
            'primaryPurpose', None)
        self.startDate = kwargs.get(
            'startDate', None)
        self.studyIdentifier = kwargs.get(
            'studyIdentifier', None)
        self.studyType = kwargs.get(
            'studyType', None)
        self.studyUrl = kwargs.get(
            'studyUrl', None)
        self.title = kwargs.get(
            'title', None)
        self.variantActionable = kwargs.get(
            'variantActionable', None)


class TrialLocation(ProtocolElement):
    """
    No documentation
    """
    _schemaSource = """
{"type": "record", "name": "TrialLocation", "namespace": "org.gel.models.report.avro", "fields":
[{"name": "name", "type": ["null", "string"]}, {"name": "city", "type": ["null", "string"]},
{"name": "country", "type": ["null", "string"]}, {"name": "zip", "type": ["null", "string"]}]}
"""
    schema = avro_parse(_schemaSource)
    requiredFields = {
        "city",
        "country",
        "name",
        "zip",
    }

    @classmethod
    def isEmbeddedType(cls, fieldName):
        embeddedTypes = {}
        return fieldName in embeddedTypes

    @classmethod
    def getEmbeddedType(cls, fieldName):
        embeddedTypes = {}

        return embeddedTypes[fieldName]

    __slots__ = [
        'city', 'country', 'name', 'zip'
    ]

    def __init__(self, **kwargs):
        self.city = kwargs.get(
            'city', None)
        self.country = kwargs.get(
            'country', None)
        self.name = kwargs.get(
            'name', None)
        self.zip = kwargs.get(
            'zip', None)


class TumorigenesisClassification(object):
    """
    No documentation
    """
    driver = "driver"
    passenger = "passenger"
    modifier = "modifier"

    def __hash__(self):
        return str(self).__hash__()


class TumourContent(object):
    """
    No documentation
    """
    High = "High"
    Medium = "Medium"
    Low = "Low"

    def __hash__(self):
        return str(self).__hash__()


class TumourSample(ProtocolElement):
    """
    A tumour sample
    """
    _schemaSource = """
{"type": "record", "name": "TumourSample", "namespace": "org.gel.models.participant.avro", "doc":
"", "fields": [{"name": "sampleId", "type": "string", "doc": ""}, {"name": "labSampleId", "type":
"string", "doc": ""}, {"name": "LDPCode", "type": "string", "doc": ""}, {"name": "tumourId", "type":
"string", "doc": ""}, {"name": "programmePhase", "type": ["null", {"type": "enum", "name":
"ProgrammePhase", "symbols": ["CRUK", "OXFORD", "CLL", "IIP", "MAIN", "EXPT"]}], "doc": ""},
{"name": "diseaseType", "type": ["null", "string"], "doc": ""}, {"name": "diseaseSubType", "type":
["null", "string"], "doc": ""}, {"name": "clinicalSampleDateTime", "type": ["null", "string"],
"doc": ""}, {"name": "tumourType", "type": ["null", {"type": "enum", "name": "TumourType",
"symbols": ["PRIMARY", "METASTATIC_RECURRENCE", "RECURRENCE_OF_PRIMARY_TUMOUR", "METASTASES"]}],
"doc": ""}, {"name": "tumourContent", "type": ["null", {"type": "enum", "name": "TumourContent",
"symbols": ["High", "Medium", "Low"]}], "doc": ""}, {"name": "source", "type": ["null", {"type":
"enum", "name": "SampleSource", "doc": "", "symbols": ["TUMOUR",
"BONE_MARROW_ASPIRATE_TUMOUR_SORTED_CELLS", "BONE_MARROW_ASPIRATE_TUMOUR_CELLS", "BLOOD", "SALIVA",
"FIBROBLAST", "TISSUE"]}], "doc": ""}, {"name": "preparationMethod", "type": ["null", {"type":
"enum", "name": "PreparationMethod", "symbols": ["EDTA", "ORAGENE", "FF", "FFPE",
"CD128_SORTED_CELLS", "ASPIRATE"]}], "doc": ""}, {"name": "tissueSource", "type": ["null", {"type":
"enum", "name": "TissueSource", "symbols": ["BMA_TUMOUR_SORTED_CELLS", "CT_GUIDED_BIOPSY",
"ENDOSCOPIC_BIOPSY", "ENDOSCOPIC_ULTRASOUND_GUIDED_BIOPSY", "ENDOSCOPIC_ULTRASOUND_GUIDED_FNA",
"LAPAROSCOPIC_BIOPSY", "LAPAROSCOPIC_EXCISION", "MRI_GUIDED_BIOPSY", "NON_GUIDED_BIOPSY",
"SURGICAL_RESECTION", "STEREOTACTICALLY_GUIDED_BIOPSY", "USS_GUIDED_BIOPSY", "NON_STANDARD_BIOPSY",
"NOT_SPECIFIED"]}], "doc": ""}, {"name": "product", "type": ["null", {"type": "enum", "name":
"Product", "symbols": ["DNA", "RNA"]}], "doc": ""}, {"name": "morphologyICD", "type": ["null",
"string"], "doc": ""}, {"name": "morphologySnomedCT", "type": ["null", "string"], "doc": ""},
{"name": "morphologySnomedRT", "type": ["null", "string"], "doc": ""}, {"name": "topographyICD",
"type": ["null", "string"], "doc": ""}, {"name": "topographySnomedCT", "type": ["null", "string"],
"doc": ""}, {"name": "topographySnomedRT", "type": ["null", "string"], "doc": ""}]}
"""
    schema = avro_parse(_schemaSource)
    requiredFields = {
        "LDPCode",
        "clinicalSampleDateTime",
        "diseaseSubType",
        "diseaseType",
        "labSampleId",
        "morphologyICD",
        "morphologySnomedCT",
        "morphologySnomedRT",
        "preparationMethod",
        "product",
        "programmePhase",
        "sampleId",
        "source",
        "tissueSource",
        "topographyICD",
        "topographySnomedCT",
        "topographySnomedRT",
        "tumourContent",
        "tumourId",
        "tumourType",
    }

    @classmethod
    def isEmbeddedType(cls, fieldName):
        embeddedTypes = {}
        return fieldName in embeddedTypes

    @classmethod
    def getEmbeddedType(cls, fieldName):
        embeddedTypes = {}

        return embeddedTypes[fieldName]

    __slots__ = [
        'LDPCode', 'clinicalSampleDateTime', 'diseaseSubType',
        'diseaseType', 'labSampleId', 'morphologyICD',
        'morphologySnomedCT', 'morphologySnomedRT',
        'preparationMethod', 'product', 'programmePhase', 'sampleId',
        'source', 'tissueSource', 'topographyICD',
        'topographySnomedCT', 'topographySnomedRT', 'tumourContent',
        'tumourId', 'tumourType'
    ]

    def __init__(self, **kwargs):
        self.LDPCode = kwargs.get(
            'LDPCode', None)
        self.clinicalSampleDateTime = kwargs.get(
            'clinicalSampleDateTime', None)
        self.diseaseSubType = kwargs.get(
            'diseaseSubType', None)
        self.diseaseType = kwargs.get(
            'diseaseType', None)
        self.labSampleId = kwargs.get(
            'labSampleId', None)
        self.morphologyICD = kwargs.get(
            'morphologyICD', None)
        self.morphologySnomedCT = kwargs.get(
            'morphologySnomedCT', None)
        self.morphologySnomedRT = kwargs.get(
            'morphologySnomedRT', None)
        self.preparationMethod = kwargs.get(
            'preparationMethod', None)
        self.product = kwargs.get(
            'product', None)
        self.programmePhase = kwargs.get(
            'programmePhase', None)
        self.sampleId = kwargs.get(
            'sampleId', None)
        self.source = kwargs.get(
            'source', None)
        self.tissueSource = kwargs.get(
            'tissueSource', None)
        self.topographyICD = kwargs.get(
            'topographyICD', None)
        self.topographySnomedCT = kwargs.get(
            'topographySnomedCT', None)
        self.topographySnomedRT = kwargs.get(
            'topographySnomedRT', None)
        self.tumourContent = kwargs.get(
            'tumourContent', None)
        self.tumourId = kwargs.get(
            'tumourId', None)
        self.tumourType = kwargs.get(
            'tumourType', None)


class TumourType(object):
    """
    No documentation
    """
    PRIMARY = "PRIMARY"
    METASTATIC_RECURRENCE = "METASTATIC_RECURRENCE"
    RECURRENCE_OF_PRIMARY_TUMOUR = "RECURRENCE_OF_PRIMARY_TUMOUR"
    METASTASES = "METASTASES"

    def __hash__(self):
        return str(self).__hash__()


class TypeOfAdditionalFinding(object):
    """
    No documentation
    """
    domain3 = "domain3"
    tier3 = "tier3"
    sv_cnv = "sv_cnv"
    mutational_signatures = "mutational_signatures"
    mutational_burden = "mutational_burden"
    other = "other"

    def __hash__(self):
        return str(self).__hash__()


class UniparentalDisomy(ProtocolElement):
    """
    No documentation
    """
    _schemaSource = """
{"type": "record", "name": "UniparentalDisomy", "namespace": "org.gel.models.report.avro", "fields":
[{"name": "assembly", "type": {"type": "enum", "name": "Assembly", "doc": "", "symbols": ["GRCh38",
"GRCh37"]}, "doc": ""}, {"name": "chromosome", "type": "string", "doc": ""}, {"name": "complete",
"type": ["null", "boolean"], "doc": ""}, {"name": "origin", "type": {"type": "enum", "name":
"UniparentalDisomyOrigin", "symbols": ["paternal", "maternal", "unknown"]}, "doc": ""}, {"name":
"uniparentalDisomyFragments", "type": ["null", {"type": "array", "items": {"type": "record", "name":
"UniparentalDisomyFragment", "fields": [{"name": "coordinates", "type": ["null", {"type": "record",
"name": "Coordinates", "fields": [{"name": "assembly", "type": "Assembly"}, {"name": "chromosome",
"type": "string"}, {"name": "start", "type": "int"}, {"name": "end", "type": "int"}, {"name":
"ciStart", "type": ["null", {"type": "record", "name": "ConfidenceInterval", "fields": [{"name":
"left", "type": "int"}, {"name": "right", "type": "int"}]}]}, {"name": "ciEnd", "type": ["null",
"ConfidenceInterval"]}]}], "doc": ""}, {"name": "uniparentalDisomyType", "type": {"type": "enum",
"name": "UniparentalDisomyType", "symbols": ["isodisomy", "heterodisomy", "both"]}, "doc": ""}]}}],
"doc": ""}, {"name": "participantId", "type": "string", "doc": ""}, {"name":
"uniparentalDisomyEvidences", "type": ["null", {"type": "record", "name":
"UniparentalDisomyEvidences", "fields": [{"name": "ibds", "type": ["null", {"type": "array",
"items": {"type": "record", "name": "IdentityByDescent", "fields": [{"name": "relatedSample",
"type": "string"}, {"name": "ibd0", "type": "float"}, {"name": "ibd1", "type": "float"}, {"name":
"ibd2", "type": "float"}, {"name": "pihat", "type": "float"}]}}]}]}], "doc": ""}]}
"""
    schema = avro_parse(_schemaSource)
    requiredFields = {
        "assembly",
        "chromosome",
        "complete",
        "origin",
        "participantId",
        "uniparentalDisomyEvidences",
        "uniparentalDisomyFragments",
    }

    @classmethod
    def isEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'uniparentalDisomyEvidences': UniparentalDisomyEvidences,
            'uniparentalDisomyFragments': UniparentalDisomyFragment,
        }
        return fieldName in embeddedTypes

    @classmethod
    def getEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'uniparentalDisomyEvidences': UniparentalDisomyEvidences,
            'uniparentalDisomyFragments': UniparentalDisomyFragment,
        }

        return embeddedTypes[fieldName]

    __slots__ = [
        'assembly', 'chromosome', 'complete', 'origin',
        'participantId', 'uniparentalDisomyEvidences',
        'uniparentalDisomyFragments'
    ]

    def __init__(self, **kwargs):
        self.assembly = kwargs.get(
            'assembly', None)
        self.chromosome = kwargs.get(
            'chromosome', None)
        self.complete = kwargs.get(
            'complete', None)
        self.origin = kwargs.get(
            'origin', None)
        self.participantId = kwargs.get(
            'participantId', None)
        self.uniparentalDisomyEvidences = kwargs.get(
            'uniparentalDisomyEvidences', None)
        self.uniparentalDisomyFragments = kwargs.get(
            'uniparentalDisomyFragments', None)


class UniparentalDisomyEvidences(ProtocolElement):
    """
    No documentation
    """
    _schemaSource = """
{"type": "record", "name": "UniparentalDisomyEvidences", "namespace": "org.gel.models.report.avro",
"fields": [{"name": "ibds", "type": ["null", {"type": "array", "items": {"type": "record", "name":
"IdentityByDescent", "fields": [{"name": "relatedSample", "type": "string"}, {"name": "ibd0",
"type": "float"}, {"name": "ibd1", "type": "float"}, {"name": "ibd2", "type": "float"}, {"name":
"pihat", "type": "float"}]}}]}]}
"""
    schema = avro_parse(_schemaSource)
    requiredFields = {
        "ibds",
    }

    @classmethod
    def isEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'ibds': IdentityByDescent,
        }
        return fieldName in embeddedTypes

    @classmethod
    def getEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'ibds': IdentityByDescent,
        }

        return embeddedTypes[fieldName]

    __slots__ = [
        'ibds'
    ]

    def __init__(self, **kwargs):
        self.ibds = kwargs.get(
            'ibds', None)


class UniparentalDisomyFragment(ProtocolElement):
    """
    No documentation
    """
    _schemaSource = """
{"type": "record", "name": "UniparentalDisomyFragment", "namespace": "org.gel.models.report.avro",
"fields": [{"name": "coordinates", "type": ["null", {"type": "record", "name": "Coordinates",
"fields": [{"name": "assembly", "type": {"type": "enum", "name": "Assembly", "doc": "", "symbols":
["GRCh38", "GRCh37"]}}, {"name": "chromosome", "type": "string"}, {"name": "start", "type": "int"},
{"name": "end", "type": "int"}, {"name": "ciStart", "type": ["null", {"type": "record", "name":
"ConfidenceInterval", "fields": [{"name": "left", "type": "int"}, {"name": "right", "type":
"int"}]}]}, {"name": "ciEnd", "type": ["null", "ConfidenceInterval"]}]}], "doc": ""}, {"name":
"uniparentalDisomyType", "type": {"type": "enum", "name": "UniparentalDisomyType", "symbols":
["isodisomy", "heterodisomy", "both"]}, "doc": ""}]}
"""
    schema = avro_parse(_schemaSource)
    requiredFields = {
        "coordinates",
        "uniparentalDisomyType",
    }

    @classmethod
    def isEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'coordinates': Coordinates,
        }
        return fieldName in embeddedTypes

    @classmethod
    def getEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'coordinates': Coordinates,
        }

        return embeddedTypes[fieldName]

    __slots__ = [
        'coordinates', 'uniparentalDisomyType'
    ]

    def __init__(self, **kwargs):
        self.coordinates = kwargs.get(
            'coordinates', None)
        self.uniparentalDisomyType = kwargs.get(
            'uniparentalDisomyType', None)


class UniparentalDisomyOrigin(object):
    """
    No documentation
    """
    paternal = "paternal"
    maternal = "maternal"
    unknown = "unknown"

    def __hash__(self):
        return str(self).__hash__()


class UniparentalDisomyType(object):
    """
    No documentation
    """
    isodisomy = "isodisomy"
    heterodisomy = "heterodisomy"
    both = "both"

    def __hash__(self):
        return str(self).__hash__()


class User(ProtocolElement):
    """
    No documentation
    """
    _schemaSource = """
{"type": "record", "name": "User", "namespace": "org.gel.models.report.avro", "fields": [{"name":
"username", "type": "string"}, {"name": "role", "type": "string"}, {"name": "email", "type":
"string"}, {"name": "groups", "type": {"type": "array", "items": "string"}}]}
"""
    schema = avro_parse(_schemaSource)
    requiredFields = {
        "email",
        "groups",
        "role",
        "username",
    }

    @classmethod
    def isEmbeddedType(cls, fieldName):
        embeddedTypes = {}
        return fieldName in embeddedTypes

    @classmethod
    def getEmbeddedType(cls, fieldName):
        embeddedTypes = {}

        return embeddedTypes[fieldName]

    __slots__ = [
        'email', 'groups', 'role', 'username'
    ]

    def __init__(self, **kwargs):
        self.email = kwargs.get(
            'email', None)
        self.groups = kwargs.get(
            'groups', None)
        self.role = kwargs.get(
            'role', None)
        self.username = kwargs.get(
            'username', None)


class ValidationResult(object):
    """
    No documentation
    """
    NotPerformed = "NotPerformed"
    Confirmed = "Confirmed"
    NotConfirmed = "NotConfirmed"

    def __hash__(self):
        return str(self).__hash__()


class VariantAttributes(ProtocolElement):
    """
    Some additional variant attributes
    """
    _schemaSource = """
{"type": "record", "name": "VariantAttributes", "namespace": "org.gel.models.report.avro", "doc":
"", "fields": [{"name": "genomicChanges", "type": ["null", {"type": "array", "items": "string"}],
"doc": ""}, {"name": "cdnaChanges", "type": ["null", {"type": "array", "items": "string"}], "doc":
""}, {"name": "proteinChanges", "type": ["null", {"type": "array", "items": "string"}], "doc": ""},
{"name": "additionalTextualVariantAnnotations", "type": ["null", {"type": "map", "values":
"string"}], "doc": ""}, {"name": "references", "type": ["null", {"type": "map", "values":
"string"}], "doc": ""}, {"name": "variantIdentifiers", "type": ["null", {"type": "record", "name":
"VariantIdentifiers", "fields": [{"name": "dbSnpId", "type": ["null", "string"], "doc": ""},
{"name": "cosmicIds", "type": ["null", {"type": "array", "items": "string"}], "doc": ""}, {"name":
"clinVarIds", "type": ["null", {"type": "array", "items": "string"}], "doc": ""}, {"name":
"otherIds", "type": ["null", {"type": "array", "items": {"type": "record", "name": "Identifier",
"fields": [{"name": "source", "type": "string", "doc": ""}, {"name": "identifier", "type": "string",
"doc": ""}]}}]}]}]}, {"name": "alleleFrequencies", "type": ["null", {"type": "array", "items":
{"type": "record", "name": "AlleleFrequency", "doc": "", "fields": [{"name": "study", "type":
"string", "doc": ""}, {"name": "population", "type": "string", "doc": ""}, {"name":
"alternateFrequency", "type": "float", "doc": ""}]}}], "doc": ""}, {"name":
"additionalNumericVariantAnnotations", "type": ["null", {"type": "map", "values": "float"}], "doc":
""}, {"name": "comments", "type": ["null", {"type": "array", "items": "string"}], "doc": ""},
{"name": "alleleOrigins", "type": ["null", {"type": "array", "items": {"type": "enum", "name":
"AlleleOrigin", "doc": "", "symbols": ["de_novo_variant", "germline_variant", "maternal_variant",
"paternal_variant", "pedigree_specific_variant", "population_specific_variant",
"somatic_variant"]}}], "doc": ""}, {"name": "ihp", "type": ["null", "int"], "doc": ""}, {"name":
"recurrentlyReported", "type": ["null", "boolean"], "doc": ""}, {"name": "fdp50", "type": ["null",
"float"], "doc": ""}, {"name": "others", "type": ["null", {"type": "map", "values": "string"}],
"doc": ""}]}
"""
    schema = avro_parse(_schemaSource)
    requiredFields = {
        "additionalNumericVariantAnnotations",
        "additionalTextualVariantAnnotations",
        "alleleFrequencies",
        "alleleOrigins",
        "cdnaChanges",
        "comments",
        "fdp50",
        "genomicChanges",
        "ihp",
        "others",
        "proteinChanges",
        "recurrentlyReported",
        "references",
        "variantIdentifiers",
    }

    @classmethod
    def isEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'alleleFrequencies': AlleleFrequency,
            'variantIdentifiers': VariantIdentifiers,
        }
        return fieldName in embeddedTypes

    @classmethod
    def getEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'alleleFrequencies': AlleleFrequency,
            'variantIdentifiers': VariantIdentifiers,
        }

        return embeddedTypes[fieldName]

    __slots__ = [
        'additionalNumericVariantAnnotations',
        'additionalTextualVariantAnnotations', 'alleleFrequencies',
        'alleleOrigins', 'cdnaChanges', 'comments', 'fdp50',
        'genomicChanges', 'ihp', 'others', 'proteinChanges',
        'recurrentlyReported', 'references', 'variantIdentifiers'
    ]

    def __init__(self, **kwargs):
        self.additionalNumericVariantAnnotations = kwargs.get(
            'additionalNumericVariantAnnotations', None)
        self.additionalTextualVariantAnnotations = kwargs.get(
            'additionalTextualVariantAnnotations', None)
        self.alleleFrequencies = kwargs.get(
            'alleleFrequencies', None)
        self.alleleOrigins = kwargs.get(
            'alleleOrigins', None)
        self.cdnaChanges = kwargs.get(
            'cdnaChanges', None)
        self.comments = kwargs.get(
            'comments', None)
        self.fdp50 = kwargs.get(
            'fdp50', None)
        self.genomicChanges = kwargs.get(
            'genomicChanges', None)
        self.ihp = kwargs.get(
            'ihp', None)
        self.others = kwargs.get(
            'others', None)
        self.proteinChanges = kwargs.get(
            'proteinChanges', None)
        self.recurrentlyReported = kwargs.get(
            'recurrentlyReported', None)
        self.references = kwargs.get(
            'references', None)
        self.variantIdentifiers = kwargs.get(
            'variantIdentifiers', None)


class VariantCall(ProtocolElement):
    """
    This is intended to hold the genotypes for the family members.
    This assumes that varinats have been split before.     In
    principle it is a phased zygosity as in VCF spec and called by the
    analysis provider if further phasing is conducted
    """
    _schemaSource = """
{"type": "record", "name": "VariantCall", "namespace": "org.gel.models.report.avro", "doc": "",
"fields": [{"name": "participantId", "type": "string", "doc": ""}, {"name": "sampleId", "type":
"string", "doc": ""}, {"name": "zygosity", "type": {"type": "enum", "name": "Zygosity", "doc": "",
"symbols": ["reference_homozygous", "heterozygous", "alternate_homozygous", "missing",
"half_missing_reference", "half_missing_alternate", "alternate_hemizigous", "reference_hemizigous",
"unk", "na"]}, "doc": ""}, {"name": "phaseGenotype", "type": ["null", {"type": "record", "name":
"PhaseGenotype", "fields": [{"name": "sortedAlleles", "type": {"type": "array", "items": "string"}},
{"name": "phaseSet", "type": "int"}]}], "doc": ""}, {"name": "sampleVariantAlleleFrequency", "type":
["null", "double"], "doc": ""}, {"name": "depthReference", "type": ["null", "int"], "doc": ""},
{"name": "depthAlternate", "type": ["null", "int"], "doc": ""}, {"name": "numberOfCopies", "type":
["null", {"type": "array", "items": {"type": "record", "name": "NumberOfCopies", "fields": [{"name":
"numberOfCopies", "type": "int", "doc": ""}, {"name": "confidenceIntervalMaximum", "type": ["null",
"int"]}, {"name": "confidenceIntervalMinimum", "type": ["null", "int"]}]}}], "doc": ""}, {"name":
"alleleOrigins", "type": ["null", {"type": "array", "items": {"type": "enum", "name":
"AlleleOrigin", "doc": "", "symbols": ["de_novo_variant", "germline_variant", "maternal_variant",
"paternal_variant", "pedigree_specific_variant", "population_specific_variant",
"somatic_variant"]}}], "doc": ""}, {"name": "supportingReadTypes", "type": ["null", {"type":
"array", "items": {"type": "enum", "name": "SupportingReadType", "symbols": ["spanning", "flanking",
"inrepeat"]}}]}]}
"""
    schema = avro_parse(_schemaSource)
    requiredFields = {
        "alleleOrigins",
        "depthAlternate",
        "depthReference",
        "numberOfCopies",
        "participantId",
        "phaseGenotype",
        "sampleId",
        "sampleVariantAlleleFrequency",
        "supportingReadTypes",
        "zygosity",
    }

    @classmethod
    def isEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'numberOfCopies': NumberOfCopies,
            'phaseGenotype': PhaseGenotype,
        }
        return fieldName in embeddedTypes

    @classmethod
    def getEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'numberOfCopies': NumberOfCopies,
            'phaseGenotype': PhaseGenotype,
        }

        return embeddedTypes[fieldName]

    __slots__ = [
        'alleleOrigins', 'depthAlternate', 'depthReference',
        'numberOfCopies', 'participantId', 'phaseGenotype',
        'sampleId', 'sampleVariantAlleleFrequency',
        'supportingReadTypes', 'zygosity'
    ]

    def __init__(self, **kwargs):
        self.alleleOrigins = kwargs.get(
            'alleleOrigins', None)
        self.depthAlternate = kwargs.get(
            'depthAlternate', None)
        self.depthReference = kwargs.get(
            'depthReference', None)
        self.numberOfCopies = kwargs.get(
            'numberOfCopies', None)
        self.participantId = kwargs.get(
            'participantId', None)
        self.phaseGenotype = kwargs.get(
            'phaseGenotype', None)
        self.sampleId = kwargs.get(
            'sampleId', None)
        self.sampleVariantAlleleFrequency = kwargs.get(
            'sampleVariantAlleleFrequency', None)
        self.supportingReadTypes = kwargs.get(
            'supportingReadTypes', None)
        self.zygosity = kwargs.get(
            'zygosity', None)


class VariantClassification(ProtocolElement):
    """
    The variant classification according to different properties.
    """
    _schemaSource = """
{"type": "record", "name": "VariantClassification", "namespace": "org.gel.models.report.avro",
"doc": "", "fields": [{"name": "clinicalSignificance", "type": ["null", {"type": "enum", "name":
"ClinicalSignificance", "symbols": ["benign", "likely_benign", "likely_pathogenic", "pathogenic",
"uncertain_significance"]}], "doc": ""}, {"name": "drugResponseClassification", "type": ["null",
{"type": "enum", "name": "DrugResponseClassification", "symbols": ["altered_sensitivity",
"reduced_sensitivity", "increased_sensitivity", "altered_resistance", "increased_resistance",
"reduced_resistance", "increased_risk_of_toxicity", "reduced_risk_of_toxicity", "altered_toxicity",
"adverse_drug_reaction", "indication", "contraindication", "dosing_alteration", "increased_dose",
"reduced_dose", "increased_monitoring", "increased_efficacy", "reduced_efficacy",
"altered_efficacy"]}], "doc": ""}, {"name": "traitAssociation", "type": ["null", {"type": "enum",
"name": "TraitAssociation", "symbols": ["established_risk_allele", "likely_risk_allele",
"uncertain_risk_allele", "protective"]}], "doc": ""}, {"name": "tumorigenesisClassification",
"type": ["null", {"type": "enum", "name": "TumorigenesisClassification", "symbols": ["driver",
"passenger", "modifier"]}], "doc": ""}, {"name": "functionalEffect", "type": ["null", {"type":
"enum", "name": "VariantFunctionalEffect", "symbols": ["dominant_negative_variant",
"gain_of_function_variant", "lethal_variant", "loss_of_function_variant", "loss_of_heterozygosity",
"null_variant"]}], "doc": ""}]}
"""
    schema = avro_parse(_schemaSource)
    requiredFields = {
        "clinicalSignificance",
        "drugResponseClassification",
        "functionalEffect",
        "traitAssociation",
        "tumorigenesisClassification",
    }

    @classmethod
    def isEmbeddedType(cls, fieldName):
        embeddedTypes = {}
        return fieldName in embeddedTypes

    @classmethod
    def getEmbeddedType(cls, fieldName):
        embeddedTypes = {}

        return embeddedTypes[fieldName]

    __slots__ = [
        'clinicalSignificance', 'drugResponseClassification',
        'functionalEffect', 'traitAssociation',
        'tumorigenesisClassification'
    ]

    def __init__(self, **kwargs):
        self.clinicalSignificance = kwargs.get(
            'clinicalSignificance', None)
        self.drugResponseClassification = kwargs.get(
            'drugResponseClassification', None)
        self.functionalEffect = kwargs.get(
            'functionalEffect', None)
        self.traitAssociation = kwargs.get(
            'traitAssociation', None)
        self.tumorigenesisClassification = kwargs.get(
            'tumorigenesisClassification', None)


class VariantConsequence(ProtocolElement):
    """
    A variant consequence as defined by the Sequence Ontology (SO)
    (e.g.: id = SO:0001816 ; name = non synonymous)     NOTE: this
    record is equivalent to OpenCB's `ConsequenceType`, but we want to
    avoid naming collisions
    """
    _schemaSource = """
{"type": "record", "name": "VariantConsequence", "namespace": "org.gel.models.report.avro", "doc":
"", "fields": [{"name": "id", "type": "string", "doc": ""}, {"name": "name", "type": ["null",
"string"], "doc": ""}]}
"""
    schema = avro_parse(_schemaSource)
    requiredFields = {
        "id",
        "name",
    }

    @classmethod
    def isEmbeddedType(cls, fieldName):
        embeddedTypes = {}
        return fieldName in embeddedTypes

    @classmethod
    def getEmbeddedType(cls, fieldName):
        embeddedTypes = {}

        return embeddedTypes[fieldName]

    __slots__ = [
        'id', 'name'
    ]

    def __init__(self, **kwargs):
        self.id = kwargs.get(
            'id', None)
        self.name = kwargs.get(
            'name', None)


class VariantCoordinates(ProtocolElement):
    """
    The variant coordinates representing uniquely a small variant.
    No multi-allelic variant supported, alternate only represents one
    alternate allele.
    """
    _schemaSource = """
{"type": "record", "name": "VariantCoordinates", "namespace": "org.gel.models.report.avro", "doc":
"", "fields": [{"name": "chromosome", "type": "string", "doc": ""}, {"name": "position", "type":
"int", "doc": ""}, {"name": "reference", "type": "string", "doc": ""}, {"name": "alternate", "type":
"string", "doc": ""}, {"name": "assembly", "type": {"type": "enum", "name": "Assembly", "doc": "",
"symbols": ["GRCh38", "GRCh37"]}, "doc": ""}]}
"""
    schema = avro_parse(_schemaSource)
    requiredFields = {
        "alternate",
        "assembly",
        "chromosome",
        "position",
        "reference",
    }

    @classmethod
    def isEmbeddedType(cls, fieldName):
        embeddedTypes = {}
        return fieldName in embeddedTypes

    @classmethod
    def getEmbeddedType(cls, fieldName):
        embeddedTypes = {}

        return embeddedTypes[fieldName]

    __slots__ = [
        'alternate', 'assembly', 'chromosome', 'position', 'reference'
    ]

    def __init__(self, **kwargs):
        self.alternate = kwargs.get(
            'alternate', None)
        self.assembly = kwargs.get(
            'assembly', None)
        self.chromosome = kwargs.get(
            'chromosome', None)
        self.position = kwargs.get(
            'position', None)
        self.reference = kwargs.get(
            'reference', None)


class VariantFunctionalEffect(object):
    """
    No documentation
    """
    dominant_negative_variant = "dominant_negative_variant"
    gain_of_function_variant = "gain_of_function_variant"
    lethal_variant = "lethal_variant"
    loss_of_function_variant = "loss_of_function_variant"
    loss_of_heterozygosity = "loss_of_heterozygosity"
    null_variant = "null_variant"

    def __hash__(self):
        return str(self).__hash__()


class VariantGroupLevelQuestions(ProtocolElement):
    """
    The variant group level questions
    """
    _schemaSource = """
{"type": "record", "name": "VariantGroupLevelQuestions", "namespace": "org.gel.models.report.avro",
"doc": "", "fields": [{"name": "variantGroup", "type": "int", "doc": ""}, {"name":
"variantLevelQuestions", "type": ["null", {"type": "array", "items": {"type": "record", "name":
"VariantLevelQuestions", "doc": "", "fields": [{"name": "variantCoordinates", "type": {"type":
"record", "name": "VariantCoordinates", "doc": "", "fields": [{"name": "chromosome", "type":
"string", "doc": ""}, {"name": "position", "type": "int", "doc": ""}, {"name": "reference", "type":
"string", "doc": ""}, {"name": "alternate", "type": "string", "doc": ""}, {"name": "assembly",
"type": {"type": "enum", "name": "Assembly", "doc": "", "symbols": ["GRCh38", "GRCh37"]}, "doc":
""}]}, "doc": ""}, {"name": "confirmationDecision", "type": {"type": "enum", "name":
"ConfirmationDecision", "symbols": ["yes", "no", "na"]}, "doc": ""}, {"name": "confirmationOutcome",
"type": {"type": "enum", "name": "ConfirmationOutcome", "symbols": ["yes", "no", "na"]}, "doc": ""},
{"name": "reportingQuestion", "type": {"type": "enum", "name": "ReportingQuestion", "symbols":
["yes", "no", "na"]}, "doc": ""}, {"name": "acmgClassification", "type": {"type": "enum", "name":
"ACMGClassification", "symbols": ["pathogenic_variant", "likely_pathogenic_variant",
"variant_of_unknown_clinical_significance", "likely_benign_variant", "benign_variant",
"not_assessed", "na"]}, "doc": ""}, {"name": "publications", "type": "string", "doc": ""}]}}],
"doc": ""}, {"name": "shortTandemRepeatLevelQuestions", "type": ["null", {"type": "array", "items":
{"type": "record", "name": "ShortTandemRepeatLevelQuestions", "doc": "", "fields": [{"name":
"coordinates", "type": {"type": "record", "name": "Coordinates", "fields": [{"name": "assembly",
"type": "Assembly"}, {"name": "chromosome", "type": "string"}, {"name": "start", "type": "int"},
{"name": "end", "type": "int"}, {"name": "ciStart", "type": ["null", {"type": "record", "name":
"ConfidenceInterval", "fields": [{"name": "left", "type": "int"}, {"name": "right", "type":
"int"}]}]}, {"name": "ciEnd", "type": ["null", "ConfidenceInterval"]}]}, "doc": ""}, {"name":
"confirmationDecision", "type": "ConfirmationDecision", "doc": ""}, {"name": "confirmationOutcome",
"type": "ConfirmationOutcome", "doc": ""}, {"name": "reportingQuestion", "type":
"ReportingQuestion", "doc": ""}, {"name": "acmgClassification", "type": "ACMGClassification", "doc":
""}, {"name": "publications", "type": "string", "doc": ""}]}}], "doc": ""}, {"name":
"structuralVariantLevelQuestions", "type": ["null", {"type": "array", "items": {"type": "record",
"name": "StructuralVariantLevelQuestions", "doc": "", "fields": [{"name": "variantType", "type":
{"type": "enum", "name": "StructuralVariantType", "symbols": ["ins", "dup", "inv", "amplification",
"deletion", "dup_tandem", "del_me", "ins_me"]}, "doc": ""}, {"name": "coordinates", "type":
"Coordinates", "doc": ""}, {"name": "confirmationDecision", "type": "ConfirmationDecision", "doc":
""}, {"name": "confirmationOutcome", "type": "ConfirmationOutcome", "doc": ""}, {"name":
"reportingQuestion", "type": "ReportingQuestion", "doc": ""}, {"name": "acmgClassification", "type":
"ACMGClassification", "doc": ""}, {"name": "publications", "type": "string", "doc": ""}]}}], "doc":
""}, {"name": "actionability", "type": {"type": "enum", "name": "Actionability", "symbols": ["yes",
"no", "not_yet", "na"]}, "doc": ""}, {"name": "clinicalUtility", "type": {"type": "array", "items":
{"type": "enum", "name": "ClinicalUtility", "symbols": ["none", "change_in_medication",
"surgical_option", "additional_surveillance_for_proband_or_relatives", "clinical_trial_eligibility",
"informs_reproductive_choice", "unknown", "other"]}}, "doc": ""}, {"name": "phenotypesSolved",
"type": {"type": "enum", "name": "PhenotypesSolved", "symbols": ["yes", "no", "partially",
"unknown"]}, "doc": ""}, {"name": "phenotypesExplained", "type": ["null", {"type": "array", "items":
"string"}], "doc": ""}]}
"""
    schema = avro_parse(_schemaSource)
    requiredFields = {
        "actionability",
        "clinicalUtility",
        "phenotypesExplained",
        "phenotypesSolved",
        "shortTandemRepeatLevelQuestions",
        "structuralVariantLevelQuestions",
        "variantGroup",
        "variantLevelQuestions",
    }

    @classmethod
    def isEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'shortTandemRepeatLevelQuestions': ShortTandemRepeatLevelQuestions,
            'structuralVariantLevelQuestions': StructuralVariantLevelQuestions,
            'variantLevelQuestions': VariantLevelQuestions,
        }
        return fieldName in embeddedTypes

    @classmethod
    def getEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'shortTandemRepeatLevelQuestions': ShortTandemRepeatLevelQuestions,
            'structuralVariantLevelQuestions': StructuralVariantLevelQuestions,
            'variantLevelQuestions': VariantLevelQuestions,
        }

        return embeddedTypes[fieldName]

    __slots__ = [
        'actionability', 'clinicalUtility', 'phenotypesExplained',
        'phenotypesSolved', 'shortTandemRepeatLevelQuestions',
        'structuralVariantLevelQuestions', 'variantGroup',
        'variantLevelQuestions'
    ]

    def __init__(self, **kwargs):
        self.actionability = kwargs.get(
            'actionability', None)
        self.clinicalUtility = kwargs.get(
            'clinicalUtility', None)
        self.phenotypesExplained = kwargs.get(
            'phenotypesExplained', None)
        self.phenotypesSolved = kwargs.get(
            'phenotypesSolved', None)
        self.shortTandemRepeatLevelQuestions = kwargs.get(
            'shortTandemRepeatLevelQuestions', None)
        self.structuralVariantLevelQuestions = kwargs.get(
            'structuralVariantLevelQuestions', None)
        self.variantGroup = kwargs.get(
            'variantGroup', None)
        self.variantLevelQuestions = kwargs.get(
            'variantLevelQuestions', None)


class VariantIdentifiers(ProtocolElement):
    """
    No documentation
    """
    _schemaSource = """
{"type": "record", "name": "VariantIdentifiers", "namespace": "org.gel.models.report.avro",
"fields": [{"name": "dbSnpId", "type": ["null", "string"], "doc": ""}, {"name": "cosmicIds", "type":
["null", {"type": "array", "items": "string"}], "doc": ""}, {"name": "clinVarIds", "type": ["null",
{"type": "array", "items": "string"}], "doc": ""}, {"name": "otherIds", "type": ["null", {"type":
"array", "items": {"type": "record", "name": "Identifier", "fields": [{"name": "source", "type":
"string", "doc": ""}, {"name": "identifier", "type": "string", "doc": ""}]}}]}]}
"""
    schema = avro_parse(_schemaSource)
    requiredFields = {
        "clinVarIds",
        "cosmicIds",
        "dbSnpId",
        "otherIds",
    }

    @classmethod
    def isEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'otherIds': Identifier,
        }
        return fieldName in embeddedTypes

    @classmethod
    def getEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'otherIds': Identifier,
        }

        return embeddedTypes[fieldName]

    __slots__ = [
        'clinVarIds', 'cosmicIds', 'dbSnpId', 'otherIds'
    ]

    def __init__(self, **kwargs):
        self.clinVarIds = kwargs.get(
            'clinVarIds', None)
        self.cosmicIds = kwargs.get(
            'cosmicIds', None)
        self.dbSnpId = kwargs.get(
            'dbSnpId', None)
        self.otherIds = kwargs.get(
            'otherIds', None)


class VariantInterpretationLog(ProtocolElement):
    """
    No documentation
    """
    _schemaSource = """
{"type": "record", "name": "VariantInterpretationLog", "namespace": "org.gel.models.report.avro",
"fields": [{"name": "variantCoordinates", "type": {"type": "record", "name": "VariantCoordinates",
"doc": "", "fields": [{"name": "chromosome", "type": "string", "doc": ""}, {"name": "position",
"type": "int", "doc": ""}, {"name": "reference", "type": "string", "doc": ""}, {"name": "alternate",
"type": "string", "doc": ""}, {"name": "assembly", "type": {"type": "enum", "name": "Assembly",
"doc": "", "symbols": ["GRCh38", "GRCh37"]}, "doc": ""}]}}, {"name": "user", "type": {"type":
"record", "name": "User", "fields": [{"name": "username", "type": "string"}, {"name": "role",
"type": "string"}, {"name": "email", "type": "string"}, {"name": "groups", "type": {"type": "array",
"items": "string"}}]}}, {"name": "timestamp", "type": "string"}, {"name": "familyId", "type":
"string"}, {"name": "caseId", "type": "string"}, {"name": "variantValidation", "type": ["null",
{"type": "record", "name": "VariantValidation", "fields": [{"name": "validationTechnology", "type":
"string"}, {"name": "validationResult", "type": {"type": "enum", "name": "ValidationResult",
"symbols": ["NotPerformed", "Confirmed", "NotConfirmed"]}}]}]}, {"name": "comments", "type":
["null", {"type": "array", "items": "string"}]}, {"name": "variantClassification", "type": {"type":
"record", "name": "GuidelineBasedVariantClassification", "doc": "", "fields": [{"name":
"acmgVariantClassification", "type": ["null", {"type": "record", "name":
"AcmgVariantClassification", "doc": "", "fields": [{"name": "acmgEvidences", "type": {"type":
"array", "items": {"type": "record", "name": "AcmgEvidence", "doc": "", "fields": [{"name":
"category", "type": {"type": "enum", "name": "AcmgEvidenceCategory", "doc": "", "symbols":
["population_data", "computational_and_predictive_data", "functional_data", "segregation_data",
"de_novo_data", "allelic_data", "other_database", "other_data"]}, "doc": ""}, {"name": "type",
"type": {"type": "enum", "name": "AcmgEvidenceType", "doc": "", "symbols": ["bening",
"pathogenic"]}, "doc": ""}, {"name": "weight", "type": {"type": "enum", "name":
"AcmgEvidenceWeight", "doc": "", "symbols": ["stand_alone", "supporting", "moderate", "strong",
"very_strong"]}, "doc": ""}, {"name": "modifier", "type": "int", "doc": ""}, {"name": "description",
"type": ["null", "string"], "doc": ""}]}}}, {"name": "clinicalSignificance", "type": {"type":
"enum", "name": "ClinicalSignificance", "symbols": ["benign", "likely_benign", "likely_pathogenic",
"pathogenic", "uncertain_significance"]}}, {"name": "assessment", "type": ["null", "string"]}]}]},
{"name": "ampVariantClassification", "type": ["null", {"type": "record", "name":
"AmpVariantClassification", "doc": "", "fields": [{"name": "ampEvidences", "type": {"type": "array",
"items": {"type": "record", "name": "AmpEvidence", "doc": "", "fields": [{"name": "type", "type":
{"type": "enum", "name": "AmpEvidenceType", "doc": "", "symbols": ["mutation_type", "therapies",
"variant_frequencies", "potential_germline", "population_database_presence",
"germline_database_presence", "somatic_database_presence", "impact_predictive_software",
"pathway_involvement", "publications"]}, "doc": ""}, {"name": "evidenceAssessment", "type":
"string", "doc": ""}]}}, "doc": ""}, {"name": "ampTier", "type": {"type": "enum", "name": "AmpTier",
"doc": "", "symbols": ["tierI", "tierII", "tierIII", "tierIV"]}, "doc": ""}, {"name":
"ampClincialOrExperimentalEvidence", "type": ["null", {"type": "array", "items": {"type": "record",
"name": "AmpClincialOrExperimentalEvidence", "doc": "", "fields": [{"name": "category", "type":
{"type": "enum", "name": "AmpClinicalOrExperimentalEvidenceCategory", "doc": "", "symbols":
["therapeutic", "diagnosis", "prognosis"]}, "doc": ""}, {"name": "level", "type": {"type": "enum",
"name": "AmpClinicalOrExperimentalEvidenceLevel", "doc": "", "symbols": ["levelA", "levelB",
"levelC", "levelD"]}, "doc": ""}, {"name": "description", "type": ["null", "string"], "doc":
""}]}}], "doc": ""}, {"name": "assessment", "type": ["null", "string"], "doc": ""}]}]}]}}, {"name":
"VariantValidation", "type": ["null", "VariantValidation"]}, {"name": "Artifact", "type": ["null",
"boolean"]}, {"name": "decisionSupportSystemFilters", "type": ["null", {"type": "map", "values":
"string"}]}]}
"""
    schema = avro_parse(_schemaSource)
    requiredFields = {
        "Artifact",
        "VariantValidation",
        "caseId",
        "comments",
        "decisionSupportSystemFilters",
        "familyId",
        "timestamp",
        "user",
        "variantClassification",
        "variantCoordinates",
        "variantValidation",
    }

    @classmethod
    def isEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'VariantValidation': VariantValidation,
            'user': User,
            'variantClassification': GuidelineBasedVariantClassification,
            'variantCoordinates': VariantCoordinates,
            'variantValidation': VariantValidation,
        }
        return fieldName in embeddedTypes

    @classmethod
    def getEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'VariantValidation': VariantValidation,
            'user': User,
            'variantClassification': GuidelineBasedVariantClassification,
            'variantCoordinates': VariantCoordinates,
            'variantValidation': VariantValidation,
        }

        return embeddedTypes[fieldName]

    __slots__ = [
        'Artifact', 'VariantValidation', 'caseId', 'comments',
        'decisionSupportSystemFilters', 'familyId', 'timestamp',
        'user', 'variantClassification', 'variantCoordinates',
        'variantValidation'
    ]

    def __init__(self, **kwargs):
        self.Artifact = kwargs.get(
            'Artifact', None)
        self.VariantValidation = kwargs.get(
            'VariantValidation', None)
        self.caseId = kwargs.get(
            'caseId', None)
        self.comments = kwargs.get(
            'comments', None)
        self.decisionSupportSystemFilters = kwargs.get(
            'decisionSupportSystemFilters', None)
        self.familyId = kwargs.get(
            'familyId', None)
        self.timestamp = kwargs.get(
            'timestamp', None)
        self.user = kwargs.get(
            'user', User())
        self.variantClassification = kwargs.get(
            'variantClassification', GuidelineBasedVariantClassification())
        self.variantCoordinates = kwargs.get(
            'variantCoordinates', VariantCoordinates())
        self.variantValidation = kwargs.get(
            'variantValidation', None)


class VariantLevelQuestions(ProtocolElement):
    """
    The variant level questions
    """
    _schemaSource = """
{"type": "record", "name": "VariantLevelQuestions", "namespace": "org.gel.models.report.avro",
"doc": "", "fields": [{"name": "variantCoordinates", "type": {"type": "record", "name":
"VariantCoordinates", "doc": "", "fields": [{"name": "chromosome", "type": "string", "doc": ""},
{"name": "position", "type": "int", "doc": ""}, {"name": "reference", "type": "string", "doc": ""},
{"name": "alternate", "type": "string", "doc": ""}, {"name": "assembly", "type": {"type": "enum",
"name": "Assembly", "doc": "", "symbols": ["GRCh38", "GRCh37"]}, "doc": ""}]}, "doc": ""}, {"name":
"confirmationDecision", "type": {"type": "enum", "name": "ConfirmationDecision", "symbols": ["yes",
"no", "na"]}, "doc": ""}, {"name": "confirmationOutcome", "type": {"type": "enum", "name":
"ConfirmationOutcome", "symbols": ["yes", "no", "na"]}, "doc": ""}, {"name": "reportingQuestion",
"type": {"type": "enum", "name": "ReportingQuestion", "symbols": ["yes", "no", "na"]}, "doc": ""},
{"name": "acmgClassification", "type": {"type": "enum", "name": "ACMGClassification", "symbols":
["pathogenic_variant", "likely_pathogenic_variant", "variant_of_unknown_clinical_significance",
"likely_benign_variant", "benign_variant", "not_assessed", "na"]}, "doc": ""}, {"name":
"publications", "type": "string", "doc": ""}]}
"""
    schema = avro_parse(_schemaSource)
    requiredFields = {
        "acmgClassification",
        "confirmationDecision",
        "confirmationOutcome",
        "publications",
        "reportingQuestion",
        "variantCoordinates",
    }

    @classmethod
    def isEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'variantCoordinates': VariantCoordinates,
        }
        return fieldName in embeddedTypes

    @classmethod
    def getEmbeddedType(cls, fieldName):
        embeddedTypes = {
            'variantCoordinates': VariantCoordinates,
        }

        return embeddedTypes[fieldName]

    __slots__ = [
        'acmgClassification', 'confirmationDecision',
        'confirmationOutcome', 'publications', 'reportingQuestion',
        'variantCoordinates'
    ]

    def __init__(self, **kwargs):
        self.acmgClassification = kwargs.get(
            'acmgClassification', None)
        self.confirmationDecision = kwargs.get(
            'confirmationDecision', None)
        self.confirmationOutcome = kwargs.get(
            'confirmationOutcome', None)
        self.publications = kwargs.get(
            'publications', None)
        self.reportingQuestion = kwargs.get(
            'reportingQuestion', None)
        self.variantCoordinates = kwargs.get(
            'variantCoordinates', VariantCoordinates())


class VariantValidation(ProtocolElement):
    """
    No documentation
    """
    _schemaSource = """
{"type": "record", "name": "VariantValidation", "namespace": "org.gel.models.report.avro", "fields":
[{"name": "validationTechnology", "type": "string"}, {"name": "validationResult", "type": {"type":
"enum", "name": "ValidationResult", "symbols": ["NotPerformed", "Confirmed", "NotConfirmed"]}}]}
"""
    schema = avro_parse(_schemaSource)
    requiredFields = {
        "validationResult",
        "validationTechnology",
    }

    @classmethod
    def isEmbeddedType(cls, fieldName):
        embeddedTypes = {}
        return fieldName in embeddedTypes

    @classmethod
    def getEmbeddedType(cls, fieldName):
        embeddedTypes = {}

        return embeddedTypes[fieldName]

    __slots__ = [
        'validationResult', 'validationTechnology'
    ]

    def __init__(self, **kwargs):
        self.validationResult = kwargs.get(
            'validationResult', None)
        self.validationTechnology = kwargs.get(
            'validationTechnology', None)


class VersionControl(ProtocolElement):
    """
    No documentation
    """
    _schemaSource = """
{"type": "record", "name": "VersionControl", "namespace": "org.gel.models.participant.avro",
"fields": [{"name": "GitVersionControl", "type": "string", "doc": "", "default": "1.1.3"}]}
"""
    schema = avro_parse(_schemaSource)
    requiredFields = {}

    @classmethod
    def isEmbeddedType(cls, fieldName):
        embeddedTypes = {}
        return fieldName in embeddedTypes

    @classmethod
    def getEmbeddedType(cls, fieldName):
        embeddedTypes = {}

        return embeddedTypes[fieldName]

    __slots__ = [
        'GitVersionControl'
    ]

    def __init__(self, **kwargs):
        self.GitVersionControl = kwargs.get(
            'GitVersionControl', '1.1.3')


class Zygosity(object):
    """
    It is a representation of the zygosity  * `reference_homozygous`:
    0/0, 0|0 * `heterozygous`: 0/1, 1/0, 1|0, 0|1 *
    `alternate_homozygous`: 1/1, 1|1 * `missing`: ./., .|. *
    `half_missing_reference`: ./0, 0/., 0|., .|0 *
    `half_missing_alternate`: ./1, 1/., 1|., .|1 *
    `alternate_hemizigous`: 1 * `reference_hemizigous`: 0 * `unk`:
    Anything unexpected
    """
    reference_homozygous = "reference_homozygous"
    heterozygous = "heterozygous"
    alternate_homozygous = "alternate_homozygous"
    missing = "missing"
    half_missing_reference = "half_missing_reference"
    half_missing_alternate = "half_missing_alternate"
    alternate_hemizigous = "alternate_hemizigous"
    reference_hemizigous = "reference_hemizigous"
    unk = "unk"
    na = "na"

    def __hash__(self):
        return str(self).__hash__()


class diseaseType(object):
    """
    This is not used in this version
    """
    ADULT_GLIOMA = "ADULT_GLIOMA"
    BLADDER = "BLADDER"
    BREAST = "BREAST"
    CARCINOMA_OF_UNKNOWN_PRIMARY = "CARCINOMA_OF_UNKNOWN_PRIMARY"
    CHILDHOOD = "CHILDHOOD"
    COLORECTAL = "COLORECTAL"
    ENDOCRINE = "ENDOCRINE"
    ENDOMETRIAL_CARCINOMA = "ENDOMETRIAL_CARCINOMA"
    HAEMONC = "HAEMONC"
    HEPATOPANCREATOBILIARY = "HEPATOPANCREATOBILIARY"
    LUNG = "LUNG"
    MALIGNANT_MELANOMA = "MALIGNANT_MELANOMA"
    NASOPHARYNGEAL = "NASOPHARYNGEAL"
    ORAL_OROPHARYNGEAL = "ORAL_OROPHARYNGEAL"
    OVARIAN = "OVARIAN"
    PROSTATE = "PROSTATE"
    RENAL = "RENAL"
    SARCOMA = "SARCOMA"
    SINONASAL = "SINONASAL"
    TESTICULAR_GERM_CELL_TUMOURS = "TESTICULAR_GERM_CELL_TUMOURS"
    UPPER_GASTROINTESTINAL = "UPPER_GASTROINTESTINAL"
    OTHER = "OTHER"
    NON_HODGKINS_B_CELL_LYMPHOMA_LOW_MOD_GRADE = "NON_HODGKINS_B_CELL_LYMPHOMA_LOW_MOD_GRADE"
    CLASSICAL_HODGKINS = "CLASSICAL_HODGKINS"
    NODULAR_LYMPHOCYTE_PREDOMINANT_HODGKINS = "NODULAR_LYMPHOCYTE_PREDOMINANT_HODGKINS"
    T_CELL_LYMPHOMA = "T_CELL_LYMPHOMA"

    def __hash__(self):
        return str(self).__hash__()
