From f223fbc426906a4334482099f8fe5d826c4aaa67 Mon Sep 17 00:00:00 2001 From: Evgeny Mukha Date: Wed, 18 Oct 2023 18:13:37 +0200 Subject: [PATCH] Finish pipeline impl Co-authored-by: @Panthevm --- src/ftr/ci_pipelines/rxnorm/core.clj | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/src/ftr/ci_pipelines/rxnorm/core.clj b/src/ftr/ci_pipelines/rxnorm/core.clj index 3f18ee7..e583a77 100644 --- a/src/ftr/ci_pipelines/rxnorm/core.clj +++ b/src/ftr/ci_pipelines/rxnorm/core.clj @@ -5,7 +5,8 @@ [clojure.pprint] [ftr.ci-pipelines.utils] [ftr.utils.unifn.core :as u] - [clojure.string :as str]) + [clojure.string :as str] + [ftr.utils.core]) (:import [java.io File])) @@ -16,6 +17,7 @@ {:automated-downloads-url "https://uts-ws.nlm.nih.gov/download" :rxnorm-current-version-url "https://download.nlm.nih.gov/umls/kss/rxnorm/RxNorm_full_current.zip" :db "jdbc:postgresql://localhost:5125/ftr?user=ftr&password=password" + :api-key "9548827f-7935-45a1-8c22-a953c042d7c2" :ftr-path "/tmp/ftr/" :working-dir-path "/tmp/rxnorm_work_dir"}) @@ -92,6 +94,14 @@ :url "http://www.nlm.nih.gov/research/umls/rxnorm/valueset"}}}}) +(defmethod u/*fn ::clear-working-dir + [{:as _ctx, + :keys [extract-destination download-destination]}] + (ftr.utils.core/rmrf extract-destination) + (ftr.utils.core/rmrf download-destination) + {}) + + (defmethod u/*fn ::generate-rxnorm-zen-package [{:as _ctx, :keys [working-dir-path rxnorm-version module]}] @@ -124,15 +134,15 @@ (let [cfg (-> (merge config-defaults args) (assoc :ftr.utils.unifn.core/tracers [:ftr.logger.core/log-step]))] (clojure.pprint/pprint - (u/*apply [#_:ftr.ci-pipelines.utils/download-previous-ftr-version! + (u/*apply [:ftr.ci-pipelines.utils/download-previous-ftr-version! ::get-rxnorm-bundle! ::build-ftr-cfg :ftr.core/apply-cfg - #_::clear-working-dir - #_:ftr.ci-pipelines.utils/upload-to-gcp-bucket - #_::generate-rxnorm-zen-package - #_:ftr.ci-pipelines.utils/push-zen-package - #_:ftr.ci-pipelines.utils/send-tg-notification] + ::clear-working-dir + :ftr.ci-pipelines.utils/upload-to-gcp-bucket + ::generate-rxnorm-zen-package + :ftr.ci-pipelines.utils/push-zen-package + :ftr.ci-pipelines.utils/send-tg-notification] cfg))))