Skip to content

Commit

Permalink
Merge branch 'openmrs:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
Muta-Jonathan authored May 18, 2022
2 parents e20fbe8 + 4c62023 commit be80ecf
Show file tree
Hide file tree
Showing 111 changed files with 18,763 additions and 968 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build-2.x.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ jobs:
- 8
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v2.4.0
- uses: actions/checkout@v3
- name: Setup JDK
uses: actions/setup-java@v2
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: ${{ matrix.java-version }}
- name: Cache Maven packages
uses: actions/cache@v2.1.7
uses: actions/cache@v3
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
- 2.4.x
- 2.5.x
pull_request:
types: [opened, synchronize, reopened]
types:
branches:
- master
- 2.4.x
Expand All @@ -27,20 +27,20 @@ jobs:
- 11
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v2.4.0
- uses: actions/checkout@v3
- name: Setup JDK
uses: actions/setup-java@v2
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: ${{ matrix.java-version }}
- name: Cache Maven packages
uses: actions/cache@v2.1.7
uses: actions/cache@v3
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Cache SonarCloud packages
uses: actions/cache@v2.1.7
uses: actions/cache@v3
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
Expand Down
70 changes: 70 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches: [ master ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ master ]
schedule:
- cron: '45 0 * * 2'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'java', 'javascript' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Learn more about CodeQL language support at https://git.io/codeql-language-support

steps:
- name: Checkout repository
uses: actions/checkout@v2

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
4 changes: 2 additions & 2 deletions .github/workflows/qa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Trigger QAFramework
uses: peter-evans/repository-dispatch@v1.1.3
uses: peter-evans/repository-dispatch@v2
with:
token: ${{secrets.ACTIONS_TOKEN}}
repository: openmrs/openmrs-contrib-qaframework
event-type: qa-initialSetup
event-type: qa
2 changes: 1 addition & 1 deletion .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v4
- uses: actions/stale@v5
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
days-before-stale: 150
Expand Down
16 changes: 5 additions & 11 deletions api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -178,21 +178,10 @@
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-1.2-api</artifactId>
</dependency>
<!-- TODO This is necessary to support Hibernate 4.x with log4j2
this dependency should be removed when upgrading Hibernate -->
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging</artifactId>
<version>3.4.2.Final</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>log4j-over-slf4j</artifactId>
</dependency>
<dependency>
<groupId>com.thoughtworks.xstream</groupId>
<artifactId>xstream</artifactId>
Expand Down Expand Up @@ -288,6 +277,11 @@
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-analyzers-phonetic</artifactId>
</dependency>
<dependency>
<groupId>com.sun.mail</groupId>
<artifactId>javax.mail</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<resources>
Expand Down
36 changes: 36 additions & 0 deletions api/src/main/java/liquibase/ext/logging/slf4j/Slf4JLogService.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/**
* This Source Code Form is subject to the terms of the Mozilla Public License,
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
* obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under
* the terms of the Healthcare Disclaimer located at http://openmrs.org/license.
*
* Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS
* graphic logo is a trademark of OpenMRS Inc.
*/
package liquibase.ext.logging.slf4j;

import java.util.HashMap;
import java.util.Map;

import liquibase.logging.Logger;
import liquibase.logging.core.AbstractLogService;

/**
* An implementation of {@link liquibase.logging.LogService} to use SLF4J for Liquibase logging
*
* @since 2.5.1, 2.6.0
*/
public class Slf4JLogService extends AbstractLogService {

private final Map<Class<?>, Slf4JLogger> loggers = new HashMap<>();

@Override
public int getPriority() {
return PRIORITY_SPECIALIZED;
}

@Override
public Logger getLog(Class clazz) {
return loggers.computeIfAbsent(clazz, c -> new Slf4JLogger(c, getFilter()));
}
}
54 changes: 54 additions & 0 deletions api/src/main/java/liquibase/ext/logging/slf4j/Slf4JLogger.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/**
* This Source Code Form is subject to the terms of the Mozilla Public License,
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
* obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under
* the terms of the Healthcare Disclaimer located at http://openmrs.org/license.
*
* Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS
* graphic logo is a trademark of OpenMRS Inc.
*/
package liquibase.ext.logging.slf4j;

import java.util.logging.Level;

import liquibase.logging.LogMessageFilter;
import liquibase.logging.core.AbstractLogger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
* Simple layer to ensure liquibase logs get written to our standard loggers
*
* @since 2.5.1, 2.6.0
*/
public class Slf4JLogger extends AbstractLogger {

private final Logger logger;

public Slf4JLogger(Class<?> clazz, LogMessageFilter filter) {
super(filter);
logger = LoggerFactory.getLogger(clazz);
}

@Override
public void log(Level level, String message, Throwable e) {
// NB java.util.logging supports a couple of levels not replicable through SLF4J
// These messages are attempted to be routed to their closest level

if (level == Level.SEVERE) {
logger.error(message, e);
} else if (level == Level.WARNING) {
logger.warn(message, e);
} else if (level == Level.INFO) {
logger.info(message, e);
} else if (level == Level.CONFIG) {
logger.debug(message, e);
} else if (level == Level.FINE) {
logger.debug(message, e);
} else if (level == Level.FINER) {
logger.trace(message, e);
} else {
logger.trace(message, e);
}
}
}
19 changes: 16 additions & 3 deletions api/src/main/java/org/openmrs/ConceptMapType.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,31 @@

import org.codehaus.jackson.annotate.JsonIgnore;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

/**
* ConceptMapType are used to define relationships between concepts and concept reference terms e.g
* IS_A or SAME_AS, BROADER_THAN
*
* @since 1.9
*/
@Entity
@Table(name = "concept_map_type")
public class ConceptMapType extends BaseChangeableOpenmrsMetadata {

private static final long serialVersionUID = 1L;


@Id
@Column(name = "concept_map_type_id")
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer conceptMapTypeId;


@Column(name = "is_hidden", nullable = false, length = 1)
private Boolean isHidden = Boolean.FALSE;

public static final String SAME_AS_MAP_TYPE_UUID = "35543629-7d8c-11e1-909d-c80aa9edcf4e";
Expand Down
7 changes: 3 additions & 4 deletions api/src/main/java/org/openmrs/Condition.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@
*/
package org.openmrs;

import java.util.Date;
import java.util.Objects;

import javax.persistence.AssociationOverride;
import javax.persistence.AssociationOverrides;
import javax.persistence.AttributeOverride;
Expand All @@ -29,6 +26,8 @@
import javax.persistence.Table;
import javax.persistence.Transient;

import java.util.Date;

/**
* The condition class records detailed information about a condition, problem, diagnosis, or other
* situation or issue. This records information about a disease/illness identified from diagnosis or
Expand Down Expand Up @@ -352,5 +351,5 @@ public Encounter getEncounter() {
public void setEncounter(Encounter encounter) {
this.encounter = encounter;
}

}
30 changes: 29 additions & 1 deletion api/src/main/java/org/openmrs/ConditionClinicalStatus.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,34 @@ public enum ConditionClinicalStatus {
* the common OpenMRS use case.
* Remission is where the patient is no longer experiencing the symptoms of the condition,
* but there is a risk of the symptoms returning.
*
* @deprecated as of 2.6.0
* */
HISTORY_OF
HISTORY_OF,

/**
* The Patient is experiencing a re-occurrence or repeating of a previously resolved condition,
* e.g. urinary tract infection, pancreatitis, cholangitis, conjunctivitis.
*/
RECURRENCE,

/**
* The Patient is experiencing a return of a condition, or signs and symptoms after a period of
* improvement or remission, e.g. relapse of cancer, multiple sclerosis, rheumatoid arthritis,
* systemic lupus erythematosus, bipolar disorder, [psychotic relapse of] schizophrenia, etc.
*/
RELAPSE,

/**
* The Patient is no longer experiencing the symptoms of the condition, but there is a risk
* of the symptoms returning.
*/
REMISSION,

/**
* The Patient is no longer experiencing the symptoms of the condition and there is a
* negligible perceived risk of the symptoms returning.
*/
RESOLVED

}
Loading

0 comments on commit be80ecf

Please sign in to comment.