Uploaded image for project: 'OpenMRS Core'
  1. OpenMRS Core
  2. TRUNK-4681

Remove hard-coded concept ids from OpenMRS constants

    XMLWordPrintable

    Details

    • Type: Story
    • Status: Closed
    • Priority: Should
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: Core 2.5.0
    • Component/s: None
    • Labels:
    • Complexity:
      Low

      Description

      Currently, in OpenmrsConstants there is a set of core global properties defined that are set upon first installing the system. Much of this still retains hard-coded references to concept ids that are no longer guaranteed to be in place in a fresh system. And more concerning than having them point to non-existent concepts is the prospect that they might point to existing yet incorrect concepts, leading to data that does not reflect what was intended.

      These should be removed.

      In the case where a starter dictionary is set up that reflects these hard-coded ids, we should move this setup code into the place where those starter dictionaries are installed.

      This may also require OpenMRS to have an initial configuration page that forces end-users to configure any required properties before using the system.

      An example of problematic code includes this snippet from OpenmrsConstants.java:

      props.add(new GlobalProperty("concept.weight", "5089", "Concept id of the concept defining the WEIGHT concept"));
      props.add(new GlobalProperty("concept.height", "5090", "Concept id of the concept defining the HEIGHT concept"));
      props.add(new GlobalProperty("concept.cd4_count", "5497", "Concept id of the concept defining the CD4 count concept"));
      props.add(new GlobalProperty("concept.causeOfDeath", "5002", "Concept id of the concept defining the CAUSE OF DEATH concept"));
      props.add(new GlobalProperty("concept.none", "1107", "Concept id of the concept defining the NONE concept"));
      props.add(new GlobalProperty("concept.otherNonCoded", "5622", "Concept id of the concept defining the OTHER NON-CODED concept"));
      props.add(new GlobalProperty("concept.patientDied", "1742", "Concept id of the concept defining the PATIENT DIED concept"));
      props.add(new GlobalProperty("concept.reasonExitedCare", "","Concept id of the concept defining the REASON EXITED CARE concept"));
      props.add(new GlobalProperty("concept.reasonOrderStopped", "1812", "Concept id of the concept defining the REASON ORDER STOPPED concept"));
      

      [~djazayeri] fyi

        Gliffy Diagrams

          Attachments

            Activity

              People

              Assignee:
              suubi7 SSEBAANA Suubi Joshua
              Reporter:
              mseaton Mike Seaton
              Designated Committer:
              Daniel Kayiwa Daniel Kayiwa
              Votes:
              1 Vote for this issue
              Watchers:
              10 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 hour
                  1h