Skip to content

Commit

Permalink
Merge branch 'develop' into dependabot/maven/org.springframework-spri…
Browse files Browse the repository at this point in the history
…ng-core-5.3.27
  • Loading branch information
CalebSLane authored Jun 14, 2024
2 parents ca368c0 + 63c4ff1 commit 11cf0bd
Show file tree
Hide file tree
Showing 69 changed files with 3,646 additions and 136 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: openelisglobal-plugins CI Build
on:
push:
branches: [develop]
pull_request:
branches: [develop]
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: Cache local Maven repository
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Checkout openelisglobal-plugins
uses: actions/checkout@v2
with:
repository: ${{github.repository}}

- name: Build openelisglobal-plugins
run: mvn clean install


12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,15 @@ openelisglobal-plugins
======================

Repository for plugins for openelisglobal

[![Build Status](https://github.com/openelisglobal/openelisglobal-plugins/actions/workflows/ci.yml/badge.svg)](https://github.com/openelisglobal/openelisglobal-plugins/actions/workflows/ci.yml)

For Building The Plugins

1. Got to the [Parent pom file](./pom.xml)
1. set the right absolute `SystemPath path` to the `openelisglobal` dependence located under the [lib](./lib/) folder
1. Run the Maven Build

```mvn clean install```
1. Find the built plugin jars under the `plugins` directory

Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class CobasC111Permission extends PermissionPlugin{
protected boolean insertPermission(){
PluginPermissionService service = new PluginPermissionService();
SystemModule module = service.getOrCreateSystemModule( "AnalyzerResults", "CobasC111Analyzer", "Results->Analyzer->CobasC111Analyzer" );
Role role = service.getSystemRole( "Results entry" );
Role role = service.getSystemRole( "Results" );
return service.bindRoleToModule( role, module );
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ public class CobasIntegra400Permission extends PermissionPlugin{
protected boolean insertPermission(){
PluginPermissionService service = new PluginPermissionService();
SystemModule module = service.getOrCreateSystemModule( "AnalyzerResults", "CobasIntegra400", "Results->Analyzer->CobasIntegra400" );
Role role = service.getSystemRole( "Results Admin" );
//Role role = service.getSystemRole( "Results entry" );
Role role = service.getSystemRole( "Results" );
//Role role = service.getSystemRole( "Results" );
return service.bindRoleToModule( role, module );
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class TaqMan48DBSPermission extends PermissionPlugin{
protected boolean insertPermission(){
PluginPermissionService service = new PluginPermissionService();
SystemModule module = service.getOrCreateSystemModule( "AnalyzerResults", "TaqMan48DBSAnalyzer", "Results->Analyzer->TaqMan48DBSAnalyzer" );
Role role = service.getSystemRole( "Results entry" );
Role role = service.getSystemRole( "Results" );
return service.bindRoleToModule( role, module );
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class FacsCaliburPermission extends PermissionPlugin{
protected boolean insertPermission(){
PluginPermissionService service = new PluginPermissionService();
SystemModule module = service.getOrCreateSystemModule( "AnalyzerResults", "FacsCalibur", "Results->Analyzer->FacsCalibur" );
Role role = service.getSystemRole( "Results entry" );
Role role = service.getSystemRole( "Results" );
return service.bindRoleToModule( role, module );
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ public class FacsCantoIIPermission extends PermissionPlugin{
protected boolean insertPermission(){
PluginPermissionService service = new PluginPermissionService();
SystemModule module = service.getOrCreateSystemModule( "AnalyzerResults", "FacsCantoII", "Results->Analyzer->FacsCantoII" );
Role role = service.getSystemRole( "Results Admin" );
//Role role = service.getSystemRole( "Results Entry" );
Role role = service.getSystemRole( "Results" );
//Role role = service.getSystemRole( "Results" );
return service.bindRoleToModule( role, module );
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class FacsPrestoPermission extends PermissionPlugin{
protected boolean insertPermission(){
PluginPermissionService service = new PluginPermissionService();
SystemModule module = service.getOrCreateSystemModule( "AnalyzerResults", "FacsPrestoAnalyzer", "Results->Analyzer->FacsPrestoAnalyzer" );
Role role = service.getSystemRole( "Results entry" );
Role role = service.getSystemRole( "Results" );
return service.bindRoleToModule( role, module );
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class FullyPermission extends PermissionPlugin{
protected boolean insertPermission(){
PluginPermissionService service = new PluginPermissionService();
SystemModule module = service.getOrCreateSystemModule( "AnalyzerResults", "FullyAnalyzer", "Results->Analyzer->FullyAnalyzer" );
Role role = service.getSystemRole( "Results entry" );
Role role = service.getSystemRole( "Results" );
return service.bindRoleToModule( role, module );
}
}
5 changes: 5 additions & 0 deletions analyzers/GeneXpert/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"java.project.sourcePaths": [
"src/main/java"
]
}
26 changes: 11 additions & 15 deletions analyzers/GeneXpert/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.openelisglobal.plugins</groupId>
<artifactId>GeneXpert</artifactId>
<artifactId>GeneXpertAnalyzer</artifactId>
<parent>
<groupId>org.openelisglobal</groupId>
<artifactId>openelisglobal-plugins</artifactId>
<version>1.0</version>
<relativePath>../../pom.xml</relativePath>
</parent>

<version>0.3</version>
<version>0.4</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<hapi.version>2.3</hapi.version>
Expand All @@ -25,14 +25,9 @@
<scope>provided</scope>
</dependency>
<dependency>
<groupId>ca.uhn.hapi</groupId>
<artifactId>hapi-hl7overhttp</artifactId>
<version>${hapi.version}</version>
</dependency>
<dependency>
<groupId>ca.uhn.hapi</groupId>
<artifactId>hapi-structures-v25</artifactId>
<version>${hapi.version}</version>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>1.4</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
Expand All @@ -42,13 +37,14 @@
</dependencies>

<build>
<sourceDirectory>src</sourceDirectory>
<sourceDirectory>src/main/java</sourceDirectory>
<resources>
<resource>
<directory>src</directory>
<excludes>
<exclude>**/*.java</exclude>
</excludes>
<directory>src/main/filtered-resources</directory>
<filtering>true</filtering>
</resource>
<resource>
<directory>src/main/resources</directory>
</resource>
</resources>
<plugins>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* basis, WITHOUT WARRANTY OF ANY KIND, either eXNLress or implied. See the
* License for the specific language governing rights and limitations under
* the License.
*
Expand All @@ -20,39 +20,165 @@

import java.util.ArrayList;
import java.util.List;
import java.util.regex.Pattern;

import org.openelisglobal.analyzerimport.analyzerreaders.AnalyzerLineInserter;
import org.openelisglobal.common.services.PluginAnalyzerService;
import org.openelisglobal.plugin.AnalyzerImporterPlugin;
import org.openelisglobal.analyzerimport.analyzerreaders.AnalyzerResponder;
import org.openelisglobal.common.log.LogEvent;

public class GeneXpertAnalyzer implements AnalyzerImporterPlugin {

public static final String ANALYZER_NAME = "GeneXpertAnalyzer";

@Override
public boolean connect() {
@Override
public boolean connect() {
List<PluginAnalyzerService.TestMapping> nameMapping = new ArrayList<>();
nameMapping.add(
new PluginAnalyzerService.TestMapping(GeneXpertAnalyzerImplementation.HBV, "HEPATITIS B VIRAL LOAD",
GeneXpertAnalyzerImplementation.HBV_LOINC));
new PluginAnalyzerService.TestMapping(GeneXpertAnalyzerImplementation.ANALYZER_TEST_WBC, "White Blood Cells Count (WBC)",
GeneXpertAnalyzerImplementation.LOINC_WBC));
nameMapping.add(
new PluginAnalyzerService.TestMapping(GeneXpertAnalyzerImplementation.ANALYZER_TEST_RBC, "Red Blood Cells Count (RBC)",
GeneXpertAnalyzerImplementation.LOINC_RBC));
nameMapping.add(
new PluginAnalyzerService.TestMapping(GeneXpertAnalyzerImplementation.ANALYZER_TEST_HGB, "Hemoglobin",
GeneXpertAnalyzerImplementation.LOINC_HGB));
nameMapping.add(
new PluginAnalyzerService.TestMapping(GeneXpertAnalyzerImplementation.ANALYZER_TEST_HCT, "Hematocrit",
GeneXpertAnalyzerImplementation.LOINC_HCT));
nameMapping.add(
new PluginAnalyzerService.TestMapping(GeneXpertAnalyzerImplementation.ANALYZER_TEST_MCV, "Medium corpuscular volum",
GeneXpertAnalyzerImplementation.LOINC_MCV));
nameMapping.add(
new PluginAnalyzerService.TestMapping(GeneXpertAnalyzerImplementation.HCV, "HEPATITIS C VIRAL LOAD",
GeneXpertAnalyzerImplementation.HCV_LOINC));
new PluginAnalyzerService.TestMapping(GeneXpertAnalyzerImplementation.ANALYZER_TEST_MCH, "",
GeneXpertAnalyzerImplementation.LOINC_MCH));
nameMapping
.add(new PluginAnalyzerService.TestMapping(GeneXpertAnalyzerImplementation.ANALYZER_TEST_MCHC, "",
GeneXpertAnalyzerImplementation.LOINC_MCHC));
nameMapping
.add(new PluginAnalyzerService.TestMapping(GeneXpertAnalyzerImplementation.ANALYZER_TEST_RDWSD, "",
GeneXpertAnalyzerImplementation.LOINC_RDWSD));
nameMapping.add(
new PluginAnalyzerService.TestMapping(GeneXpertAnalyzerImplementation.HIV_QUAL, "​Xpert HIV-1 Qual",
GeneXpertAnalyzerImplementation.HIV_QUAL_LOINC));
new PluginAnalyzerService.TestMapping(GeneXpertAnalyzerImplementation.ANALYZER_TEST_RDWCV, "",
GeneXpertAnalyzerImplementation.LOINC_RDWCV));
nameMapping
.add(new PluginAnalyzerService.TestMapping(GeneXpertAnalyzerImplementation.HIV_VIRAL, "HIV VIRAL LOAD",
GeneXpertAnalyzerImplementation.HIV_VIRAL_LOINC));
.add(new PluginAnalyzerService.TestMapping(GeneXpertAnalyzerImplementation.ANALYZER_TEST_PLT, "Platelets",
GeneXpertAnalyzerImplementation.LOINC_PLT));
nameMapping.add(
new PluginAnalyzerService.TestMapping(GeneXpertAnalyzerImplementation.ANALYZER_TEST_MPV, "",
GeneXpertAnalyzerImplementation.LOINC_MPV));
nameMapping.add(
new PluginAnalyzerService.TestMapping(GeneXpertAnalyzerImplementation.ANALYZER_TEST_NEUT_COUNT, "Neutrophiles",
GeneXpertAnalyzerImplementation.LOINC_NEUT_COUNT));
nameMapping.add(
new PluginAnalyzerService.TestMapping(GeneXpertAnalyzerImplementation.ANALYZER_TEST_NEUT_PERCENT, "Neutrophiles (%)",
GeneXpertAnalyzerImplementation.LOINC_NEUT_PERCENT));
nameMapping.add(
new PluginAnalyzerService.TestMapping(GeneXpertAnalyzerImplementation.ANALYZER_TEST_LYMPH_COUNT, "Lymphocytes (Abs)",
GeneXpertAnalyzerImplementation.LOINC_LYMPH_COUNT));
nameMapping.add(
new PluginAnalyzerService.TestMapping(GeneXpertAnalyzerImplementation.ANALYZER_TEST_LYMPH_PERCENT, "Lymphocytes (%)",
GeneXpertAnalyzerImplementation.LOINC_LYMPH_PERCENT));
nameMapping.add(
new PluginAnalyzerService.TestMapping(GeneXpertAnalyzerImplementation.ANALYZER_TEST_MONO_COUNT, "Monocytes (Abs)",
GeneXpertAnalyzerImplementation.LOINC_MONO_COUNT));
nameMapping.add(
new PluginAnalyzerService.TestMapping(GeneXpertAnalyzerImplementation.ANALYZER_TEST_MONO_PERCENT, "Monocytes (%)",
GeneXpertAnalyzerImplementation.LOINC_MONO_PERCENT));
nameMapping.add(
new PluginAnalyzerService.TestMapping(GeneXpertAnalyzerImplementation.ANALYZER_TEST_EO_COUNT, "Eosinophiles",
GeneXpertAnalyzerImplementation.LOINC_EO_COUNT));
nameMapping.add(
new PluginAnalyzerService.TestMapping(GeneXpertAnalyzerImplementation.ANALYZER_TEST_EO_PERCENT, "Eosinophiles (%)",
GeneXpertAnalyzerImplementation.LOINC_EO_PERCENT));
nameMapping.add(
new PluginAnalyzerService.TestMapping(GeneXpertAnalyzerImplementation.ANALYZER_TEST_BASO_COUNT, "Basophiles",
GeneXpertAnalyzerImplementation.LOINC_BASO_COUNT));
nameMapping.add(
new PluginAnalyzerService.TestMapping(GeneXpertAnalyzerImplementation.ANALYZER_TEST_BASO_PERCENT, "Basophiles (%)",
GeneXpertAnalyzerImplementation.LOINC_BASO_PERCENT));
nameMapping.add(
new PluginAnalyzerService.TestMapping(GeneXpertAnalyzerImplementation.ANALYZER_TEST_IG_COUNT, "",
GeneXpertAnalyzerImplementation.LOINC_IG_COUNT));
nameMapping.add(
new PluginAnalyzerService.TestMapping(GeneXpertAnalyzerImplementation.ANALYZER_TEST_IG_PERCENT, "",
GeneXpertAnalyzerImplementation.LOINC_IG_PERCENT));
nameMapping.add(
new PluginAnalyzerService.TestMapping(GeneXpertAnalyzerImplementation.COV_2, "COVID-19 PCR",
GeneXpertAnalyzerImplementation.COV_2_LOINC));
new PluginAnalyzerService.TestMapping(GeneXpertAnalyzerImplementation.ANALYZER_TEST_RET_COUNT, "",
GeneXpertAnalyzerImplementation.LOINC_RET_COUNT));
nameMapping.add(
new PluginAnalyzerService.TestMapping(GeneXpertAnalyzerImplementation.ANALYZER_TEST_RET_PERCENT, "",
GeneXpertAnalyzerImplementation.LOINC_RET_PERCENT));
nameMapping.add(
new PluginAnalyzerService.TestMapping(GeneXpertAnalyzerImplementation.ANALYZER_TEST_IRF, "",
GeneXpertAnalyzerImplementation.LOINC_IRF));
nameMapping.add(
new PluginAnalyzerService.TestMapping(GeneXpertAnalyzerImplementation.ANALYZER_TEST_RETHE, "",
GeneXpertAnalyzerImplementation.LOINC_RETHE));
nameMapping.add(
new PluginAnalyzerService.TestMapping(GeneXpertAnalyzerImplementation.ANALYZER_TEST_WBCBF, "",
GeneXpertAnalyzerImplementation.LOINC_WBCBF));
nameMapping.add(
new PluginAnalyzerService.TestMapping(GeneXpertAnalyzerImplementation.ANALYZER_TEST_RBCBF, "",
GeneXpertAnalyzerImplementation.LOINC_RBCBF));
nameMapping.add(
new PluginAnalyzerService.TestMapping(GeneXpertAnalyzerImplementation.ANALYZER_TEST_MN_COUNT, "",
GeneXpertAnalyzerImplementation.LOINC_MN_COUNT));
nameMapping.add(
new PluginAnalyzerService.TestMapping(GeneXpertAnalyzerImplementation.ANALYZER_TEST_MN_PERCENT, "",
GeneXpertAnalyzerImplementation.LOINC_MN_PERCENT));
nameMapping.add(
new PluginAnalyzerService.TestMapping(GeneXpertAnalyzerImplementation.ANALYZER_TEST_PMN_COUNT, "",
GeneXpertAnalyzerImplementation.LOINC_PMN_COUNT));
nameMapping.add(
new PluginAnalyzerService.TestMapping(GeneXpertAnalyzerImplementation.ANALYZER_TEST_PMN_PERCENT, "",
GeneXpertAnalyzerImplementation.LOINC_PMN_PERCENT));
nameMapping.add(
new PluginAnalyzerService.TestMapping(GeneXpertAnalyzerImplementation.ANALYZER_TEST_TCBF_COUNT, "",
GeneXpertAnalyzerImplementation.LOINC_TCBF_COUNT));
getInstance().addAnalyzerDatabaseParts("GeneXpertAnalyzer", "GeneXpertAnalyzer", nameMapping, true);
getInstance().registerAnalyzer(this);
return true;
}

@Override
// this plugin does not work for flat files, so we disable it in that workflow
public boolean isTargetAnalyzer(List<String> lines) {
for (String line : lines) {
if (line.startsWith(GeneXpertAnalyzerImplementation.HEADER_RECORD_IDENTIFIER)) {
String[] headerRecord = line.split(Pattern.quote(GeneXpertAnalyzerImplementation.FD));
if (headerRecord.length < 5) {
LogEvent.logTrace(this.getClass().getSimpleName(), "isTargetAnalyzer", "incoming message is not GeneXpert: header record not long enough");
return false;
}
String[] senderNameFields = headerRecord[4].split(Pattern.quote(GeneXpertAnalyzerImplementation.CD));
if (senderNameFields.length < 2) {
LogEvent.logTrace(this.getClass().getSimpleName(), "isTargetAnalyzer", "incoming message is not GeneXpert: sender name field not long enough");
return false;
}
String systemName = senderNameFields[1].trim();

LogEvent.logTrace(this.getClass().getSimpleName(), "isTargetAnalyzer", "incoming message analyzer name is " + systemName);
if (systemName.equalsIgnoreCase("GeneXpert")) {
LogEvent.logTrace(this.getClass().getSimpleName(), "isTargetAnalyzer", "incoming message is GeneXpert ");
return true;
}
LogEvent.logTrace(this.getClass().getSimpleName(), "isTargetAnalyzer", "incoming message is not GeneXpert: sender name doesn't match");
return false;
}
}
LogEvent.logTrace(this.getClass().getSimpleName(), "isTargetAnalyzer", "incoming message is not GeneXpert: no header line");
return false;
}

@Override
public boolean isAnalyzerResult(List<String> lines) {
for (String line : lines) {
if (line.startsWith(GeneXpertAnalyzerImplementation.RESULT_RECORD_IDENTIFIER)) {
return true;
}
}
LogEvent.logDebug(this.getClass().getSimpleName(), "isAnalyzerResult", "no result recoord identifier located");
return false;
}

Expand All @@ -61,4 +187,9 @@ public AnalyzerLineInserter getAnalyzerLineInserter() {
return new GeneXpertAnalyzerImplementation();
}

@Override
public AnalyzerResponder getAnalyzerResponder() {
return new GeneXpertAnalyzerImplementation();
}

}
Loading

0 comments on commit 11cf0bd

Please sign in to comment.