Uploaded image for project: 'Webservices REST Module'
  1. Webservices REST Module
  2. RESTWS-140

Clean up representations of Cohort and CohortMember

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Ready for Work
    • Priority: Should
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
    • Complexity:
      High
    • Sprint:
      RESTWS Sprint - Feb 2013

      Description

      Cohorts are currently inappropriately exposing internal object IDs for member. The Cohort resource should expose metadata about the cohort and a link to member list at /ws/rest/cohort/{uuid}/members, that returns a paged list of Patient resources.

      Orginial Description (outdated)

      We need to decide whether a cohort resource should just have a memberIds property, or if it should have a members property. (I propose that the default rep includes just ids, and the full rep should include the members as patients.)

      The CohortMember resource should probably be modified to actually delegate to Patient resource somehow. For example:

      
      curl -i -u admin:test http://localhost:8080/openmrs/ws/rest/cohort/0bbc73bd-0986-4581-9d3a-87cdeea13251/members
      -->
      [
        { "display":"987654321 - Darius Testing",
          "links":[
            { "uri":"http://localhost:8080/openmrs/ws/rest/cohort/0bbc73bd-0986-4581-9d3a-87cdeea13251/members/5ee9b94c-81f8-4c15-96ec-c1aa9c0b0d66",
              "rel":"self" }
          ]
        }
      ]
      

      But I think it should really include a straight-up patient, instead of the internal CohortMember.

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            darius Darius Jazayeri
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Dates

              Created:
              Updated:

                Time Tracking

                Estimated:
                Original Estimate - 1 day
                1d
                Remaining:
                Time Spent - 30 minutes Remaining Estimate - 7 hours, 30 minutes
                7h 30m
                Logged:
                Time Spent - 30 minutes Remaining Estimate - 7 hours, 30 minutes
                30m