$schema: "https://json-schema.org/draft/2020-12/schema"
title: "Common Tyrer-Cuzick Types"
type: object
definitions:
  age_at_menarche:
    title: Age At Menarche
    description: Age at first menstrual period. Leave blank if unknown.
    type: integer
    minimum: 0
    maximum: 99
  number_of_live_births:
    title: Number Of Live Births
    description: Leave blank if unknown.
    type: integer
    minimum: 0
    maximum: 50
  age_at_first_birth:
    title: Age At First Birth
    description: Leave blank if unknown.
    type: integer
    minimum: 0
    maximum: 99
  menopausal_status:
    $ref: '../core.json#/definitions/MenopausalStatus'
  age_at_menopause:
    title: Age At Menopause
    description: Leave blank if unknown.
    type: integer
    minimum: 0
    maximum: 99
  history_of_hyperplasia:
    title: History Of Hyperplasia
    $ref: '../core.json#/definitions/YesNoUnknown'
  history_of_atypical_hyperplasia:
    title: History Of Atypical Hyperplasia
    $ref: '../core.json#/definitions/YesNoUnknown'
  history_of_lcis:
    title: History Of LCIS
    description: 'Lobular carcinoma in situ (LCIS)'
    $ref: '../core.json#/definitions/YesNoUnknown'
  history_of_ovarian_cancer:
    title: History Of Ovarian Cancer
    $ref: '../core.json#/definitions/YesNoUnknown'
  age_at_diagnosis_of_ovarian_cancer:
    title: Age At Diagnosis Of Ovarian Cancer
    type: integer
    minimum: 0
    maximum: 99
  hormone_replacement_therapy_use:
    title: Hormone Replacement Therapy (HRT) Use
    type: string
    anyOf:
      - title: Never
        type: string
        enum:
        - NEVER
      - title: Previous user (more than 5 years ago)
        type: string
        enum:
        - GT_5_YEARS_AGO
      - title: Previous user (less than 5 years ago)
        type: string
        enum:
        - LT_5_YEARS_AGO
      - title: Current user (or stopped using less than 12 months ago)
        type: string
        enum:
        - CURRENT
  type_of_hormone_replacement_therapy_taken:
    title: Type Of Hormone Replacement Therapy (HRT) Taken
    type: string
    enum:
    - OESTROGEN
    - COMBINED
    - UNKNOWN
  length_of_time_taking_hormone_replacement_therapy:
    title: Length Of Time Taking Hormone Replacement Therapy (HRT)
    description: Round to the nearest decimal point (e.g. 4.5 years)
    type: number
    minimum: 0
  length_of_future_time_intended_to_take_hormone_replacement_therapy:
    title: Length Of Future Time Intended To Continue Taking Hormone Replacement Therapy (HRT)
    description: Round to the nearest decimal point (e.g. 4.5 years)
    type: number
    minimum: 0
  length_of_time_since_last_taking_hormone_replacement_therapy:
    title: Length Of Time Since Last Taking Hormone Replacement Therapy (HRT)
    description: Round to the nearest decimal point (e.g. 4.5 years)
    type: number
    minimum: 0
  genetic_testing:
    $ref: "../core.json#/definitions/BreastCancerGeneticTesting"
    title: Genetic Testing Of The Woman
  genetic_testing_of_father:
    $ref: "../core.json#/definitions/BreastCancerGeneticTesting"
    title: Genetic Testing Of The Woman's Father
  mother:
    $ref: "#/definitions/TyrerCuzickFamilyHistory"
    title: Mother
  paternal_grandmother:
    $ref: "#/definitions/TyrerCuzickFamilyHistory"
    title: Paternal Grandmother
  maternal_grandmother:
    $ref: "#/definitions/TyrerCuzickFamilyHistory"
    title: Maternal Grandmother
  sisters:
    title: Sisters
    type: array
    items:
      type: object
      properties:
        personal_history:
          title: Personal History
          $ref: "#/definitions/TyrerCuzickFamilyHistory"
        daughters:
          title: Daughters (Nieces)
          type: array
          items:
            $ref: "#/definitions/TyrerCuzickFamilyHistory"
  paternal_aunts:
    title: Paternal Aunts
    type: array
    items:
      type: object
      properties:
        personal_history:
          title: Personal History
          $ref: "#/definitions/TyrerCuzickFamilyHistory"
        daughters:
          title: Daughters (Cousins)
          type: array
          items:
            $ref: "#/definitions/TyrerCuzickFamilyHistory"
  maternal_aunts:
    title: Maternal Aunts
    type: array
    items:
      type: object
      properties:
        personal_history:
          title: Personal History
          $ref: "#/definitions/TyrerCuzickFamilyHistory"
        daughters:
          title: Daughters (Cousins)
          type: array
          items:
            $ref: "#/definitions/TyrerCuzickFamilyHistory"
  daughters:
    title: Daughters
    type: array
    items:
      $ref: "#/definitions/TyrerCuzickFamilyHistory"
  brothers_daughters:
    title: Brothers' Daughters With Breast Cancer
    type: array
    items:
      $ref: "#/definitions/TyrerCuzickFamilyHistory"
  paternal_half_sisters:
    title: Paternal Half Sisters
    type: array
    items:
      $ref: "#/definitions/TyrerCuzickFamilyHistory"
  maternal_half_sisters:
    title: Maternal Half Sisters
    type: array
    items:
      $ref: "#/definitions/TyrerCuzickFamilyHistory"
  paternal_uncles_daughters:
    title: Paternal Uncles' Daughters (Cousins)
    type: array
    items:
      $ref: "#/definitions/TyrerCuzickFamilyHistory"
  maternal_uncles_daughters:
    title: Maternal Uncles' Daughters (Cousins)
    type: array
    items:
      $ref: "#/definitions/TyrerCuzickFamilyHistory"
  father_had_breast_cancer:
    title: Has The Father Had Breast Cancer?
    $ref: '../core.json#/definitions/YesNoUnknown'
  brother_had_breast_cancer:
    title: Has A Brother Had Breast Cancer?
    $ref: '../core.json#/definitions/YesNoUnknown'
  breast_density_measure:
    title: Breast Density Measure
    type: string
    anyOf:
      - title: Volpara® Volumetric Density (%)
        type: string
        enum:
        - VOLPARA
      - title: VAS Percentage Density
        type: string
        enum:
        - VAS
      - title: BI-RADS® ATLAS Density
        type: string
        enum:
        - BIRADS
      - title: Not Available
        type: string
        enum:
        - NOT_AVAILABLE
  breast_density_value_decimal:
    title: Breast Density Value (0.00 to 100.00)
    description: Value for Volpara® and VAS
    type: number
    minimum: 0.0
    maximum: 100.0
  breast_density_value_birads:
    title: Breast Density Value
    description: Value for BI-RADS
    type: string
    enum:
    - ALMOST_ENTIRELY_FATTY
    - SCATTERED_FIBROGLANDULAR DENSITY
    - HETEROGENEOUSLY_DENSE
    - EXTREMELY_DENSE
  polygenic_snp_score:
    title: Polygenic SNP Score
    description: Log relative risk, decimal
    type: number
  name:
    title: Name
    type: string
  had_breast_cancer:
    title: Did They Have Breast Cancer?
    $ref: '../core.json#/definitions/YesNoUnknown'
  breast_cancer_bilateral:
    title: Was Breast Cancer Bilateral?
    $ref: '../core.json#/definitions/YesNoUnknown'
  age_at_breast_cancer:
    title: Age At Which They Developed Breast Cancer?
    description: If unknown, then their current age or the age at which they died.
    type: integer
    minimum: 0
  age_at_breast_cancer_bilateral:
    title: Age At Which They Developed Bilateral Breast Cancer?
    description: If unknown, then their current age or the age at which they died.
    type: integer
    minimum: 0
  had_ovarian_cancer:
    title: Did They Have Ovarian Cancer?
    $ref: '../core.json#/definitions/YesNoUnknown'
  age_at_ovarian_cancer:
    title: Age At Which They Developed Ovarian Cancer?
    description: If unknown, then their current age or the age at which they died.
    type: integer
    minimum: 0
  TyrerCuzickFamilyHistory:
    type: object
    properties:
      name:
        $ref: '#/definitions/name'
      had_breast_cancer:
        $ref: '#/definitions/had_breast_cancer'
      breast_cancer_bilateral:
        $ref: '#/definitions/breast_cancer_bilateral'
      age_at_breast_cancer:
        $ref: '#/definitions/age_at_breast_cancer'
      age_at_breast_cancer_bilateral:
        $ref: '#/definitions/age_at_breast_cancer_bilateral'
      had_ovarian_cancer:
        $ref: '#/definitions/had_ovarian_cancer'
      age_at_ovarian_cancer:
        $ref: '#/definitions/age_at_ovarian_cancer'
      genetic_testing:
        $ref: "../core.json#/definitions/BreastCancerGeneticTesting"
  TyrerCuzickFamilyHistoryWithDependencies:
    type: object
    properties:
      name:
        $ref: '#/definitions/name'
      had_breast_cancer:
        $ref: '#/definitions/had_breast_cancer'
      had_ovarian_cancer:
        $ref: '#/definitions/had_ovarian_cancer'
      genetic_testing:
        $ref: "../core.json#/definitions/BreastCancerGeneticTesting"
    dependencies:
      had_breast_cancer:
        oneOf:
          - properties:
              had_breast_cancer:
                enum:
                - "NO"
                - "UNKNOWN"
          - properties:
              had_breast_cancer:
                enum:
                - "YES"
              breast_cancer_bilateral:
                $ref: '#/definitions/breast_cancer_bilateral'
              age_at_breast_cancer:
                $ref: '#/definitions/age_at_breast_cancer'
            dependencies:
              breast_cancer_bilateral:
                oneOf:
                  - properties:
                      breast_cancer_bilateral:
                        enum:
                        - "NO"
                        - "UNKNOWN"
                  - properties:
                      breast_cancer_bilateral:
                        enum:
                        - "YES"
                      age_at_breast_cancer_bilateral:
                        $ref: '#/definitions/age_at_breast_cancer_bilateral'
      had_ovarian_cancer:
        oneOf:
          - properties:
              had_ovarian_cancer:
                enum:
                - "NO"
                - "UNKNOWN"
          - properties:
              had_ovarian_cancer:
                enum:
                - "YES"
              age_at_ovarian_cancer:
                $ref: '#/definitions/age_at_ovarian_cancer'
