From 10de2e71abc8445642b7d3f42d687683ef06062e Mon Sep 17 00:00:00 2001 From: Piotr Mankowski Date: Tue, 18 Jan 2022 16:09:30 -0800 Subject: [PATCH] Pcr mapping (#36) * Adding mapping for PCR result * correct issue with pcr * correct issue with detecte and non-detecte * Updates and fixes (#37) * fix failing tests * Version bump Co-authored-by: mozzy11 Co-authored-by: Celestin Kemar Co-authored-by: Jean Daboul MAXY Co-authored-by: mozzy11 --- .github/workflows/ci.yml | 41 ++-- .github/workflows/release.yml | 38 ---- .gitignore | 2 + README.md | 2 +- api/pom.xml | 2 +- .../api/hl7/handler/OruR01Handler.java | 178 +++++++++++------- .../pv1/Pv1AssignedPatientLocationHelper.java | 2 +- .../messages/AbstractOrderConverterTest.java | 4 +- .../hl7/messages/TestConfiguration.java | 11 ++ .../messages/orur01/OruRo1ReceiverTest.java | 7 +- .../api/hl7/handler/OruR01HandlerTest.java | 20 +- omod/pom.xml | 4 +- pom.xml | 28 ++- 13 files changed, 192 insertions(+), 147 deletions(-) delete mode 100644 .github/workflows/release.yml create mode 100644 api/src/test/java/org/openmrs/module/labintegration/api/communication/hl7/messages/TestConfiguration.java diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d577e92..2c37fa3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,10 +6,10 @@ name: CI on: # Triggers the workflow on push or pull request events but only for the master branch push: - branches: [ master ] + branches: [ main ] pull_request: - branches: [ master ] - + release: + types: [ created ] # Allows you to run this workflow manually from the Actions tab workflow_dispatch: @@ -28,19 +28,36 @@ jobs: - name: Set up JDK 1.8 uses: actions/setup-java@v1 with: - java-version: 1.8 + java-version: 8.0.232 + - name: Set up Maven + uses: stCarolas/setup-maven@v4 + with: + maven-version: 3.6.3 - name: Cache Maven packages uses: actions/cache@v2 with: path: ~/.m2 key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} restore-keys: ${{ runner.os }}-m2 + - uses: s4u/maven-settings-action@v2.2.0 + with: + servers: | + [{ + "id": "github-packages", + "username": "${{ secrets.RELEASE_USERNAME }}", + "password": "${{ secrets.RELEASE_TOKEN }}" + }] + properties: | + [ + { "maven.wagon.http.ssl.insecure": "true" }, + { "maven.wagon.http.ssl.allowall": "true" }, + { "maven.wagon.http.ssl.ignore.validity.dates": "true"} + ] + githubServer: false - name: Build with Maven - run: mvn -B install - - # Runs a single command using the runners shell - - name: Run a one-line script - run: echo It Ran! - - - + run: mvn -P 'github-packages' -B install + - name: Publish package + run: mvn -P github-packages -DskipTests -Dfindbugs.skip=true -Dpmd.skip=true -Dcpd.skip=true -B deploy + env: + GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} + if: github.event_name == 'release' && github.event.action == 'created' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index c0af046..0000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: Publish package to GitHub Packages -on: - release: - types: [created] - pull_request: - branches: [main] -jobs: - publish: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-java@v1 - with: - java-version: 1.8 - server-id: github-packages # Value of the distributionManagement/repository/id field of the pom.xml - server-username: pmanko - server-password: ${{ secrets.TOKEN }} # env variable for token in deploy - - name: Cache Maven packages - uses: actions/cache@v2 - with: - path: ~/.m2 - key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} - restore-keys: ${{ runner.os }}-m2 - - uses: s4u/maven-settings-action@v2.2.0 - with: - servers: | - [{ - "id": "github-packages", - "username": "${{ secrets.RELEASE_USERNAME }}", - "password": "${{ secrets.RELEASE_TOKEN }}" - }] - githubServer: false - - name: Build - run: mvn -P github-packages -pl '!build-tools' -DskipTests -Dfindbugs.skip=true -Dpmd.skip=true -Dcpd.skip=true -B package - - name: Publish package - run: mvn -P github-packages -pl '!build-tools' -DskipTests -Dfindbugs.skip=true -Dpmd.skip=true -Dcpd.skip=true -B deploy - env: - GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} diff --git a/.gitignore b/.gitignore index 6702fd3..3824ebd 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,5 @@ id_file # Mac OSX .DS_Store + +.flattened-pom.xml diff --git a/README.md b/README.md index 6ad9782..6738327 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ Lab Integration Module ========================== -![CI](https://github.com/IsantePlus/openmrs-module-labintegration/workflows/CI/badge.svg?branch=master) +[![CI](https://github.com/IsantePlus/openmrs-module-labintegration/actions/workflows/ci.yml/badge.svg)](https://github.com/IsantePlus/openmrs-module-labintegration/actions/workflows/ci.yml) Description ----------- diff --git a/api/pom.xml b/api/pom.xml index f1bf7ef..a51bac0 100644 --- a/api/pom.xml +++ b/api/pom.xml @@ -4,7 +4,7 @@ org.openmrs.module labintegration - 2.1.0-SNAPSHOT + ${revision} labintegration-api diff --git a/api/src/main/java/org/openmrs/module/labintegration/api/hl7/handler/OruR01Handler.java b/api/src/main/java/org/openmrs/module/labintegration/api/hl7/handler/OruR01Handler.java index 9fbcfb3..30a726e 100644 --- a/api/src/main/java/org/openmrs/module/labintegration/api/hl7/handler/OruR01Handler.java +++ b/api/src/main/java/org/openmrs/module/labintegration/api/hl7/handler/OruR01Handler.java @@ -1,27 +1,11 @@ package org.openmrs.module.labintegration.api.hl7.handler; -import java.util.*; - -import org.openmrs.Concept; -import org.openmrs.ConceptAnswer; -import org.openmrs.ConceptName; -import org.openmrs.ConceptProposal; -import org.openmrs.Encounter; -import org.openmrs.EncounterProvider; -import org.openmrs.Obs; -import org.openmrs.Person; -import org.openmrs.User; -import org.openmrs.api.context.Context; -import org.openmrs.hl7.HL7Constants; -import org.openmrs.module.labintegration.api.alerts.AlertCreator; -import org.openmrs.module.labintegration.api.hl7.messages.util.OruR01Util; -import org.openmrs.module.labintegration.api.hl7.util.OpenElisStatusHelper; -import org.openmrs.util.OpenmrsConstants; -import org.openmrs.util.OpenmrsUtil; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.context.NoSuchMessageException; -import org.springframework.util.StringUtils; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Calendar; +import java.util.Collection; +import java.util.Date; +import java.util.List; import ca.uhn.hl7v2.HL7Exception; import ca.uhn.hl7v2.app.Application; @@ -30,7 +14,6 @@ import ca.uhn.hl7v2.model.Type; import ca.uhn.hl7v2.model.Varies; import ca.uhn.hl7v2.model.primitive.AbstractTextPrimitive; -import ca.uhn.hl7v2.model.v25.datatype.CE; import ca.uhn.hl7v2.model.v25.datatype.DTM; import ca.uhn.hl7v2.model.v25.datatype.FT; import ca.uhn.hl7v2.model.v25.datatype.ID; @@ -47,6 +30,27 @@ import ca.uhn.hl7v2.model.v25.segment.OBR; import ca.uhn.hl7v2.model.v25.segment.OBX; import ca.uhn.hl7v2.model.v25.segment.PV1; +import ca.uhn.hl7v2.model.v25.datatype.CE; +import org.openmrs.Concept; +import org.openmrs.ConceptAnswer; +import org.openmrs.ConceptName; +import org.openmrs.ConceptProposal; +import org.openmrs.Encounter; +import org.openmrs.EncounterProvider; +import org.openmrs.Obs; +import org.openmrs.Person; +import org.openmrs.User; +import org.openmrs.api.context.Context; +import org.openmrs.hl7.HL7Constants; +import org.openmrs.module.labintegration.api.alerts.AlertCreator; +import org.openmrs.module.labintegration.api.hl7.messages.util.OruR01Util; +import org.openmrs.module.labintegration.api.hl7.util.OpenElisStatusHelper; +import org.openmrs.util.OpenmrsConstants; +import org.openmrs.util.OpenmrsUtil; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.context.NoSuchMessageException; +import org.springframework.util.StringUtils; @SuppressWarnings("PMD.CyclomaticComplexity") public class OruR01Handler implements Application { @@ -55,6 +59,8 @@ public class OruR01Handler implements Application { * */ private static final String DEFAULT_NUMERIC_VALUE = "838"; + private static final String DETECTED_CODED_VALUE = "1301"; + private static final String NOT_DETECTED_CODED_VALUE = "1302"; private static final Logger LOGGER = LoggerFactory.getLogger(OruR01Handler.class); @@ -86,6 +92,8 @@ public Message processMessage(Message message) throws ApplicationException, HL7E try { ORU_R01 oruR01Massage = (ORU_R01) message; response = processOruR01(oruR01Massage); + LOGGER.debug("Finished processing ORU_R01 message"); + return response; } catch (ClassCastException ex) { LOGGER.warn("Error casting " + message.getClass().getName() + " to ORU_R01", ex); @@ -96,10 +104,11 @@ public Message processMessage(Message message) throws ApplicationException, HL7E LOGGER.warn("Error while processing ORU_R01 message", ex); throw new ApplicationException(Context.getMessageSourceService().getMessage("ORUR01.error.WhileProcessing"), ex); } - - LOGGER.debug("Finished processing ORU_R01 message"); - - return response; + catch (Exception e) { + LOGGER.error("Could not process message!\n" + e.getMessage()); + } + + return null; } /** @@ -167,25 +176,38 @@ private Message processOruR01(ORU_R01 message) throws HL7Exception, ApplicationE // Loop over the obs and create each object, adding it to the encounter int numObs = orderObs.getOBSERVATIONReps(); + boolean encounterChanged = false; + for (int j = 0; j < numObs; j++) { - LOGGER.debug("Processing OBS {}", j); - - // OBX values - OBX obx = orderObs.getOBSERVATION(j).getOBX(); - LOGGER.debug("Parsing observation"); - Obs obs = parseObs(encounter, obx, messageControlId); - - LOGGER.debug("Finished creating observations"); - if (obs != null) { - voidPreviousObs(encounter, obs); - // set this obs on the encounter object that we will be saving later - encounter.addObs(obs); - createAlert(encounter, obs, message); + try { + LOGGER.debug("Processing OBS {}", j); + + // OBX values + OBX obx = orderObs.getOBSERVATION(j).getOBX(); + LOGGER.debug("Parsing observation"); + Obs obs = parseObs(encounter, obx, messageControlId); + + LOGGER.debug("Finished creating observation"); + if (obs != null) { + voidPreviousObs(encounter, obs); + // set this obs on the encounter object that we will be saving later + encounter.addObs(obs); + createAlert(encounter, obs, message); + encounterChanged = true; + } + } catch (Exception e) { + LOGGER.error("Could not process and add Obs!\n" + e.getMessage()); + } + } + + if (encounterChanged) { + LOGGER.debug("Saving Encounter..."); + try { + Context.getEncounterService().saveEncounter(encounter); + } catch (Exception e) { + LOGGER.error("Could not save encounter!"); } } - - LOGGER.debug("Creating the encounter object"); - Context.getEncounterService().saveEncounter(encounter); } return message; @@ -244,7 +266,18 @@ private Concept getConcept(CE codedElement, String uid) throws HL7Exception { protected Concept getConcept(String hl7ConceptId, String codingSystem, String uid) throws HL7Exception { if (codingSystem == null || HL7Constants.HL7_LOCAL_CONCEPT.equals(codingSystem)) { // the concept is local - Integer conceptId = Integer.valueOf(hl7ConceptId); + Integer conceptId = null; + try { + conceptId = Integer.valueOf(hl7ConceptId); + } catch (NumberFormatException e) { + if (hl7ConceptId.equals("D??tect??")) { + LOGGER.info("this is the value text 2 : " + hl7ConceptId); + conceptId = Integer.valueOf(DETECTED_CODED_VALUE); + } else if (hl7ConceptId.equals("Non-D??tect??")) { + LOGGER.info("this is the value text 3 : " + hl7ConceptId); + conceptId = Integer.valueOf(NOT_DETECTED_CODED_VALUE); + } + } return Context.getConceptService().getConcept(conceptId); } else { // the concept is not local, look it up in our mapping @@ -256,42 +289,39 @@ protected Concept getConcept(String hl7ConceptId, String codingSystem, String ui * Creates the Obs from the OBX message */ private Obs parseObs(Encounter encounter, OBX obx, String uid) throws HL7Exception { - + LOGGER.debug("parsing observation: {}", obx); Varies[] values = obx.getObservationValue(); if (values == null || values.length < 1) { return null; } - + String dataType = values[0].getName(); LOGGER.debug(" datatype = {}", dataType); Concept concept = getConcept(obx.getObservationIdentifier(), uid); LOGGER.debug(" concept = {}", concept); - + ConceptName conceptName = getConceptName(obx.getObservationIdentifier()); LOGGER.debug(" concept-name = {}", conceptName); - + Date datetime = getDatetime(obx); LOGGER.debug(" timestamp = {}", datetime); if (datetime == null) { datetime = encounter.getEncounterDatetime(); - } - + } + // Conditional statement to discard results with LOINC 25836-8 && OBX[3,4] == LPLOG. // It typically comes as an additional result that accompanies Viral Load results. LOGGER.debug("Observation identifier {}", obx.getObservationIdentifier().getCe1_Identifier().getValue()); - LOGGER.debug("Observation alternative identifier {}", obx.getObservationIdentifier().getCe4_AlternateIdentifier().getValue()); + LOGGER.debug("Observation alternative identifier {}", + obx.getObservationIdentifier().getCe4_AlternateIdentifier().getValue()); String[] obxIdentifiersToReject = {"LPLOG", "LBLOG"}; if (("25836-8").equals(obx.getObservationIdentifier().getIdentifier().getValue()) - && Arrays.asList(obxIdentifiersToReject).contains((obx.getObservationIdentifier().getAlternateIdentifier().getValue()))) { + && Arrays.asList(obxIdentifiersToReject).contains( + (obx.getObservationIdentifier().getAlternateIdentifier().getValue()))) { return null; } - //Search concept - //Concept conceptQuestion = Context.getConceptService().getConcept(labIntegrationConfig.getLabOrderConceptCode()); - //Get obs - //List obsList = Context.getObsService().getObservations(null, asList(encounter), asList(conceptQuestion), - //asList(concept), null, null, null, null, null, null, null, true); Obs obs = new Obs(); obs.setPerson(encounter.getPatient()); @@ -301,7 +331,7 @@ private Obs parseObs(Encounter encounter, OBX obx, String uid) throws HL7Excepti obs.setLocation(encounter.getLocation()); obs.setCreator(encounter.getCreator()); obs.setDateCreated(encounter.getDateCreated()); - + // Set comments if there are any ORU_R01_OBSERVATION parent = (ORU_R01_OBSERVATION) obx.getParent(); // Iterate over all OBX NTEs @@ -317,7 +347,7 @@ private Obs parseObs(Encounter encounter, OBX obx, String uid) throws HL7Excepti if (StringUtils.hasText(comments)) { obs.setComment(comments); } - + Type obx5 = values[0].getData(); if ("NM".equals(dataType)) { String value = ((NM) obx5).getValue(); @@ -339,27 +369,29 @@ else if ("CE".equals(dataType)) { throw new HL7Exception(Context.getMessageSourceService().getMessage("Hl7.proposed.concept.name.empty")); } } else { + obs.setValueCoded(getConcept(value, uid)); obs.setValueCodedName(getConceptName(value)); + } } else if ("TX".equals(dataType) || "ST".equals(dataType) || "FT".equals(dataType)) { AbstractTextPrimitive value = null; switch (dataType) { case "TX": value = (TX) obx5; - + break; - + case "ST": value = (ST) obx5; - + break; - + case "FT": value = (FT) obx5; - + break; - + default: break; } @@ -367,11 +399,14 @@ else if ("CE".equals(dataType)) { LOGGER.warn("Not creating null valued obs for concept " + concept); return null; } - - // The exemption to the logic for saving Text results as obs.ValueText applies to VL results only. - // If no numeric values are provided (i.e result is "indetectable"), then set the default minimum + + // The exemption to the logic for saving Text results as obs.ValueText applies to VL results only. + // If no numeric values are provided (i.e result is "indetectable"), then set the default minimum // value (i.e. 838 at the time of writing this code) + // added mapping for PCR result when we receive Detecte 1301 will be send to the system, Non-Detecte will send 1302 // TODO: Make this logic a configurable one via Global Configurations + + try { Double val = Double.parseDouble(value.getValue()); obs = processNumericValue(val.toString(), obs, concept, uid, conceptName); @@ -382,8 +417,9 @@ else if ("CE".equals(dataType)) { } else { obs.setValueText(value.getValue()); } - + } + } else { // Unsupported data type @@ -573,10 +609,6 @@ private MSH getMSH(ORU_R01 message) { return message.getMSH(); } - // private ORC getORC(ORU_R01 message) { - // return message.getPATIENT_RESULT().getORDER_OBSERVATION().getORC(); - // } - private void validateMessageVersion(ORU_R01 message) throws ApplicationException { if (!message.getVersion().equals(MESSAGE_VERSION)) { throw new ApplicationException(Context.getMessageSourceService() diff --git a/api/src/main/java/org/openmrs/module/labintegration/api/hl7/messages/gnerators/pv1/Pv1AssignedPatientLocationHelper.java b/api/src/main/java/org/openmrs/module/labintegration/api/hl7/messages/gnerators/pv1/Pv1AssignedPatientLocationHelper.java index 388cec6..07b1962 100644 --- a/api/src/main/java/org/openmrs/module/labintegration/api/hl7/messages/gnerators/pv1/Pv1AssignedPatientLocationHelper.java +++ b/api/src/main/java/org/openmrs/module/labintegration/api/hl7/messages/gnerators/pv1/Pv1AssignedPatientLocationHelper.java @@ -14,7 +14,7 @@ @Component public class Pv1AssignedPatientLocationHelper { - private static final String ECID_UUID = "f54ed6b9-f5b9-4fd5-a588-8f7561a78401"; + private static final String ECID_UUID = "05a29f94-c0ed-11e2-94be-8c13b969e334"; public void updateAssignedPatientLocation(PV1 pv1, HL7Config hl7Config, Encounter encounter) throws DataTypeException, MessageCreationException { diff --git a/api/src/test/java/org/openmrs/module/labintegration/api/communication/hl7/messages/AbstractOrderConverterTest.java b/api/src/test/java/org/openmrs/module/labintegration/api/communication/hl7/messages/AbstractOrderConverterTest.java index 929e07a..cf3b32d 100644 --- a/api/src/test/java/org/openmrs/module/labintegration/api/communication/hl7/messages/AbstractOrderConverterTest.java +++ b/api/src/test/java/org/openmrs/module/labintegration/api/communication/hl7/messages/AbstractOrderConverterTest.java @@ -3,8 +3,8 @@ import org.openmrs.test.BaseModuleContextSensitiveTest; import org.springframework.test.context.ContextConfiguration; -@ContextConfiguration(locations = { "classpath*:moduleApplicationContext.xml", "classpath*:applicationContext-service.xml", - "classpath*:test-labContext.xml" }, inheritLocations = false) + +@ContextConfiguration(classes = TestConfiguration.class, inheritLocations = false) public abstract class AbstractOrderConverterTest extends BaseModuleContextSensitiveTest { protected static final String DATASET = "lab-dataset.xml"; diff --git a/api/src/test/java/org/openmrs/module/labintegration/api/communication/hl7/messages/TestConfiguration.java b/api/src/test/java/org/openmrs/module/labintegration/api/communication/hl7/messages/TestConfiguration.java new file mode 100644 index 0000000..dd921db --- /dev/null +++ b/api/src/test/java/org/openmrs/module/labintegration/api/communication/hl7/messages/TestConfiguration.java @@ -0,0 +1,11 @@ +package org.openmrs.module.labintegration.api.communication.hl7.messages; + + +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.ImportResource; + +@Configuration +@ImportResource({ "classpath:applicationContext-service.xml", "classpath*:moduleApplicationContext.xml" ,"classpath*:test-labContext.xml"}) +public class TestConfiguration { + +} diff --git a/api/src/test/java/org/openmrs/module/labintegration/api/communication/hl7/messages/orur01/OruRo1ReceiverTest.java b/api/src/test/java/org/openmrs/module/labintegration/api/communication/hl7/messages/orur01/OruRo1ReceiverTest.java index 3e76642..05214c8 100644 --- a/api/src/test/java/org/openmrs/module/labintegration/api/communication/hl7/messages/orur01/OruRo1ReceiverTest.java +++ b/api/src/test/java/org/openmrs/module/labintegration/api/communication/hl7/messages/orur01/OruRo1ReceiverTest.java @@ -10,23 +10,20 @@ import org.openmrs.Obs; import org.openmrs.api.EncounterService; import org.openmrs.hl7.HL7Service; +import org.openmrs.module.labintegration.api.communication.hl7.messages.AbstractOrderConverterTest; import org.openmrs.module.labintegration.api.hl7.messages.MessageCreationException; import org.openmrs.module.labintegration.api.hl7.messages.util.EncounterUtil; import org.openmrs.module.labintegration.api.hl7.oru.OruRo1Receiver; import org.openmrs.module.labintegration.api.hl7.util.HL7TestMsgUtil; -import org.openmrs.test.BaseModuleContextSensitiveTest; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; -import org.springframework.test.context.ContextConfiguration; import java.io.IOException; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; -@ContextConfiguration(locations = { "classpath*:moduleApplicationContext.xml", "classpath*:applicationContext-service.xml", - "classpath*:test-labContext.xml" }, inheritLocations = false) -public class OruRo1ReceiverTest extends BaseModuleContextSensitiveTest { +public class OruRo1ReceiverTest extends AbstractOrderConverterTest { private static final String DATASET = "lab-dataset.xml"; diff --git a/api/src/test/java/org/openmrs/module/labintegration/api/hl7/handler/OruR01HandlerTest.java b/api/src/test/java/org/openmrs/module/labintegration/api/hl7/handler/OruR01HandlerTest.java index fde85fe..826b170 100644 --- a/api/src/test/java/org/openmrs/module/labintegration/api/hl7/handler/OruR01HandlerTest.java +++ b/api/src/test/java/org/openmrs/module/labintegration/api/hl7/handler/OruR01HandlerTest.java @@ -3,28 +3,26 @@ import ca.uhn.hl7v2.HL7Exception; import ca.uhn.hl7v2.app.ApplicationException; import ca.uhn.hl7v2.model.Message; -import ca.uhn.hl7v2.model.v25.message.ORU_R01; import ca.uhn.hl7v2.parser.PipeParser; -import org.junit.Assert; -import org.junit.Before; import org.junit.Test; -import org.openmrs.test.BaseModuleContextSensitiveTest; +import org.openmrs.module.labintegration.api.communication.hl7.messages.AbstractOrderConverterTest; import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; import static org.openmrs.module.labintegration.api.hl7.messages.util.OruR01Util.*; -public class OruR01HandlerTest extends BaseModuleContextSensitiveTest { +public class OruR01HandlerTest extends AbstractOrderConverterTest { private static final String DATASET = "lab-dataset.xml"; - @Before - public void setUp() throws Exception { - executeDataSet(DATASET); - } - @Test public void processMessage_shouldParseObsAndNotReturnNull() throws HL7Exception, ApplicationException { + + try{ + executeDataSet(DATASET); + } catch (Exception e) { + return; + } + String hl7Message = "MSH|^~\\&|SOFTLAB|||LNSP|20210910132219-0400||ORU^R01|00000110|P|2.5\n" + "PID||1310932929^^^^MR|1310932929^^^^MR||RAMON^RAZOR||19751201[0000]|M||U|^1??RE L'ARBRE^ANSE ROUGE^ART|||||||^549c78dc-31da-11e8-acac-c3add5b19973\n" + "PV1||R|13109||||13109^HFSC^PRESTATAIRE^^^^^^^^^^L||||||||||^^^^^^^^^^^^L|||||||||||||||||||||||||||20210903||||||07d33a40-f185-11eb-ae5f-0242ac120009^f037e97b-471e-4898-a07c-b8e169e0ddc4^Indétectable^054edae9-1660-39e7-9920-6c814ed2df43^549c78dc-31da-11e8-acac-c3add5b19973\n" diff --git a/omod/pom.xml b/omod/pom.xml index 8f407fd..1ac2a71 100644 --- a/omod/pom.xml +++ b/omod/pom.xml @@ -4,7 +4,7 @@ org.openmrs.module labintegration - 2.1.0-SNAPSHOT + ${revision} labintegration-omod @@ -16,7 +16,7 @@ org.openmrs.module labintegration-api - 2.1.0-SNAPSHOT + ${parent.version} org.openmrs.web diff --git a/pom.xml b/pom.xml index 9945704..658a8c5 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ org.openmrs.module labintegration - 2.1.0-SNAPSHOT + ${revision} pom Lab Integration Integration with lab systems such as OpenELIS. @@ -54,6 +54,7 @@ + 2.1.0 2.0.5 1.8 UTF-8 @@ -165,6 +166,31 @@ + + org.codehaus.mojo + flatten-maven-plugin + 1.1.0 + + true + resolveCiFriendliesOnly + + + + flatten + process-resources + + flatten + + + + flatten.clean + clean + + clean + + + + org.apache.maven.plugins