Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SYNCT-294: Sync 2 - support of OpenMRS 1.x (#133)
* SYNCT-294: Changed the JDK version to 1.7 and the version of OpenMRS platform to 1.9.10. Added support of new and old UI. * SYNCT-294: Fixed issue with the objects serialization and fixed issue with the beans injection * SYNCT-294: Fixed issue with AuditMessage resource * SYNCT-294: Fixed issue with the page redirects * SYNCT-294: Fixed issue with the person address conversion (sync fail when the address was empty) * SYNCT-294: Changed supported OpenMRS versions in the audit message resource * SYNCT-294: Fixed issue with the Audit Messages * SYNCT-294: Fixed issue with the UI (UI crash when the wrong message UUID was set) * SYNCT-294: Fixed issue with PersonResource in OpenMRS 1.11.3 * SYNCT-294: Fixed issue with the code indentation
- Loading branch information
Showing
71 changed files
with
879 additions
and
432 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<parent> | ||
<artifactId>sync2</artifactId> | ||
<groupId>org.openmrs.module</groupId> | ||
<version>1.5.0-SNAPSHOT</version> | ||
</parent> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<artifactId>sync2-api-1.9</artifactId> | ||
<packaging>jar</packaging> | ||
<name>Sync2 Module API 1.9</name> | ||
<description>API project for Sync2 Module</description> | ||
|
||
<properties> | ||
<openmrsPlatformVersion>1.9.10</openmrsPlatformVersion> | ||
</properties> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>${project.parent.groupId}</groupId> | ||
<artifactId>${project.parent.artifactId}-api</artifactId> | ||
<version>${project.parent.version}</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
</dependencies> | ||
</project> |
16 changes: 16 additions & 0 deletions
16
api-1.9/src/main/java/org/openmrs/module/sync2/api19/helper/AllergyHelperImpl1_9.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package org.openmrs.module.sync2.api19.helper; | ||
|
||
import org.openmrs.activelist.Allergy; | ||
import org.openmrs.annotation.OpenmrsProfile; | ||
import org.openmrs.module.sync2.api.helper.AllergyHelper; | ||
import org.springframework.stereotype.Component; | ||
|
||
@Component(value = "sync2.AllergyHelper1_9") | ||
@OpenmrsProfile(openmrsPlatformVersion = "1.9.* - 1.11.*") | ||
public class AllergyHelperImpl1_9 implements AllergyHelper { | ||
|
||
@Override | ||
public Class getAllergyClass() { | ||
return Allergy.class; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<parent> | ||
<artifactId>sync2</artifactId> | ||
<groupId>org.openmrs.module</groupId> | ||
<version>1.5.0-SNAPSHOT</version> | ||
</parent> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<artifactId>sync2-api-2.0</artifactId> | ||
<packaging>jar</packaging> | ||
<name>Sync2 Module API 1.9</name> | ||
<description>API project for Sync2 Module</description> | ||
|
||
<properties> | ||
<openmrsPlatformVersion>2.0.5</openmrsPlatformVersion> | ||
</properties> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>${project.parent.groupId}</groupId> | ||
<artifactId>${project.parent.artifactId}-api</artifactId> | ||
<version>${project.parent.version}</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
</dependencies> | ||
</project> |
16 changes: 16 additions & 0 deletions
16
api-2.0/src/main/java/org/openmrs/module/sync2/api20/helper/AllergyHelperImpl2_0.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package org.openmrs.module.sync2.api20.helper; | ||
|
||
import org.openmrs.Allergy; | ||
import org.openmrs.annotation.OpenmrsProfile; | ||
import org.openmrs.module.sync2.api.helper.AllergyHelper; | ||
import org.springframework.stereotype.Component; | ||
|
||
@Component(value = "sync2.AllergyHelper2_0") | ||
@OpenmrsProfile(openmrsPlatformVersion = "2.0.*") | ||
public class AllergyHelperImpl2_0 implements AllergyHelper { | ||
|
||
@Override | ||
public Class getAllergyClass() { | ||
return Allergy.class; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
api/src/main/java/org/openmrs/module/sync2/api/filter/FilterService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
package org.openmrs.module.sync2.api.filter; | ||
|
||
import org.openmrs.module.sync2.api.model.enums.CategoryEnum; | ||
import org.openmrs.module.sync2.api.model.SyncCategory; | ||
|
||
public interface FilterService { | ||
|
||
boolean shouldBeSynced(CategoryEnum category, Object object, String action); | ||
boolean shouldBeSynced(SyncCategory category, Object object, String action); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
api/src/main/java/org/openmrs/module/sync2/api/helper/AllergyHelper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package org.openmrs.module.sync2.api.helper; | ||
|
||
public interface AllergyHelper { | ||
|
||
Class getAllergyClass(); | ||
} |
8 changes: 8 additions & 0 deletions
8
api/src/main/java/org/openmrs/module/sync2/api/helper/CategoryHelper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package org.openmrs.module.sync2.api.helper; | ||
|
||
import org.openmrs.module.sync2.api.model.SyncCategory; | ||
|
||
public interface CategoryHelper { | ||
|
||
SyncCategory getByCategory(String category); | ||
} |
38 changes: 38 additions & 0 deletions
38
api/src/main/java/org/openmrs/module/sync2/api/helper/impl/CategoryHelperImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package org.openmrs.module.sync2.api.helper.impl; | ||
|
||
import org.openmrs.module.fhir.api.util.FHIRConstants; | ||
import org.openmrs.module.sync2.SyncConstants; | ||
import org.openmrs.module.sync2.api.helper.CategoryHelper; | ||
import org.openmrs.module.sync2.api.model.SyncCategory; | ||
import org.openmrs.module.sync2.api.model.enums.CategoryEnum; | ||
import org.openmrs.module.sync2.api.utils.ContextUtils; | ||
import org.springframework.stereotype.Component; | ||
|
||
@Component(value = SyncConstants.SYNC_CATEGORY_HELPER) | ||
public class CategoryHelperImpl implements CategoryHelper { | ||
|
||
@Override | ||
public SyncCategory getByCategory(String category) { | ||
SyncCategory syncCategory = null; | ||
if (category.equalsIgnoreCase(FHIRConstants.CATEGORY_ALLERGY)) { | ||
syncCategory = buildSyncCategoryObject(category, ContextUtils.getAllergyHelper().getAllergyClass()); | ||
} else { | ||
syncCategory = buildSyncCategoryObject(CategoryEnum.getByCategory(category)); | ||
} | ||
if (syncCategory == null) { | ||
throw new UnsupportedOperationException(String.format("Category %s is not supported", category)); | ||
} | ||
return syncCategory; | ||
} | ||
|
||
private SyncCategory buildSyncCategoryObject(CategoryEnum categoryEnum) { | ||
if (categoryEnum == null) { | ||
return null; | ||
} | ||
return buildSyncCategoryObject(categoryEnum.getCategory(), categoryEnum.getClazz()); | ||
} | ||
|
||
private SyncCategory buildSyncCategoryObject(String category, Class clazz) { | ||
return new SyncCategory(category, clazz); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.