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

Add ability to filter concepts by Name Type & Description Type #37

Closed
paynejd opened this issue Feb 23, 2018 · 11 comments
Closed

Add ability to filter concepts by Name Type & Description Type #37

paynejd opened this issue Feb 23, 2018 · 11 comments
Assignees
Labels
discussion-needed Flagged for discussion on OCL Community call enhancement New feature or request intro Issues which are easy enough to work on for new developers

Comments

@paynejd
Copy link
Member

paynejd commented Feb 23, 2018

Example use case is populating a drop down of locales that have a ISO 639-2 code.

https://app.openconceptlab.org/#/orgs/OCL/sources/Locales/concepts/zza/

@paynejd paynejd added the enhancement New feature or request label Jul 8, 2019
@paynejd paynejd added the discussion-needed Flagged for discussion on OCL Community call label Oct 9, 2020
@rkorytkowski rkorytkowski added the intro Issues which are easy enough to work on for new developers label Jul 9, 2021
@rkorytkowski
Copy link
Contributor

@snyaggarwal is this already supported? If yes, please close.

@snyaggarwal
Copy link
Contributor

@rkorytkowski Not yet!

@paynejd
Copy link
Member Author

paynejd commented Sep 7, 2021

@snyaggarwal to add description to this ticket

@paynejd paynejd changed the title Add ability to filter concepts by Name Type Add ability to filter concepts by Name Type & Description Type Sep 7, 2021
@jamlung-ri
Copy link
Member

@snyaggarwal
Copy link
Contributor

Tasks:

  1. Will need to add name_types as ListField in ES (in ConceptDocument)
  2. Add name_types in facets for Concept (in ConceptSearch)

@PatrickCmd PatrickCmd self-assigned this Sep 14, 2021
@PatrickCmd
Copy link

PatrickCmd commented Sep 14, 2021

@snyaggarwal from your comment, so I am planning to add name_types as name_types = fields.ListField(fields.KeywordField()) in ConceptDocument and a prepping for name_types as below

@staticmethod
    def prepare_name_types(instance):
        return list(
            instance.names.filter(type__isnull=False).distinct('type').values_list('type', flat=True)
        )

Is this okay. And if yes, I think I am to do the same for description types.

@snyaggarwal
Copy link
Contributor

@PatrickCmd This looks good to me.

PatrickCmd added a commit to PatrickCmd/oclapi2 that referenced this issue Sep 20, 2021
@jamlung-ri
Copy link
Member

@PatrickCmd Maybe we can do a demo of this on our Dev call this week?

PatrickCmd added a commit to PatrickCmd/oclapi2 that referenced this issue Oct 12, 2021
PatrickCmd added a commit to PatrickCmd/oclapi2 that referenced this issue Oct 19, 2021
PatrickCmd added a commit to PatrickCmd/oclapi2 that referenced this issue Oct 19, 2021
PatrickCmd added a commit to PatrickCmd/oclapi2 that referenced this issue Oct 22, 2021
snyaggarwal added a commit to OpenConceptLab/oclapi2 that referenced this issue Oct 25, 2021
…sctription_types

OpenConceptLab/ocl_issues#37 | filter concepts by name and description types
snyaggarwal added a commit to OpenConceptLab/oclweb2 that referenced this issue Oct 25, 2021
@snyaggarwal
Copy link
Contributor

@paynejd @jamlung-ri I have tested this and merged in master.
Some example queries I tried:
/concepts/?description_types=Description
/concepts/?verbose=false&name_types=IETF+BCP+47,ISO+639-1+Non-preferred,Fully-Specified
Please give a final go-ahead to close this.

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

@paynejd @jamlung-ri This is now available in all environments. The concepts are reindexed (staging is still under indexing).

@jamlung-ri
Copy link
Member

Looks good! @snyaggarwal Please let me know if I should document this anywhere e.g. ReadTheDocs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion-needed Flagged for discussion on OCL Community call enhancement New feature or request intro Issues which are easy enough to work on for new developers
Projects
None yet
Development

No branches or pull requests

5 participants