Downloads Documentation Community Contribute Demo






Show Sidebar
Login | Register

Ticket #1414 (closed defect: fixed)

Opened 1 year ago

Last modified 6 months ago

Changing a concept's datatype from Coded to something else does not remove its answers from the database

Reported by: djazayeri Assigned to:
Priority: critical Milestone: OpenMRS 1.6
Component: OpenMRS Code Base Keywords:
Cc: pbiondich, bmamlin, bwolfe, ball Introductory Ticket: 0
Code Review Status:

Description

  • Create a concept, give it datatype=Coded, and give it answers. Save it.
  • Edit that concept, change its datatype to N/A. Save it.
  • Edit that concept again, and choose Coded again from the datatype dropdown: the original answers are still there. You can see this in the database as well.

In particular this is breaking concept synching for PIH, because there's now a cycle where a concept that's now N/A "contains" a question, which contains the first N/A concept. (The database thinks it contains it anyway.)

I propose that if you change a concept's datatype from Coded to anything else, then the service and/or DAO should forcibly delete its answers.

(Same should happen with sets that are re-saved as isSet=false, but I haven't checked whether there's a bug there or not.)

Change History

04/15/09 22:55:08 changed by bmamlin

Sounds okay as long as an exception is thrown if the concept has been used -- i.e., if there are are observations or published forms referring to the concept, then you should not be able to change the datatype.

07/23/09 15:21:39 changed by bmamlin

  • milestone changed from OpenMRS 1.4 to OpenMRS 1.6.

09/02/09 19:10:15 changed by bwolfe

  • status changed from new to closed.
  • resolution set to fixed.

This does not happen to ConceptSets because there is an explicit call to clear the sets if isSet==false.

Fixed the concept datatypes persisting in [10183] in trunk.