One option using fancyhdr and the offsets provided by the package. Using
\fancyhfoffset[OR,EL]{\dimexpr\marginparsep+\marginparwidth\relax}
the headers are offset by an amount equal to \marginparsep+\marginparwidth to the right on odd-numbered pages and to the left on even-numbered ones. Then the actual headers are placed using
\fancyhead[OR]{\textsc{\leftmark}\quad\smash{\rule[-.2ex]{1pt}{4cm}}\quad\thepage}
\fancyhead[EL]{\thepage\quad\smash{\rule[-.2ex]{1pt}{4cm}}\quad\textsc{\chaptername~\thechapter}}
\renewcommand{\chaptermark}[1]{\markboth{#1}{}}
A complete example code:
\documentclass{book}
\usepackage{fancyhdr}
\usepackage{lipsum}
\pagestyle{fancy}
\fancyhf{}
\fancyhfoffset[OR,EL]{\dimexpr\marginparsep+\marginparwidth\relax}
\fancyhead[OR]{\textsc{\leftmark}\quad\smash{\rule[-.2ex]{1pt}{4cm}}\quad\thepage}
\fancyhead[EL]{\thepage\quad\smash{\rule[-.2ex]{1pt}{4cm}}\quad\textsc{\chaptername~\thechapter}}
\renewcommand\headrulewidth{0pt}
\renewcommand{\chaptermark}[1]{\markboth{#1}{}}
\begin{document}
\chapter{Test chapter}
\lipsum[1-40]
\end{document}

\enspace\enspaceyou could use\quad. By the way, I don't know where I read it (and how “important” it is) but\enskipis the LaTeX preferred way, instead of\enspace. – Manuel May 26 '14 at 01:48\quad. In this case, there's no difference between\enspaceand\enskip; both are kernel commands: the former is a\kern:\def\enspace{\kern.5em }the other is a\hskip:\def\enskip{\hskip.5em\relax}. – Gonzalo Medina May 26 '14 at 01:57\enspacemay be dangerous if it happens to fall at where a paragraph should start, because it would issue a vertical space;\enskipwould start horizontal mode, instead, but allowing a line break. A header is normally typeset in restricted horizontal mode, so there's no difference between the two, in that case. – egreg May 26 '14 at 09:27