Skip to content

Commit

Permalink
Merge branch 'openmrs:master' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
nityan authored Oct 30, 2024
2 parents fee4009 + df3665a commit 4d28e25
Show file tree
Hide file tree
Showing 286 changed files with 8,966 additions and 4,402 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/scorecard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ jobs:

steps:
- name: "Checkout code"
uses: actions/checkout@v4.1.1
uses: actions/checkout@v4
with:
persist-credentials: false

- name: "Run analysis"
uses: ossf/scorecard-action@v2.3.1
uses: ossf/scorecard-action@v2.4.0
with:
results_file: results.sarif
results_format: sarif
Expand All @@ -50,6 +50,6 @@ jobs:
# Upload the results to GitHub's code scanning dashboard (optional).
# Commenting out will disable upload of results to your repo's Code Scanning dashboard
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@v3.24.9
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: results.sarif
11 changes: 7 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,18 @@
# Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS
# graphic logo is a trademark of OpenMRS Inc.

ARG DEV_JDK=amazoncorretto-8
ARG RUNTIME_JDK=jdk8-corretto

### Compile Stage (platform-agnostic)
FROM --platform=$BUILDPLATFORM maven:3.8-amazoncorretto-8 as compile
FROM --platform=$BUILDPLATFORM maven:3.8-$DEV_JDK as compile

RUN yum -y update && yum -y install git && yum clean all

WORKDIR /openmrs_core

ENV OMRS_SDK_PLUGIN="org.openmrs.maven.plugins:openmrs-sdk-maven-plugin"
ENV OMRS_SDK_PLUGIN_VERSION="4.5.0"
ENV OMRS_SDK_PLUGIN_VERSION="5.11.0"

COPY docker-pom.xml .

Expand Down Expand Up @@ -46,7 +49,7 @@ ARG MVN_ARGS='clean install -DskipTests'
RUN mvn $MVN_SETTINGS $MVN_ARGS

### Development Stage
FROM maven:3.8-amazoncorretto-8 as dev
FROM maven:3.8-$DEV_JDK as dev

RUN yum -y update && yum -y install tar gzip git && yum clean all

Expand Down Expand Up @@ -92,7 +95,7 @@ ENTRYPOINT ["/usr/bin/tini", "--", "/usr/local/bin/mvn-entrypoint.sh"]
CMD ["/openmrs/startup-dev.sh"]

### Production Stage
FROM tomcat:8.5-jdk8-corretto
FROM tomcat:9-$RUNTIME_JDK

RUN yum -y update && yum clean all && rm -rf /usr/local/tomcat/webapps/*

Expand Down
4 changes: 4 additions & 0 deletions api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,10 @@
<groupId>org.hibernate</groupId>
<artifactId>hibernate-search-orm</artifactId>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-envers</artifactId>
</dependency>
<dependency>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-queryparser</artifactId>
Expand Down
2 changes: 2 additions & 0 deletions api/src/main/java/org/openmrs/Allergy.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,15 @@
import org.apache.commons.lang3.StringUtils;
import org.hibernate.annotations.LazyCollection;
import org.hibernate.annotations.LazyCollectionOption;
import org.hibernate.envers.Audited;
import org.openmrs.util.OpenmrsUtil;

/**
* Represent allergy
*/
@Entity
@Table(name = "allergy")
@Audited
public class Allergy extends BaseFormRecordableOpenmrsData {

public static final long serialVersionUID = 1;
Expand Down
2 changes: 2 additions & 0 deletions api/src/main/java/org/openmrs/AllergyReaction.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@
package org.openmrs;

import org.apache.commons.lang3.StringUtils;
import org.hibernate.envers.Audited;
import org.openmrs.util.OpenmrsUtil;

/**
* Represent allergy reactions
*/
@Audited
public class AllergyReaction extends BaseOpenmrsObject implements java.io.Serializable{

public static final long serialVersionUID = 1;
Expand Down
2 changes: 2 additions & 0 deletions api/src/main/java/org/openmrs/BaseCustomizableMetadata.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
package org.openmrs;

import org.hibernate.annotations.BatchSize;
import org.hibernate.envers.Audited;
import org.openmrs.attribute.Attribute;
import org.openmrs.customdatatype.CustomValueDescriptor;
import org.openmrs.customdatatype.Customizable;
Expand All @@ -32,6 +33,7 @@
* @since 1.9
*/
@MappedSuperclass
@Audited
public abstract class BaseCustomizableMetadata<A extends Attribute> extends BaseChangeableOpenmrsMetadata implements Customizable<A> {

@OrderBy("voided asc")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
package org.openmrs;

import org.apache.commons.lang3.StringUtils;
import org.hibernate.envers.Audited;
import org.openmrs.api.APIException;

import javax.persistence.Column;
Expand All @@ -21,6 +22,7 @@
* @since 2.4.0
*/
@MappedSuperclass
@Audited
public abstract class BaseFormRecordableOpenmrsData extends BaseChangeableOpenmrsData implements FormRecordable {

private static final long serialVersionUID = 1L;
Expand Down
2 changes: 2 additions & 0 deletions api/src/main/java/org/openmrs/BaseOpenmrsData.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import javax.persistence.MappedSuperclass;

import org.codehaus.jackson.annotate.JsonIgnore;
import org.hibernate.envers.Audited;
import org.hibernate.search.annotations.Field;

/**
Expand All @@ -28,6 +29,7 @@
* @see OpenmrsData
*/
@MappedSuperclass
@Audited
public abstract class BaseOpenmrsData extends BaseOpenmrsObject implements OpenmrsData {

//***** Properties *****
Expand Down
2 changes: 2 additions & 0 deletions api/src/main/java/org/openmrs/BaseOpenmrsMetadata.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import javax.persistence.MappedSuperclass;

import org.codehaus.jackson.annotate.JsonIgnore;
import org.hibernate.envers.Audited;
import org.hibernate.search.annotations.Field;

/**
Expand All @@ -29,6 +30,7 @@
* @see OpenmrsMetadata
*/
@MappedSuperclass
@Audited
public abstract class BaseOpenmrsMetadata extends BaseOpenmrsObject implements OpenmrsMetadata {

//***** Properties *****
Expand Down
2 changes: 2 additions & 0 deletions api/src/main/java/org/openmrs/BaseOpenmrsObject.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.hibernate.Hibernate;
import org.hibernate.envers.Audited;

/**
* This is the base implementation of the {@link OpenmrsObject} interface.<br>
* It implements the uuid variable that all objects are expected to have.
*/
@MappedSuperclass
@Audited
public abstract class BaseOpenmrsObject implements Serializable, OpenmrsObject {

@Column(name = "uuid", unique = true, nullable = false, length = 38, updatable = false)
Expand Down
152 changes: 152 additions & 0 deletions api/src/main/java/org/openmrs/BaseReferenceRange.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
/**
* 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 org.openmrs;

import org.hibernate.envers.Audited;

import javax.persistence.Column;
import javax.persistence.MappedSuperclass;
import java.io.Serializable;

/**
* This is the base class for reference ranges.
*
* @since 2.7.0
*/
@MappedSuperclass
@Audited
public abstract class BaseReferenceRange extends BaseOpenmrsObject implements Serializable {

@Column(name = "hi_absolute")
private Double hiAbsolute;

@Column(name = "hi_critical")
private Double hiCritical;

@Column(name = "hi_normal")
private Double hiNormal;

@Column(name = "low_absolute")
private Double lowAbsolute;

@Column(name = "low_critical")
private Double lowCritical;

@Column(name = "low_normal")
private Double lowNormal;

/**
* Gets high absolute value of the referenceRange
*
* @return hiAbsolute the high absolute value
*/
public Double getHiAbsolute() {
return this.hiAbsolute;
}

/**
* Sets high absolute value of the referenceRange
*
* @param hiAbsolute high absolute value to set
*/
public void setHiAbsolute(Double hiAbsolute) {
this.hiAbsolute = hiAbsolute;
}

/**
* Gets high critical value of the referenceRange
*
* @return the high critical value
*/
public Double getHiCritical() {
return this.hiCritical;
}

/**
* Sets high critical value of the referenceRange
*
* @param hiCritical high critical value to set
*/
public void setHiCritical(Double hiCritical) {
this.hiCritical = hiCritical;
}

/**
* Returns high normal value of the referenceRange
*
* @return the high normal value
*/
public Double getHiNormal() {
return this.hiNormal;
}

/**
* Sets high normal value of the referenceRange
*
* @param hiNormal high normal value to set
*/
public void setHiNormal(Double hiNormal) {
this.hiNormal = hiNormal;
}

/**
* Gets low absolute value of the referenceRange
*
* @return the low absolute value
*/
public Double getLowAbsolute() {
return this.lowAbsolute;
}

/**
* Sets low absolute value of the referenceRange
*
* @param lowAbsolute low absolute value to set
*/
public void setLowAbsolute(Double lowAbsolute) {
this.lowAbsolute = lowAbsolute;
}

/**
* Gets low critical value of the referenceRange
*
* @return the low critical value
*/
public Double getLowCritical() {
return this.lowCritical;
}

/**
* Sets low critical value of the referenceRange
*
* @param lowCritical low critical value to set
*/
public void setLowCritical(Double lowCritical) {
this.lowCritical = lowCritical;
}

/**
* Gets low normal value of the referenceRange
*
* @return the low normal value
*/
public Double getLowNormal() {
return this.lowNormal;
}

/**
* Sets low normal value of the referenceRange
*
* @param lowNormal low normal value to set
*/
public void setLowNormal(Double lowNormal) {
this.lowNormal = lowNormal;
}
}
3 changes: 3 additions & 0 deletions api/src/main/java/org/openmrs/CareSetting.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
*/
package org.openmrs;

import org.hibernate.envers.Audited;

/**
* Care Setting defines the scope of care for any piece of data within the medical record. Clinical
* data (treatments, notes, etc.) apply within their associated care setting. Implementations
Expand All @@ -24,6 +26,7 @@
*
* @since 1.10
*/
@Audited
public class CareSetting extends BaseChangeableOpenmrsMetadata {

public enum CareSettingType {
Expand Down
2 changes: 2 additions & 0 deletions api/src/main/java/org/openmrs/Cohort.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
package org.openmrs;

import org.apache.commons.lang3.StringUtils;
import org.hibernate.envers.Audited;

import java.util.Arrays;
import java.util.Collection;
Expand All @@ -21,6 +22,7 @@
/**
* This class represents a list of patientIds.
*/
@Audited
public class Cohort extends BaseChangeableOpenmrsData {

public static final long serialVersionUID = 0L;
Expand Down
2 changes: 2 additions & 0 deletions api/src/main/java/org/openmrs/CohortMembership.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@
import java.util.Date;
import java.util.Objects;

import org.hibernate.envers.Audited;
import org.openmrs.util.OpenmrsUtil;

/**
* @since 2.1.0
*/
@Audited
public class CohortMembership extends BaseChangeableOpenmrsData implements Comparable<CohortMembership> {

public static final long serialVersionUID = 0L;
Expand Down
Loading

0 comments on commit 4d28e25

Please sign in to comment.