Lens ODM Parser is a library which parses ODM XML files into a Clojure data structure and vice versa.
The data structure generated by an XML parser is not sufficient for tasks like comparing two snapshot ODM files. The data structure I introduce here uses sequences of data elements comprising their properties as well as possible children.
<ClinicalData StudyOID="S01">
<SubjectData SubjectKey="1000">
</SubjectData>
<SubjectData SubjectKey="1001">
</SubjectData>
</ClinicalData>
#:odm.clinical-data
{:study-oid "S01",
:subject-data
[#:odm.subject-data{:subject-key "1000"}
#:odm.subject-data{:subject-key "1001"}]
To install, just add the following to your project dependencies:
[org.clojars.akiel/lens-odm-parser "0.7"]
(require '[clojure.data.xml :as xml])
(require '[clojure.java.io :as io])
(require '[lens-odm-parser.core :as p])
(-> (io/input-stream filename)
(xml/parse)
(p/parse-elem))
The data structure generated by the parser is described as Spec. You can find all specs in the associated odm-spec project.
Currently the following parts are parsed:
ClinicalData
Study
Other parts like AdminData
and others will follow as I have a need
for them.
Works only with Java 8.
Copyright © 2016 Alexander Kiel
Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.
Can you improve this documentation?Edit on GitHub
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close