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

Module Should Allow Patient Identifier Subresource Creation with Pre-existing UUID

    XMLWordPrintable

Details

    • Enhancement
    • Status: Closed
    • TBD
    • Resolution: Change Implemented
    • None
    • None
    • None
    • None
    • Undetermined

    Description

      Context
      I am testing Sync2 which uses rest. When a new patient identifier is added via REST using the format (see below)

      POST /ws/rest/v1/patient/<patient-uuid>/identifier
      {
           "identifierType": "patient_identifier_type.uuid",
           "identifier": "the new uuid string",
           "location": "identifier location"
      }
      

      It is added successfully, however when synchronizing this event to another server the resource will be sent with the associated UUID after performing a get. Unfortunately the identifier won't be added because the "uuid" is not "creatable" property throwing the error shown below.

      org.openmrs.module.sync2.api.exceptions.SyncException: Object posting error. Code: 400. Details: org.openmrs.module.sync2.api.exceptions.SyncException: Object posting error. Code: 400. Details: 400 null : {"error":{"message":"[Some properties are not allowed to be set: uuid]","code":"org.openmrs.module.webservices.rest.web.resource.impl.BaseDelegatingResource:674","detail":"org.openmrs.module.webservices.rest.web.response.ConversionException: Some properties are not allowed to be set: uuid at org.openmrs.module.webservices.rest.web.resource.impl.BaseDelegatingResource.setConvertedProperties(BaseDelegatingResource.java:674) at org.openmrs.module.webservices.rest.web.resource.impl.DelegatingSubResource.create(DelegatingSubResource.java:94) at org.openmrs.module.webservices.rest.web.v1_0.controller.MainSubResourceController.create(MainSubResourceController.java:125) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at 
      *Truncated...*
      

      Proposal
      Include uuid as creatable property because of situations like this, moreover, I don't see a reason to prevent users from specifying a uuid if they wish to do so.

      Gliffy Diagrams

        Attachments

          Activity

            People

              Unassigned Unassigned
              willa Willa Mhawila
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: