-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
First commit of clojure terminology service.
- Loading branch information
0 parents
commit 3efb8fc
Showing
4 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.cpcache/ | ||
.idea/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
50469 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
(ns com.eldrix.hermes.import | ||
"Provides import functionality for processing directories of files") | ||
|
||
(def ^:private snomed-files | ||
[#"sct2_Concept_Snapshot_\S+_\S+.txt" | ||
#"sct2_Description_Snapshot-\S+_\S+.txt"]) | ||
|
||
(defn is-snomed-file? [filename] | ||
(not-empty (filter #(re-find % filename) snomed-files))) | ||
|
||
(defn snomed-file-seq | ||
"A tree sequence for SNOMED CT data files" | ||
[dir] | ||
(->> dir | ||
clojure.java.io/file | ||
file-seq | ||
(filter #(.isFile %)) | ||
(filter #(is-snomed-file? (.getName %))))) | ||
|
||
(defn -main [x] | ||
(let [ff (snomed-file-seq x)] | ||
(println "Found" (count ff) "files in" x))) | ||
|
||
|
||
|
||
(comment | ||
(require '[clojure.reflect :as reflect]) | ||
(clojure.pprint/pprint (reflect/reflect (java.util.Date.))) | ||
(def f (first (file-seq (clojure.java.io/file ".")))) | ||
(reflect/reflect f) | ||
(def patterns (vals snomed-files)) | ||
|
||
|
||
(is-snomed-file? "sct2_Concept_Snapshot_INT_20190731.txt") | ||
(re-find (:snomed/concept snomed-files) "sct2_Concept_Snapshot_INT_20190731.txt") | ||
) |