I am using a structured format to print patient's documenatation using LaTeX. The structure is like this:
Demography
Name Surname
Age/Sex
Address
Clinical Details
History, Past History, Personal History, Family History and others (as subsections) er:
Examination
Diagnosis
Provisional
Final
Investigations
available and suggested
Treatment
I used koma article class (scrartcl
) with section
, subsection
, enumerate
. I am aware of the datatool
package which I could have used to get the things done, while I would have documented the visit to csv/excel/calc. I could not figure out how a csv entries could be filtered so that I could print an individual patient record.
My question is, if I follow above mentioned simple structure, is there any way to export the data of all patient to csv file/excel/calc for analysis?
I am typing the structure of tex
file :
\documentclass[12pts]{scrartcl}
\usepackage{fontspec}
\usepackage[a4paper]{geometry}
\geometry{verbose,tmargin=2cm,bmargin=2cm,lmargin=1cm,rmargin=1cm}
\usepackage{array}
\usepackage{fixltx2e}
\setmainfont[Script=Devanagari]{Sanskrit 2003}
\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.
%% Because html converters don't know tabularnewline
\providecommand{\tabularnewline}{\\}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands.
\usepackage{enumitem} % customizable list environments
\newlength{\lyxlabelwidth} % auxiliary length
\@ifundefined{lettrine}{\usepackage{lettrine}}{}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
\usepackage[us,24hr]{datetime}
\makeatother
\usepackage{xunicode}
\usepackage{polyglossia}
\title{Consultation Report}
\begin{document}
\maketitle
\section*{Clinical details}
\subsection*{Present history}
\subsection*{Past History}
\subsection*{Personal history}
\subsection*{Family history }
\subsection*{Examination}
examination finding
\section*{Diagnosis}
\begin{enumerate}
\item Disease
\end{enumerate}
\section*{Rx}
\begin{enumerate}
\item here goes teatment
\item tab abc दिवसातून दोनदा
\end{enumerate}
\begin{flushright}
My Name \\
{\footnotesize Qualification
}\\
{\footnotesize designation}\\
{\footnotesize Ph: }
\par\end{flushright}{\footnotesize \par}
\end{document}
I think I need to elaborate. Till date I was using the template provided to create a regular consultation. The receptionist used to create a folder named after the patient and insert a demography.tex
file containing
Name surname \\\ dob\\\address\\\Phone.
I used to create small tex files named as yymmdd.tex
where I used to enter clinical data. Clinical data included history, examination and diagnosis.
We use to create a third small file Rx.tex
where itemised treatment used to go. The three files used to be compiled by placing \input
commands in a template provided. The advantage of having three small files was I could use demography in a follow up visit. Treatment mostly had to be modified a little bit. The clinical data used to change, so I had to change the input file everytime in a template. Overall, the text generated used to have consistent patern. I could share the folders on intranet. But possibly there is better way of doing this using data tool. I had two problems using data tool.
-
Though I understood how to create tables using data tool, I failed to understand how an individual entry can be used. E.g. presenting history for presenting history in already provided template, past history at past history template.
-
If I use unique identification no for every patient and visit, how can I export only the data for the visit day to latex template.
If I can figure it out, then may be all my patient data can be entered on excel and exported to latex templates to create a needed document. The question, why not use a MySQL like database? It seems beyond my capacity and available time to learn new tool, though it may be worth it. In no way I am creating emr. That is way beyond. If you can help me out in getting cvs to LaTeX template I provided I will be obliged. For technical reason I would like |
to be separator and not the comma.
Best Answer
I agree with the comments that you'd need a scripting language to extract the information from your existing documents, but once you have the information in a database you can use the datatool package to generate a report for a particular patient. For the type of information you want to save, I wouldn't recommend using csv as I would find that tricky to edit (but that depends on what you use to edit it). Here's how it might look in csv form (using | as a separator as you requested):
Alternatively, the same information can be store in a .tex file using the datatool format:
You can access a particular patient like this: