Details

    • Type: New Feature New Feature
    • Status: Ready for Work
    • Priority: Must Must
    • Resolution: Unresolved
    • Affects Version/s: 1.0
    • Fix Version/s: 1.3
    • Component/s: None
    • Labels:
      None
    • Complexity:
      Medium
    • Sprint:
      Open Concept Lab 1

      Description

      Limit of results returned by OCL when requesting updates by OclClient.fetchUpdates is set to 100000 items by default, but the maximum number of items per page imposed by OCL service is actually 1000. We need to do subsequent calls to fetch all remaining items if they exceed 1000 items limit.

      You need to append to the query in fetchUpdates: &limit=1000&page=(starts from 1). If there are 1000 returned items, then request the next page and repeat until there are less than 1000 returned items. You need to combine all responses into one OclResponse object and return it from fetchUpdates.

        Gliffy Diagrams

          Issue Links

            Activity

            Hide
            Darius Jazayeri added a comment -

            As an aside, if the OCL API doesn't actually tell you that there's another page (e.g. via a link) then we should ask them to add that feature.

            (E.g. there might be exactly 1000 concepts.)

            Show
            Darius Jazayeri added a comment - As an aside, if the OCL API doesn't actually tell you that there's another page (e.g. via a link) then we should ask them to add that feature. (E.g. there might be exactly 1000 concepts.)
            Hide
            Nicholas Ingosi added a comment -

            Rafal Korytkowski I cannot easily tell how many pages are there before I create a loop for that. I think there should be a way of telling how many pages are there, or maybe there is another way, please advice

            Show
            Nicholas Ingosi added a comment - Rafal Korytkowski I cannot easily tell how many pages are there before I create a loop for that. I think there should be a way of telling how many pages are there, or maybe there is another way, please advice
            Hide
            Rafal Korytkowski added a comment -

            [~djazayeri], Jonathan told me that it is unlikely they make any changes in API right now. He doesn't have any developers at the moment to help with that.

            Nicholas Ingosi, you basically need to create a while loop that ends when you get less than 1000 items on a page. If it is 1000 items, it asks for the next page.

            Show
            Rafal Korytkowski added a comment - [~djazayeri] , Jonathan told me that it is unlikely they make any changes in API right now. He doesn't have any developers at the moment to help with that. Nicholas Ingosi , you basically need to create a while loop that ends when you get less than 1000 items on a page. If it is 1000 items, it asks for the next page.
            Show
            Nicholas Ingosi added a comment - Rafal Korytkowski check this https://github.com/openmrs/openmrs-module-openconceptlab/pull/16
            Hide
            Daniel Kayiwa added a comment -

            Nicholas Ingosi i have a question for you on github.

            Show
            Daniel Kayiwa added a comment - Nicholas Ingosi i have a question for you on github.
            Hide
            Rafal Korytkowski added a comment -

            Nicholas Ingosi, rework is needed. Please see my comment on github.

            Show
            Rafal Korytkowski added a comment - Nicholas Ingosi , rework is needed. Please see my comment on github.
            Hide
            Rafal Korytkowski added a comment -

            I'm taking it over since Nicholas cannot complete it by the end of this week.

            Show
            Rafal Korytkowski added a comment - I'm taking it over since Nicholas cannot complete it by the end of this week.
            Hide
            Daniel Kayiwa added a comment -

            Tomasz Marzeion are you still working on this?

            Show
            Daniel Kayiwa added a comment - Tomasz Marzeion are you still working on this?

              People

              • Assignee:
                Unassigned
                Reporter:
                Rafal Korytkowski
              • Votes:
                1 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:

                  Time Tracking

                  Estimated:
                  Original Estimate - 3 days
                  3d
                  Remaining:
                  Time Spent - 2 days Remaining Estimate - 1 day
                  1d
                  Logged:
                  Time Spent - 2 days Remaining Estimate - 1 day
                  2d

                    Development

                      Agile