Skip to content
This repository has been archived by the owner on Sep 14, 2023. It is now read-only.

Idea for collection iteration in queries #78

Open
cldwalker opened this issue Apr 13, 2021 · 0 comments
Open

Idea for collection iteration in queries #78

cldwalker opened this issue Apr 13, 2021 · 0 comments

Comments

@cldwalker
Copy link
Contributor

cldwalker commented Apr 13, 2021

We've had a number of repetitive queries that just iterate over one attribute e.g.

{:site-trial-patient [[1 {:refs {:site-patient-id :sp0
                                 :site-trial-id :st0
                                 :patient-source-id :ps1}}]
                      [1 {:refs {:site-patient-id :sp1
                                 :site-trial-id :st0
                                 :patient-source-id :ps1}}]
                      [1 {:refs {:site-patient-id :sp2
                                 :site-trial-id :st0
                                 :patient-source-id :ps1}}]]}

We can make these more readable with for e.g.

(vec
  (for [id [:sp0 :sp1 :sp2]]
    [1 {:refs {:site-patient-id id
        :site-trial-id :st0
        :patient-source-id :ps1}}]))

It would be helpful for this to be supported in specmonstah as it would make this easy and would allow iteration to be done in contexts where we only want to interact with specmonstah queries as edn. One idea:

[3 {:refs {:site-patient-id [:for [:sp0 :sp1 :sp2]]
           :site-trial-id :st0
           :patient-source-id :ps1}}]
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant