---
table: _subjects
maps: subject_table
cols:
  - name: id
    dtype: integer
    maps: id
  - name: subject
    primary: yes
    dtype: str(6)
    maps: subjectID
    like: "D[0-9]{4}"
    replace:
      value: subjectID
      to: D_number
      file: ""
  - name: name
    dtype: str
    maps: name
    hide: yes
  - name: phone
    dtype: str(10)
    maps: phone
    like: "[0-9]{10}"
    hide: yes
  - name: gender
    dtype: str(6)
    maps: gender
    case: lower
    like: "(male|female)"
  - name: date_of_birth
    dtype: date
    maps: subjectID
    like: "^\\d{4}-\\d{2}-\\d{2}$"
    replace:
      value: subjectID
      to: DOB
      file: ""
  - name: city
    dtype: str
    maps: city
    case: lower
    like: "[a-z A-Z]+"
    hide: yes
  - name: update_timestamp
    dtype: datetime
    maps: date
---
table: _assessments
maps: mainassessment_table
cols:
  - name: id
    dtype: integer
    maps: id
  - name: subject
    primary: yes
    dtype: str(6)
    maps: subjectID
    like: "D[0-9]{4}"
    refs: "_subjects.subject"
    replace:
      value: subjectID
      to: D_number
      file: ""
  - name: session
    primary: yes
    dtype: str(3)
    maps: assessmentId
    extract: "([0-9]{3})[0-9]{6}"
    like: "[0-9]{3}"
  - name: appointment_date
    dtype: datetime
    maps: deep_date
  - name: update_timestamp
    dtype: datetime
    maps: Tdate
---
table: _clinical_global_impression
maps: cgitable
refs:
  - cols: [subject, session]
    links: [_assessments.subject, _assessments.session]
cols:
  - name: id
    dtype: integer
    maps: id
  - name: subject
    primary: yes
    dtype: str(6)
    maps: assessmentId
    extract: "[0-9]{3}([0-9]{6})"
    like: "D[0-9]{4}"
    replace:
      value: subjectID
      to: D_number
      file: ""
  - name: session
    primary: yes
    dtype: str(3)
    maps: assessmentId
    extract: "([0-9]{3})[0-9]{6}"
    like: "[0-9]{3}"
  - name: severity_of_illness
    dtype: integer
    maps: ans1
    between: [0,7]
  - name: global_improvement
    dtype: integer
    maps: ans2
    between: [0,7]
  - name: efficacy_index
    dtype: integer
    maps: ans3
    between: [0,15]
  - name: score
    dtype: integer
    maps: Stotal
    between: [0,29]
  - name: update_timestamp
    dtype: datetime
    maps: date_of_last_update
---
table: _hindi_mental_state_examination
maps: hindi__mental__state__examinationtable
refs:
  - cols: [subject, session]
    links: [_assessments.subject, _assessments.session]
cols:
  - name: id
    dtype: integer
    maps: id
  - name: subject
    primary: yes
    dtype: str(6)
    maps: assessmentId
    extract: "[0-9]{3}([0-9]{6})"
    like: "D[0-9]{4}"
    replace:
      value: subjectID
      to: D_number
      file: ""
  - name: session
    primary: yes
    dtype: str(3)
    maps: assessmentId
    extract: "([0-9]{3})[0-9]{6}"
    like: "[0-9]{3}"
  - name: time_of_day
    dtype: boolean
    maps: ans1
  - name: day_of_week
    dtype: boolean
    maps: ans2
  - name: date_of_month
    dtype: boolean
    maps: ans3
  - name: month_of_year
    dtype: boolean
    maps: ans4
  - name: season_of_year
    dtype: boolean
    maps: ans5
  - name: village_post_office
    dtype: boolean
    maps: ans6
  - name: village_district
    dtype: boolean
    maps: ans7
  - name: village_name
    dtype: boolean
    maps: ans8
  - name: area_number
    dtype: boolean
    maps: ans9
  - name: place_name
    dtype: boolean
    maps: ans10
  - name: object_registration
    dtype: integer
    maps: ans11
    betweeen: [0,3]
  - name: world_backwards
    dtype: integer
    maps: ans12
    betweeen: [0,5]
  - name: object_recall
    dtype: integer
    maps: ans13_14_15
    betweeen: [0,5]
  - name: name_watch
    dtype: boolean
    maps: ans17
  - name: name_pen
    dtype: boolean
    maps: ans18
  - name: repeat_phrase
    dtype: boolean
    maps: ans19
  - name: follow_command
    dtype: boolean
    maps: ans20
  - name: three_step_task
    dtype: integer
    maps: ans21
    betweeen: [0,3]
  - name: score
    dtype: integer
    maps: total
  - name: attempted
    dtype: integer
    maps: attended_ques
  - name: update_timestamp
    dtype: datetime
    maps: date_of_last_update
---
table: _adult_adhd_self_report_scale
maps: adult_adhd_self_report_scaletable
refs:
  - cols: [subject, session]
    links: [_assessments.subject, _assessments.session]
cols:
  - name: id
    dtype: integer
    maps: id
  - name: subject
    primary: yes
    dtype: str(6)
    maps: assessmentId
    extract: "[0-9]{3}([0-9]{6})"
    like: "D[0-9]{4}"
    replace:
      value: subjectID
      to: D_number
      file: ""
  - name: session
    primary: yes
    dtype: str(3)
    maps: assessmentId
    extract: "([0-9]{3})[0-9]{6}"
    like: "[0-9]{3}"
  - name: trouble_wrapping_final_details
    dtype: str(10)
    maps: ans1
    in: [Never, Rarely, Sometimes, Often, Very Often]
  - name: difficulty_in_organization
    dtype: str(10)
    maps: ans2
    in: [Never, Rarely, Sometimes, Often, Very Often]
  - name: problem_remembering_appointments
    dtype: str(10)
    maps: ans1
    in: [Never, Rarely, Sometimes, Often, Very Often]
  - name: avoid_challenging_tasks
    dtype: str(10)
    maps: ans4
    in: [Never, Rarely, Sometimes, Often, Very Often]
  - name: fidget_while_seated
    dtype: str(10)
    maps: ans5
    in: [Never, Rarely, Sometimes, Often, Very Often]
  - name: overly_active
    dtype: str(10)
    maps: ans6
    in: [Never, Rarely, Sometimes, Often, Very Often]
  - name: careless_mistakes_on_boring_tasks
    dtype: str(10)
    maps: ans7
    in: [Never, Rarely, Sometimes, Often, Very Often]
  - name: difficulty_focusing_on_boring_tasks
    dtype: str(10)
    maps: ans8
    in: [Never, Rarely, Sometimes, Often, Very Often]
  - name: difficulty_focusing_on_people_speaking
    dtype: str(10)
    maps: ans9
    in: [Never, Rarely, Sometimes, Often, Very Often]
  - name: difficulty_finding_things
    dtype: str(10)
    maps: ans10
    in: [Never, Rarely, Sometimes, Often, Very Often]
  - name: easily_distracted_by_noise
    dtype: str(10)
    maps: ans11
    in: [Never, Rarely, Sometimes, Often, Very Often]
  - name: difficulty_remaining_seated
    dtype: str(10)
    maps: ans12
    in: [Never, Rarely, Sometimes, Often, Very Often]
  - name: feel_restless
    dtype: str(10)
    maps: ans13
    in: [Never, Rarely, Sometimes, Often, Very Often]
  - name: difficulty_unwinding_in_seclusion
    dtype: str(10)
    maps: ans14
    in: [Never, Rarely, Sometimes, Often, Very Often]
  - name: talkative_in_social_situations
    dtype: str(10)
    maps: ans15
    in: [Never, Rarely, Sometimes, Often, Very Often]
  - name: finish_sentences_for_others
    dtype: str(10)
    maps: ans16
    in: [Never, Rarely, Sometimes, Often, Very Often]
  - name: difficulty_waiting_for_turn
    dtype: str(10)
    maps: ans17
    in: [Never, Rarely, Sometimes, Often, Very Often]
  - name: integererrupt_others_when_busy
    dtype: str(10)
    maps: ans18
    in: [Never, Rarely, Sometimes, Often, Very Often]
  - name: age_during_first_occurence_of_problem
    dtype: integer
    maps: problm
    like: "[0-9]+"
    between: [1,100]
  - name: symptoms_not_consistent_with_adhd
    dtype: integer
    maps: A_White
    between: [0,6]
  - name: additional_cues_not_consistent_with_adhd
    dtype: integer
    maps: B_White
    between: [0,12]
  - name: symptoms_highly_consistent_with_adhd
    dtype: integer
    maps: A_Dark
    between: [0,6]
  - name: additional_cues_consistent_with_adhd
    dtype: integer
    maps: B_Dark
    between: [0,12]
  - name: not_consistent_with_adhd_score
    dtype: integer
    maps: AB_White
    between: [0,18]
  - name: consistent_with_adhd_score
    dtype: integer
    maps: AB_Dark
    between: [0,18]
  - name: update_timestamp
    dtype: datetime
    maps: date_of_last_update
---
table: _modified_kuppuswamy_socioeconomic_scale
maps: modified_kuppuswamy_table
refs:
  - cols: [subject, session]
    links: [_assessments.subject, _assessments.session]
cols:
  - name: id
    dtype: integer
    maps: id
  - name: subject
    primary: yes
    dtype: str(6)
    maps: assessmentId
    extract: "[0-9]{3}([0-9]{6})"
    like: "D[0-9]{4}"
    replace:
      value: subjectID
      to: D_number
      file: ""
  - name: session
    primary: yes
    dtype: str(3)
    maps: assessmentId
    extract: "([0-9]{3})[0-9]{6}"
    like: "[0-9]{3}"
  - name: education_level
    dtype: integer
    maps: education
    between: [1,7]
  - name: occupation_level
    dtype: integer
    maps: occupation
    between: [1,10]
  - name: income_level
    dtype: integer
    maps: Income
    between: [1,12]
  - name: score
    dtype: integer
    maps: stotal
    between: [1,29]
  - name: update_timestamp
    dtype: datetime
    maps: date_of_last_update
---
table: _work_and_social_adjustment_scale
maps: workandsocial_table
refs:
  - cols: [subject, session]
    links: [_assessments.subject, _assessments.session]
cols:
  - name: id
    dtype: integer
    maps: id
  - name: subject
    primary: yes
    dtype: str(6)
    maps: assessmentId
    extract: "[0-9]{3}([0-9]{6})"
    like: "D[0-9]{4}"
    replace:
      value: subjectID
      to: D_number
      file: ""
  - name: session
    primary: yes
    dtype: str(3)
    maps: assessmentId
    extract: "([0-9]{3})[0-9]{6}"
    like: "[0-9]{3}"
  - name: unrelated_retirement
    dtype: boolean
    maps: retired
  - name: work_ability_impaired
    dtype: integer
    maps: be
    between: [0,8]
  - name: home_management_impaired
    dtype: integer
    maps: bec
    between: [0,8]
  - name: social_activities_impaired
    dtype: integer
    maps: beca
    between: [0,8]
  - name: private_activities_impaired
    dtype: integer
    maps: becau
    between: [0,8]
  - name: relationships_impaired
    dtype: integer
    maps: becaus
    between: [0,8]
  - name: score
    dtype: integer
    maps: total
    between: [0,40]
  - name: update_timestamp
    dtype: datetime
    maps: date_of_last_update
---
table: _global_assessment_of_functioning
maps: globalassessmentoffunctioningscale_table
refs:
  - cols: [subject, session]
    links: [_assessments.subject, _assessments.session]
cols:
  - name: id
    dtype: integer
    maps: id
  - name: subject
    primary: yes
    dtype: str(6)
    maps: assessmentId
    extract: "[0-9]{3}([0-9]{6})"
    like: "D[0-9]{4}"
    replace:
      value: subjectID
      to: D_number
      file: ""
  - name: session
    primary: yes
    dtype: str(3)
    maps: assessmentId
    extract: "([0-9]{3})[0-9]{6}"
    like: "[0-9]{3}"
  - name: score
    dtype: integer
    maps: Persistent
    like: "[0-9]{1,3}"
    betweeen: [0,100]
  - name: update_timestamp
    dtype: datetime
    maps: date_of_last_update
---
table: _adverse_childhood_experiences
maps: adversechildhoodexperiencesinternational_table
refs:
  - cols: [subject, session]
    links: [_assessments.subject, _assessments.session]
cols:
  - name: id
    dtype: integer
    maps: id
  - name: subject
    primary: yes
    dtype: str(6)
    maps: assessmentId
    extract: "[0-9]{3}([0-9]{6})"
    like: "D[0-9]{4}"
    replace:
      value: subjectID
      to: D_number
      file: ""
  - name: session
    primary: yes
    dtype: str(3)
    maps: assessmentId
    extract: "([0-9]{3})[0-9]{6}"
    like: "[0-9]{3}"
  - name: age
    dtype: integer
    maps: How
    like: "[0-9]{1,3}"
    between: [1,100]
  - name: ethnic_background
    dtype: str
    maps: Whatis
    case: lower
  - name: level_of_education
    dtype: str
    maps: Whatisthe
    like: "(No formal schooling|Less than primary school|Primary school completed|Secondary\/High school completed|College\/University completed|Post graduate degree|Refused)"
  - name: work_status
    dtype: str
    maps: Whichof
    like: "(Government employee|Non-government employee|Self-employed|Non-paid|Student|Homemaker|Retired|Unemployed but able to work|Unemployed as unable to work|Refused)"
    replace:
      - value: "Unemploed (able to work)"
        to: "Unemployed but able to work"
      - value: "Unemployed (unable to work"
        to: "Unemployed as unable to work"
  - name: civic_status
    dtype: str
    maps: Whatisyour
    like: "(Married|Living as couple|Divorced or separated|Single|Widowed|Other|Refused)"
    replace:
      - value: "Married (Go to Q.M2)"
        to: "Married"
      - value: "Widowed (Go to Q.M2)"
        to: "Widowed"
  - name: been_married
    dtype: boolean
    maps: Have
    replace:
      - value: "No (Go to Q.M5)"
        to: "No"
  - name: age_of_marriage
    dtype: integer
    maps: Atwhat
    like: "[0-9]{1,2}"
    between: [1,99]
  - name: freedom_of_choice_to_marry
    dtype: str
    maps: Atthetime
    like: "(Yes|No|Not sure|Refused)"
    replace:
      - value: "Yes (Go to Q.M5)"
        to: "Yes"
      - value: "Don't know / Not sure"
        to: "Not sure"
  - name: consent_for_marriage
    dtype: str
    maps: Atthetimeof
    like: "(Yes|No|Refused)"
  - name: age_during_first_baby
    dtype: str
    maps: Ifyouare
    like: "(1[5-9]|[2-6][0-9]|Not Applicable|Refused)"
  - name: parents_understood_problems
    dtype: str
    maps: Didyour
    like: "(Always|Most of the time|Sometimes|Rarely|Never|Refused)"
  - name: parents_knew_hobbies
    dtype: str
    maps: Didyourparents
    like: "(Always|Most of the time|Sometimes|Rarely|Never|Refused)"
  - name: parents_starved_subject
    dtype: str
    maps: Howoften
    like: "(Many times|A few times|Once|Never|Refused)"
  - name: neglect_due_to_drugs
    dtype: str
    maps: Wereyour
    like: "(Many times|A few times|Once|Never|Refused)"
  - name: parents_deprived_education
    dtype: str
    maps: Howoftendidyour
    like: "(Many times|A few times|Once|Never|Refused)"
  - name: drug_addict_in_household
    dtype: str
    maps: Didyoulivewith
    like: "(Yes|No|Refused)"
  - name: mentally_disturbed_in_household
    dtype: str
    maps: Didyoulivewitha
    like: "(Yes|No|Refused)"
  - name: prisoner_in_household
    dtype: str
    maps: Didyoulivewithahousehold
    like: "(Yes|No|Refused)"
  - name: parents_separated
    dtype: str
    maps: Wereyourparentseve
    like: "(Yes|No|Not Applicable|Refused)"
  - name: parent_died
    dtype: str
    maps: Didyourmother
    like: "(Yes|No|Not sure|Refused)"
    replace:
      - value: "Don't know / Not sure"
        to: "Not sure"
  - name: verbal_abuse_in_household
    dtype: str
    maps: Didyouseeor
    like: "(Many times|A few times|Once|Never|Refused)"
  - name: mild_physical_abuse_in_household
    dtype: str
    maps: Didyouseeorhear
    like: "(Many times|A few times|Once|Never|Refused)"
  - name: severe_physical_abuse_in_household
    dtype: str
    maps: Didyouseeorhearaparent
    like: "(Many times|A few times|Once|Never|Refused)"
  - name: verbal_abuse_on_subject
    dtype: str
    maps: Didaparentguardian
    like: "(Many times|A few times|Once|Never|Refused)"
  - name: abandon_threat_on_subject
    dtype: str
    maps: Didaparentguardianor
    like: "(Many times|A few times|Once|Never|Refused)"
  - name: mild_physical_abuse_on_subject
    dtype: str
    maps: Didaparentguardianorotherhouseholdmember
    like: "(Many times|A few times|Once|Never|Refused)"
  - name: severe_physical_abuse_on_subject
    dtype: str
    maps: Didaparentguardianorotherhouseholdmemberhit
    like: "(Many times|A few times|Once|Never|Refused)"
  - name: sexual_harassment_on_subject
    dtype: str
    maps: Didsomeonetouch
    like: "(Many times|A few times|Once|Never|Refused)"
  - name: subject_forced_into_sexual_activities
    dtype: str
    maps: Didsomeonemake
    like: "(Many times|A few times|Once|Never|Refused)"
  - name: forced_sexual_attempt_on_subject
    dtype: str
    maps: Didsomeoneattemptoral
    like: "(Many times|A few times|Once|Never|Refused)"
  - name: forced_sex_with_subject
    dtype: str
    maps: Didsomeoneactuallyhaveoralanal
    like: "(Many times|A few times|Once|Never|Refused)"
  - name: subject_bullied
    dtype: str
    maps: Howoftenwereyou
    like: "(Many times|A few times|Once|Never|Refused)"
    replace:
      - value: "Never (Go to Q.V3)"
        to: "Never"
  - name: bullied_method_or_cause
    dtype: str
    maps: Howwereyoubulliedmost
    like: "(I was hit, kicked, pushed, shoved around, or locked indoors|I was made fun of because of my race, nationality or colour|I was made fun of because of my religion|I was made fun of with sexual jokes, comments, or gestures|I was left out of activities on purpose or completely ignored|I was made fun of because of how my body or face looked|I was bullied in some other way|Refused)"
  - name: subject_involved_in_fight
    dtype: str
    maps: Howoftenwereyouin
    like: "(Many times|A few times|Once|Never|Refused)"
  - name: witnessed_physical_violence
    dtype: str
    maps: Didyouseeor1
    like: "(Many times|A few times|Once|Never|Refused)"
  - name: witnessed_murder
    dtype: str
    maps: Didyouseeorhear1
    like: "(Many times|A few times|Once|Never|Refused)"
  - name: witnessed_murder_threat
    dtype: str
    maps: Didyouseeorhearsomeonebeing
    like: "(Many times|A few times|Once|Never|Refused)"
  - name: forced_migration
    dtype: str
    maps: Wereyouforced
    like: "(Many times|A few times|Once|Never|Refused)"
  - name: home_destroyed_in_violence
    dtype: str
    maps: Didyouexperience
    like: "(Many times|A few times|Once|Never|Refused)"
  - name: physical_abuse_by_police
    dtype: str
    maps: Wereyoubeaten
    like: "(Many times|A few times|Once|Never|Refused)"
  - name: relative_murdered_or_beaten_by_police
    dtype: str
    maps: Wasafamily
    like: "(Many times|A few times|Once|Never|Refused)"
  - name: update_timestamp
    dtype: datetime
    maps: date_of_last_update
---
table: _adult_temperament
maps: adulttemperamentquestionnaire_table
refs:
  - cols: [subject, session]
    links: [_assessments.subject, _assessments.session]
cols:
  - name: id
    dtype: integer
    maps: id
  - name: subject
    primary: yes
    dtype: str(6)
    maps: assessmentId
    extract: "[0-9]{3}([0-9]{6})"
    like: "D[0-9]{4}"
    replace:
      value: subjectID
      to: D_number
      file: ""
  - name: session
    primary: yes
    dtype: str(3)
    maps: assessmentId
    extract: "([0-9]{3})[0-9]{6}"
    like: "[0-9]{3}"
  - name: frightened_easily
    dtype: integer
    maps: Ibecome
    between: [0,7]
  - name: late_for_appointments
    dtype: integer
    maps: Iam
    between: [0,7]
  - name: happiness_due_to_mild_events
    dtype: integer
    maps: Sometimes
    between: [0,7]
  - name: irritated_by_loud_noises
    dtype: integer
    maps: Ifindloud
    between: [0,7]
  - name: hard_to_alternate_between_tasks
    dtype: integer
    maps: Its
    between: [0,7]
  - name: not_annoyed_with_slow_lines
    dtype: integer
    maps: Irarelybecome
    between: [0,7]
  - name: not_enjoy_loud_music_with_laser
    dtype: integer
    maps: Iwould
    between: [0,7]
  - name: not_follow_plans
    dtype: integer
    maps: Ioften
    between: [0,7]
  - name: departure_of_relatives_not_saddening
    dtype: integer
    maps: Irarelyfeel
    between: [0,7]
  - name: attention_not_captured_by_minor_visuals
    dtype: integer
    maps: Barely
    between: [0,7]
  - name: sit_still_even_when_energized
    dtype: integer
    maps: Even
    between: [0,7]
  - name: uneasiness_at_high_places
    dtype: integer
    maps: Looking
    between: [0,7]
  - name: subtle_tone_aswareness_in_music
    dtype: integer
    maps: when_1
    between: [0,7]
  - name: dislike_socalizing_job
    dtype: integer
    maps: Iwouldnot
    between: [0,7]
  - name: keep_performing_task_even_if_dont_want
    dtype: integer
    maps: Ican
    between: [0,7]
  - name: unable_to_enjoy_joyful_activities
    dtype: integer
    maps: Isometimes
    between: [0,7]
  - name: annoyance_when_item_not_in_store
    dtype: integer
    maps: Ifind
    between: [0,7]
  - name: notice_emotional_aspects_in_pictures
    dtype: integer
    maps: Itend
    between: [0,7]
  - name: like_to_talk_a_lot
    dtype: integer
    maps: Iusually
    between: [0,7]
  - name: not_sad_watching_sad_movie
    dtype: integer
    maps: Iseldombecome
    between: [0,7]
  - name: aware_of_bird_sounds_in_vicinity
    dtype: integer
    maps: Im
    between: [0,7]
  - name: uneasy_in_small_places
    dtype: integer
    maps: WhenIam
    between: [0,7]
  - name: listen_to_music_at_high_volume
    dtype: integer
    maps: Whenlistening
    between: [0,7]
  - name: understand_things_intuitively
    dtype: integer
    maps: Isometimesseem
    between: [0,7]
  - name: sad_due_to_minor_events
    dtype: integer
    maps: Sometimesminor
    between: [0,7]
  - name: easy_hold_laugh_when_appropriate
    dtype: integer
    maps: Itis
    between: [0,7]
  - name: work_difficult_task_when_not_feel_like_trying
    dtype: integer
    maps: Icanmake
    between: [0,7]
  - name: frequently_experience_brief_intense_happiness
    dtype: integer
    maps: Irarelyever
    between: [0,7]
  - name: easily_distracted_when_trying_to_focus
    dtype: integer
    maps: WhenIamtrying
    between: [0,7]
  - name: enjoy_playing_fast_noisy_game
    dtype: integer
    maps: Iwouldprobably
    between: [0,7]
  - name: become_agitated_while_waiting
    dtype: integer
    maps: Whenever
    between: [0,7]
  - name: bothered_by_bright_light
    dtype: integer
    maps: Imoften
    between: [0,7]
  - name: not_notice_people_eye_color
    dtype: integer
    maps: Irarely
    between: [0,7]
  - name: not_sad_on_hearing_sad_event
    dtype: integer
    maps: Iseldom
    between: [0,7]
  - name: focus_back_when_interrupted
    dtype: integer
    maps: Wheninterrupted
    between: [0,7]
  - name: scratchy_sounds_irritating
    dtype: integer
    maps: Ifindcertain
    between: [0,7]
  - name: like_many_people_conversations
    dtype: integer
    maps:  Ilike
    between: [0,7]
  - name: patient_person
    dtype: integer
    maps: Iamusually
    between: [0,7]
  - name: see_visual_images_when_eyes_closed
    dtype: integer
    maps: WhenIamresting
    between: [0,7]
  - name: difficult_to_focus_when_distressed
    dtype: integer
    maps: Itisveryhard
    between: [0,7]
  - name: mind_has_diverse_thoughts_sometimes
    dtype: integer
    maps: Sometimesmymind
    between: [0,7]
  - name: bothered_by_bright_colors
    dtype: integer
    maps: Very
    between: [0,7]
  - name: resist_talking_out_of_turn
    dtype: integer
    maps: Icaneasily
    between: [0,7]
  - name: not_enjoy_wild_carnival_ride
    dtype: integer
    maps: Iwouldprobablynot
    between: [0,7]
  - name: sad_for_more_than_an_hour
    dtype: integer
    maps: Isometimesfeel
    between: [0,7]
  - name: rarely_enjoy_socializing
    dtype: integer
    maps: Irarelyenjoy
    between: [0,7]
  - name: get_right_to_work_on_things
    dtype: integer
    maps: IfI
    between: [0,7]
  - name: easily_frustrated
    dtype: integer
    maps: Itdoesnttake
    between: [0,7]
  - name: easily_made_happy
    dtype: integer
    maps: Itdoesnttakemuch
    between: [0,7]
  - name: hard_focusing_due_to_upcoming_event
    dtype: integer
    maps: WhenIamhappy
    between: [0,7]
  - name: panic_for_no_reason
    dtype: integer
    maps: SometimesIfeel
    between: [0,7]
  - name: notice_mild_odours
    dtype: integer
    maps: Ioftennotice
    between: [0,7]
  - name: trouble_resisting_cravings
    dtype: integer
    maps: Ioftenhave
    between: [0,7]
  - name: bothered_by_flashing_lights
    dtype: integer
    maps: Colorful
    between: [0,7]
  - name: finish_things_before_due_date
    dtype: integer
    maps: Iusuallyfinishdoing
    between: [0,7]
  - name: often_feel_sad
    dtype: integer
    maps: Ioftenfeelsad
    between: [0,7]
  - name: aware_of_color_affecting_mood
    dtype: integer
    maps: Iamoftenaware
    between: [0,7]
  - name: remain_calm_when_things_not_smooth
    dtype: integer
    maps: Iusuallyremain
    between: [0,7]
  - name: loud_music_unpleasant
    dtype: integer
    maps: Loud
    between: [0,7]
  - name: jump_right_in_when_excited
    dtype: integer
    maps: WhenImexcitedabout
    between: [0,7]
  - name: scared_by_loud_noises
    dtype: integer
    maps: Loudnoises
    between: [0,7]
  - name: have_vivid_dreams
    dtype: integer
    maps: Isometimesdream
    between: [0,7]
  - name: hard_resisting_attractive_items
    dtype: integer
    maps: WhenIsee
    between: [0,7]
  - name: enjoy_laser_show
    dtype: integer
    maps: Iwouldenjoywatching
    between: [0,7]
  - name: sad_on_hearing_sad_event
    dtype: integer
    maps: WhenIhear
    between: [0,7]
  - name: do_not_notice_setting_in_movie
    dtype: integer
    maps: WhenIwatchamovie
    between: [0,7]
  - name: spend_free_time_with_people
    dtype: integer
    maps: Iusuallyliketospend
    between: [0,7]
  - name: not_frightened_by_people_suddenly
    dtype: integer
    maps: Itdoesnot
    between: [0,7]
  - name: aware_of_weather_affecting_mood
    dtype: integer
    maps: Iamoftenconsciously
    between: [0,7]
  - name: takes_lot_make_me_happy
    dtype: integer
    maps: Ittakesalot
    between: [0,7]
  - name: rarely_aware_of_texture
    dtype: integer
    maps: Iamrarelyaware
    between: [0,7]
  - name: avoid_dealing_with_unexpected_situations
    dtype: integer
    maps: WhenIamafraidofhow
    between: [0,7]
  - name: enjoy_talk_without_thinking
    dtype: integer
    maps: Iespecially
    between: [0,7]
  - name: creative_ideas_without_effort
    dtype: integer
    maps: Withoutapplying
    between: [0,7]
  - name: not_concerned_about_failing
    dtype: integer
    maps: WhenItry
    between: [0,7]
  - name: easily_inhibit_fun_but_inappropriate_acts
    dtype: integer
    maps: Itiseasy
    between: [0,7]
  - name: not_enjoy_yelling
    dtype: integer
    maps: Iwouldnotenjoy
    between: [0,7]
  - name: score
    dtype: integer
    maps: total_score
    between: [0,539]
  - name: update_timestamp
    dtype: datetime
    maps: date_of_last_update
---
table: _mini_ipip_scale
maps: theminiipipscale_table
refs:
  - cols: [subject, session]
    links: [_assessments.subject, _assessments.session]
cols:
  - name: id
    dtype: integer
    maps: id
  - name: subject
    primary: yes
    dtype: str(6)
    maps: assessmentId
    extract: "[0-9]{3}([0-9]{6})"
    like: "D[0-9]{4}"
    replace:
      value: subjectID
      to: D_number
      file: ""
  - name: session
    primary: yes
    dtype: str(3)
    maps: assessmentId
    extract: "([0-9]{3})[0-9]{6}"
    like: "[0-9]{3}"
  - name: life_of_party
    dtype: boolean
    maps: e1
  - name: sympathize_with_others
    dtype: boolean
    maps: a1
  - name: complete_chores_immediately
    dtype: boolean
    maps: c1
  - name: frequent_mood_swings
    dtype: boolean
    maps: n1
  - name: vivid_imagination
    dtype: boolean
    maps: i1
  - name: talk_less
    dtype: boolean
    maps: e2
  - name: not_interested_in_others_problems
    dtype: boolean
    maps: a2
  - name: forget_to_put_things_back
    dtype: boolean
    maps: c2
  - name: mostly_relaxed
    dtype: boolean
    maps: n2
  - name: not_interested_in_abstract_ideas
    dtype: boolean
    maps: i2
  - name: talk_to_different_people
    dtype: boolean
    maps: e3
  - name: feel_others_emotions
    dtype: boolean
    maps: a3
  - name: like_order
    dtype: boolean
    maps: c3
  - name: easily_upset
    dtype: boolean
    maps: n3
  - name: difficulty_understanding_abstract_ideas
    dtype: boolean
    maps: i3
  - name: keep_in_background
    dtype: boolean
    maps: e4
  - name: not_interested_in_others
    dtype: boolean
    maps: a4
  - name: mess_up_things
    dtype: boolean
    maps: c4
  - name: seldom_feel_blue
    dtype: boolean
    maps: n4
  - name: not_good_imagination
    dtype: boolean
    maps: i4
  - name: extraversion_score
    dtype: integer
    maps: total_e
    between: [0,4]
  - name: agreeableness_score
    dtype: integer
    maps: total_a
    between: [0,4]
  - name: conscientiousness_score
    dtype: integer
    maps: total_c
    between: [0,4]
  - name: neuroticism_score
    dtype: integer
    maps: total_n
    between: [0,4]
  - name: imagination_score
    dtype: integer
    maps: total_i
    between: [0,4]
  - name: update_timestamp
    dtype: datetime
    maps: date_of_last_update
---
table: _hamilton_anxiety_rating
maps: hamiltonanxietyratingscale_table
refs:
  - cols: [subject, session]
    links: [_assessments.subject, _assessments.session]
cols:
  - name: id
    dtype: integer
    maps: id
  - name: subject
    primary: yes
    dtype: str(6)
    maps: assessmentId
    extract: "[0-9]{3}([0-9]{6})"
    like: "D[0-9]{4}"
    replace:
      value: subjectID
      to: D_number
      file: ""
  - name: session
    primary: yes
    dtype: str(3)
    maps: assessmentId
    extract: "([0-9]{3})[0-9]{6}"
    like: "[0-9]{3}"
  - name: anxiety
    dtype: integer
    maps: Anxiousmood
    between: [0,4]
  - name: tension
    dtype: integer
    maps: Tension
    between: [0,4]
  - name: fears
    dtype: integer
    maps: Fears
    between: [0,4]
  - name: insomnia
    dtype: integer
    maps: Insomnia
    between: [0,4]
  - name: intellectuality
    dtype: integer
    maps: Intellectual
    between: [0,4]
  - name: depressed_mood
    dtype: integer
    maps: Depressed
    between: [0,4]
  - name: somatic_muscular
    dtype: integer
    maps: Somatic
    between: [0,4]
  - name: somatic_sensory
    dtype: integer
    maps: Somaticsensory
    between: [0,4]
  - name: cardiovascular_symptoms
    dtype: integer
    maps: Cardiovascular
    between: [0,4]
  - name: respiratory_symptoms
    dtype: integer
    maps: Respiratory
    between: [0,4]
  - name: gastrointestinal_symptoms
    dtype: integer
    maps: Gastrointestinal
    between: [0,4]
  - name: genitourinary_symptoms
    dtype: integer
    maps: Genitourinary
    between: [0,4]
  - name: autonomic_symptoms
    dtype: integer
    maps: Autonomic
    between: [0,4]
  - name: behavior
    dtype: integer
    maps: Behavior
    between: [0,4]
  - name: score
    dtype: integer
    maps: total
    betweeen: [0,56]
  - name: update_timestamp
    dtype: datetime
    maps: date_of_last_update
---
table: _hamilton_depression_rating
maps: hamiltonratingscalefordepression_table
refs:
  - cols: [subject, session]
    links: [_assessments.subject, _assessments.session]
cols:
  - name: id
    dtype: integer
    maps: id
  - name: subject
    primary: yes
    dtype: str(6)
    maps: assessmentId
    extract: "[0-9]{3}([0-9]{6})"
    like: "D[0-9]{4}"
    replace:
      value: subjectID
      to: D_number
      file: ""
  - name: session
    primary: yes
    dtype: str(3)
    maps: assessmentId
    extract: "([0-9]{3})[0-9]{6}"
    like: "[0-9]{3}"
  - name: depression
    dtype: integer
    maps: Depressed
    between: [0,4]
  - name: guilty_feeling
    dtype: integer
    maps: Feelings
    between: [0,4]
  - name: suicidal_feeling
    dtype: integer
    maps: Suicide
    between: [0,4]
  - name: early_insomnia
    dtype: integer
    maps: Insomnia
    between: [0,2]
  - name: middle_insomnia
    dtype: integer
    maps: InsomniaMiddle
    between: [0,2]
  - name: late_insomnia
    dtype: integer
    maps: InsomniaLate
    between: [0,2]
  - name: work_and_activities
    dtype: integer
    maps: Work
    between: [0,4]
  - name: retardation
    dtype: integer
    maps: Retardation
    between: [0,4]
  - name: agitation
    dtype: integer
    maps: Agitation
    between: [0,2]
  - name: psychic_anxiety
    dtype: integer
    maps: Anxiety
    between: [0,4]
  - name: somatic_anxiety
    dtype: integer
    maps: AnxietySomatic
    between: [0,4]
  - name: gastrointestinal_symptoms
    dtype: integer
    maps: Somatic
    between: [0,2]
  - name: general_somatic_symptoms
    dtype: integer
    maps: SomaticSymptoms
    between: [0,2]
  - name: genital_symptoms
    dtype: integer
    maps: Genita
    between: [0,2]
  - name: hypochondriasis
    dtype: integer
    maps: Hypochondriasis
    between: [0,4]
  - name: loss_of_weight_by_history
    dtype: integer
    maps: Loss_a
    between: [0,2]
  - name: loss_of_weight_by_weekly
    dtype: integer
    maps: Loss_b
    between: [0,2]
  - name: insight
    dtype: integer
    maps: Insight
    between: [0,2]
  - name: score
    dtype: integer
    maps: total
    between: [0,52]
  - name: update_timestamp
    dtype: datetime
    maps: date_of_last_update
---
table: _negative_symptoms_assessment
maps: sans_table
refs:
  - cols: [subject, session]
    links: [_assessments.subject, _assessments.session]
cols:
  - name: id
    dtype: integer
    maps: id
  - name: subject
    primary: yes
    dtype: str(6)
    maps: assessmentId
    extract: "[0-9]{3}([0-9]{6})"
    like: "D[0-9]{4}"
    replace:
      value: subjectID
      to: D_number
      file: ""
  - name: session
    primary: yes
    dtype: str(3)
    maps: assessmentId
    extract: "([0-9]{3})[0-9]{6}"
    like: "[0-9]{3}"
  - name: facial_expression_unchanged
    dtype: integer
    maps: Unchanged
    between: [0,5]
  - name: decreased_spontaneous_movements
    dtype: integer
    maps: Decreased
    between: [0,5]
  - name: expressive_gestures_paucity
    dtype: integer
    maps: Paucity
    between: [0,5]
  - name: poor_eye_contact
    dtype: integer
    maps: Poor
    between: [0,5]
  - name: affective_nonresponsiveness
    dtype: integer
    maps: Affective
    between: [0,5]
  - name: inappropriate_effect
    dtype: integer
    maps: Inappropriate
    between: [0,5]
  - name: vocal_inflections_absence
    dtype: integer
    maps: Lack
    between: [0,5]
  - name: affective_flattening_global_response
    dtype: integer
    maps: Global1
    between: [0,5]
  - name: poverty_of_speech
    dtype: integer
    maps: Poverty
    between: [0,5]
  - name: speech_content_poverty
    dtype: integer
    maps: Povertyof
    between: [0,5]
  - name: thoughts_interrupted
    dtype: integer
    maps: Blocking
    between: [0,5]
  - name: response_latency_increase
    dtype: integer
    maps: Increased
    between: [0,5]
  - name: alogia_global_rating
    dtype: integer
    maps: GlobalRating
    between: [0,5]
  - name: grooming_rating
    dtype: integer
    maps: Grooming
    between: [0,5]
  - name: work_impersistence
    dtype: integer
    maps: Impersistence
    between: [0,5]
  - name: physical_anergia
    dtype: integer
    maps: Physical
    between: [0,5]
  - name: avolition_apathy_global_rating
    dtype: integer
    maps: GlobalRatingof
    between: [0,5]
  - name: recreational_interests
    dtype: integer
    maps: Recreational
    between: [0,5]
  - name: sexual_activity
    dtype: integer
    maps: Sexual
    between: [0,5]
  - name: closeness_feel_ability
    dtype: integer
    maps: Ability
    between: [0,5]
  - name: relationship_with_friends
    dtype: integer
    maps: Relationships
    between: [0,5]
  - name: anhedonia_asociality_global_rating
    dtype: integer
    maps: GlobalRatingofAnhedonia
    between: [0,5]
  - name: social_inattentiveness
    dtype: integer
    maps: Social1
    between: [0,5]
  - name: mental_status_testing_inattentiveness
    dtype: integer
    maps: Inattentiveness
    between: [0,5]
  - name: attention_global_rating
    dtype: integer
    maps: GlobalRatingofAttention
    between: [0,5]
  - name: affective_score
    dtype: integer
    maps: affective_total
    between: [0,40]
  - name: alogia_score
    dtype: integer
    maps: alogia_total
    between: [0,25]
  - name: avolition_score
    dtype: integer
    maps: avolition_total
    between: [0,20]
  - name: anhedonia_score
    dtype: integer
    maps: anhedonia_total
    between: [0,25]
  - name: attention_score
    dtype: integer
    maps: attention_total
    between: [0,15]
  - name: score
    dtype: integer
    maps: total
    between: [0,125]
  - name: update_timestamp
    dtype: datetime
    maps: date_of_last_update
---
table: _positive_symptoms_assessment
maps: saps_table
refs:
  - cols: [subject, session]
    links: [_assessments.subject, _assessments.session]
cols:
  - name: id
    dtype: integer
    maps: id
  - name: subject
    primary: yes
    dtype: str(6)
    maps: assessmentId
    extract: "[0-9]{3}([0-9]{6})"
    like: "D[0-9]{4}"
    replace:
      value: subjectID
      to: D_number
      file: ""
  - name: session
    primary: yes
    dtype: str(3)
    maps: assessmentId
    extract: "([0-9]{3})[0-9]{6}"
    like: "[0-9]{3}"
  - name: auditory_hallucinations
    dtype: integer
    maps: Auditory
    between: [0,5]
  - name: voices_commenting
    dtype: integer
    maps: Voices
    between: [0,5]
  - name: voices_conversing
    dtype: integer
    maps: VoicesConversing
    between: [0,5]
  - name: somatic_hallucinations
    dtype: integer
    maps: Somaticor
    between: [0,5]
  - name: olfactory_hallucinations
    dtype: integer
    maps: Olfactory
    between: [0,5]
  - name: visual_hallucinations
    dtype: integer
    maps: Visual
    between: [0,5]
  - name: hallucinations_global_rating
    dtype: integer
    maps: GlobalRatingofHallucinations
    between: [0,5]
  - name: persecutary_delusions
    dtype: integer
    maps: Persecutory
    between: [0,5]
  - name: delusions_of_jealousy
    dtype: integer
    maps: Delusions
    between: [0,5]
  - name: delusions_of_guilt
    dtype: integer
    maps: Delusionsof
    between: [0,5]
  - name: grandiose_delusions
    dtype: integer
    maps: Grandiose
    between: [0,5]
  - name: religious_delusions
    dtype: integer
    maps: Religious
    between: [0,5]
  - name: somatic_delusions
    dtype: integer
    maps: Somatic
    between: [0,5]
  - name: delusions_of_reference
    dtype: integer
    maps: DelusionsofReference
    between: [0,5]
  - name: delusions_of_being_controlled
    dtype: integer
    maps: DelusionsofBeing
    between: [0,5]
  - name: delusion_of_mind_reading
    dtype: integer
    maps: DelusionsofMind
    between: [0,5]
  - name: thought_broadcasting
    dtype: integer
    maps: Thought
    between: [0,5]
  - name: thought_insertion
    dtype: integer
    maps: ThoughtInsertion
    between: [0,5]
  - name: thought_withdrawal
    dtype: integer
    maps: ThoughtWithdrawal
    between: [0,5]
  - name: delusion_global_rating
    dtype: integer
    maps: GlobalRatingofDelusions
    between: [0,5]
  - name: clothing_and_appearance
    dtype: integer
    maps: Clothing
    between: [0,5]
  - name: social_behavior
    dtype: integer
    maps: Social
    between: [0,5]
  - name: aggressive_behavior
    dtype: integer
    maps: Aggressive
    between: [0,5]
  - name: repeptitive_behavior
    dtype: integer
    maps: Repetitiveor
    between: [0,5]
  - name: bizarre_behavior_global_rating
    dtype: integer
    maps: GlobalRatingofBizarre
    between: [0,5]
  - name: derailment
    dtype: integer
    maps: Derailment
    between: [0,5]
  - name: tangentiality
    dtype: integer
    maps: Tangentiality
    between: [0,5]
  - name: incoherance
    dtype: integer
    maps: Incoherence
    between: [0,5]
  - name: illogicality
    dtype: integer
    maps: Illogicality
    between: [0,5]
  - name: circumstantiality
    dtype: integer
    maps: Circumstantiality
    between: [0,5]
  - name: pressure_of_speech
    dtype: integer
    maps: Pressure
    between: [0,5]
  - name: distractable_speech
    dtype: integer
    maps: Distractible
    between: [0,5]
  - name: clanging
    dtype: integer
    maps: Changing
    between: [0,5]
  - name: positive_formal_thought_disorder_global_rating
    dtype: integer
    maps: Global
    between: [0,5]
  - name: hallucinations_rating
    dtype: integer
    maps: hallucinations_total
    betweeen: [0,30]
  - name: delusions_rating
    dtype: integer
    maps: delusions_total
    betweeen: [0,30]
  - name: bizzarre_rating
    dtype: integer
    maps: bizzarre_total
    betweeen: [0,20]
  - name: positive_rating
    dtype: integer
    maps: positive_total
    betweeen: [0,40]
  - name: score
    dtype: integer
    maps: total
    betweeen: [0,120]
  - name: update_timestamp
    dtype: datetime
    maps: date_of_last_update
---
table: _young_mania_rating_scale
maps: young_mania_table
refs:
  - cols: [subject, session]
    links: [_assessments.subject, _assessments.session]
cols:
  - name: id
    dtype: integer
    maps: id
  - name: subject
    primary: yes
    dtype: str(6)
    maps: assessmentId
    extract: "[0-9]{3}([0-9]{6})"
    like: "D[0-9]{4}"
    replace:
      value: subjectID
      to: D_number
      file: ""
  - name: session
    primary: yes
    dtype: str(3)
    maps: assessmentId
    extract: "([0-9]{3})[0-9]{6}"
    like: "[0-9]{3}"
  - name: elevated_mood
    dtype: integer
    maps: Elevated
    between: [0,4]
  - name: increased_motor_activity
    dtype: integer
    maps: Increased
    between: [0,4]
  - name: sexual_interest
    dtype: integer
    maps: Sexual
    between: [0,4]
  - name: sleep
    dtype: integer
    maps: Sleep
    between: [0,4]
  - name: irritability
    dtype: integer
    maps: Irritability
    like: "[02468]"
    between: [0,8]
  - name: speech
    dtype: integer
    maps: Speech1
    like: "[02468]"
    between: [0,8]
  - name: language_disorder
    dtype: integer
    maps: Language
    between: [0,4]
  - name: thought_content
    dtype: integer
    maps: Thought
    like: "[02468]"
    between: [0,8]
  - name: disruptive_behavior
    dtype: integer
    maps: Disruptive
    like: "[02468]"
    between: [0,8]
  - name: appearance
    dtype: integer
    maps: Appearance
    between: [0,4]
  - name: insight
    dtype: integer
    maps: Insight
    between: [0,4]
  - name: score
    dtype: integer
    maps: total
    between: [0,60]
  - name: update_timestamp
    dtype: datetime
    maps: date_of_last_update
---
table: _severity_of_alcohol_dependence
maps: sadq_table
refs:
  - cols: [subject, session]
    links: [_assessments.subject, _assessments.session]
cols:
  - name: id
    dtype: integer
    maps: id
  - name: subject
    primary: yes
    dtype: str(6)
    maps: assessmentId
    extract: "[0-9]{3}([0-9]{6})"
    like: "D[0-9]{4}"
    replace:
      value: subjectID
      to: D_number
      file: ""
  - name: session
    primary: yes
    dtype: str(3)
    maps: assessmentId
    extract: "([0-9]{3})[0-9]{6}"
    like: "[0-9]{3}"
  - name: month_of_heavy_drinking
    dtype: str
    maps: month_year
    extract: "(\\w+) - \\d+"
    like: "(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)"
    case: lower
  - name: year_of_heavy_drinking
    dtype: integer
    maps: month_year
    extract: "\\w+ - (\\d+)"
    between: [2000, 2050]
  - name: next_day_wake_up_feeling_sweaty
    dtype: integer
    maps: ans1
    between: [0,3]
  - name: next_day_shaking_hands_in_morning
    dtype: integer
    maps: ans2
    between: [0,3]
  - name: next_day_body_shakes_violently_in_morning
    dtype: integer
    maps: ans3
    between: [0,3]
  - name: next_day_drenched_in_sweat_in_morning
    dtype: integer
    maps: ans4
    between: [0,3]
  - name: next_day_dread_waking_up
    dtype: integer
    maps: ans5
    between: [0,3]
  - name: next_day_frightened_of_meeting_people
    dtype: integer
    maps: ans6
    between: [0,3]
  - name: next_day_felt_at_edge_of_despair
    dtype: integer
    maps: ans7
    between: [0,3]
  - name: next_day_felt_frightened_in_morning
    dtype: integer
    maps: ans8
    between: [0,3]
  - name: next_day_like_drinking_again_in_morning
    dtype: integer
    maps: ans9
    between: [0,3]
  - name: next_day_gulp_first_few_drinks
    dtype: integer
    maps: ans10
    between: [0,3]
  - name: next_day_drank_alcohol_to_rid_shakes
    dtype: integer
    maps: ans11
    between: [0,3]
  - name: next_day_strong_craving_for_drink_in_morning
    dtype: integer
    maps: ans12
    between: [0,3]
  - name: drank_more_than_quarter_per_day
    dtype: integer
    maps: ans13
    between: [0,3]
  - name: drank_more_than_half_per_day
    dtype: integer
    maps: ans14
    between: [0,3]
  - name: drank_more_than_one_per_day
    dtype: integer
    maps: ans15
    between: [0,3]
  - name: drank_more_than_two_per_day
    dtype: integer
    maps: ans16
    between: [0,3]
  - name: relapse_drinking_morning_sweating
    dtype: integer
    maps: ans17
    between: [0,3]
  - name: relapse_drinking_hands_shaking
    dtype: integer
    maps: ans18
    between: [0,3]
  - name: relapse_drinking_body_shaking
    dtype: integer
    maps: ans19
    between: [0,3]
  - name: relapse_drinking_alcohol_craving
    dtype: integer
    maps: ans20
    between: [0,3]
  - name: physical_withdrawal_score
    dtype: integer
    maps: score_1_4
    like: ^[0-1]?\d$
    between: [0,12]
  - name: affective_withdrawal_score
    dtype: integer
    maps: score_5_8
    between: [0,12]
  - name: withdrawal_relief_drinking_score
    dtype: integer
    maps: score_9_12
    between: [0,12]
  - name: alcohol_consumption_score
    dtype: integer
    maps: score_13_16
    between: [0,12]
  - name: rapidity_of_reinstatement_score
    dtype: integer
    maps: score_17_20
    between: [0,12]
  - name: score
    dtype: integer
    maps: total
    between: [0,60]
  - name: update_timestamp
    dtype: datetime
    maps: date_of_last_update
---
table: _yale_brown_obsessive_compulsive_scale
maps: ocdybocschecklistandseverityassessments_table
refs:
  - cols: [subject, session]
    links: [_assessments.subject, _assessments.session]
cols:
  - name: id
    dtype: integer
    maps: id
  - name: subject
    primary: yes
    dtype: str(6)
    maps: assessmentId
    extract: "[0-9]{3}([0-9]{6})"
    like: "D[0-9]{4}"
    replace:
      value: subjectID
      to: D_number
      file: ""
  - name: session
    primary: yes
    dtype: str(3)
    maps: assessmentId
    extract: "([0-9]{3})[0-9]{6}"
    like: "[0-9]{3}"
  - name: time_spent_on_obsessive_thoughts
    dtype: integer
    maps: How
    between: [0,4]
  - name: interference_by_obsessive_thoughts
    dtype: integer
    maps: Howmuch
    between: [0,4]
  - name: distress_caused_by_obsessive_thoughts
    dtype: integer
    maps: Howmuchdistress
    between: [0,4]
  - name: resistance_against_obsessions
    dtype: integer
    maps: Howmuchofan
    between: [0,4]
  - name: control_over_obsessive_thoughts
    dtype: integer
    maps: Howmuchcontrol
    between: [0,4]
  - name: time_spent_performing_compulsive_behaviors
    dtype: integer
    maps: Howmuchtime
    between: [0,4]
  - name: interference_by_compulsive_behaviors
    dtype: integer
    maps: Howmuchdo
    between: [0,4]
  - name: distress_caused_by_compulsive_behaviors
    dtype: integer
    maps: Howwould
    between: [0,4]
  - name: effort_to_resist_compulsive_behaviors
    dtype: integer
    maps: Howmuchof
    between: [0,4]
  - name: control_over_compulsive_behaviors
    dtype: integer
    maps: Howstrong
    between: [0,4]
  - name: insight_rating
    dtype: integer
    maps: insight_score
    between: [0,4]
  - name: avoidance_rating
    dtype: integer
    maps: avoidance_score
    between: [0,4]
  - name: obsession_score
    dtype: integer
    maps: obsessive_total
    between: [0,25]
  - name: compulsion_score
    dtype: integer
    maps: compulsive_total
    between: [0,25]
  - name: score
    dtype: integer
    maps: ybocs_total
    between: [0,50]
  - name: update_timestamp
    dtype: datetime
    maps: date_of_last_update
---
table: _yale_brown_obsessive_compulsive_symptoms
maps: ocdybocschecklistandseverityassessments_table
refs:
  - cols: [subject, session]
    links: [_assessments.subject, _assessments.session]
cols:
  - name: id
    dtype: integer
    maps: id
  - name: subject
    primary: yes
    dtype: str(6)
    maps: assessmentId
    extract: "[0-9]{3}([0-9]{6})"
    like: "D[0-9]{4}"
    replace:
      value: subjectID
      to: D_number
      file: ""
  - name: session
    primary: yes
    dtype: str(3)
    maps: assessmentId
    extract: "([0-9]{3})[0-9]{6}"
    like: "[0-9]{3}"
  - name: fear_of_self_harm
    dtype: integer
    maps: etFear
    between: [1,3]
    replace:
      - value: "Current"
        to: "1"
      - value: "Current,"
        to: "1"
      - value: ",Past"
        to: "2"
      - value: "Past"
        to: "2"
      - value: "Current,Past"
        to: "3"
  - name: fear_of_harming_others
    dtype: integer
    maps: etFearmight
    between: [1,3]
    replace:
      - value: "Current"
        to: "1"
      - value: "Current,"
        to: "1"
      - value: ",Past"
        to: "2"
      - value: "Past"
        to: "2"
      - value: "Current,Past"
        to: "3"
  - name: violent_images
    dtype: integer
    maps: etViolent
    between: [1,3]
    replace:
      - value: "Current"
        to: "1"
      - value: "Current,"
        to: "1"
      - value: ",Past"
        to: "2"
      - value: "Past"
        to: "2"
      - value: "Current,Past"
        to: "3"
  - name: fear_of_blurting_insults
    dtype: integer
    maps: etFearof
    between: [1,3]
    replace:
      - value: "Current"
        to: "1"
      - value: "Current,"
        to: "1"
      - value: ",Past"
        to: "2"
      - value: "Past"
        to: "2"
      - value: "Current,Past"
        to: "3"
  - name: fear_of_doing_embarrassing_things
    dtype: integer
    maps: etFearofdoing
    between: [1,3]
    replace:
      - value: "Current"
        to: "1"
      - value: "Current,"
        to: "1"
      - value: ",Past"
        to: "2"
      - value: "Past"
        to: "2"
      - value: "Current,Past"
        to: "3"
  - name: fear_of_acting_on_impulses
    dtype: integer
    maps: etFearwillact
    between: [1,3]
    replace:
      - value: "Current"
        to: "1"
      - value: "Current,"
        to: "1"
      - value: ",Past"
        to: "2"
      - value: "Past"
        to: "2"
      - value: "Current,Past"
        to: "3"
  - name: fear_of_stealing
    dtype: integer
    maps: etFearwill
    between: [1,3]
    replace:
      - value: "Current"
        to: "1"
      - value: "Current,"
        to: "1"
      - value: ",Past"
        to: "2"
      - value: "Past"
        to: "2"
      - value: "Current,Past"
        to: "3"
  - name: fear_will_harm_other_if_careless
    dtype: integer
    maps: etFearwillharm
    between: [1,3]
    replace:
      - value: "Current"
        to: "1"
      - value: "Current,"
        to: "1"
      - value: ",Past"
        to: "2"
      - value: "Past"
        to: "2"
      - value: "Current,Past"
        to: "3"
  - name: fear_of_responsibility_for_terrible
    dtype: integer
    maps: etFearwillbe
    between: [1,3]
    replace:
      - value: "Current"
        to: "1"
      - value: "Current,"
        to: "1"
      - value: ",Past"
        to: "2"
      - value: "Past"
        to: "2"
      - value: "Current,Past"
        to: "3"
  - name: disgust_with_bodily_secretions
    dtype: integer
    maps: etConcern
    between: [1,3]
    replace:
      - value: "Current"
        to: "1"
      - value: "Current,"
        to: "1"
      - value: ",Past"
        to: "2"
      - value: "Past"
        to: "2"
      - value: "Current,Past"
        to: "3"
  - name: concern_with_germs
    dtype: integer
    maps: etConcerned
    between: [1,3]
    replace:
      - value: "Current"
        to: "1"
      - value: "Current,"
        to: "1"
      - value: ",Past"
        to: "2"
      - value: "Past"
        to: "2"
      - value: "Current,Past"
        to: "3"
  - name: concern_with_environmental_contaminants
    dtype: integer
    maps: etExcessive
    between: [1,3]
    replace:
      - value: "Current"
        to: "1"
      - value: "Current,"
        to: "1"
      - value: ",Past"
        to: "2"
      - value: "Past"
        to: "2"
      - value: "Current,Past"
        to: "3"
  - name: concern_with_household_items
    dtype: integer
    maps: etExcessiveconcern
    between: [1,3]
    replace:
      - value: "Current"
        to: "1"
      - value: "Current,"
        to: "1"
      - value: ",Past"
        to: "2"
      - value: "Past"
        to: "2"
      - value: "Current,Past"
        to: "3"
  - name: bothered_by_sticky_residues
    dtype: integer
    maps: etExcessivebothered
    between: [1,3]
    replace:
      - value: "Current"
        to: "1"
      - value: "Current,"
        to: "1"
      - value: ",Past"
        to: "2"
      - value: "Past"
        to: "2"
      - value: "Current,Past"
        to: "3"
  - name: concerned_will_get_ill
    dtype: integer
    maps: etConcernedwill
    between: [1,3]
    replace:
      - value: "Current"
        to: "1"
      - value: "Current,"
        to: "1"
      - value: ",Past"
        to: "2"
      - value: "Past"
        to: "2"
      - value: "Current,Past"
        to: "3"
  - name: concerned_will_spread_germs
    dtype: integer
    maps: etConcernedwillget
    between: [1,3]
    replace:
      - value: "Current"
        to: "1"
      - value: "Current,"
        to: "1"
      - value: ",Past"
        to: "2"
      - value: "Past"
        to: "2"
      - value: "Current,Past"
        to: "3"
  - name: not_concerned_with_contamination_consequences
    dtype: integer
    maps: etNoconcern
    between: [1,3]
    replace:
      - value: "Current"
        to: "1"
      - value: "Current,"
        to: "1"
      - value: ",Past"
        to: "2"
      - value: "Past"
        to: "2"
      - value: "Current,Past"
        to: "3"
  - name: other_contamination_obsessions
    dtype: integer
    maps: etOther1
    between: [1,3]
    replace:
      - value: "Current"
        to: "1"
      - value: "Current,"
        to: "1"
      - value: ",Past"
        to: "2"
      - value: "Past"
        to: "2"
      - value: "Current,Past"
        to: "3"
  - name:  doubt_performing_activities
    dtype: integer
    maps: etAfter
    between: [1,3]
    replace:
      - value: "Current"
        to: "1"
      - value: "Current,"
        to: "1"
      - value: ",Past"
        to: "2"
      - value: "Past"
        to: "2"
      - value: "Current,Past"
        to: "3"
  - name: unacceptable_sexual_thoughts
    dtype: integer
    maps: etPersonally
    between: [1,3]
    replace:
      - value: "Current"
        to: "1"
      - value: "Current,"
        to: "1"
      - value: ",Past"
        to: "2"
      - value: "Past"
        to: "2"
      - value: "Current,Past"
        to: "3"
  - name: sexual_thoughts_of_children
    dtype: integer
    maps: etContents
    between: [1,3]
    replace:
      - value: "Current"
        to: "1"
      - value: "Current,"
        to: "1"
      - value: ",Past"
        to: "2"
      - value: "Past"
        to: "2"
      - value: "Current,Past"
        to: "3"
  - name: sexual_thoughts_of_homosexuality
    dtype: integer
    maps: etContentinvolves
    between: [1,3]
    replace:
      - value: "Current"
        to: "1"
      - value: "Current,"
        to: "1"
      - value: ",Past"
        to: "2"
      - value: "Past"
        to: "2"
      - value: "Current,Past"
        to: "3"
  - name: aggressive_sexual_behaviors
    dtype: integer
    maps: etSexualbehavior
    between: [1,3]
    replace:
      - value: "Current"
        to: "1"
      - value: "Current,"
        to: "1"
      - value: ",Past"
        to: "2"
      - value: "Past"
        to: "2"
      - value: "Current,Past"
        to: "3"
  - name: other_sexual_obsessions
    dtype: integer
    maps: etOthers2
    between: [1,3]
    replace:
      - value: "Current"
        to: "1"
      - value: "Current,"
        to: "1"
      - value: ",Past"
        to: "2"
      - value: "Past"
        to: "2"
      - value: "Current,Past"
        to: "3"
  - name: collect_useless_items
    dtype: integer
    maps: etCollect
    between: [1,3]
    replace:
      - value: "Current"
        to: "1"
      - value: "Current,"
        to: "1"
      - value: ",Past"
        to: "2"
      - value: "Past"
        to: "2"
      - value: "Current,Past"
        to: "3"
  - name: concerned_with_losing_items
    dtype: integer
    maps: etConcernedwithlosing
    between: [1,3]
    replace:
      - value: "Current"
        to: "1"
      - value: "Current,"
        to: "1"
      - value: ",Past"
        to: "2"
      - value: "Past"
        to: "2"
      - value: "Current,Past"
        to: "3"
  - name: concerned_with_blasphemy
    dtype: integer
    maps: etConcernedwith
    between: [1,3]
    replace:
      - value: "Current"
        to: "1"
      - value: "Current,"
        to: "1"
      - value: ",Past"
        to: "2"
      - value: "Past"
        to: "2"
      - value: "Current,Past"
        to: "3"
  - name: excess_concern_with_morality
    dtype: integer
    maps: etExcess
    between: [1,3]
    replace:
      - value: "Current"
        to: "1"
      - value: "Current,"
        to: "1"
      - value: ",Past"
        to: "2"
      - value: "Past"
        to: "2"
      - value: "Current,Past"
        to: "3"
  - name: bothered_by_order
    dtype: integer
    maps: etBothered
    between: [1,3]
    replace:
      - value: "Current"
        to: "1"
      - value: "Current,"
        to: "1"
      - value: ",Past"
        to: "2"
      - value: "Past"
        to: "2"
      - value: "Current,Past"
        to: "3"
  - name: symmetry_while_grooming
    dtype: integer
    maps: etExactness
    between: [1,3]
    replace:
      - value: "Current"
        to: "1"
      - value: "Current,"
        to: "1"
      - value: ",Past"
        to: "2"
      - value: "Past"
        to: "2"
      - value: "Current,Past"
        to: "3"
  - name: magical_thinking
    dtype: integer
    maps: etAccompanied
    between: [1,3]
    replace:
      - value: "Current"
        to: "1"
      - value: "Current,"
        to: "1"
      - value: ",Past"
        to: "2"
      - value: "Past"
        to: "2"
      - value: "Current,Past"
        to: "3"
  - name: no_magical_thinking
    dtype: integer
    maps: etNot
    between: [1,3]
    replace:
      - value: "Current"
        to: "1"
      - value: "Current,"
        to: "1"
      - value: ",Past"
        to: "2"
      - value: "Past"
        to: "2"
      - value: "Current,Past"
        to: "3"
  - name: need_to_remember
    dtype: integer
    maps: etNeed
    between: [1,3]
    replace:
      - value: "Current"
        to: "1"
      - value: "Current,"
        to: "1"
      - value: ",Past"
        to: "2"
      - value: "Past"
        to: "2"
      - value: "Current,Past"
        to: "3"
  - name: fear_of_saying_things
    dtype: integer
    maps: etFearofsaying
    between: [1,3]
    replace:
      - value: "Current"
        to: "1"
      - value: "Current,"
        to: "1"
      - value: ",Past"
        to: "2"
      - value: "Past"
        to: "2"
      - value: "Current,Past"
        to: "3"
  - name: fear_of_not_saying_right_things
    dtype: integer
    maps: etFearofnotsaying
    between: [1,3]
    replace:
      - value: "Current"
        to: "1"
      - value: "Current,"
        to: "1"
      - value: ",Past"
        to: "2"
      - value: "Past"
        to: "2"
      - value: "Current,Past"
        to: "3"
  - name: fear_of_losing_things
    dtype: integer
    maps: etFearoflosing
    between: [1,3]
    replace:
      - value: "Current"
        to: "1"
      - value: "Current,"
        to: "1"
      - value: ",Past"
        to: "2"
      - value: "Past"
        to: "2"
      - value: "Current,Past"
        to: "3"
  - name: superstitious_fear
    dtype: integer
    maps: etSuperstitious
    between: [1,3]
    replace:
      - value: "Current"
        to: "1"
      - value: "Current,"
        to: "1"
      - value: ",Past"
        to: "2"
      - value: "Past"
        to: "2"
      - value: "Current,Past"
        to: "3"
  - name: intrusive_meaningless_thoughts
    dtype: integer
    maps: etIntrusive
    between: [1,3]
    replace:
    replace:
      - value: "Current"
        to: "1"
      - value: "Current,"
        to: "1"
      - value: ",Past"
        to: "2"
      - value: "Past"
        to: "2"
      - value: "Current,Past"
        to: "3"
  - name: other_miscellaneous_obsessions
    dtype: integer
    maps: etOthers4
    between: [1,3]
    replace:
      - value: "Current"
        to: "1"
      - value: "Current,"
        to: "1"
      - value: ",Past"
        to: "2"
      - value: "Past"
        to: "2"
      - value: "Current,Past"
        to: "3"
  - name: concern_with_illness
    dtype: integer
    maps: etConcernwithillness
    between: [1,3]
    replace:
      - value: "Current"
        to: "1"
      - value: "Current,"
        to: "1"
      - value: ",Past"
        to: "2"
      - value: "Past"
        to: "2"
      - value: "Current,Past"
        to: "3"
  - name: excessive_concern_with_body
    dtype: integer
    maps: etExcessiveconcernwithbody
    between: [1,3]
    replace:
      - value: "Current"
        to: "1"
      - value: "Current,"
        to: "1"
      - value: ",Past"
        to: "2"
      - value: "Past"
        to: "2"
      - value: "Current,Past"
        to: "3"
  - name: other_somatic_obsessions
    dtype: integer
    maps: etOthers
    between: [1,3]
    replace:
      - value: "Current"
        to: "1"
      - value: "Current,"
        to: "1"
      - value: ",Past"
        to: "2"
      - value: "Past"
        to: "2"
      - value: "Current,Past"
        to: "3"
  - name: ritualized_hand_washing
    dtype: integer
    maps: etExcessiveor
    between: [1,3]
    replace:
      - value: "Current"
        to: "1"
      - value: "Current,"
        to: "1"
      - value: ",Past"
        to: "2"
      - value: "Past"
        to: "2"
      - value: "Current,Past"
        to: "3"
  - name: ritualized_grooming
    dtype: integer
    maps: etExcessiveorritualized
    between: [1,3]
    replace:
      - value: "Current"
        to: "1"
      - value: "Current,"
        to: "1"
      - value: ",Past"
        to: "2"
      - value: "Past"
        to: "2"
      - value: "Current,Past"
        to: "3"
  - name: cleaning_household_items
    dtype: integer
    maps: etCleaningof
    between: [1,3]
    replace:
      - value: "Current"
        to: "1"
      - value: "Current,"
        to: "1"
      - value: ",Past"
        to: "2"
      - value: "Past"
        to: "2"
      - value: "Current,Past"
        to: "3"
  - name: preventing_contaminant_contact
    dtype: integer
    maps: etOthermeasures
    between: [1,3]
    replace:
      - value: "Current"
        to: "1"
      - value: "Current,"
        to: "1"
      - value: ",Past"
        to: "2"
      - value: "Past"
        to: "2"
      - value: "Current,Past"
        to: "3"
  - name: avoiding_contaminant_contact
    dtype: integer
    maps: etAvoidance
    between: [1,3]
    replace:
      - value: "Current"
        to: "1"
      - value: "Current,"
        to: "1"
      - value: ",Past"
        to: "2"
      - value: "Past"
        to: "2"
      - value: "Current,Past"
        to: "3"
  - name: checking_for_harm
    dtype: integer
    maps: etCheckingthat
    between: [1,3]
    replace:
      - value: "Current"
        to: "1"
      - value: "Current,"
        to: "1"
      - value: ",Past"
        to: "2"
      - value: "Past"
        to: "2"
      - value: "Current,Past"
        to: "3"
  - name: checkings_locks
    dtype: integer
    maps: etCheckinglocks
    between: [1,3]
    replace:
      - value: "Current"
        to: "1"
      - value: "Current,"
        to: "1"
      - value: ",Past"
        to: "2"
      - value: "Past"
        to: "2"
      - value: "Current,Past"
        to: "3"
  - name: checking_for_mistakes
    dtype: integer
    maps: etCheckingthatdid
    between: [1,3]
    replace:
      - value: "Current"
        to: "1"
      - value: "Current,"
        to: "1"
      - value: ",Past"
        to: "2"
      - value: "Past"
        to: "2"
      - value: "Current,Past"
        to: "3"
  - name: checking_for_terrible_things
    dtype: integer
    maps: etCheckingthatnothing
    between: [1,3]
    replace:
      - value: "Current"
        to: "1"
      - value: "Current,"
        to: "1"
      - value: ",Past"
        to: "2"
      - value: "Past"
        to: "2"
      - value: "Current,Past"
        to: "3"
  - name: checking_tied_to_somatic
    dtype: integer
    maps: etCheckingtied
    between: [1,3]
    replace:
      - value: "Current"
        to: "1"
      - value: "Current,"
        to: "1"
      - value: ",Past"
        to: "2"
      - value: "Past"
        to: "2"
      - value: "Current,Past"
        to: "3"
  - name: checking_personal_appearance
    dtype: integer
    maps: etCheckingforpersonal
    between: [1,3]
    replace:
      - value: "Current"
        to: "1"
      - value: "Current,"
        to: "1"
      - value: ",Past"
        to: "2"
      - value: "Past"
        to: "2"
      - value: "Current,Past"
        to: "3"
  - name: rereading
    dtype: integer
    maps: etRereading
    between: [1,3]
    replace:
      - value: "Current"
        to: "1"
      - value: "Current,"
        to: "1"
      - value: ",Past"
        to: "2"
      - value: "Past"
        to: "2"
      - value: "Current,Past"
        to: "3"
  - name: repeating_questions
    dtype: integer
    maps: etRepeatingsame
    between: [1,3]
    replace:
      - value: "Current"
        to: "1"
      - value: "Current,"
        to: "1"
      - value: ",Past"
        to: "2"
      - value: "Past"
        to: "2"
      - value: "Current,Past"
        to: "3"
  - name: repeat_routine_activities
    dtype: integer
    maps: etNeedto
    between: [1,3]
    replace:
      - value: "Current"
        to: "1"
      - value: "Current,"
        to: "1"
      - value: ",Past"
        to: "2"
      - value: "Past"
        to: "2"
      - value: "Current,Past"
        to: "3"
  - name: crossing_rituals
    dtype: integer
    maps: etRituals
    between: [1,3]
    replace:
      - value: "Current"
        to: "1"
      - value: "Current,"
        to: "1"
      - value: ",Past"
        to: "2"
      - value: "Past"
        to: "2"
      - value: "Current,Past"
        to: "3"
  - name: inspecting_household_trash
    dtype: integer
    maps: etInspecting
    between: [1,3]
    replace:
      - value: "Current"
        to: "1"
      - value: "Current,"
        to: "1"
      - value: ",Past"
        to: "2"
      - value: "Past"
        to: "2"
      - value: "Current,Past"
        to: "3"
  - name: line_up_clothes
    dtype: integer
    maps: etLines
    between: [1,3]
    replace:
      - value: "Current"
        to: "1"
      - value: "Current,"
        to: "1"
      - value: ",Past"
        to: "2"
      - value: "Past"
        to: "2"
      - value: "Current,Past"
        to: "3"
  - name: need_for_symmetry
    dtype: integer
    maps: etNeedfor
    between: [1,3]
    replace:
      - value: "Current"
        to: "1"
      - value: "Current,"
        to: "1"
      - value: ",Past"
        to: "2"
      - value: "Past"
        to: "2"
      - value: "Current,Past"
        to: "3"
  - name: activity_incomplete_till_right
    dtype: integer
    maps: etCant
    between: [1,3]
    replace:
      - value: "Current"
        to: "1"
      - value: "Current,"
        to: "1"
      - value: ",Past"
        to: "2"
      - value: "Past"
        to: "2"
      - value: "Current,Past"
        to: "3"
  - name: accumulating_useless_objects
    dtype: integer
    maps: etInspectinghousehold
    between: [1,3]
    replace:
      - value: "Current"
        to: "1"
      - value: "Current,"
        to: "1"
      - value: ",Past"
        to: "2"
      - value: "Past"
        to: "2"
      - value: "Current,Past"
        to: "3"
  - name: mental_rituals
    dtype: integer
    maps: etMental
    between: [1,3]
    replace:
      - value: "Current"
        to: "1"
      - value: "Current,"
        to: "1"
      - value: ",Past"
        to: "2"
      - value: "Past"
        to: "2"
      - value: "Current,Past"
        to: "3"
  - name: pathological_slowness
    dtype: integer
    maps: etPathologicalslowness
    between: [1,3]
    replace:
      - value: "Current"
        to: "1"
      - value: "Current,"
        to: "1"
      - value: ",Past"
        to: "2"
      - value: "Past"
        to: "2"
      - value: "Current,Past"
        to: "3"
  - name: compulsion_by_proxy
    dtype: integer
    maps: etCompulsion
    between: [1,3]
    replace:
      - value: "Current"
        to: "1"
      - value: "Current,"
        to: "1"
      - value: ",Past"
        to: "2"
      - value: "Past"
        to: "2"
      - value: "Current,Past"
        to: "3"
  - name: need_to_touch
    dtype: integer
    maps: etNeedtotouch
    between: [1,3]
    replace:
      - value: "Current"
        to: "1"
      - value: "Current,"
        to: "1"
      - value: ",Past"
        to: "2"
      - value: "Past"
        to: "2"
      - value: "Current,Past"
        to: "3"
  - name: excessive_list_making
    dtype: integer
    maps: etExcessivelist
    between: [1,3]
    replace:
      - value: "Current"
        to: "1"
      - value: "Current,"
        to: "1"
      - value: ",Past"
        to: "2"
      - value: "Past"
        to: "2"
      - value: "Current,Past"
        to: "3"
  - name: need_to_tell
    dtype: integer
    maps: etNeedtotell
    between: [1,3]
    replace:
      - value: "Current"
        to: "1"
      - value: "Current,"
        to: "1"
      - value: ",Past"
        to: "2"
      - value: "Past"
        to: "2"
      - value: "Current,Past"
        to: "3"
  - name: measures_to_prevent
    dtype: integer
    maps: etMeasures
    between: [1,3]
    replace:
      - value: "Current"
        to: "1"
      - value: "Current,"
        to: "1"
      - value: ",Past"
        to: "2"
      - value: "Past"
        to: "2"
      - value: "Current,Past"
        to: "3"
  - name: ritualized_eating_behaviors
    dtype: integer
    maps: etRitualized
    between: [1,3]
    replace:
      - value: "Current"
        to: "1"
      - value: "Current,"
        to: "1"
      - value: ",Past"
        to: "2"
      - value: "Past"
        to: "2"
      - value: "Current,Past"
        to: "3"
  - name: trichotillomania
    dtype: integer
    maps: etTrichotillomania
    between: [1,3]
    replace:
      - value: "Current"
        to: "1"
      - value: "Current,"
        to: "1"
      - value: ",Past"
        to: "2"
      - value: "Past"
        to: "2"
      - value: "Current,Past"
        to: "3"
  - name: superstitions
    dtype: integer
    maps: etSuperstitions
    between: [1,3]
    replace:
      - value: "Current"
        to: "1"
      - value: "Current,"
        to: "1"
      - value: ",Past"
        to: "2"
      - value: "Past"
        to: "2"
      - value: "Current,Past"
        to: "3"
  - name: repeated_reassurance_required
    dtype: integer
    maps: etAsking
    between: [1,3]
    replace:
      - value: "Current"
        to: "1"
      - value: "Current,"
        to: "1"
      - value: ",Past"
        to: "2"
      - value: "Past"
        to: "2"
      - value: "Current,Past"
        to: "3"
  - name: self_damaging_behavior
    dtype: integer
    maps: etSelf
    between: [1,3]
    replace:
      - value: "Current"
        to: "1"
      - value: "Current,"
        to: "1"
      - value: ",Past"
        to: "2"
      - value: "Past"
        to: "2"
      - value: "Current,Past"
        to: "3"
  - name: blinking_rituals
    dtype: integer
    maps: etRitualsinvolved
    between: [1,3]
    replace:
      - value: "Current"
        to: "1"
      - value: "Current,"
        to: "1"
      - value: ",Past"
        to: "2"
      - value: "Past"
        to: "2"
      - value: "Current,Past"
        to: "3"
  - name: other_miscellaneous_compulsions
    dtype: integer
    maps: etOthers5
    between: [1,3]
    replace:
      - value: "Current"
        to: "1"
      - value: "Current,"
        to: "1"
      - value: ",Past"
        to: "2"
      - value: "Past"
        to: "2"
      - value: "Current,Past"
        to: "3"
  - name: aggressive_obsessions_are_principal
    dtype: boolean
    maps: etC
  - name: contamination_obsessions_are_principal
    dtype: boolean
    maps: etA
  - name: pathological_doubts_are_principal
    dtype: boolean
    maps: etG
  - name: sexual_obsessions_are_principal
    dtype: boolean
    maps: etD
  - name: saving_obsessions_are_principal
    dtype: boolean
    maps: etF
  - name: religious_obsessions_are_principal
    dtype: boolean
    maps: etE
  - name: symmetry_obsessions_are_principal
    dtype: boolean
    maps: etH
  - name: miscellaneous_obsessions_are_principal
    dtype: boolean
    maps: etI
  - name: somatic_obsessions_are_principal
    dtype: boolean
    maps: etB
  - name: cleaning_compulsions_are_principal
    dtype: boolean
    maps: etA1
  - name: checking_compulsions_are_principal
    dtype: boolean
    maps: etB1
  - name: repeating_rituals_are_principal
    dtype: boolean
    maps: etC1
  - name: counting_compulsions_are_principal
    dtype: boolean
    maps: etD1
  - name: arranging_compulsions_are_principal
    dtype: boolean
    maps: etE1
  - name: hoarding_compulsions_are_principal
    dtype: boolean
    maps: etF1
  - name: miscellaneous_compulsions_are_principal
    dtype: boolean
    maps: etG1
  - name: update_timestamp
    dtype: datetime
    maps: date_of_last_update
---
table: _mental_status_assessment
maps: mseotd_assessmenttable
refs:
  - cols: [subject, session]
    links: [_assessments.subject, _assessments.session]
cols:
  - name: id
    dtype: integer
    maps: id
  - name: subject
    primary: yes
    dtype: str(6)
    maps: assessmentId
    extract: "[0-9]{3}([0-9]{6})"
    like: "D[0-9]{4}"
    replace:
      value: subjectID
      to: D_number
      file: ""
  - name: session
    primary: yes
    dtype: str(3)
    maps: assessmentId
    extract: "([0-9]{3})[0-9]{6}"
    like: "[0-9]{3}"
  - name: description
    dtype: str(1000)
    maps: mseotd
  - name: update_timestamp
    dtype: datetime
    maps: date_of_last_update
---
table: _physical_examination
maps: physicalexamination_table1
refs:
  - cols: [subject, session]
    links: [_assessments.subject, _assessments.session]
cols:
  - name: id
    dtype: integer
    maps: id
  - name: subject
    primary: yes
    dtype: str(6)
    maps: assessmentId
    extract: "[0-9]{3}([0-9]{6})"
    like: "D[0-9]{4}"
    replace:
      value: subjectID
      to: D_number
      file: ""
  - name: session
    primary: yes
    dtype: str(3)
    maps: assessmentId
    extract: "([0-9]{3})[0-9]{6}"
    like: "[0-9]{3}"
  - name: weight
    dtype: float
    maps: etWeight_
    between: [20,150]
  - name: standing_height
    dtype: float
    maps: etStandingHeight1_
    betweeen: [50,300]
  - name: sitting_height
    dtype: float
    maps: etSittingHeight1_
    between: [45,270]
  - name: height_ratio
    dtype: float
    maps: HeightRatio
    between: [0,1]
  - name: head_circumference
    dtype: float
    maps: etHead1_
    between: [35,70]
  - name: anemia
    dtype: boolean
    maps: Anemia_
  - name: pedal_edema
    dtype: boolean
    maps: Pedal_
  - name: cyanosis
    dtype: boolean
    maps: Cyanosis_
  - name: clubbing
    dtype: boolean
    maps: Clubbing_
  - name: iceterus
    dtype: boolean
    maps: Icterus_
  - name: lymphadenopathy
    dtype: boolean
    maps: Lymphadenopathy_
  - name: pulse_rate
    dtype: integer
    maps: etPulse_
    between: [0,200]
  - name: systolic_blood_pressure_while_seated
    dtype: integer
    maps: etBloodPressureSitting1_
    between: [60,200]
  - name: diastolic_blood_pressure_while_seated
    dtype: integer
    maps: etBloodPressureSitting2_
    between: [50,100]
  - name: systolic_blood_pressure_while_standing
    dtype: integer
    maps: etBloodPressureStanding1_
    between: [70,200]
  - name: diastolic_blood_pressure_while_standing
    dtype: integer
    maps: etBloodPressureStanding2_
    between: [50,120]
  - name: pupil_bilateral_size
    dtype: str
    maps: Equal_
    like: "(equal|unequal)"
    case: lower
  - name: pupil_reflexes
    dtype: str
    maps: Reactive_
    like: "(reactive|sluggish)"
    case: lower
  - name: electric_hair
    dtype: integer
    maps: Hair_
    like: "[012]"
  - name: hair_whorls
    dtype: integer
    maps: Hair2_
    like: "[01]"
  - name: head_circumference
    dtype: integer
    maps: Hair3_
    like: "[012]"
  - name: epicanthus
    dtype: integer
    maps: Epicanthus_
    like: "[012]"
  - name: hypertelorism
    dtype: integer
    maps: Epicanthus2_
    like: "[012]"
  - name: lowset_ears
    dtype: integer
    maps: Lowset_
    like: "[012]"
  - name: adherent_ear_lobes
    dtype: integer
    maps: Adherent_
    like: "[01]"
  - name: lower_edge_of_ears_extend
    dtype: integer
    maps: LowerEdge_
    like: "[01]"
  - name: malformed_ears
    dtype: integer
    maps: Malformed_
    like: "[01]"
  - name: asymmetrical_ears
    dtype: integer
    maps: Asymmetrical_
    like: "[01]"
  - name: soft_and_pliable_ears
    dtype: integer
    maps: Softandpliable_
    like: "[01]"
  - name: oral_cavity_palate
    dtype: integer
    maps: Palate_
    like: "[012]"
  - name: furrowed_tongue
    dtype: integer
    maps: Tongue_
    like: "[012]"
  - name: tongue_with_smooth_rough_spots
    dtype: integer
    maps: Tongue2_
    like: "[01]"
  - name: curved_fifth_finger
    dtype: integer
    maps: Curved_
    like: "[01]"
  - name: transverse_palmar_crease
    dtype: integer
    maps: Transverse
    like: "[01]"
  - name: third_toe
    dtype: integer
    maps: Third
    like: "[012]"
  - name: syndactylia
    dtype: integer
    maps: Syndactylia
    like: "[01]"
  - name: gap_between_first_second_toe
    dtype: integer
    maps: Gap
    like: "[01]"
  - name: waldrop_scale_comments
    dtype: str
    maps: etComments_
  - name: respiratory_system
    dtype: str
    maps: ChRespiratory_
    like: "WNL"
  - name: cardiovascular_system
    dtype: str
    maps: ChCardiovascular_
    like: "WNL"
  - name: abdominal_system
    dtype: str
    maps: ChAbdomen_
    like: "WNL"
  - name: respiratory_system_comment
    dtype: str
    maps: etRespiratory_
  - name: cardiovascular_system_comment
    dtype: str
    maps: etCardiovascular_
  - name: abdominal_system_comment
    dtype: str
    maps: etPerAbdomen_
  - name: hepatocellular_failure
    dtype: str
    maps: Hepatocellular
    like: "(present|absent)"
    case: lower
  - name: cranial_nerves
    dtype: str
    maps: Cranial
    like: "(normal|abnormal)"
    case: lower
  - name: cranial_nerves_comment
    dtype: str
    maps: etCranial_
  - name: power_in_limbs
    dtype: str
    maps: Power
    like: "(equal|unequal)"
    case: lower
  - name: tone_in_limbs
    dtype: str
    maps: Tone
    like: "(normal|abnormal)"
    case: lower
  - name: tone_condition
    dtype: str
    maps: Abnormal
    like: "(hypertonic|hypotonic)"
    case: lower
  - name: tone_condition_comment
    dtype: str
    maps: etAbnormal_
  - name: deep_tendon_reflexes
    dtype: str
    maps: DeepTendon
    like: "(normal|brisk|absent|others)"
    case: lower
  - name: deep_tendon_reflexes_comment
    dtype: str
    maps: etDeepTendon_
  - name: peripheral_neuropathy
    dtype: str
    maps: Peripheral
    like: "(present|absent)"
    case: lower
  - name: rombergs_sign
    dtype: str
    maps: Rombergs
    like: "(positive|negative)"
    case: lower
  - name: cerebellar_coordination
    dtype: str
    maps: Celebellar
    like: "(intact|lost)"
    case: lower
  - name: cerebellar_coordination_comment
    dtype: str
    maps: etCelebellar_
  - name: gait
    dtype: str
    maps: Gait
    like: "(normal|broad based|antalgic|others)"
    case: lower
  - name: gait_comment
    dtype: str
    maps: etGait_
  - name: plantars
    dtype: str
    maps: Plantars
    like: (normal|abnormal)
    case: lower
  - name: primitive_reflexes
    dtype: str
    maps: Primitive
    like: "(absent|present)"
    case: lower
  - name: primitive_reflexes_comment
    dtype: str
    maps: etPrimitive_
  - name: within_normal
    dtype: boolean
    maps: Remarks
  - name: remarks
    dtype: str
    maps: etCoOrdination_
  - name: update_timestamp
    dtype: datetime
    maps: date_of_last_update
---
table: _post_traumatic_stress_disorder
maps: posttraumaticstressdisorder_table
refs:
  - cols: [subject, session]
    links: [_assessments.subject, _assessments.session]
cols:
  - name: id
    dtype: integer
    maps: id
  - name: subject
    primary: yes
    dtype: str(6)
    maps: assessmentId
    extract: "[0-9]{3}([0-9]{6})"
    like: "D[0-9]{4}"
    replace:
      value: subjectID
      to: D_number
      file: ""
  - name: session
    primary: yes
    dtype: str(3)
    maps: assessmentId
    extract: "([0-9]{3})[0-9]{6}"
    like: "[0-9]{3}"
  - name: experienced_traumatic_event
    dtype: boolean
    maps: ans1
  - name: responded_to_event_with_fear
    dtype: boolean
    maps: ans2
  - name: reexperienced_event
    dtype: boolean
    maps: ans3
  - name: avoided_thinking_about_event
    dtype: boolean
    maps: ans4
  - name: avoided_activities_that_remind
    dtype: boolean
    maps: ans5
  - name: trouble_recalling
    dtype: boolean
    maps: ans6
  - name: become_less_interested_in_hobbies
    dtype: boolean
    maps: ans7
  - name: felt_detached
    dtype: boolean
    maps: ans8
  - name: feelings_are_numbed
    dtype: boolean
    maps: ans9
  - name: felt_life_shortened
    dtype: boolean
    maps: ans10
  - name: difficulty_sleeping
    dtype: boolean
    maps: ans12
  - name: irritable
    dtype: boolean
    maps: ans13
  - name: difficulty_concentrating
    dtype: boolean
    maps: ans14
  - name: nervous
    dtype: boolean
    maps: ans15
  - name: easily_startled
    dtype: boolean
    maps: ans16
  - name: problems_interfered_with_work
    dtype: boolean
    maps: ans18
  - name: update_timestamp
    dtype: datetime
    maps: date_of_last_update
---
table: _socialphobia
maps: socialphobia_table
refs:
  - cols: [subject, session]
    links: [_assessments.subject, _assessments.session]
cols:
  - name: id
    dtype: integer
    maps: id
  - name: subject
    primary: yes
    dtype: str(6)
    maps: assessmentId
    extract: "[0-9]{3}([0-9]{6})"
    like: "D[0-9]{4}"
    replace:
      value: subjectID
      to: D_number
      file: ""
  - name: session
    primary: yes
    dtype: str(3)
    maps: assessmentId
    extract: "([0-9]{3})[0-9]{6}"
    like: "[0-9]{3}"
  - name: fear_of_humiliation
    dtype: boolean
    maps: G1
  - name: unreasonable_fear
    dtype: boolean
    maps: G2
  - name: avoid_social_situations_due_to_fear
    dtype: boolean
    maps: G3
  - name: disrupts_work
    dtype: boolean
    maps: G4
  - name: current
    dtype: boolean
    maps: ans3
  - name: type
    dtype: str
    maps: Generalized
    like: "(generalized|non-generalized)"
    case: lower
  - name: update_timestamp
    dtype: datetime
    maps: date_of_last_update
---
table: _suicidality
maps: suicidality_table
refs:
  - cols: [subject, session]
    links: [_assessments.subject, _assessments.session]
cols:
  - name: id
    dtype: integer
    maps: id
  - name: subject
    primary: yes
    dtype: str(6)
    maps: assessmentId
    extract: "[0-9]{3}([0-9]{6})"
    like: "D[0-9]{4}"
    replace:
      value: subjectID
      to: D_number
      file: ""
  - name: session
    primary: yes
    dtype: str(3)
    maps: assessmentId
    extract: "([0-9]{3})[0-9]{6}"
    like: "[0-9]{3}"
  - name: suffered_accident
    dtype: boolean
    maps: ans1
  - name: planned_to_hurt_self_in_accident
    dtype: boolean
    maps: ans2
  - name: intended_to_die_in_accident
    dtype: boolean
    maps: ans3
  - name: wish_you_were_dead
    dtype: boolean
    maps: ans4
  - name: want_to_harm_self
    dtype: boolean
    maps: ans5
  - name: think_about_suicide
    dtype: boolean
    maps: ans6
  - name: suicidal_thoughts_frequency
    dtype: str
    maps: ans14
    like: "(occasionally|often|very often)"
    case: lower
  - name: suicidal_thoughts_intensity
    dtype: str
    maps: ans15
    like: "(mild|moderate|severe)"
    case: lower
  - name: control_these_impulses
    dtype: boolean
    maps: ans7
  - name: have_suicide_plan
    dtype: boolean
    maps: ans8
  - name: prepared_for_attempt
    dtype: boolean
    maps: ans9
  - name: deliberately_injured_without_planning_death
    dtype: boolean
    maps: ans10
  - name: attempt_possible
    dtype: boolean
    maps: ans11
  - name: expected_outcome
    dtype: str
    maps: AttemptSuicideT
    like: "(survival|death)"
    replace:
      - value: "Hoped to be rescued / survive"
        to: "survival"
      - value: "Expected / intended to die"
        to: "death"
  - name: attempted_suicide_before
    dtype: boolean
    maps: ans12
  - name: at_risk
    dtype: boolean
    maps: ans13
  - name: score
    dtype: integer
    maps: sumtotal
    between: [0,50]
  - name: update_timestamp
    dtype: datetime
    maps: date_of_last_update
---
table: _panic_disorder
maps: panicdisorder_table
refs:
  - cols: [subject, session]
    links: [_assessments.subject, _assessments.session]
cols:
  - name: id
    dtype: integer
    maps: id
  - name: subject
    primary: yes
    dtype: str(6)
    maps: assessmentId
    extract: "[0-9]{3}([0-9]{6})"
    like: "D[0-9]{4}"
    replace:
      value: subjectID
      to: D_number
      file: ""
  - name: session
    primary: yes
    dtype: str(3)
    maps: assessmentId
    extract: "([0-9]{3})[0-9]{6}"
    like: "[0-9]{3}"
  - name: had_spells_of_anxiousness
    dtype: boolean
    maps: ans1
  - name: spells_peaked_within_ten_minutes
    dtype: boolean
    maps: ans2
  - name: unpredictable
    dtype: boolean
    maps: ans3
  - name: significant_change_due_to_attack
    dtype: boolean
    maps: ans4
  - name: pounding_heart
    dtype: boolean
    maps: ans5
  - name: sweating_hand
    dtype: boolean
    maps: ans6
  - name: trembling
    dtype: boolean
    maps: ans7
  - name: shortness_of_breath
    dtype: boolean
    maps: ans8
  - name: choking_sensation
    dtype: boolean
    maps: ans9
  - name: chest_pain
    dtype: boolean
    maps: ans10
  - name: nausea
    dtype: boolean
    maps: ans11
  - name: felt_faint
    dtype: boolean
    maps: ans12
  - name: felt_strange
    dtype: boolean
    maps: ans13
  - name: lost_control
    dtype: boolean
    maps: ans14
  - name: feared_death
    dtype: boolean
    maps: ans15
  - name: numbness
    dtype: boolean
    maps: ans16
  - name: chills
    dtype: boolean
    maps: ans17
  - name: current
    dtype: boolean
    maps: ans20
    replace:
      - value: "Yes (PANIC DISORDER CURRENT)"
        to: "Yes"
  - name: lifetime
    dtype: boolean
    maps: ans18
    replace:
      - value: "Yes (PANIC DISORDER LIFETIME)"
        to: "Yes"
  - name: lifetime_limited_symptoms
    dtype: boolean
    maps: ans19
    replace:
      - value: "Yes   (LIMITED SYMPTOM ATTACKS LIFETIME)"
        to: "Yes"
  - name: update_timestamp
    dtype: datetime
    maps: date_of_last_update
---
table: _obsessive_compulsive_disorder
maps: obsessive_compulsivedisorder_table
refs:
  - cols: [subject, session]
    links: [_assessments.subject, _assessments.session]
cols:
  - name: id
    dtype: integer
    maps: id
  - name: subject
    primary: yes
    dtype: str(6)
    maps: assessmentId
    extract: "[0-9]{3}([0-9]{6})"
    like: "D[0-9]{4}"
    replace:
      value: subjectID
      to: D_number
      file: ""
  - name: session
    primary: yes
    dtype: str(3)
    maps: assessmentId
    extract: "([0-9]{3})[0-9]{6}"
    like: "[0-9]{3}"
  - name: bothered_by_recurrent_thoughts
    dtype: boolean
    maps: ans1
  - name: thoughts_keep_coming_back
    dtype: boolean
    maps: ans2
  - name: obsessions_product_of_own_mind
    dtype: boolean
    maps: ans3
    replace:
      - value: "Yes(obsessions)"
        to: "Yes"
  - name: did_something_repeatedly
    dtype: boolean
    maps: ans4
    replace:
      - value: "Yes (compulsions)"
        to: "Yes"
  - name: thoughts_were_unreasonable
    dtype: boolean
    maps: ans6
  - name: current
    dtype: boolean
    maps: ans7
  - name: update_timestamp
    dtype: datetime
    maps: date_of_last_update
---
table: _agoraphobia
maps: agoraphobia_table
refs:
  - cols: [subject, session]
    links: [_assessments.subject, _assessments.session]
cols:
  - name: id
    dtype: integer
    maps: id
  - name: subject
    primary: yes
    dtype: str(6)
    maps: assessmentId
    extract: "[0-9]{3}([0-9]{6})"
    like: "D[0-9]{4}"
    replace:
      value: subjectID
      to: D_number
      file: ""
  - name: session
    primary: yes
    dtype: str(3)
    maps: assessmentId
    extract: "([0-9]{3})[0-9]{6}"
    like: "[0-9]{3}"
  - name: fear_of_places_that_cause_attack
    dtype: boolean
    maps: ans1
  - name: avoidance_due_to_fear
    dtype: boolean
    maps: ans2
  - name: panic_disorder_without_agoraphobia
    dtype: boolean
    maps: ans3
  - name: panic_disorder_with_agoraphobia
    dtype: boolean
    maps: ans4
  - name: agoraphobia_without_panic_disorder_history
    dtype: boolean
    maps: ans5
  - name: update_timestamp
    dtype: datetime
    maps: date_of_last_update
---
table: _alchohol_dependence
maps: alcoholabuseanddependence_table
refs:
  - cols: [subject, session]
    links: [_assessments.subject, _assessments.session]
cols:
  - name: id
    dtype: integer
    maps: id
  - name: subject
    primary: yes
    dtype: str(6)
    maps: assessmentId
    extract: "[0-9]{3}([0-9]{6})"
    like: "D[0-9]{4}"
    replace:
      value: subjectID
      to: D_number
      file: ""
  - name: session
    primary: yes
    dtype: str(3)
    maps: assessmentId
    extract: "([0-9]{3})[0-9]{6}"
    like: "[0-9]{3}"
  - name: history_of_alcohol_dependence
    dtype: boolean
    maps: ans1
  - name: need_more_drink_to_get_same_effect
    dtype: boolean
    maps: ans2
  - name: cutting_down_led_to_shakes
    dtype: boolean
    maps: ans3
  - name: drank_more_than_you_planned
    dtype: boolean
    maps: ans4
  - name: failed_attempt_to_stop
    dtype: boolean
    maps: ans5
  - name: spent_substantial_time_drinking
    dtype: boolean
    maps: ans6
  - name: spent_less_time_working
    dtype: boolean
    maps: ans7
  - name: drinking_despite_knowing_health_problems
    dtype: boolean
    maps: ans8
  - name: current
    dtype: boolean
    maps: ans9
    replace:
      - value: "Yes*"
        to: "Yes"
  - name: update_timestamp
    dtype: datetime
    maps: date_of_last_update
---
table: _alchohol_abuse
maps: alcoholabuseanddependence_table
refs:
  - cols: [subject, session]
    links: [_assessments.subject, _assessments.session]
cols:
  - name: id
    dtype: integer
    maps: id
  - name: subject
    primary: yes
    dtype: str(6)
    maps: assessmentId
    extract: "[0-9]{3}([0-9]{6})"
    like: "D[0-9]{4}"
    replace:
      value: subjectID
      to: D_number
      file: ""
  - name: session
    primary: yes
    dtype: str(3)
    maps: assessmentId
    extract: "([0-9]{3})[0-9]{6}"
    like: "[0-9]{3}"
  - name: intoxication_caused_problems
    dtype: boolean
    maps: ans10
  - name: intoxicated_while_physically_at_risk
    dtype: boolean
    maps: ans11
  - name: legal_problems_due_to_drinking
    dtype: boolean
    maps: ans12
  - name: drinking_despite_problems_with_family
    dtype: boolean
    maps: ans13
  - name: current
    dtype: boolean
    maps: ans14
  - name: update_timestamp
    dtype: datetime
    maps: date_of_last_update
---
table: _anorexia_nervosa
maps: anorexianervosa_table
refs:
  - cols: [subject, session]
    links: [_assessments.subject, _assessments.session]
cols:
  - name: id
    dtype: integer
    maps: id
  - name: subject
    primary: yes
    dtype: str(6)
    maps: assessmentId
    extract: "[0-9]{3}([0-9]{6})"
    like: "D[0-9]{4}"
    replace:
      value: subjectID
      to: D_number
      file: ""
  - name: session
    primary: yes
    dtype: str(3)
    maps: assessmentId
    extract: "([0-9]{3})[0-9]{6}"
    like: "[0-9]{3}"
  - name: height
    dtype: float
    maps: heightInCm
    between: [10, 300]
  - name: lowest_weight_in_past_quarter
    dtype: float
    maps: weightInKg
    between: [10, 200]
  - name: weight_below_threshold
    dtype: boolean
    maps: ans1
  - name: tried_not_to_gain_weight
    dtype: boolean
    maps: ans2
  - name: feared_getting_fat
    dtype: boolean
    maps: ans3
  - name: consider_yourself_fat
    dtype: boolean
    maps: ans4
  - name: body_shape_influenced_self_esteem
    dtype: boolean
    maps: ans5
  - name: think_current_weight_is_excessive
    dtype: boolean
    maps: ans6
  - name: current
    dtype: boolean
    maps: ans9
  - name: update_timestamp
    dtype: datetime
    maps: date_of_last_update
---
table: _anitisocial_personality_disorder
maps: antisocialpersonalitydisorder_table
refs:
  - cols: [subject, session]
    links: [_assessments.subject, _assessments.session]
cols:
  - name: id
    dtype: integer
    maps: id
  - name: subject
    primary: yes
    dtype: str(6)
    maps: assessmentId
    extract: "[0-9]{3}([0-9]{6})"
    like: "D[0-9]{4}"
    replace:
      value: subjectID
      to: D_number
      file: ""
  - name: session
    primary: yes
    dtype: str(3)
    maps: assessmentId
    extract: "([0-9]{3})[0-9]{6}"
    like: "[0-9]{3}"
  - name: ran_away_from_home_or_school_when_young
    dtype: boolean
    maps: ans1
  - name: repeatedly_con_or_steal_when_young
    dtype: boolean
    maps: ans2
  - name: start_fights_or_bully_when_young
    dtype: boolean
    maps: ans3
  - name: deliberately_destroy_things_when_young
    dtype: boolean
    maps: ans4
  - name: deliberately_hurt_animals_when_young
    dtype: boolean
    maps: ans5
  - name: forced_sex_with_others_when_young
    dtype: boolean
    maps: ans6
  - name: behaved_irresponsibly_when_adult
    dtype: boolean
    maps: ans8
  - name: done_illegal_things_when_adult
    dtype: boolean
    maps: ans9
  - name: repeated_physical_fights_when_adult
    dtype: boolean
    maps: ans10
  - name: lied_often_when_adult
    dtype: boolean
    maps: ans11
  - name: exposed_others_to_danger_when_adult
    dtype: boolean
    maps: ans12
  - name: felt_no_guilt_when_adult
    dtype: boolean
    maps: ans13
  - name: lifetime
    dtype: boolean
    maps: ans14
  - name: update_timestamp
    dtype: datetime
    maps: date_of_last_update
---
table: _bulimia_nervosa
maps: bulimianervosa_table
refs:
  - cols: [subject, session]
    links: [_assessments.subject, _assessments.session]
cols:
  - name: id
    dtype: integer
    maps: id
  - name: subject
    primary: yes
    dtype: str(6)
    maps: assessmentId
    extract: "[0-9]{3}([0-9]{6})"
    like: "D[0-9]{4}"
    replace:
      value: subjectID
      to: D_number
      file: ""
  - name: session
    primary: yes
    dtype: str(3)
    maps: assessmentId
    extract: "([0-9]{3})[0-9]{6}"
    like: "[0-9]{3}"
  - name: eating_binges
    dtype: boolean
    maps: ans1
  - name: eating_binges_often
    dtype: boolean
    maps: ans2
  - name: eating_out_of_control
    dtype: boolean
    maps: ans3
  - name: steps_to_prevent_weight_gain
    dtype: boolean
    maps: ans4
  - name: body_shape_influences_self_esteem
    dtype: boolean
    maps: ans5
  - name: anorexia_symptoms
    dtype: boolean
    maps: ans6
  - name: underweight_triggers_binges
    dtype: boolean
    maps: ans7
  - name: threshold_weight
    dtype: float
    maps: usedDrug
    between: [10, 150]
  - name: bulimia
    dtype: boolean
    maps: ans8
  - name: binge_eating_type
    dtype: boolean
    maps: ans9
  - name: update_timestamp
    dtype: datetime
    maps: date_of_last_update
---
table: _recent_life_events
maps: "cambridge_bereavement_table"
refs:
  - cols: [subject, session]
    links: [_assessments.subject, _assessments.session]
cols:
  - name: id
    dtype: integer
    maps: id
  - name: subject
    primary: yes
    dtype: str(6)
    maps: assessmentId
    extract: "[0-9]{3}([0-9]{6})"
    like: "D[0-9]{4}"
    replace:
      value: subjectID
      to: D_number
      file: ""
  - name: session
    primary: yes
    dtype: str(3)
    maps: assessmentId
    extract: "([0-9]{3})[0-9]{6}"
    like: "[0-9]{3}"
  - name: update_timestamp
    dtype: datetime
    maps: date_of_last_update
attach:
  - name: timing
    primary: yes
    dtype: str
  - name: event
    primary: yes
    dtype: str
  - name: occurence
    dtype: integer
  - name: independence
    dtype: integer
  - name: impact
    dtype: integer
detach:
  - name: recent-death_of_close_friend-occurence
    dtype: integer
    maps: m_recent_1
  - name: recent-death_of_close_family-occurence
    dtype: integer
    maps: m_recent_2
  - name: recent-death_of_child-occurence
    dtype: integer
    maps: m_recent_3
  - name: recent-death_of_spouse-occurence
    dtype: integer
    maps: m_recent_4
  - name: recent-lost_item_of_personal_value-occurence
    dtype: integer
    maps: m_recent_5
  - name: recent-death_of_close_friend-independence
    dtype: integer
    maps: i_recent_1
  - name: recent-death_of_close_family-independence
    dtype: integer
    maps: i_recent_2
  - name: recent-death_of_child-independence
    dtype: integer
    maps: i_recent_3
  - name: recent-death_of_spouse-independence
    dtype: integer
    maps: i_recent_4
  - name: recent-lost_item_of_personal_value-independence
    dtype: integer
    maps: i_recent_5
  - name: recent-death_of_close_friend-impact
    dtype: integer
    maps: n_recent_1
  - name: recent-death_of_close_family-impact
    dtype: integer
    maps: n_recent_2
  - name: recent-death_of_child-impact
    dtype: integer
    maps: n_recent_3
  - name: recent-death_of_spouse-impact
    dtype: integer
    maps: n_recent_4
  - name: recent-lost_item_of_personal_value-impact
    dtype: integer
    maps: n_recent_5
  - name: onset-death_of_close_friend-occurence
    dtype: integer
    maps: m_onset_1
  - name: onset-death_of_close_family-occurence
    dtype: integer
    maps: m_onset_2
  - name: onset-death_of_child-occurence
    dtype: integer
    maps: m_onset_3
  - name: onset-death_of_spouse-occurence
    dtype: integer
    maps: m_onset_4
  - name: onset-lost_item_of_personal_value-occurence
    dtype: integer
    maps: m_onset_5
  - name: onset-death_of_close_friend-independence
    dtype: integer
    maps: i_onset_1
  - name: onset-death_of_close_family-independence
    dtype: integer
    maps: i_onset_2
  - name: onset-death_of_child-independence
    dtype: integer
    maps: i_onset_3
  - name: onset-death_of_spouse-independence
    dtype: integer
    maps: i_onset_4
  - name: onset-lost_item_of_personal_value-independence
    dtype: integer
    maps: i_onset_5
  - name: onset-death_of_close_friend-impact
    dtype: integer
    maps: n_onset_1
  - name: onset-death_of_close_family-impact
    dtype: integer
    maps: n_onset_2
  - name: onset-death_of_child-impact
    dtype: integer
    maps: n_onset_3
  - name: onset-death_of_spouse-impact
    dtype: integer
    maps: n_onset_4
  - name: onset-lost_item_of_personal_value-impact
    dtype: integer
    maps: n_onset_5
reshape:
  - add:
      name: category
      value: bereavement
  - melt:
      id_vars: [id, subject, session, category, update_timestamp]
  - split:
      name: variable
      pat: "-"
      rename: [timing, event, variable]
  - pivot:
      columns: variable
      values: value
      index: [subject, session, timing, event]
---
table: _presenting_disorders
maps: hopi_master
refs:
  - cols: [subject, session]
    links: [_assessments.subject, _assessments.session]
cols:
  - name: id
    dtype: integer
    maps: id
  - name: subject
    primary: yes
    dtype: str(6)
    maps: assessmentId
    extract: "[0-9]{3}([0-9]{6})"
    like: "D[0-9]{4}"
    replace:
      value: subjectID
      to: D_number
      file: ""
  - name: session
    primary: yes
    dtype: str(3)
    maps: assessmentId
    extract: "([0-9]{3})[0-9]{6}"
    like: "[0-9]{3}"
  - name: addiction
    dtype: boolean
    maps: Addiction
  - name: bipolar
    dtype: boolean
    maps: Bipolar
  - name: dementia
    dtype: boolean
    maps: Dementia
  - name: ocd
    dtype: boolean
    maps: ocd
  - name: schizophrenia
    dtype: boolean
    maps: Schizophrenia
  - name: update_timestamp
    dtype: datetime
    maps: date_of_last_update