Uploaded image for project: 'Sync 2'
  1. Sync 2
  2. SYNCT-340

Fails to Synchronize Obs Because of Rest Resource Representation

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Code Review (Post-Commit)
    • Priority: Should
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
      None
    • Complexity:
      Low

      Description

      Note: Specific to REST client.
      This happens when trying to synchronize an obs that is associated with an encounter. When the client pulls the obs from the source server, it uses the full representation which includes the parent encounter with it's associated obs. However, the obs contained within an encounter have a ref representation which fails processing when {{post}}ed to the destination. Fails with ConstraintViolationException concept_id cannot be null .
      See an example of the obs representation sent to destination below.

      Also this leads to unnecessary double processing if the encounter has already been captured with a separate event.

      {
          "uuid": "44ab9c10-96c0-420b-ab62-a1120969bc07",
          "display": "LACTAÇÃO: SIM",
          "concept": {
              "uuid": "bc4fe755-fc8f-49b8-9956-baf2477e8313",
              "display": "LACTAÇÃO",
              "resourceVersion": "1.11"
          },
          "person": {
              "uuid": "b16de07f-3179-4cd5-993d-372ec474a609",
              "display": "125004 - Virtual4 Parentcreated Jumatatu",
              "links": [
                  {
                      "rel": "self",
                      "uri": "http://localhost:8080/openmrs/ws/rest/v1/patient/b16de07f-3179-4cd5-993d-372ec474a609"
                  }
              ]
          },
          "obsDatetime": "2019-11-05T00:00:00.000-0600",
          "encounter": {
              "uuid": "638f6f47-0163-4b8b-9200-0e3f222eabfa",
              "encounterType": {},
              "obs": [
                // These obs here create problems because they don't have concepts
                  {
                      "uuid": "8a68ffd6-1e2c-431f-aba22-262bd1a10cf5",
                      "display": "RASTREIO DE TB: NAO",
                      "links": [
                          {
                              "rel": "self",
                              "uri": "http://localhost:8080/openmrs/ws/rest/v1/obs/8a68ffd6-1e2c-431f-aba2-262bd1a10cf5"
                          }
                      ]
                  },
                  {
                      "uuid": "7c607bc5-1482-49f3-808b-40f77c757580",
                      "display": "URINA, TESTE DE GRAVIDEZ: NEGATIVO",
                      "links": [
                          {
                              "rel": "self",
                              "uri": "http://localhost:8080/openmrs/ws/rest/v1/obs/7c607bc5-1482-49f3-808b-40f77c757580"
                          }
                      ]
                  }
              ],
              "voided": false,
              "resourceVersion": "1.9"
          },
          "voided": false,
          "value": {
              "uuid": "e1d81b62-1d5f-11e0-b929-000c29ad1d07",
              "display": "SIM",
              "resourceVersion": "1.11"
          },
          "resourceVersion": "1.11"
      }
      

        Attachments

          Activity

            People

            Assignee:
            willa Willa Mhawila
            Reporter:
            willa Willa Mhawila
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated: