Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce URL parameter to store fully enumerated reference expressions #1230

Closed
paynejd opened this issue Mar 11, 2022 · 2 comments
Closed
Assignees

Comments

@paynejd
Copy link
Member

paynejd commented Mar 11, 2022

We want to provide 2 options for how the OCL API stores collection references:

  • Dynamic: OCL stores what the user submits and, where applicable, is able to dynamically re-evaluate the reference at a later time
  • Fully Enumerated: OCL stores the fully resolved references to specific resource versions -- this is similar to how OCL used to persist references before we had support for dynamic references

For example: Given a request to add CIEL:163310 as a cascaded reference to a collection, we can do this is several ways. Here's the concept:

Ways to add a cascaded reference:

  • Using ?cascade=sourceconcepts in the request should be identical to using the $cascade operator in a reference expression without any parameters:
PUT /orgs/KenyaMOH/collections/KenyaEMR/references/?cascade=sourceconcepts
{ "data": { "expressions": ["/orgs/CIEL/sources/CIEL/concepts/163310/"] } }
PUT /orgs/KenyaMOH/collections/KenyaEMR/references/
{ "data": { "expressions": ["/orgs/CIEL/sources/CIEL/concepts/163310/$cascade"] } }

Focusing on the ?cascade=sourceconcepts approach:

image

* In the new collection model, this stored references to _**version-less**_ concepts & mappings, which allows this to be re-evaluated in the future to incorporate updates to CIEL -- see here: https://app.staging.openconceptlab.org/#/users/paynejd/collections/NewTestDictionary/references

image

We want to provide a new URL parameter (saveEnumeratedReferences=true) that will cause OCL to store the fully enumerated versioned references in the new Collection model. This parameter should work with any type of reference expression, not just cascade=sourceconcepts.

Example usage:

PUT /orgs/KenyaMOH/collections/KenyaEMR/references/?cascade=sourceconcepts&saveEnumeratedReferences=true
{ "data": { "expressions": ["/orgs/CIEL/sources/CIEL/concepts/163310/"] } }
@paynejd
Copy link
Member Author

paynejd commented Mar 15, 2022

transformReferences=none (default)
transformReferences=resourceVersions
transformReferences=versionlessResources

PUT /orgs/MyOrg/collections/MyCollection/references/?cascade=sourceconcepts&transformReferences=resourceVersions

snyaggarwal added a commit to OpenConceptLab/oclapi2 that referenced this issue Mar 21, 2022
@paynejd
Copy link
Member Author

paynejd commented Mar 29, 2022

Final testing for this will be done using the Dictionary Manager -- Ticket created by OpenMRS squad here: https://issues.openmrs.org/browse/OCLOMRS-1096

@paynejd paynejd closed this as completed Apr 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants