Created by Andrew Tropin and contributors
In our case it's a tree-like structure,
anything isomorphic to json/xml
Interaction
fronted:
{"name" : "Alexander Ivanov"}
backend:
{
"name": [{
"given": [
"Alexander"
],
"family": "Ivanov"
}]
}
{% for item in items %}
- {{item}}
{% endfor %}
They all have:
:rules [{:form [:ihm/name<->vector [0]]
:fhir [:name [0] :given [0]]}
{:form [:ihm/name<->vector [1]]
:fhir [:name [0] :family]}
{:ih/value {:fhir [:default-gender]}
:fhir [:gender]}]
Addressing the element
[:name [0] :given [0]]
[:telecom [:* {:system "phone"}] :value]
;; {:name "Firstname Secondname"}
[:name :ihs/str<->vector [0]] ;; => [["Firstname"]]
(microexpand-path
{:ih/micros {:ihm/name [:name [:index] :given [0]]}}
[{:ih/micro :ihm/name :index 10}])
;; => [:name [10] :given [0]]
{:ih/values {:person/name "Name not provided by the form"}
:ih/rules [{:form [:name]
:form-2 [:fullname]
:ih/value {:form-2 [:ih/values :person/name]}}]}
- str<->ast
- camel<->kebab
- suitable?
{"ul":
{"li": [{"-class": "cl", "#text": "str<->ast"},
{"-class": "cl", "#text": "camel<->kebab"},
{"-class": "cl", "#text": "suitable?"}]}}
(s/def ::path (s/coll-of ::pelem))
(s/def ::pelem (s/or :mkey ::mkey :sight ::sight :vnav ::vnav))
(s/def ::mkey keyword?)
(s/def ::sight sight?)
(s/def ::vnav
(s/cat :vkey ::vkey :vfilter (s/? ::vfilter)))
(s/def ::vkey (s/or :index ::index :wildcard ::wildcard))
(s/def ::wildcard #(= :* %))
(s/def ::index nat-int?)
(s/def ::vfilter map?)
@andrewtropin
https://github.com/abcdw healthsamurai/ironhide