Skip to content

Commit 5186f52

Browse files
committed
fix(js reader): use full property names
1 parent 2ec0cbb commit 5186f52

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/generator/reader.clj

+7-3
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,10 @@
139139
(println k (:resource config))
140140
acc)
141141
(if (not-empty-values? v)
142-
(let [schema (read-schema ztx v (assoc config :property k))]
142+
(let [schema (read-schema ztx v (assoc config
143+
:property k
144+
:full-resource-name (str (:full-resource-name config)
145+
(str/capitalize (name k)))))]
143146
(cond
144147
(vector? schema)
145148
(reduce (fn [ac [property target]]
@@ -204,8 +207,8 @@
204207
seq)]
205208
result))
206209

207-
(defn parse-value-set [ztx schema {:keys [resource property parent package-name] :as config}]
208-
(let [enum-name (str resource (when property (capitalize-first (name property))))
210+
(defn parse-value-set [ztx schema {:keys [resource property parent package-name full-resource-name] :as config}]
211+
(let [enum-name full-resource-name
209212
sym (get-in schema [:zen.fhir/value-set :symbol])
210213
result (get-valueset-values ztx sym)]
211214
(cond
@@ -405,6 +408,7 @@
405408
{:base-path base-path
406409
:imports-path (conj base-path :imports)
407410
:resource (or sub-name main-name)
411+
:full-resource-name (or sub-name main-name)
408412
:parent (when (and sub-name (not (contains? wrong-main-names main-name))) main-name)
409413
:package-name package-name})]
410414
(update-visited sym true)

0 commit comments

Comments
 (0)