Skip to content

Commit

Permalink
Add temp hack for NICTIZ package
Browse files Browse the repository at this point in the history
Latest version of NICTIZ package lacks of some profiles, build separate
package for 1.3.18
  • Loading branch information
ApricotLace committed Jun 13, 2023
1 parent b718d5a commit 900ad48
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 6 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/github-standalone-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,18 @@ jobs:
- run: bb init-r3
name: Install npm R3 packages

- run: bb init-r3
name: Install specific version of NICTIZ package, tmp hack

- name: Build jar
run: bb build

- name: Build standalone R3
run: bb build-stanadlone-projects "r3/node_modules/" "zrc/standalone_projects/"

- name: Build R3-nictiz-hack
run: bb build-r3-nictiz-hack

- name: Build standalone projects
run: bb build-standalone-zen-profiles-all-versions "node_modules/" "zrc/standalone_projects/"

Expand Down
19 changes: 17 additions & 2 deletions bb.edn
Original file line number Diff line number Diff line change
Expand Up @@ -119,19 +119,34 @@
(shell {:dir "r3"} "npm --registry=https://packages.simplifier.net install")
(shell {:dir "r3"} "npm --registry=https://packages.simplifier.net install"))}

init-r3-nictiz-hack {:depends [set-zen-fhir-version set-zen-fhir-lib-version]
:task (do
(shell {:dir "r3-tmp-nictiz-hack"} "npm --registry=https://packages.simplifier.net install")
(shell {:dir "r3-tmp-nictiz-hack"} "npm --registry=https://packages.simplifier.net install"))}

build-r3-nictiz-hack (binding [*command-line-args* (list "r3-tmp-nictiz-hack/"
"zrc/standalone_projects/"
nil
nil
true)]
(run 'build-stanadlone-projects))

build (clojure "-X:build all")

zen-profiles (let [[node-modules zrc ver package] *command-line-args*]
(clojure (str "-M -m zen.fhir.tooling " node-modules " " zrc " " ver " " package)))

zen-profiles-packages (clojure (str "-J-Xmx16g -M -m zen.fhir.tooling-packages " (str/join " " *command-line-args*)))

build-stanadlone-projects (let [[node-modules zrc preserve-package alt-package-name] *command-line-args*
build-stanadlone-projects (let [[node-modules zrc preserve-package alt-package-name rename-package] *command-line-args*
opts (cond-> {}
preserve-package
(assoc "preserve-package" preserve-package)
alt-package-name
(assoc "alt-package-name" alt-package-name))]
(assoc "alt-package-name" alt-package-name)
rename-package
(assoc "rename-package" rename-package))]

(clojure (str "-M -m zen.fhir.tooling.aidbox-standalone-v2 " node-modules " " zrc " " (str/join " " (flatten (seq opts))))))

build-standalone-zen-profiles-all-versions
Expand Down
6 changes: 6 additions & 0 deletions r3-tmp-nictiz-hack/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"dependencies": {
"hl7.fhir.r3.core": "3.0.2",
"nictiz.fhir.nl.stu3.zib2017": "1.3.18"
}
}
1 change: 1 addition & 0 deletions resources/rename-package.edn
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{nictiz-fhir-nl-stu3-zib2017 nictiz-fhir-nl-stu3-zib2017-1.3.18}
9 changes: 5 additions & 4 deletions src/zen/fhir/tooling/aidbox_standalone_v2.clj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
packages-deps-nses]]
[zen.fhir.inter-utils]
[clojure.java.shell :as shell]
[clojure.string :as str]))
[clojure.string :as str]
[clojure.java.io :as io]))

(comment
(require '[clj-async-profiler.core :as prof])
Expand Down Expand Up @@ -43,9 +44,8 @@
(str/replace "." "-")
(str/lower-case)))


(defn -main [node-modules-folder zrc-dir & {:as opts}]
(let [{:as opts, :strs [omit-deps? preserve-package alt-package-name]} opts
(let [{:as opts, :strs [omit-deps? preserve-package alt-package-name rename-package]} opts
ztx (zen-core/new-context {})]
(load-all ztx nil {:node-modules-folder node-modules-folder})
(generate-zen-schemas ztx)
Expand All @@ -55,7 +55,8 @@
(= package-name (symbol (coerce-to-internal-package-name preserve-package))))]
(let [package-name package-name
standalone-dir (str zrc-dir "/" package-name "/")
alt-package-name (or alt-package-name package-name)]
rename-package (when rename-package (read-string (slurp "resources/rename-package.edn")))
alt-package-name (or (get rename-package package-name) alt-package-name package-name)]
(if omit-deps?
(spit-zen-modules ztx standalone-dir package-name)
(doseq [package (cons package-name (zen.fhir.inter-utils/get-all-deps package-name packages-deps))]
Expand Down

0 comments on commit 900ad48

Please sign in to comment.