CityOfBoston / CityWorker-issues-Incapsulate

Archived for legacy purposes
0 stars 0 forks source link

Service has ambiguous attribute code #134

Closed jqr closed 4 years ago

jqr commented 6 years ago

Some Service's Outcome's Attributes have multiple references to the same code. This means two questions get mapped into the same answer key, causing one answer to be written over. This is non-deterministic and very likely to be confusing to users.

Example and Additional Description

HPSRPR Has two Activities with Outcomes that have duplicate use of SIGN-QTY. Here are the questions for HPSRPR-VERFYREPR (Verify information - HP Repair) Activity:

    Sign info: 
    Quantity:  (first)
    Sign description:
    Sign post:
    Quantity: (second)

Imagine you enter 1 for the first Quantity: question and 2 for the second. The value submitted to Incapsulate will be either 1 or 2, but not both, and likely not consistent on which is chosen.

This error occurs because the data is transmitted to Incapsulate using a one-to-one mapping of code -> value and we're using the code more than once. Here's what would be sent to Incapsulate for this example:

{
  "attribute[SIGN-QTY]": "1",
}

Steps to Reproduce

  1. Query the HPSRPR Service using the Incapsulate Service API.
  2. Inspect the activities[0].outcomes[0].attributes

Expected Outcome: There would be only one reference to code of SIGN-QTY.

Actual Outcome: There are two references to code with SIGN-QTY.