diff --git a/api/src/main/java/org/openmrs/Concept.java b/api/src/main/java/org/openmrs/Concept.java index 9cf7c8c4e4bc..7198f790c9c7 100644 --- a/api/src/main/java/org/openmrs/Concept.java +++ b/api/src/main/java/org/openmrs/Concept.java @@ -991,8 +991,7 @@ public ConceptName getShortestName(Locale locale, Boolean exact) { ConceptName shortestNameForConcept = null; if (locale != null) { - for (Iterator i = getNames().iterator(); i.hasNext();) { - ConceptName possibleName = i.next(); + for (ConceptName possibleName : getNames()) { if (possibleName.getLocale().equals(locale)) { if ((shortestNameForLocale == null) || (possibleName.getName().length() < shortestNameForLocale.getName().length())) { diff --git a/api/src/main/java/org/openmrs/util/OpenmrsConstants.java b/api/src/main/java/org/openmrs/util/OpenmrsConstants.java index 555722e95078..5e4bb0479d5e 100644 --- a/api/src/main/java/org/openmrs/util/OpenmrsConstants.java +++ b/api/src/main/java/org/openmrs/util/OpenmrsConstants.java @@ -1081,6 +1081,8 @@ public static final Collection AUTO_ROLES() { public static final String GP_CASE_SENSITIVE_NAMES_IN_CONCEPT_NAME_TABLE = "concept.caseSensitiveNamesInConceptNameTable"; + public static final String GP_DASHBOARD_CONCEPTS = "dashboard.header.showConcept"; + public static final String GP_MAIL_SMTP_STARTTLS_ENABLE = "mail.smtp.starttls.enable"; /** @@ -1105,6 +1107,10 @@ public static final List CORE_GLOBAL_PROPERTIES() { props.add(new GlobalProperty("dashboard.overview.showConcepts", "", "Comma delimited list of concepts ids to show on the patient dashboard overview tab")); + + props.add(new GlobalProperty(GP_DASHBOARD_CONCEPTS, "5497", + "Comma delimited list of concepts ids to show on the patient header overview")); + props .add(new GlobalProperty("dashboard.encounters.showEmptyFields", "true", "true/false whether or not to show empty fields on the 'View Encounter' window", @@ -1215,9 +1221,7 @@ public static final List CORE_GLOBAL_PROPERTIES() { 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")); diff --git a/api/src/main/resources/liquibase-update-to-latest.xml b/api/src/main/resources/liquibase-update-to-latest.xml index 4e14d6c30243..2df77d54cb20 100644 --- a/api/src/main/resources/liquibase-update-to-latest.xml +++ b/api/src/main/resources/liquibase-update-to-latest.xml @@ -7488,6 +7488,21 @@ + + + Adding configurability to Patient Header on Dashboard. Therefore the cd4_count property is dropped and + replaced with a header.showConcept property. + + + + + + property='concept.cd4_count' + + + Adding 3 foreign key relationships (creator,created_by,voided_by) to encounter_provider table @@ -7496,4 +7511,4 @@ - \ No newline at end of file + diff --git a/release-test/src/main/java/org/openmrs/steps/VerifyPatientDashboardSteps.java b/release-test/src/main/java/org/openmrs/steps/VerifyPatientDashboardSteps.java index 422cac90939d..0f150f29846b 100644 --- a/release-test/src/main/java/org/openmrs/steps/VerifyPatientDashboardSteps.java +++ b/release-test/src/main/java/org/openmrs/steps/VerifyPatientDashboardSteps.java @@ -57,7 +57,7 @@ public void verifyPatientDashBoard(){ assertPresenceOf(div().with(attribute("id",equalTo("patientHeaderPatientName"))).with(text(equalTo("Mr. Horatio L Hornblower Esq.")))); assertPresenceOf(cell().with(attribute("id",equalTo("patientHeaderPatientAge"))).with(text(containsString("71 yrs")))); assertPresenceOf(table().with(attribute("id",equalTo("patientHeaderObs")))); - assertPresenceOf(cell().with(attribute("id",equalTo("patientHeaderObsCD4")))); + assertPresenceOf(cell().with(attribute("class",equalTo("patientRecentObsConfigured")))); assertPresenceOf(cell().with(attribute("id", equalTo("patientHeaderObsRegimen")))); assertPresenceOf(div().with(attribute("id",equalTo("patientHeaderPreferredIdentifier"))).with(text(containsString("101-6")))); assertPresenceOf(cell().with(attribute("id", equalTo("patientHeaderOtherIdentifiers"))).with(text(containsString("Old Identification Number: 101")))); diff --git a/web/src/main/java/org/openmrs/web/taglib/ConceptTag.java b/web/src/main/java/org/openmrs/web/taglib/ConceptTag.java index 6da6a27f84b2..01d8850bd0e1 100644 --- a/web/src/main/java/org/openmrs/web/taglib/ConceptTag.java +++ b/web/src/main/java/org/openmrs/web/taglib/ConceptTag.java @@ -43,7 +43,7 @@ public class ConceptTag extends BodyTagSupport { private String nameVar; - private String shortNameVar; + private String shortestNameVar; private String numericVar; @@ -87,11 +87,9 @@ public int doStartTag() throws JspException { log.debug("Retrieved name " + cName.getName() + ", set to variable: " + nameVar); } - /** - * ABK - no short name attribute exists in openmrs.tld ConceptName shortName = - * c.getShortName(loc); if (shortNameVar != null && shortName != null) - * pageContext.setAttribute(shortNameVar, shortName); - */ + if (shortestNameVar != null) { + pageContext.setAttribute(shortestNameVar, c.getShortestName(loc, false)); + } if (numericVar != null) { pageContext.setAttribute(numericVar, cs.getConceptNumeric(conceptId)); @@ -201,6 +199,14 @@ public String getSetMemberVar() { return setMemberVar; } + public String getShortestNameVar() { + return shortestNameVar; + } + + public void setShortestNameVar(String shortestNameVar) { + this.shortestNameVar = shortestNameVar; + } + /** * @param SetMemberVar the SetMemberVar to set */ diff --git a/webapp/src/main/webapp/WEB-INF/taglibs/openmrs.tld b/webapp/src/main/webapp/WEB-INF/taglibs/openmrs.tld index 99e2bbaa31a1..5190dd7c5560 100644 --- a/webapp/src/main/webapp/WEB-INF/taglibs/openmrs.tld +++ b/webapp/src/main/webapp/WEB-INF/taglibs/openmrs.tld @@ -415,6 +415,12 @@ true java.lang.String + + shortestNameVar + false + true + java.lang.String + numericVar false diff --git a/webapp/src/main/webapp/WEB-INF/view/portlets/customMostRecentObs.jsp b/webapp/src/main/webapp/WEB-INF/view/portlets/customMostRecentObs.jsp index db4dce4b5b06..f1e255d6d49d 100644 --- a/webapp/src/main/webapp/WEB-INF/view/portlets/customMostRecentObs.jsp +++ b/webapp/src/main/webapp/WEB-INF/view/portlets/customMostRecentObs.jsp @@ -15,40 +15,40 @@ - + - + - diff --git a/webapp/src/main/webapp/WEB-INF/view/portlets/patientGraphs.jsp b/webapp/src/main/webapp/WEB-INF/view/portlets/patientGraphs.jsp index 20250029a806..41ba913d534f 100644 --- a/webapp/src/main/webapp/WEB-INF/view/portlets/patientGraphs.jsp +++ b/webapp/src/main/webapp/WEB-INF/view/portlets/patientGraphs.jsp @@ -70,24 +70,24 @@ table#labTestTable th { - - + + @@ -178,15 +178,15 @@ table#labTestTable th { } function loadGraphs() { - - + + - $j.getJSON("patientGraphJson.form?patientId=${patient.patientId}&conceptId=${conceptId}", function(json){ - $j("#conceptBox-${conceptId} .conceptGraphTitle").html(json.name); + $j.getJSON("patientGraphJson.form?patientId=${patient.patientId}&conceptId=${conceptIds}", function(json){ + $j("#conceptBox-${conceptIds} .conceptGraphTitle").html(json.name); - var plot = $j.plot($j('#conceptGraphBox-${conceptId}'), + var plot = $j.plot($j('#conceptGraphBox-${conceptIds}'), [{ data: json.data, lines:{show:true}, @@ -217,7 +217,7 @@ table#labTestTable th { grid: { hoverable: true, clickable: true } }); - $j("#conceptBox-${conceptId}").bind("plothover", function (event, pos, item) { + $j("#conceptBox-${conceptIds}").bind("plothover", function (event, pos, item) { $j("#tooltip").remove(); plot.unhighlight(); if (item) { diff --git a/webapp/src/main/webapp/WEB-INF/view/portlets/patientHeader.jsp b/webapp/src/main/webapp/WEB-INF/view/portlets/patientHeader.jsp index a0f225ef93bf..0805a5fdf922 100644 --- a/webapp/src/main/webapp/WEB-INF/view/portlets/patientHeader.jsp +++ b/webapp/src/main/webapp/WEB-INF/view/portlets/patientHeader.jsp @@ -165,7 +165,7 @@
:: - + - +
-
+

- +
-
+


- +
- + - - + + + + +
) : - : + + ${sn}: + + + :