$schema: "https://json-schema.org/draft/2020-12/schema"
title: "Tyrer-Cuzick Risk Score Inputs"
type: "object"
additionalProperties: false
properties:
  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
  menopausal_status:
    $ref: '../core.json#/definitions/MenopausalStatus'
  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'
  hormone_replacement_therapy_use:
    title: Hormone Replacement Therapy (HRT) Use
    type: string
    anyOf:
      - title: Never
        enum:
        - NEVER
      - title: Previous user (more than 5 years ago)
        enum:
        - GT_5_YEARS_AGO
      - title: Previous user (less than 5 years ago)
        enum:
        - LT_5_YEARS_AGO
      - title: Current user (or stopped using less than 12 months ago)
        enum:
        - CURRENT
  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: "../structs.json#/definitions/TyrerCuzickFamilyHistory"
    title: Mother
  paternal_grandmother:
    $ref: "../structs.json#/definitions/TyrerCuzickFamilyHistory"
    title: Paternal Grandmother
  maternal_grandmother:
    $ref: "../structs.json#/definitions/TyrerCuzickFamilyHistory"
    title: Maternal Grandmother
  sisters:
    title: Sisters
    type: array
    items:
      type: object
      properties:
        personal_history:
          title: Personal History
          $ref: "../structs.json#/definitions/TyrerCuzickFamilyHistory"
        daughters:
          title: Daughters (Nieces)
          type: array
          items:
            $ref: "../structs.json#/definitions/TyrerCuzickFamilyHistory"
  paternal_aunts:
    title: Paternal Aunts
    type: array
    items:
      type: object
      properties:
        personal_history:
          title: Personal History
          $ref: "../structs.json#/definitions/TyrerCuzickFamilyHistory"
        daughters:
          title: Daughters (Cousins)
          type: array
          items:
            $ref: "../structs.json#/definitions/TyrerCuzickFamilyHistory"
  maternal_aunts:
    title: Maternal Aunts
    type: array
    items:
      type: object
      properties:
        personal_history:
          title: Personal History
          $ref: "../structs.json#/definitions/TyrerCuzickFamilyHistory"
        daughters:
          title: Daughters (Cousins)
          type: array
          items:
            $ref: "../structs.json#/definitions/TyrerCuzickFamilyHistory"
  daughters:
    title: Daughters
    type: array
    items:
      $ref: "../structs.json#/definitions/TyrerCuzickFamilyHistory"
  brothers_daughters:
    title: Brothers' Daughters With Breast Cancer
    type: array
    items:
      $ref: "../structs.json#/definitions/TyrerCuzickFamilyHistory"
  paternal_half_sisters:
    title: Paternal Half Sisters
    type: array
    items:
      $ref: "../structs.json#/definitions/TyrerCuzickFamilyHistory"
  maternal_half_sisters:
    title: Maternal Half Sisters
    type: array
    items:
      $ref: "../structs.json#/definitions/TyrerCuzickFamilyHistory"
  paternal_uncles_daughters:
    title: Paternal Uncles' Daughters (Cousins)
    type: array
    items:
      $ref: "../structs.json#/definitions/TyrerCuzickFamilyHistory"
  maternal_uncles_daughters:
    title: Maternal Uncles' Daughters (Cousins)
    type: array
    items:
      $ref: "../structs.json#/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 (%)
        enum:
        - VOLPARA
      - title: VAS Percentage Density
        enum:
        - VAS
      - title: BI-RADS® ATLAS Density
        enum:
        - BIRADS
      - title: Not Available
        enum:
        - NOT_AVAILABLE
  polygenic_snp_score:
    title: Polygenic SNP Score
    description: Log relative risk, decimal
    type: number

dependencies:
  number_of_live_births:
    oneOf:
      - properties:
          number_of_live_births:
            minimum: 0
            maximum: 0
      - properties:
          number_of_live_births:
            minimum: 1
          age_at_first_birth:
            title: Age At First Birth
            description: Leave blank if unknown.
            type: integer
            minimum: 0
            maximum: 99
  menopausal_status:
    oneOf:
      - properties:
          menopausal_status:
            enum:
            - PREMENOPAUSAL
            - PERIMENOPAUSAL
            - UNKNOWN
      - properties:
          menopausal_status:
            enum:
            - POSTMENOPAUSAL
          age_at_menopause:
            title: Age At Menopause
            description: Leave blank if unknown.
            type: integer
            minimum: 0
            maximum: 99
  history_of_ovarian_cancer:
    oneOf:
      - properties:
          history_of_ovarian_cancer:
            enum:
            - "NO"
            - UNKNOWN
      - properties:
          history_of_ovarian_cancer:
            enum:
            - "YES"
          age_at_diagnosis_of_ovarian_cancer:
            title: Age At Diagnosis Of Ovarian Cancer
            type: integer
            minimum: 0
            maximum: 99
  hormone_replacement_therapy_use:
    oneOf:
      - properties:
          hormone_replacement_therapy_use:
            enum:
            - NEVER
            - GT_5_YEARS_AGO
      - properties:
          hormone_replacement_therapy_use:
            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_repalcement_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_repalcement_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
      - properties:
          hormone_replacement_therapy_use:
            enum:
            - LT_5_YEARS_AGO
          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_repalcement_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_time_since_last_taking_hormone_repalcement_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
  breast_density_measure:
    oneOf:
      - properties:
          breast_density_measure:
            enum:
            - NOT_AVAILABLE
      - properties:
          breast_density_measure:
            enum:
            - VOLPARA
            - VAS
          breast_density_value_decimal:
            title: Breast Density Value (0.00 to 100.00)
            type: number
            minimum: 0.0
            maximum: 100.0
      - properties:
          breast_density_measure:
            enum:
            - BIRADS
          breast_density_value_birads:
            title: Breast Density Value
            type: string
            enum:
            - ALMOST_ENTIRELY_FATTY
            - SCATTERED_FIBROGLANDULAR DENSITY
            - HETEROGENEOUSLY_DENSE
            - EXTREMELY_DENSE