Skip to content

Commit b866912

Browse files
committed
fix(python core): fix codeable concept patterns
1 parent 6735dc2 commit b866912

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/python-generator/second-try/main.clj

+3-2
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@
100100
(if-let [pattern (some #(when (= (name (first %)) (:name item)) (last %)) patterns)]
101101
(case (:value item)
102102
"str" (assoc item :value (:pattern pattern) :literal true)
103-
"CodeableConcept" (conj item (hash-map :value (str (str/join (map help/uppercase-first-letter (str/split (help/get-resource-name constraint-name) #"-"))) (str/join (map help/uppercase-first-letter (str/split (:name item) #"-"))) " = " (str/join (map help/uppercase-first-letter (str/split (help/get-resource-name constraint-name) #"-"))) (str/join (map help/uppercase-first-letter (str/split (:name item) #"-"))) "()")))
103+
"CodeableConcept" (conj item (hash-map :value (str (str/join (map help/uppercase-first-letter (str/split (help/get-resource-name constraint-name) #"-"))) (str/join (map help/uppercase-first-letter (str/split (:name item) #"-")))) :codeable-concept-pattern true))
104104
"Quantity" item item) item)) (:elements schema))
105105
(hash-map :elements)
106106
(conj schema)
@@ -138,7 +138,8 @@
138138
((if (:array item) (fn [s] (str "List[" s "]")) str))
139139
((if (:literal item) (fn [s] (str "Literal[\"" s "\"] = " "\"" s "\"")) str))
140140
((if (and (not (:required item)) (not (:literal item))) (fn [s] (str "Optional[" s "]")) str))
141-
((if (and (not (:required item)) (not (:literal item))) help/append-default-none str))
141+
((if (and (not (:required item)) (not (:literal item))) (fn [s] (str s " = None")) str))
142+
((if (and (:required item) (:codeable-concept-pattern item)) (fn [s] (str s " = " (:value item) "()")) str))
142143
;; ((if (and (not (:required item)) (:array item)) help/append-default-vector str))
143144
(str "\t" (:name item) ": ")
144145
(str "\n")))) elements)

0 commit comments

Comments
 (0)