Uploaded image for project: 'HTML Form Entry Module'
  1. HTML Form Entry Module
  2. HTML-769

Obs with Value Drug corrupts data upon edit

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: TBD
    • Resolution: Fixed
    • Affects Version/s: HTML Form Entry 3.12.0
    • Fix Version/s: HTML Form Entry 3.13.0
    • Labels:
      None

      Description

      Unfortunately, with the implementation of HTML-748 back in September, I introduced a potentially bad bug when using the "obs" tag with the "answerDrugs" attribute set to true (which renders the "obs" tag with drug autocomplete).

       

      Problem:

      When editing a form with one of these tags, the underlying hidden value of this autocomplete is set to "drugId" when it should be "Drug:{

      {drugId}

      ".  So, if the form is submitted without ever accessing the autocomplete widget, the value is interpreted a concept ID instead of a drug id.

      Net result, if you edit a form with on of these tags, upon save, the value will change from the correct value drug to a seemingly arbitrary value coded.

      For example, here's an existing use of the tag on a PIH dispensing form.  

      Note that Paracetamol has been ordered.

      Now I open this form in edit mode...

      ...and then resave without making any changes... in the new view mode, the medication name is listed as "Shop Owner"

       

       

      This bug is in the 3.12.0 release of HFE.  I'm not sure if the "answerDrugs" attribute is used outside of PIH... hopefully (likely?) not.  

       

      I'll have a PR for the fix shortly, but would likely fast-track a 3.13.0 release of HFE once it gets approved and post to Talk encouraging people to upgrade.

       

      fyi Mike Seaton Dimitri R Grace Potma Ellen Ball

       

        Gliffy Diagrams

          Attachments

          1. 2021-02-08_13-33_1.png
            2021-02-08_13-33_1.png
            19 kB
          2. 2021-02-08_13-33.png
            2021-02-08_13-33.png
            20 kB
          3. 2021-02-08_13-34.png
            2021-02-08_13-34.png
            30 kB

            Activity

              People

              Assignee:
              mogoodrich Mark Goodrich
              Reporter:
              mogoodrich Mark Goodrich
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: