"""
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 = '1.1.1'


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 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 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": "int", "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", {"type": "enum", "name": "diseaseType", "symbols":
["ADULT_GLIOMA", "BLADDER", "BREAST", "CARCINOMA_OF_UNKNOWN_PRIMARY", "CHILDHOOD", "COLORECTAL",
"ENDOCRINE", "ENDOMETRIAL_CARCINOMA", "HAEMONC", "HEPATOPANCREATOBILIARY", "LUNG",
"MALIGNANT_MELANOMA", "NASOPHARYNGEAL", "ORAL_OROPHARYNGEAL", "OVARIAN", "PROSTATE", "RENAL",
"SARCOMA", "SINONASAL", "TESTICULAR_GERM_CELL_TUMOURS", "UPPER_GASTROINTESTINAL", "OTHER",
"NON_HODGKINS_B_CELL_LYMPHOMA_LOW_MOD_GRADE", "CLASSICAL_HODGKINS",
"NODULAR_LYMPHOCYTE_PREDOMINANT_HODGKINS", "T_CELL_LYMPHOMA"]}], "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": "int", "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.0"}]}], "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 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 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 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 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 FamilyQCState(object):
    """
    FamilyQCState
    """
    noState = "noState"
    passedMedicalReviewReadyForInterpretation = "passedMedicalReviewReadyForInterpretation"
    passedMedicalReviewNotReadyForInterpretation = "passedMedicalReviewNotReadyForInterpretation"
    queryToGel = "queryToGel"
    queryToGMC = "queryToGMC"
    failed = "failed"

    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":
"int", "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 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 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 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 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.0"}]}], "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": "int",
"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": "int",
"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 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 Product(object):
    """
    No documentation
    """
    DNA = "DNA"
    RNA = "RNA"

    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.0"}]}], "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": "int",
"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 Sample(ProtocolElement):
    """
    No documentation
    """
    _schemaSource = """
{"type": "record", "name": "Sample", "namespace": "org.gel.models.participant.avro", "fields":
[{"name": "sampleId", "type": "string", "doc": ""}, {"name": "labSampleId", "type": "int", "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 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.0"}]}, "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 SpatialPattern(object):
    """
    No documentation
    """
    DISTAL = "DISTAL"
    GENERALIZED = "GENERALIZED"
    LOCALIZED = "LOCALIZED"
    PROXIMAL = "PROXIMAL"

    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 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 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":
"int", "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", {"type": "enum", "name": "diseaseType", "symbols":
["ADULT_GLIOMA", "BLADDER", "BREAST", "CARCINOMA_OF_UNKNOWN_PRIMARY", "CHILDHOOD", "COLORECTAL",
"ENDOCRINE", "ENDOMETRIAL_CARCINOMA", "HAEMONC", "HEPATOPANCREATOBILIARY", "LUNG",
"MALIGNANT_MELANOMA", "NASOPHARYNGEAL", "ORAL_OROPHARYNGEAL", "OVARIAN", "PROSTATE", "RENAL",
"SARCOMA", "SINONASAL", "TESTICULAR_GERM_CELL_TUMOURS", "UPPER_GASTROINTESTINAL", "OTHER",
"NON_HODGKINS_B_CELL_LYMPHOMA_LOW_MOD_GRADE", "CLASSICAL_HODGKINS",
"NODULAR_LYMPHOCYTE_PREDOMINANT_HODGKINS", "T_CELL_LYMPHOMA"]}], "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 VersionControl(ProtocolElement):
    """
    No documentation
    """
    _schemaSource = """
{"type": "record", "name": "VersionControl", "namespace": "org.gel.models.participant.avro",
"fields": [{"name": "GitVersionControl", "type": "string", "doc": "", "default": "1.1.0"}]}
"""
    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.0')


class diseaseType(object):
    """
    No documentation
    """
    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__()
