Skip to content

Instantly share code, notes, and snippets.

@refset
Created May 31, 2022 07:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save refset/c8116f0862abaa94db7752af540549d5 to your computer and use it in GitHub Desktop.
Save refset/c8116f0862abaa94db7752af540549d5 to your computer and use it in GitHub Desktop.
xt-map-id-test.clj
;; https://clojurians.slack.com/archives/CG3AM2F7V/p1653948044448019
(with-open [n (xt/start-node {})]
(xt/submit-tx n [[::xt/put {:cohesic/type :measurement,
:measurement/measurement-id "left-ventricle.end-diastolic-volume",
:measurement/diagnostic-report-id
"15718872-f75a-4a3e-911b-570b84ad97ed",
:measurement/value [1.0 2.0 3.0],
:xt/id
{:measurement-id "left-ventricle.end-diastolic-volume",
:diagnostic-report-version-id "53cfbb74-beea-4630-b729-c0172591ee99"}}]])
(xt/sync n)
(xt/entity (xt/db n) {:measurement-id "left-ventricle.end-diastolic-volume",
:diagnostic-report-version-id "53cfbb74-beea-4630-b729-c0172591ee99"})
(xt/q (xt/db n) '{:find [e] :where [[e :xt/id {:measurement-id "left-ventricle.end-diastolic-volume",
:diagnostic-report-version-id "53cfbb74-beea-4630-b729-c0172591ee99"}]]}))
;=> #{[{:diagnostic-report-version-id "53cfbb74-beea-4630-b729-c0172591ee99", :measurement-id "left-ventricle.end-diastolic-volume"}]}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment