• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

openmrs / openmrs-owa-orderentry / 4483356289

pending completion
4483356289

push

github

GitHub
UHM-7070: Lab OWA test result not showing short names (#269)

603 of 769 branches covered (78.41%)

Branch coverage included in aggregate %.

17 of 17 new or added lines in 1 file covered. (100.0%)

930 of 1037 relevant lines covered (89.68%)

18.8 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

60.71
/app/js/utils/helpers.js
1
/* eslint-disable import/prefer-default-export */
2
export const getConceptShortName = (concept, locale) => {
8✔
3
  let conceptName = null;
92✔
4
  const localeShort = locale ? (locale.split('_'))[0] : "en";
92✔
5

6
  if (concept) {
92✔
7
    if (concept.names) {
90✔
8
      let foundConcept;
9
      // first, try to find the preferred SHORT name in the current locale
10
      foundConcept = concept.names.find(name =>
6✔
11
          !name.voided && name.conceptNameType === 'SHORT' && name.locale === localeShort && name.localePreferred);
12✔
12
      if (!foundConcept) {
6!
13
        // try to find the SHORT name in the current locale
14
        foundConcept = concept.names.find(name =>
6✔
15
            !name.voided && name.conceptNameType === 'SHORT' && name.locale === localeShort);
6✔
16
      }
17
      if (!foundConcept) {
6!
18
        // attempt to find the preferred name in the locale
19
        foundConcept = concept.names.find(name =>
×
20
            !name.voided && name.locale === localeShort && name.localePreferred);
×
21
      }
22
      if (!foundConcept) {
6!
23
        // attempt to find the preferred short name in English
24
        foundConcept = concept.names.find(name =>
×
25
            !name.voided && name.conceptNameType === 'SHORT' && name.locale === 'en' && name.localePreferred);
×
26
      }
27
      if (!foundConcept) {
6!
28
        // attempt to find any short name in English
29
        foundConcept = concept.names.find(name =>
×
30
            !name.voided && name.conceptNameType === 'SHORT' && name.locale === 'en');
×
31
      }
32
      if (!foundConcept) {
6!
33
        // fall back to display
34
        conceptName = concept.display;
×
35
      } else {
36
        conceptName = foundConcept.name;
6✔
37
      }
38
    }
39
  }
40
  return conceptName;
92✔
41
};
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc