Skip to content

Commit

Permalink
Remove content IDs from production reports.
Browse files Browse the repository at this point in the history
Use recipient title in report title.
  • Loading branch information
grosscol committed May 19, 2020
1 parent 7aa57f6 commit 432127c
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
3 changes: 3 additions & 0 deletions main.R
Original file line number Diff line number Diff line change
Expand Up @@ -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 #
###########################
Expand Down
35 changes: 34 additions & 1 deletion report.Rnw
Original file line number Diff line number Diff line change
Expand Up @@ -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
<<has_CID_tex, include=TRUE, eval=TRUE, echo=FALSE, results='asis'>>=
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
Expand All @@ -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
Expand All @@ -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' >>=
Expand All @@ -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}
Expand All @@ -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' >>=
Expand All @@ -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>>=
Expand All @@ -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' >>=
Expand All @@ -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}
Expand All @@ -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' >>=
Expand All @@ -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' >>=
Expand All @@ -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' >>=
Expand All @@ -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}
Expand All @@ -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' >>=
Expand Down

0 comments on commit 432127c

Please sign in to comment.