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

Unable to bulk add concepts or mappings to collection #1018

Closed
bmamlin opened this issue Oct 1, 2021 · 7 comments
Closed

Unable to bulk add concepts or mappings to collection #1018

bmamlin opened this issue Oct 1, 2021 · 7 comments
Assignees
Labels
bug Something isn't working

Comments

@bmamlin
Copy link

bmamlin commented Oct 1, 2021

The API documentation suggests this might work to add all PIH-temp concepts to the PIH-temp collection; however, it's not working as expected (on staging):

PUT /orgs/PIH/collections/PIH-temp/references/
{
  "data": {
    "uri": "/orgs/PIH/sources/PIH-temp/",
    "concepts": "*"
  }
}

this returns 202 Accepted with the result '[]`. The references for the PIH-temp collection remains empty.

I've tried several variations of the request and looked at the code, but haven't found a working solution.

@bmamlin bmamlin added the bug Something isn't working label Oct 1, 2021
snyaggarwal added a commit to OpenConceptLab/oclapi2 that referenced this issue Oct 4, 2021
@snyaggarwal
Copy link
Contributor

@bmamlin the bug is fixed.
I have created a pih-temp2 collection and added all the concepts/mappings from pih-temp by:

{
  "data": {
    "uri": "/orgs/PIH/sources/PIH-temp/",
    "concepts": "*", 
    "mappings": "*"
  }
}

The PUT API will return 202 with task ID, and it will happen async.

@bmamlin
Copy link
Author

bmamlin commented Oct 5, 2021

Thanks @snyaggarwal. I tried this for a PIH-temp collection and got a 202 with task ID. I'm not seeing any references yet and I'm not sure how to check progress on the task, so I'll just cross my fingers and be patient. 🙂

@bmamlin
Copy link
Author

bmamlin commented Oct 6, 2021

A day later and the PIH-temp collection is still empty. 😕

@bmamlin
Copy link
Author

bmamlin commented Oct 6, 2021

It turns out a deployment likely aborted the prior attempt. A repeated request to build the collection worked. Now trying to get it to show up in the Dictionary Manager.

Using my burke account on staging (a member of the PIH org with access to the PIH-temp collection):

$ http "$OCL_API_URL/user/orgs/collections/" authorization:"token $OCL_API_TOKEN" \
   | jq -r .[].id
PIH-temp
pih-temp2
COVID-19-Starter-Set

I can see the PIH-temp collection has the OpenMRS validation schema:

$ http "$OCL_API_URL/orgs/PIH/collections/PIH-temp/" authorization:"token $OCL_API_TOKEN" \
   | jq -r .custom_validation_schema
OpenMRS

but when I ask for my orgs’ collections that use the OpenMRS schema, I see my own personal collections, but not the PIH-temp collection belonging to the PIH org:

$ http "$OCL_API_URL/user/orgs/collections/?limit=20&page=1&verbose=true&q=&customValidationSchema=OpenMRS" \
  authorization:"token $OCL_API_TOKEN" | jq -r .[].id
test
test2

I switched the custom validation schema on the PIH-temp collection to “OpenMRS” after the collection was created, so that may be the problem. Checking with @snyaggarwal.

@ibacher
Copy link

ibacher commented Oct 6, 2021

@bmamlin I think that what you're seeing is the same bug reported as #988. Presumably you'd be able to browse the source here: https://openmrs.staging.openconceptlab.org/orgs/PIH/sources/PIH-temp/ and the collection here: https://openmrs.staging.openconceptlab.org/orgs/PIH/collections/PIH-temp/.

snyaggarwal added a commit to OpenConceptLab/oclapi2 that referenced this issue Oct 7, 2021
@snyaggarwal
Copy link
Contributor

@bmamlin This can be closed now?

@bmamlin
Copy link
Author

bmamlin commented Oct 11, 2021

Yes, @snyaggarwal. Creating a collection works now. I'll close this issue.

@bmamlin bmamlin closed this as completed Oct 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants