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

Person::getPersonName() does not return a new PersonName object if person has no names

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Should
    • Resolution: Won't Fix
    • Affects Version/s: OpenMRS 1.7.0
    • Fix Version/s: None
    • Component/s: None
    • Complexity:
      Low

      Description

      The documentation for Person::getPersonName() says:

      "public PersonName getPersonName()

      Convenience method to get the "preferred" name for the person. Returns a blank PersonName object if no names are given.

      Returns:
      Returns the "preferred" person name."

      If I understand correctly, it should return a new PersonName() if the person has no names. It returns null.

      Here's a unit test. ( It's written in Grails, but I think it'll work in plain Java.)

      void testOpenMRSGetPersonName() {
      Person myPerson = new Person();
      assertNotNull("api says it should return a blank name", myPerson.getPersonName());
      }

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              jriley Janet Riley
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: