diff --git a/main.R b/main.R index 1ed6400..4e32bb9 100644 --- a/main.R +++ b/main.R @@ -206,6 +206,9 @@ END_YEAR <- format(OBS_END_DATE, "%Y") # Set recipient of report RECIP <- "UMich" +# Set the flag to show(TRUE) or hide(FALSE) the content identifiers +INCLUDE_CID <- FALSE + ########################### # Generate Report Content # ########################### diff --git a/report.Rnw b/report.Rnw index 69d4e71..719e387 100644 --- a/report.Rnw +++ b/report.Rnw @@ -66,8 +66,19 @@ knitr::opts_chunk$set(echo = FALSE, warning=FALSE, message=FALSE) # Work around for "xcolor Warning: Incompatible color definition" knit_hooks$set(document = function(x) {sub('\\usepackage[]{color}', '\\usepackage{xcolor}', x, fixed = TRUE)}) +# Default include content identifiers to FALSE +if(!exists('INCLUDE_CID')){ + INCLUDE_CID <- FALSE + } +@ + +% Setup conditional to include latex content for content identifiers +\newif\ifincludeCID +<>= +if(INCLUDE_CID){ cat('\\includeCIDtrue') }else{ cat('\\includeCIDfalse') } @ + \begin{document} % Turn off top skip so minpages can sit bottom to top without a skip between @@ -78,7 +89,7 @@ knit_hooks$set(document = function(x) {sub('\\usepackage[]{color}', '\\usepackag %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \begin{minipage}[t][0.07\textheight][t]{\textwidth} \centering -\Large MICCA Quarterly Report for \Sexpr{RECIP} Jan - Apr 2020 +\Large MICCA Quarterly Report for \Sexpr{ASCRIBEE_TITLES[RECIP]} Jan - Apr 2020 \end{minipage} \nointerlineskip @@ -104,7 +115,9 @@ knit_hooks$set(document = function(x) {sub('\\usepackage[]{color}', '\\usepackag \end{minipage}\hfill \begin{minipage}[t][0.30\textheight][t]{0.5\textwidth} \strut\vspace*{-\baselineskip}\newline + \ifincludeCID \parbox{\textwidth}{ {\tiny \Sexpr{info7F5D31}} \par } + \fi \centering Payer Proportion of Deliveries << p1-top-right, include=TRUE, fig.show='hold', fig.width=4, fig.height=2.7, dev='pdf' >>= @@ -129,7 +142,9 @@ knit_hooks$set(document = function(x) {sub('\\usepackage[]{color}', '\\usepackag \strut\vspace*{-\baselineskip}\newline \captionsetup{margin=.5cm} \setlength{\abovecaptionskip}{-10pt plus 3pt minus 2pt} + \ifincludeCID \parbox{\textwidth}{ {\tiny \Sexpr{info540727}} \par } + \fi \centering Recieved Prenatal Counseling\\ \vspace{2mm} @@ -141,7 +156,9 @@ knit_hooks$set(document = function(x) {sub('\\usepackage[]{color}', '\\usepackag \end{minipage}\hfill \begin{minipage}[t][0.26\textheight][t]{0.5\textwidth} \strut\vspace*{-\baselineskip}\newline + \ifincludeCID \parbox{\textwidth}{ {\tiny \Sexpr{info5BF5D0}} \par } + \fi \centering Monthly Rate << p2-top-right, include=TRUE, fig.show='hold', fig.width=4, fig.height=2.5, dev='pdf' >>= @@ -156,7 +173,9 @@ knit_hooks$set(document = function(x) {sub('\\usepackage[]{color}', '\\usepackag %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \begin{minipage}[t][0.30\textheight][t]{0.5\textwidth} \strut\vspace*{-\baselineskip}\newline + \ifincludeCID \parbox{\textwidth}{ {\tiny \Sexpr{info82C4A3}} \par } + \fi \parbox{\textwidth}{\centering Contraception Choice} \centering{ << p2-mid-left, include=TRUE, message=FALSE, echo=FALSE>>= @@ -172,7 +191,9 @@ knit_hooks$set(document = function(x) {sub('\\usepackage[]{color}', '\\usepackag \end{minipage}\hfill \begin{minipage}[t][0.30\textheight][t]{0.5\textwidth} \strut\vspace*{-\baselineskip}\newline + \ifincludeCID \parbox{\textwidth}{ {\tiny \Sexpr{info1903AB}} \par } + \fi \centering Contraception Choice by Insurance Type << p2-mid-right, include=TRUE, fig.show='hold', fig.width=4, fig.height=3, dev='pdf' >>= @@ -199,7 +220,9 @@ knit_hooks$set(document = function(x) {sub('\\usepackage[]{color}', '\\usepackag \nointerlineskip \begin{minipage}[t][0.3\textheight][t]{0.5\textwidth} \strut\vspace*{-\baselineskip}\newline + \ifincludeCID \parbox{\textwidth}{ {\tiny \Sexpr{infoBDBC81}} \par } + \fi \centering Women who had a live birth and recieve their preferred contraceptive\\ \vspace{2mm} @@ -211,7 +234,9 @@ knit_hooks$set(document = function(x) {sub('\\usepackage[]{color}', '\\usepackag \end{minipage}\hfill \begin{minipage}[t][0.3\textheight][t]{0.5\textwidth} \strut\vspace*{-\baselineskip}\newline + \ifincludeCID \parbox{\textwidth}{ {\tiny \Sexpr{infoE8F578}} \par } + \fi Proportion of contraception preferred and provided\\ \centering << dbg2, include=TRUE, fig.show='hold', fig.width=4, fig.height=2.8, dev='pdf' >>= @@ -236,7 +261,9 @@ knit_hooks$set(document = function(x) {sub('\\usepackage[]{color}', '\\usepackag \begin{minipage}[t][0.29\textheight][t]{0.5\textwidth} \strut\vspace*{-\baselineskip}\newline + \ifincludeCID \parbox{\textwidth}{ {\tiny \Sexpr{infoADA835A}} \par } + \fi \centering Overall Rate\\ << p1-mid-left, include=TRUE, fig.show='hold', fig.width=2.5, fig.height=2.5, dev='pdf' >>= @@ -247,7 +274,9 @@ knit_hooks$set(document = function(x) {sub('\\usepackage[]{color}', '\\usepackag \end{minipage}\hfill \begin{minipage}[t][0.29\textheight][t]{0.5\textwidth} \strut\vspace*{-\baselineskip}\newline + \ifincludeCID \parbox{\textwidth}{ {\tiny \Sexpr{info707A6E}} \par } + \fi \centering Monthly Rate\\ << p1-mid-right, include=TRUE, fig.show='hold', fig.width=4, fig.height=3, dev='pdf' >>= @@ -264,7 +293,9 @@ knit_hooks$set(document = function(x) {sub('\\usepackage[]{color}', '\\usepackag %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \begin{minipage}[t][0.29\textheight][t]{0.5\textwidth} \strut\vspace*{-\baselineskip}\newline + \ifincludeCID \parbox{\textwidth}{ {\tiny \Sexpr{info9C0A4F}} \par } + \fi \centering Immediate LARC\\ \vspace{2mm} @@ -276,7 +307,9 @@ knit_hooks$set(document = function(x) {sub('\\usepackage[]{color}', '\\usepackag \end{minipage}\hfill \begin{minipage}[t][0.29\textheight][t]{0.5\textwidth} \strut\vspace*{-\baselineskip}\newline + \ifincludeCID \parbox{\textwidth}{ {\tiny \Sexpr{infoBE214E}} \par } + \fi \centering Immediate LARC Provision by Payer\\ << p1-bot-right, include=TRUE, fig.show='hold', fig.width=4, fig.height=3, dev='pdf' >>=