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

Grouping: CRUD: Concept set version #181

Open
5 of 16 tasks
Tracked by #178 ...
Sigfried opened this issue Nov 10, 2022 · 5 comments
Open
5 of 16 tasks
Tracked by #178 ...

Grouping: CRUD: Concept set version #181

Sigfried opened this issue Nov 10, 2022 · 5 comments
Assignees
Milestone

Comments

@Sigfried
Copy link
Collaborator

Sigfried commented Nov 10, 2022

Overview

Concept set version create/updates should handle (i) metadata fields, (ii) individual concept expression items, and (iii) should be able to handle multiple versions.

Sub-tasks

Creates

  • Allow for other users (@amin): Amin needs to change permissions so that other users, using their TOKENs, I believe, can make calls.
  • Frontend
    • For CSV
    • For JSON
  • Backend: enclave wrangler
    • For CSV
    • For JSON
    • Allow for multiple versions
  • Backend: fast api routes
    • For CSV
    • For JSON
  • Unit tests
    • For CSV
    • For JSON

Updates

This would be updating existing drafts.

Delete

Needed?

Read

Have?

Additional

Documentation

In addition to tests and code comments. Where? Enclave wrangler? Developer docs?

@Sigfried Sigfried mentioned this issue Nov 10, 2022
5 tasks
@Sigfried Sigfried added urgency:3/3 ease:3/3 3: easiest new feature New feature or request labels Nov 10, 2022
@joeflack4
Copy link
Member

Ah, this is what you were talking about on Teams. I think I already have laid the groundwork for this. I have 2 routes already: (i) for new concept set version w/ concept changes (or other metadata changes too, I think), and (ii) one for a new container. I think I just need to improve the robustness of that. The biggest improvement involves committing these changes to git in a stable, consistent manner. However, since we are moving to RDBMS, I think I might want to hold off on that until after RDBMS because the nature of how I do these commits (e.g. in batch) might change. But it might not either.

@Sigfried
Copy link
Collaborator Author

I agree -- RDBMS before worrying more about git persistence.

With the enclave update endpoints -- do you think it's ready for me to start writing a front end interface? Will they allow us to post on behalf of other users? And do they allow us to save actual versions, or just drafts that then have to be saved to versions in the concept set browser?

@joeflack4
Copy link
Member

joeflack4 commented Nov 14, 2022

@Sigfried I think a lot of this was in the recent pull request I made, but we didn't have time to do a review. From what I remember: (i) for a new container, it also creates a 1st draft and finalizes it (you may want to try it and double check), (ii) for a new version, it should indeed create the version draft and also finalize it immediately. I think that the routes I wrote, as well as the enclave functions that do this, talk about this in the docstring, but not 100% sure.

For these routes/features specifically, I thought that a unit test would be prudent. But that has been precluded so far because I anticipate some extra time to work with the correct DELETE endpoint(s) for the teardown step.

@Sigfried
Copy link
Collaborator Author

Sigfried commented Dec 2, 2022

finalize-draft-omop-concept-set-version/validate failing during call to route_upload_new_cset_version_with_concepts:

curl  -H "Content-type: application/json" \
            -H "Authorization: Bearer $PALANTIR_ENCLAVE_AUTHENTICATION_BEARER_TOKEN" \
            https://unite.nih.gov/api/v1/ontologies/ri.ontology.main.ontology.00000000-0000-0000-0000-000000000000/actions/create-new-draft-omop-concept-set-version/validate \
            --data '{"parameters": {"conceptSet": "[DM]Type2 Diabetes Mellitus", "intention": "", "provenance": "Created through TermHub.", "annotation": "Curated value set: [DM]Type2 Diabetes Mellitus", "intended-research-project": "RP-4A9E27", "versionId": 1000083089, "on-behalf-of": "5c560c3e-8e55-485c-9a66-f96285f273a0"}}'
            

curl  -H "Content-type: application/json" \
            -H "Authorization: Bearer $PALANTIR_ENCLAVE_AUTHENTICATION_BEARER_TOKEN" \
            https://unite.nih.gov/api/v1/ontologies/ri.ontology.main.ontology.00000000-0000-0000-0000-000000000000/actions/create-new-draft-omop-concept-set-version/apply \
            --data '{"parameters": {"conceptSet": "[DM]Type2 Diabetes Mellitus", "intention": "", "provenance": "Created through TermHub.", "annotation": "Curated value set: [DM]Type2 Diabetes Mellitus", "intended-research-project": "RP-4A9E27", "versionId": 1000083089, "on-behalf-of": "5c560c3e-8e55-485c-9a66-f96285f273a0"}}'
            

curl  -H "Content-type: application/json" \
            -H "Authorization: Bearer $PALANTIR_ENCLAVE_AUTHENTICATION_BEARER_TOKEN" \
            https://unite.nih.gov/api/v1/ontologies/ri.ontology.main.ontology.00000000-0000-0000-0000-000000000000/actions/finalize-draft-omop-concept-set-version/validate \
            --data '{"parameters": {"new-parameter1": "hello new-parameter1", "concept-set-container": "[DM]Type2 Diabetes Mellitus", "version": 1000083089, "new-parameter": "hello new-parameter", "on-behalf-of": "5c560c3e-8e55-485c-9a66-f96285f273a0"}}'
            
Unexpected <class 'requests.exceptions.HTTPError'>: 400 Client Error: Bad Request for url: https://unite.nih.gov/api/v1/ontologies/ri.ontology.main.ontology.00000000-0000-0000-0000-000000000000/actions/finalize-draft-omop-concept-set-version/validate
Traceback (most recent call last):
  File "/Users/sigfried/git-repos/TermHub/enclave_wrangler/new_enclave_api.py", line 543, in make_request
    raise err
  File "/Users/sigfried/git-repos/TermHub/enclave_wrangler/new_enclave_api.py", line 540, in make_request
    response.raise_for_status()
  File "/Users/sigfried/git-repos/TermHub/venv/lib/python3.10/site-packages/requests/models.py", line 1021, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://unite.nih.gov/api/v1/ontologies/ri.ontology.main.ontology.00000000-0000-0000-0000-000000000000/actions/finalize-draft-omop-concept-set-version/validate

@joeflack4: Do you recall how to get the documentation for an api call? Something is wrong with this call to finalize.

@joeflack4
Copy link
Member

joeflack4 commented Dec 2, 2022

Just sent you a message over teams. This may show the query to get endpoint definitions, but if not, I can find out how: https://unite.nih.gov/documentation/static/foundry/api/ontology-resources/actions/list-action-types/

Here is for the specific endpoint, from my pesonal notes:

    {
      "apiName": "finalize-draft-omop-concept-set-version",
      "description": "",
      "rid": "ri.actions.main.action-type.d53c0a2b-db9d-4a72-b10b-ad5f467f3f9c",
      "parameters": {
        "new-parameter1": {
          "description": "",
          "baseType": "String"
        },
        "concept-set-container": {
          "description": "",
          "baseType": "OntologyObject"
        },
        "version": {
          "description": "",
          "baseType": "OntologyObject"
        },
        "currentMaxVersion": {
          "description": "",
          "baseType": "Double"
        },
        "new-parameter": {
          "description": "",
          "baseType": "String"
        }
      }
    },

I remember we were using something called OTHER_TOKEN; not sure if that is your issue here.

@joeflack4 joeflack4 changed the title (i) be able to modify the concepts in an existing concept set, creating a new version, CRUD: (i) update: concepts on concept_set_version, (ii) create: concept_set_version Dec 14, 2022
@joeflack4 joeflack4 changed the title CRUD: (i) update: concepts on concept_set_version, (ii) create: concept_set_version CRUD: Concept set version Jan 18, 2023
@joeflack4 joeflack4 changed the title CRUD: Concept set version CRUD: Concept set version functions Jan 18, 2023
@joeflack4 joeflack4 changed the title CRUD: Concept set version functions CRUD: Concept set version Jan 18, 2023
@Sigfried Sigfried added this to the Upcoming features milestone Aug 14, 2023
@Sigfried Sigfried removed this from the Upcoming features milestone Aug 23, 2023
@joeflack4 joeflack4 changed the title CRUD: Concept set version Grouping: CRUD: Concept set version Apr 30, 2024
@joeflack4 joeflack4 added this to the Uncategorized milestone Apr 30, 2024
@joeflack4 joeflack4 added grouping issue and removed new feature New feature or request urgency:3/3 ease:3/3 3: easiest labels Apr 30, 2024
@joeflack4 joeflack4 modified the milestones: Uncategorized, Unplanned Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 3. Backlog
Development

No branches or pull requests

2 participants