patient <- params$first_name
pronoun <- params$his_her
library(knitr)
knitr::knit_hooks$set(crop = knitr::hook_pdfcrop)
knitr::knit_hooks$set(optipng = knitr::hook_optipng)

# Fix subfigs for rmarkdown -> latex
if (identical(knitr:::pandoc_to(), "latex")) {
  knitr::knit_hooks$set(plot = knitr::hook_plot_tex)
}

knitr::opts_chunk$set(
  # Code block options
  cache = FALSE,
  cache.path = ".cache/",
  crop = TRUE,
  dev = c("CairoPNG", "CairoPDF"),
  dev.args = list(pointsize = 8),
  dpi = 300,
  echo = FALSE,
  error = TRUE,
  fig.height = 3,
  fig.pos = "!ht",
  fig.width = 5,
  include = TRUE,
  message = FALSE,
  par = TRUE,
  results = 'asis',
  root.dir = normalizePath("./"),
  warning = FALSE
)
knitr::opts_knit$set(width = 50)
options(digits = 1, warnPartialMatchArgs = FALSE)
options(knitr.kable.NA = "--")
options(readr.show_col_types = FALSE)
options(tinytex.verbose = TRUE)
knitr::knit_engines$set(marginfigure = function(options) {
  options$type <- "marginfigure"
  eng_block <- knitr::knit_engines$get("block")
  eng_block(options)
})

(ref:wais4) Wechsler Adult Intelligence Scale, 4th ed (WAIS-IV)

(ref:wasi2) Wechsler Abbreviated Scale of Intelligence, 2nd ed (WASI-2)

(ref:ktea3) Kaufman Test of Educational Achievement, 3rd ed (KTEA-3)

(ref:wrat5) Wide Range Achievement Test, 5th ed (WRAT-5)

(ref:wiat3) Wechsler Individual Achievement Test, 3rd ed (WIAT-III)

(ref:wiat4) Wechsler Individual Achievement Test, 4th ed (WIAT-4)

(ref:evt3) Expressive Vocabulary Test, 3rd ed (EVT-3)

(ref:ppvt5) Peabody Picture Vocabulary Test, 5th ed (PPVT-5)

(ref:tiwre) Test of Irregular Word Reading Efficiency (TIWRE)

(ref:nepsy2) NEPSY-II Developmental Neuropsychological Battery

(ref:examiner) NIH Executive Abilities: Measures and Instruments for Neurobehavioral Evaluation and Research (NIH EXAMINER)

(ref:examiner-ut) Unstructured Planning Task

(ref:examiner-fluency) Verbal Fluency

(ref:examiner-brs) Behavior Rating Scale

(ref:cms) Children's Memory Scale (CMS)

(ref:pegboard) Grooved Pegboard Test

(ref:clock) Clock Drawing Test

(ref:bicycle) Bicycle Drawing Task

(ref:rocft) Rey-Osterrieth Complex Figure Test (ROCFT)

(ref:ravlt) Rey Auditory Verbal Learning Test (RAVLT)

(ref:cvltc) California Verbal Learning Test, Child ed (CVLT-C)

(ref:cvlt3) California Verbal Learning Test, 3rd ed (CVLT-3)

(ref:cvlt3-brief) California Verbal Learning Test, 3rd ed (CVLT-3), Brief Form

(ref:wms4) Wechsler Memory Scale, 4th ed (WMS-IV)

(ref:dkefs) Delis-Kaplan Executive Function System (D-KEFS)

(ref:tmt) Trail Making Test

(ref:nab) Neuropsychological Assessment Battery (NAB)

(ref:nabs) Neuropsychological Assessment Battery, Screener (NAB)

(ref:rbans) Repeatable Repeatable Battery for the Assessment of Neuropsychological Status Update (RBANS)

(ref:coca) Colorado Cognitive Assessment (CoCA)

(ref:cet) Cognitive Estimation Test

(ref:celf5) Clinical Evaluation of Language Fundamentals, 5th ed (CELF-5)

(ref:celf5-ors) Clinical Evaluation of Language Fundamentals, 5th ed (CELF-5), Observational Rating Scale

(ref:rist) Reynolds' Intellectual Screening Test (RIST)

(ref:tomm) Test of Memory Malingering (TOMM)

(ref:acs) Advanced Clinical Solutions (ACS)

(ref:acs-word-choice) Word Choice Test

(ref:acs-soc-cog) Social Cognition Battery

(ref:acs-topf) Test of Premorbid Functioning (TOPF)

(ref:abas3) Adaptive Behavior Assessment System, 3rd ed (ABAS-3)

(ref:abas3-parent) ABAS-3 Parent Report

(ref:abas3-teacher) ABAS-3 Teacher Report

(ref:brown) Brown Executive Function/Attention Scales (Brown EF/A)

(ref:brown-pr) Brown EF/A Parent-Report

(ref:brown-tr) Brown EF/A Teacher-Report

(ref:brown-sr) Brown EF/A Self-Report

(ref:cefi) Comprehensive Executive Function Inventory (CEFI)

(ref:cefi-sr) CEFI Adult Self-Report

(ref:cefi-or) CEFI Adult Observer-Report

(ref:caadid) Conners' Adult ADHD Diagnostic Interview for DSM-IV (CAADID), Part I: History

(ref:caars) Conners' Adult ADHD Rating Scale (CAARS)

(ref:caars-sr) CAARS Self-Report

(ref:caars-or) CAARS Observer-Report

(ref:swan) SWAN ADHD Rating Scale

(ref:bai) Beck Anxiety Inventory (BAI)

(ref:bdi2) Beck Depression Inventory, 2nd ed (BDI-2)

(ref:cars2) Childhood Autism Rating Scale, 2nd ed (CARS2)

(ref:cars2-hf) CARS2 High-Functioning Version (CARS2-HF)

(ref:cars2-qpc) CARS2 Questionnaire for Parents/Caregivers (CARS2-QPC)

(ref:sent-comp) Children's Sentence Completion Test

(ref:pai) Personality Assessment Inventory (PAI)

(ref:mmpi) Minnesota Multiphasic Personality Inventory-2-Restructured Form (MMPI-2-RF)

(ref:mmpi-a) Minnesota Multiphasic Personality Inventory-Adolescent (MMPI-A)

(ref:mmpi3) Minnesota Multiphasic Personality Inventory-3 (MMPI-3)

(ref:iq) Intelligence/General Ability

(ref:academics) Academic Skills

(ref:verbal) Verbal/Language

(ref:spatial) Visual Perception/Construction

(ref:memory) Memory

(ref:executive) Attention/Executive

(ref:motor) Motor

(ref:social) Social Cognition

(ref:adhd-ef) ADHD and Executive Functioning

(ref:emotion) Behavioral, Personality, and Emotional Functioning

(ref:standard-score) Standard Score (M = 100, SD = 15)

(ref:scaled-score) Scaled Score (M = 10, SD = 3)

(ref:t-score) T Score (M = 50, SD = 10)

(ref:z-score) z-Score (M = 0, SD = 1)

(ref:zplot) z = -1 (16th percentile), z = 0 (50th percentile), and z = 1 (84th percentile)

(ref:pct) A percentile shows r params$first_name's standing relative to peers. For example, a percentile rank of 70 means r params$first_name performed as well as or better than 70% of individuals the same age.

(ref:br) A base rate is the prevalence of score in the general population. If a score is rare, defined as a base rate of less than 10%, it is considered clinically significant, and that area of functioning is probably causing problems in daily life.

(ref:basc3-prs-fn) T Score (M = 50, SD = 10); Note: Adaptive Skills T scores are reversed

(ref:basc3-srp-fn) T Score (M = 50, SD = 10); Note: Personal Adjustment T scores are reversed

(ref:basc3-prs-srp-fn) T Score (M = 50, SD = 10); Note: Adaptive Skills and Personal Adjustment T scores are reversed

(ref:g) General intelligence refers to an overall capacity to reason, to solve problems, and to learn useful information.

(ref:gc) Crystallized intelligence refers to the ability to learn and use language to reason and understand how the world works.

(ref:gf) Fluid intelligence refers to the ability to use logical reasoning to figure things out without being told exactly how things work, analyze and solve novel problems, identify patterns and relationships that underpin these problems, and apply logic.

(ref:gcf) General Ability refers to an overall capacity to reason, to solve problems, and to learn useful information. Crystallized Knowledge refers to the ability to learn and use language to reason and understand how the world works. Fluid Reasoning refers to the ability to use logical reasoning to figure things out without being told exactly how things work, analyze and solve novel problems, identify patterns and relationships that underpin these problems, and apply logic.

(ref:acad) Reading ability consists of three interrelated abilities: decoding, comprehension, and fluency. Writing ability can be described in terms of spelling, grammar, expression of ideas, and writing fluency. Math ability can be described in terms of calculation skills, applied problem solving, and math fluency.

(ref:read) Reading ability can be described as consisting of three interrelated abilities: decoding (the ability to recognize and pronounce written words presented without context), comprehension (the ability not only to understand the facts presented in the text but also the ability to figure out things in the text that are not directly stated), and fluency (the ability to decode and understand simple written information in a rapid and fluent manner).

(ref:write) Writing ability can be described in terms of spelling, grammar, expression of ideas, and writing fluency. Spelling ability and writing fluency help one write quickly and with quality. If these lower-level skills do not flow easily, they can take up attention and working memory space so that more important skills such as making good choices about words and meaning (i.e., expression), and capitalizing on background grammar knowledge to construct good pieces of writing cannot be used as easily.

(ref:math) Math ability can be described in terms of calculation skills, applied problem solving (e.g., word problems), and math fluency.

(ref:vrb) Verbal/language refers to the ability to access and apply acquired word knowledge, to verbalize meaningful concepts, to understand complex multistep instructions, to think about verbal information, and to express oneself using words.

(ref:spt) Visuoperception, visuoconstruction, and visuospatial processing refer to abilities such as mentally visualizing how objects should look from different angles, visualizing how to put objects together so that they fit correctly, and being able to accurately and efficiently copy and/or reproduce visual-spatial information onto paper.

(ref:att-exe) Attentional and executive functions underlie most, if not all, domains of cognitive performance. These are behaviors and skills that allow individuals to successfully carry-out instrumental and social activities, academic work, engage with others effectively, problem solve, and successfully interact with the environment to get needs met.

(ref:att) Attention is a basic function that underlies most, if not all, domains of neurocognitive functioning. If an individual has limited attentional capacity, an inability to sustain or divide attentional focus, or a reduced ability to selectively attend to competing stimuli, then they would likely be unable to interact with the environment to an adequate degree and, thus have limited functioning in other, higher-order areas.

(ref:exe) Measures of executive functioning are used as proxies for behaviors and skills that allow individuals to successfully carry-out instrumental and social activities, such as planning, engaging with others effectively, problem solving, and successfully interacting with the environment to get needs met.

(ref:wm) Working memory is the system responsible for the transient holding and processing of information in conscious awareness just long enough to use it for problem solving, and plays a critical role in reasoning, comprehension, and learning.

(ref:ps) Processing speed refers to the rate at which the brain can repetitively process familiar and unfamiliar information during relatively easy tasks that almost everyone can do. Processing speed tests are good predictors of performance on tasks that are so well learned that they are nearly automatic, which can be critical to completing work efficiently.

(ref:mem) Learning and memory refer to the rate and ease with which new information (e. g., facts, stories, lists, faces, names) can be encoded, stored, and later recalled from long-term memory.

(ref:mtr) Sensorimotor tasks refer to the capacity to control hand movements quickly, smoothly, and with adequate precision, which are required to engage in activities such as writing and drawing.

(ref:soc-cog) Social cognition measures are used to gauge aspects of social-emotional processing and social aptitude (sometimes referred to as emotional intelligence), which are important facets of how individuals process social information about other children, adults, groups, and social contexts.

(ref:adaptive) Adaptive functioning is a broad term that refers to the collection of conceptual, social, and practical skills that enable individuals to function independently and meet the demands of everyday life. These skills include things like communication, self-care, home living, social skills, and community use.

(ref:iq-impaired) Intellectual disability is a disability characterized by significant limitations both in intellectual functioning (reasoning, learning, problem solving) and in adaptive behavior, which covers a range of everyday social and practical skills. This disability originates before the age of 18.

(ref:cog-ctrl) Cognitive control guides behavior by controlling what, when, and how information is represented in the brain. Cognitive control is associated with a wide range of processes and is not restricted to a particular cognitive domain. Impairments in cognitive control functions are associated with specific deficits in attention, memory, language comprehension and emotional processing.

(ref:adhd) ADHD is a lifelong disorder characterized by symptoms of inattention (not being able to keep focus), hyperactivity (excess movement that is not fitting to the setting) and impulsivity (hasty acts that occur in the moment without thought). Many ADHD symptoms, such as high activity levels, difficulty remaining still for long periods of time, and limited attention span are common from time to time in everyone. The difference in individuals with ADHD is that their inattention, poor impulse control, and hyperactivity are substantially greater than expected for their age and cause distress and/or problems functioning at home, at school, at work, and/or with friends.

(ref:dysgraphia) Dysgraphia is an impairment in writing, including problems with letter formation/legibility, letter spacing, spelling, fine motor coordination, rate of writing, grammar, and composition. DSM-5 categorizes writing impairment as a specific learning disability with impairment in written expression (spelling accuracy, grammar and punctuation accuracy, and clarity and organization of written expression) [@chungDisorderWrittenExpression2020].

(ref:odd) Oppositional defiant disorder (ODD) is a tendency to oppose and defy. DSM-5 categorizes ODD under Disruptive, impulse-control, and conduct disorder. It is described as a pattern of persistent anger, hostility, and argumentative behavior that persists for more than six months.

(ref:dyslexia) Dyslexia means an individual has a neurobiologically based cognitive processing problem that affects how easily and efficiently they can learn to read. Dyslexia is a common condition: some experts believe 5-10% of people have it; others say as many as 17% of people show signs of reading challenges. Dyslexia is formally classified as a specific learning disability in reading. People with dyslexia have trouble reading at a good pace and without mistakes. They may also have a hard time with reading comprehension, spelling, and writing. Importantly, these challenges are not a problem with intelligence.

(ref:comp-dyslexia) Dyslexia means an individual has a neurobiologically based cognitive processing problem that affects how easily and efficiently they can learn to read. Approximately 24% of individuals diagnosed with dyslexia are able to achieve reading skills commensurate with nondyslexic peers. A concept in the research literature is one of "compensated dyslexia"[@vanviersenHighReadingSkills2016], which is used to describe these individuals because they use strengths in other areas to compensate for deficits in reading. Dyslexia is underidentified in this population because the dyslexia can be masked by strengths in vocabulary and intelligence, making it especially difficult to identify in high-achieving individuals.

(ref:asd) Asperger syndrome (AS) is a developmental disorder and a high-functioning form of an autism spectrum disorder (ASD). AS is a distinct neurological condition characterized by a greater or lesser degree of impairment in social communication skills, as well as repetitive or restrictive patterns of thought and behavior. Unlike people with autism, people with AS retain their early language skills. A distinguishing symptom of AS is an obsessive interest in a single object or topic to the exclusion of any other. Individuals with AS want to know everything about their topic of interest and their conversations with others will be about little else. In children with AS, their expertise, high level of vocabulary, and formal speech patterns make them seem like "little professors." Other characteristics of AS include repetitive routines or rituals; peculiarities in speech and language; socially and emotionally inappropriate behavior and difficulty interacting successfully with peers; problems with non-verbal communication; and clumsy and uncoordinated motor movements.

(ref:mazes) Mazes Planning is central to human behavior and illustrates the aptitude to formulate an action in advance of performance or intended performance. Impulse control is the degree to which instant gratification may be controlled. Psychomotor speed indicates the level at which complex visual-perception information is perceived, attended, and responded to with simple fine-motor coordination. To successfully demonstrate this trio of cognitive skills, the patient must plan a course of action for navigation through the maze, while preventing the urge to take erroneous or seemingly simpler paths, all while issuing commands to their hands to physically manifest this decision-making. Tasks involving multitasking and subsequent physical action will be reduced. Sports, writing essays, or creating standardized documents, and adhering to financial institutional regulations (such as ledger maintenance), will show reduced proficiency.

(ref:letter-number) Numbers & Letters incorporates letter cancellation and counting tasks to evaluate deficits in attention, the four subtests of this task were developed to measure seven aspects of attention: sustained attention, psychomotor speed, selective attention, divided attention, information processing speed, impulsivity, and disinhibition.

(ref:driving) Driving Scenes Created to reflect situational daily living and patient proficiency with such, this assessment ascertains a combination of visual working memory, visual scanning, attention to detail, and selective attention. Visual working memory is the ability to recognize, remember, and then retrieve visually presented information for use in the short-term. Visual scanning is the ability to use vision to search in a systematic manner. Selective attention is the capacity for or process of reacting to certain stimuli selectively when several occur simultaneously. Attention to detail is the ability to achieve thoroughness and accuracy when accomplishing a task. A combination of these cognitive processes enable daily functioning. As this exam demonstrates, the ability to scan surroundings, take notice of selectively important visual details, and then quickly recall such for use in applicable situations, such as when driving, is integral to modern human independence. Below average scores reflect limited ability to safely and proficiently perform tasks associated with typical daily life.

(ref:bills) Bill Payment Purporting a necessary daily living function, this piece of the module evaluates auditory language comprehension, bill payment skills, simple calculation ability, and speech output. The patient is handed a bill statement, a check with accompanying check ledger, and an envelope. Questions are posited orally by the test administrator regarding the presented materials. Following the question and answer portion, patients are then given more complex, multistep commands involving physically responding to directives. For instance, during this phase, directions to adhere to and complete the billing instructions as they appear on the billing statement are given, complete with the need to fill out the check and assure the bill would be paid. Each requisite step, when explicitly performed, is awarded one point. Thus, (ref:first-name)'s score of XX shows that (ref:he-she) accurately completed the same number of steps towards bill payment achievement. This score leads to placement in the severely impaired interpretive category. Auditory comprehension is the ability to understand what is heard, including the tone of voice, pauses between words, emphasis used, and the rhythm and pattern of speech, and attach meaning to it. This is a foundational skill originating in early infancy that, ideally, builds with exposure and learning processes. Bill payment skills refer to the wherewithal to complete the processes surrounding proper bill satisfaction and related financial responsibility. Calculation is a deliberate process that transforms one or more inputs into one or more results. In this instance, simple calculation relates to the capacity to accurately and effectively use numerical information to maintain financial balance and responsibility utilizing only basic mathematical skills. Speech output is simply defined as the ability to put thoughts to words. The nature of this exam exhibits the potential negative ramifications in these cognitive functions. Not only will fiscal responsibility suffer deleteriously, similar or related tasks required for independent living and satisfactory life stability will also show negative effects.

(ref:aud-comp) Auditory Comprehension is the ability to understand what is heard, including the tone of voice, pauses between words, emphasis used, and the rhythm and pattern of speech, and attach meaning to it. This is a foundational skill originating in early infancy that, ideally, builds with exposure and learning processes.

(ref:planning) Planning is a neurocognitive ability used to determine, select, and apply strategies to solve problems where initiation, self-monitoring, and self-correction are especially important.

(ref:efficiency) Efficiency is not the same as speed. Efficiency is a ratio of outcome to effort, with time as a proxy for effort.

(ref:psi) The Processing Speed Index (PSI) is primarily a measure of Processing Speed (Gs). Gs refers to the efficiency of cognitive processing or speed of mental activity. It involves the ability to perform simple clerical-type tasks quickly, especially when under pressure to maintain attention and concentration. The difference between the scores that comprise the PSI is statistically significant and a difference of this size occurs in less than 10% of the general population which means the difference is relatively uncommon. This means that although the composite is likely a psychometrically sound estimate of Processing Speed, it may not be a good clinical summary because it may obscure an important and meaningful difference within this domain, which often occurs when one score is below average and the other score(s) is at least average relative to most people.

(ref:vci) The Verbal Comprehension Index (VCI) is primarily a measure of Comprehension and Knowledge (Gc). Gc refers to an individual's knowledge base (or general fund of information) that develops as a result of exposure to language, culture, general life experiences, and formal schooling. The size of the difference between the lowest and highest scores that comprise the VCI occurs in at least 10% of the general population, which makes the difference relatively common. This means that the VCI is a good psychometric summary of Comprehension and Knowledge. Additionally, information regarding where the subtest scores fall relative to each other and relative to most people may not add clinically relevant information above and beyond the VCI.

(ref:fri) The Gf-Nonverbal Fluid Reasoning Index (FRI) is primarily a measure of Fluid Reasoning (Gf). Gf refers to a type of thinking that an individual may use when faced with a relatively new or novel task that cannot be performed automatically.

(ref:vsi) The Gv-Visual Processing Index (VSI) is primarily a measure of Visual Processing (Gv). Gv Refers to an individuals ability to generate visual images and perceive and analyze visual patterns and visual information.

(ref:iep) Each public school child who receives special education and related services must have an Individualized Education Program (IEP). Each IEP must be designed for one student and must be a truly individualized document. The IEP creates an opportunity for teachers, parents, school administrators, related services personnel, and students (when appropriate) to work together to improve educational results for children with disabilities. The IEP is the cornerstone of a quality education for each child with a disability.

(ref:dyscalculia) Developmental dyscalculia is a condition that affects the ability to acquire arithmetical skills. Dyscalculic learners may have difficulty understanding simple number concepts, lack an intuitive grasp of numbers, and have problems learning number facts and procedures. Even if they produce a correct answer or use a correct method, they may do so mechanically and without confidence.

(ref:first-name) r params$first_name

(ref:last-name) r params$last_name

(ref:he-she) r params$he_she

(ref:his-her) r params$his_her

(ref:him-her) r params$him_her

(ref:he-she-cap) r params$he_she_cap

(ref:his-her-cap) r params$his_her_cap

(ref:him-her-cap) r params$him_her_cap

(ref:refdoc) r params$refdoc

(ref:doe1) r params$doe1

(ref:doe2) r params$doe2

(ref:doe3) r params$doe3

(ref:dx1) r params$dx1

(ref:dx2) r params$dx2

(ref:family) r params$family

NEUROBEHAVIORAL STATUS EXAM

(ref:patient) r params$first_name r params$last_name

(ref:mrn) r params$mrn

(ref:dob) r params$dob

(ref:age) r bwu::age(params$dob, params$doe2)

(ref:sex) r params$sex

(ref:race) r params$race

(ref:hand) r params$hand

(ref:educ) r params$educ

(ref:doe) r params$doe1, r params$doe2, and r params$doe3

```{marginfigure, echo = TRUE} Last Name: (ref:last-name)\ First Name: (ref:first-name)\ MRN: (ref:mrn)\ DOB: (ref:dob)\ Age: (ref:age)\ Gender: (ref:sex)\ Handedness: (ref:hand)\ Education: (ref:educ)\ Evaluation Dates: (ref:doe)

```r
cat(readLines("02.00_nse.md"), sep = "\n")

NEUROPSYCHOLOGICAL TESTING

Test Battery

cat(readLines("02.01_behav-obs.md"), sep = "\n")

Test Results

\autoref{fig:gauss-plot-narrow} can be used as a guide to help interpret individual test scores in terms of the degree of distance a score fell in relation to normative expectations and the magnitude of clinical severity. Test scores are easiest to interpret as percentiles^[(ref:pct)], which are provided in the tables below, and as z-scores (M = 0, SD = 1)^[(ref:zplot)], which are used to plot the various test and domain scores below.

(ref:gauss-plot-narrow) Classification of neuropsychological test scores that are normally distributed in the general population [@guilmetteAmericanAcademyClinical2020].

knitr::include_graphics("plot_narrow.png", auto_pdf = TRUE)

(ref:gauss-plot-broad) Classification of neuropsychological test scores that are positively skewed in the general population [@schoenbergReportingStandardsNeuropsychological2017].

knitr::include_graphics("plot_broad.png", auto_pdf = TRUE)
library(tidyverse)
data_path <- here::here(patient, "csv")
files <- dir(data_path, pattern = "*.csv")
neuropsych <-
  files |>
  purrr::set_names() |>
  purrr::map_df(
    ~ readr::read_csv(file.path(data_path, .), show_col_types = FALSE),
    na = c("", "NA", "--", "-"),
    .id = "filename"
  ) |>
  dplyr::filter(!is.na(percentile)) |>
  dplyr::distinct() |>
  tidytable::mutate(z = qnorm(percentile / 100)) |>
  tidytable::mutate(domain = forcats::as_factor(domain)) |>
  tidytable::mutate(subdomain = forcats::as_factor(subdomain)) |>
  tidytable::mutate(narrow = forcats::as_factor(narrow)) |>
  tidytable::mutate(pass = forcats::as_factor(pass)) |>
  tidytable::mutate(verbal = forcats::as_factor(verbal)) |>
  tidytable::mutate(timed = forcats::as_factor(timed))
# Subset neurocognitive data
neurocog <-
  neuropsych |>
  dplyr::filter(test_type == "npsych_test")
# domain
neurocog <-
  neurocog |>
  tidytable::group_by(domain, .add = TRUE) |>
  dplyr::filter(!is.na(percentile)) |>
  tidytable::mutate(z_mean_dom = mean(z), z_sd_dom = sd(z)) |>
  dplyr::ungroup()
# subdomain
neurocog <-
  neurocog |>
  tidytable::group_by(subdomain, .add = TRUE) |>
  dplyr::filter(!is.na(percentile)) |>
  tidytable::mutate(z_mean_sub = mean(z), z_sd_sub = sd(z)) |>
  dplyr::ungroup()
# narrow
neurocog <-
  neurocog |>
  tidytable::group_by(narrow, .add = TRUE) |>
  dplyr::filter(!is.na(percentile)) |>
  tidytable::mutate(z_mean_narrow = mean(z), z_sd_narrow = sd(z)) |>
  dplyr::ungroup()
# pass
neurocog <-
  neurocog |>
  tidytable::group_by(pass, .add = TRUE) |>
  dplyr::filter(!is.na(percentile)) |>
  tidytable::mutate(z_mean_pass = mean(z), z_sd_pass = sd(z)) |>
  dplyr::ungroup()
# verbal
neurocog <-
  neurocog |>
  tidytable::group_by(verbal, .add = TRUE) |>
  dplyr::filter(!is.na(percentile)) |>
  tidytable::mutate(z_mean_verbal = mean(z), z_sd_verbal = sd(z)) |>
  dplyr::ungroup()
# timed
neurocog <-
  neurocog |>
  tidytable::group_by(timed, .add = TRUE) |>
  dplyr::filter(!is.na(percentile)) |>
  tidytable::mutate(z_mean_timed = mean(z), z_sd_timed = sd(z)) |>
  dplyr::ungroup()
# Subset neurobehavioral data
neurobehav <-
  neuropsych |>
  dplyr::filter(test_type == "rating_scale")
# domain
neurobehav <-
  neurobehav |>
  tidytable::group_by(domain, .add = TRUE) |>
  dplyr::filter(!is.na(percentile)) |>
  tidytable::mutate(z_mean_dom = mean(z), z_sd_dom = sd(z)) |>
  dplyr::ungroup()
# subdomain
neurobehav <-
  neurobehav |>
  tidytable::group_by(subdomain, .add = TRUE) |>
  dplyr::filter(!is.na(percentile)) |>
  tidytable::mutate(z_mean_sub = mean(z), z_sd_sub = sd(z)) |>
  dplyr::ungroup()
# narrow
neurobehav <-
  neurobehav |>
  tidytable::group_by(narrow, .add = TRUE) |>
  dplyr::filter(!is.na(percentile)) |>
  tidytable::mutate(z_mean_narrow = mean(z), z_sd_narrow = sd(z)) |>
  dplyr::ungroup()
# Subset validity data
validity <-
  neuropsych |>
  dplyr::filter(test_type %in% c("performance_validity", "symptom_validity"))
# domain
validity <-
  validity |>
  tidytable::group_by(domain, .add = TRUE) |>
  # dplyr::filter(!is.na(percentile)) |>
  tidytable::mutate(z_mean_dom = mean(z), z_sd_dom = sd(z)) |>
  dplyr::ungroup()
# subdomain
validity <-
  validity |>
  tidytable::group_by(subdomain, .add = TRUE) |>
  # dplyr::filter(!is.na(percentile)) |>
  tidytable::mutate(z_mean_sub = mean(z), z_sd_sub = sd(z)) |>
  dplyr::ungroup()
# narrow
validity <-
  validity |>
  tidytable::group_by(narrow, .add = TRUE) |>
  # dplyr::filter(!is.na(percentile)) |>
  tidytable::mutate(z_mean_narrow = mean(z), z_sd_narrow = sd(z)) |>
  dplyr::ungroup()
readr::write_csv(neuropsych, here::here(patient, "neuropsych.csv"))
readr::write_csv(neurocog, here::here(patient, "neurocog.csv"))
readr::write_csv(neurobehav, here::here(patient, "neurobehav.csv"))
readr::write_csv(validity, here::here(patient, "validity.csv"))
neuropsych <- readr::read_csv(here::here(patient, "neuropsych.csv"))
neurocog <- readr::read_csv(here::here(patient, "neurocog.csv"))
neurobehav <- readr::read_csv(here::here(patient, "neurobehav.csv"))
validity <- readr::read_csv(here::here(patient, "validity.csv"))

General Cognitive Ability

(ref:fn-iq) Standard Score (M = 100, SD = 15)

g <- bwu::gpluck_get_index_scores(patient = patient)
cat(readLines("02.02_iq.md"), sep = "\n")
knitr::read_chunk(here::here(patient, "02.02_iq.R"))







(ref:fn-acad) Standard Score (M = 100, SD = 15)

cat(readLines("02.03_academics.md"), sep = "\n")
knitr::read_chunk(here::here(patient, "02.03_academics.R"))







Verbal/Language

(ref:fn-vrb) T Score (M = 50, SD = 10) or Scaled Score (M = 10, SD = 3)

cat(readLines("02.04_verbal.md"), sep = "\n")
knitr::read_chunk(here::here(patient, "02.04_verbal.R"))







Visual Perception/Construction

(ref:fn-spt) Standard Score (M = 100, SD = 15), T Score (M = 50, SD = 10), or Scaled Score (M = 10, SD = 3)

cat(readLines("02.05_spatial.md"), sep = "\n")
knitr::read_chunk(here::here(patient, "02.05_spatial.R"))







Attention/Executive

(ref:fn-exe) Standard Score (M = 100, SD = 15), T Score (M = 50, SD = 10), or Scaled Score (M = 10, SD = 3)

(ref:ut) This was a novel planning task published as part of the NIH EXAMINER Executive Function Battery [@kramer2014]. The task allows the examinee to choose which problems they want to work on to maximize points earned. In doing so, examinees need to plan ahead, avoid items that are strategically poor choices, and be cognizant of when a particular booklet offers diminishing returns. (ref:first-name) performed this task effortlessly.

cat(readLines("02.06_executive.md"), sep = "\n")
knitr::read_chunk(here::here(patient, "02.06_executive.R"))







Memory

(ref:fn-memory) Standard Score (M = 100, SD = 15), T Score (M = 50, SD = 10), or Scaled Score (M = 10, SD = 3)

cat(readLines("02.07_memory.md"), sep = "\n")
knitr::read_chunk(here::here(patient, "02.07_memory.R"))







Motor

(ref:fn-mtr) T Score (M = 50, SD = 10)

cat(readLines("02.08_motor.md"), sep = "\n")
knitr::read_chunk(here::here(patient, "02.08_motor.R"))







Social Cognition

(ref:fn-soc) Scaled Score (M = 10, SD = 3)

cat(readLines("02.09_social.md"), sep = "\n")
knitr::read_chunk(here::here(patient, "02.09_social.R"))







ADHD/Executive Functioning

(ref:fn-adhd) Standard Score (M = 100, SD = 15) or T Score (M = 50, SD = 10); Note: On the CAARS scales, higher scores reflect reduced functioning, but on the CEFI scales, lower scores reflect reduced functioning.

(ref:att-ef) Attention and executive functions are multidimensional concepts that contain several related processes. Both concepts require self-regulatory skills and have some common subprocesses; therefore, it is common to treat them together, or even to refer to both processes when talking about one or the other.

cat(readLines("02.10_adhd.md"), sep = "\n")
knitr::read_chunk(here::here(patient, "02.10_adhd.R"))













Emotional/Behavioral/Personality

(ref:fn-emo) T Score (M = 50, SD = 10)

cat(readLines("02.11_emotion.md"), sep = "\n")
knitr::read_chunk(here::here(patient, "02.11_emotion.R"))











SUMMARY/IMPRESSION

(ref:domain) Key Findings Neuropsychological test results show a pattern of above average performance across all scales. Verbal Reasoning was exceptionally strong, while Memory, Language, Working Memory and Psychomotor Speed were all above average. Spatial, Planning, Nonverbal Reasoning and Cognitive Efficiency were all scored as high average. Notably, even r params$first_name's normatively average scores for Attention Span and Attentional Fluency reflect performances that are well below cognitive expectations for r params$him_her. Note: z = 0 (mean) ± 1 (s.d.)

domain <-
  neurocog %>%
  dplyr::filter(test_type == "npsych_test") %>%
  dplyr::filter(!is.na(domain))
bwu::dotplot(
  data = domain,
  x = domain$z_mean_dom,
  y = domain$domain,
  domain = "domain"
)
summary <-
  readr::read_csv(here::here(patient, "csv", "index_scores.csv")) |>
  dplyr::filter(test_type == "npsych_test") |>
  dplyr::filter(domain == "Summary") |>
  dplyr::filter(!is.na(domain))
bwu::dotplot(
  data = summary,
  x = summary$z,
  y = summary$scale,
  domain = "Summary"
)

(ref:pass) PASS Cognitive Process Model Sequential and Simultaneous processing are areas of strengths, and Attention is an area of weakness.

pass <-
  neurocog |>
  dplyr::filter(test_type == "npsych_test") |>
  dplyr::filter(!is.na(pass))
bwu::dotplot(
  data = pass,
  x = pass$z_mean_pass,
  y = pass$pass,
  domain = "pass"
)

(ref:nonverbal) Verbal vs. Nonverbal Tests Scores on verbal tasks are slightly higher than scores on nonverbal/spatial processing tasks.

nonverbal <-
  neurocog |>
  dplyr::filter(test_type == "npsych_test") |>
  dplyr::filter(!is.na(verbal))
bwu::dotplot(
  data = nonverbal,
  x = nonverbal$z_mean_verbal,
  y = nonverbal$verbal,
  domain = "nonverbal"
)

(ref:timed) Timed vs. Untimed Tests r params$first_name performs more than a half of a standard deviation better on tasks that are untimed compared to tasks that require r params$him_her to respond both accurately and quickly.

timed <-
  neurocog |>
  dplyr::filter(test_type == "npsych_test") |>
  dplyr::filter(!is.na(timed))
bwu::dotplot(
  data = timed,
  x = timed$z_mean_timed,
  y = timed$timed,
  domain = "timed"
)
cat(readLines("03.00_sirf.md"), sep = "\n")

RECOMMENDATIONS

```{marginfigure, echo = TRUE} Links highlighted in \textcolor{blue}{blue} should be clickable to the online content.

```r
cat(readLines("04.00_recs.md"), sep = "\n")

It was a pleasure to work with r params$first_name. Please contact me with any questions or concerns regarding this patient.

```{marginfigure, echo = TRUE} CONTACT\ Department of Psychiatry and the Behavioral Sciences\ 2250 Alcazar St., Suite 2200\ Los Angeles, CA 90033\ (323) 442-4000\

Sincerely,

```r
knitr::include_graphics("../jwt_sig.png")

Joey Trampush, PhD\ Assistant Professor of Psychiatry\ Department of Psychiatry and the Behavioral Sciences\ University of Southern California Keck School of Medicine\ CA License PSY29212

APPENDIX

cat(readLines("telehealth_statement.md"), sep = "\n")

Test Selection Procedures

Neuropsychological tests are intrinsically performance-based, and cognitive performance assessed during this neuropsychological evaluation is summarized above. Where appropriate, qualitative observations are included. Cultural considerations were made when selecting measures, interpreting results, and making diagnostic impressions and recommendations. Results from formal tests are reported in comparison to other individuals the same age, sex, and educational level as range of functioning (e.g., below average, average, above average). Test score labels are intended solely to be descriptive, identifying positions of scores relative to a normal curve distribution, and should be interpreted within the context of the patient's individual presentation and history. Although standardized scores provide the clinician with an important and necessary understanding of the patient's test performance compared with a normative group, they do not on their own lead to accurate diagnosis or treatment recommendations.

Conversion of Test Scores

range <-
  readr::read_csv(here::here(
    patient, "test_score_ranges.csv"
  ), show_col_types = FALSE)
gt::gt(range) |>
  gt::tab_header(title = "Test Score Labels/Ranges") |>
  gt::cols_align(align = "center")


jtrampush/npsych.data documentation built on Feb. 25, 2025, 12:30 a.m.