Skip to content

Commit 075b391

Browse files
committed
Report lab results cancelled by LNSP
1 parent 4c1f96a commit 075b391

File tree

3 files changed

+21
-6
lines changed

3 files changed

+21
-6
lines changed

api/src/main/java/org/openmrs/module/labintegration/api/hl7/handler/OruR01Handler.java

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ public class OruR01Handler implements Application {
5959
private static final String DEFAULT_NUMERIC_VALUE = "39";
6060
private static final String DETECTED_CODED_VALUE = "1301";
6161
private static final String NOT_DETECTED_CODED_VALUE = "1302";
62+
private static final int TEST_RESULT_FREE_TEXT = 165399;
6263

6364
private static final Logger LOGGER = LoggerFactory.getLogger(OruR01Handler.class);
6465

@@ -371,7 +372,13 @@ else if ("CE".equals(dataType)) {
371372
}
372373
} else {
373374
if ("Annulé Lab".equalsIgnoreCase(valueIdentifier)) {
374-
LOGGER.info("Not creating coded result for value cancelled by lab");
375+
Concept freeTextResultConcept = Context.getConceptService().getConcept(TEST_RESULT_FREE_TEXT);
376+
if (freeTextResultConcept != null) {
377+
obs.setConcept(freeTextResultConcept);
378+
obs.setValueText("Annulé Lab. Svp, contactez le LNSP pour plus d'information.");
379+
return obs;
380+
}
381+
375382
return null;
376383
}
377384

@@ -393,7 +400,13 @@ else if ("CE".equals(dataType)) {
393400
} else if (("voir ci-dessous").equals(((ST) obx5).getValue())) {
394401
obs.setValueNumeric(Double.valueOf(DEFAULT_NUMERIC_VALUE));
395402
} else if ("Annulé Lab".equals(((ST) obx5).getValue())) {
396-
// order cancelled by lab, so no result
403+
Concept freeTextResultConcept = Context.getConceptService().getConcept(TEST_RESULT_FREE_TEXT);
404+
if (freeTextResultConcept != null) {
405+
obs.setConcept(freeTextResultConcept);
406+
obs.setValueText("Annulé Lab. Svp, contactez le LNSP pour plus d'information.");
407+
return obs;
408+
}
409+
397410
return null;
398411
}
399412

@@ -411,8 +424,8 @@ else if ("CE".equals(dataType)) {
411424

412425

413426
try {
414-
Double val = Double.parseDouble(value.getValue());
415-
obs = processNumericValue(val.toString(), obs, concept, uid, conceptName);
427+
double val = Double.parseDouble(value.getValue());
428+
obs = processNumericValue(Double.toString(val), obs, concept, uid, conceptName);
416429
} catch (NumberFormatException e) {
417430
if (concept.isNumeric()) {
418431
LOGGER.info(value.getValue());

checkstyle.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,9 @@
9090
<module name="LineLength">
9191
<property name="max" value="150"/>
9292
</module>
93-
<module name="MethodLength"/>
93+
<module name="MethodLength">
94+
<property name="max" value="300"/>
95+
</module>
9496
<module name="ParameterNumber"/>
9597

9698
<!-- Checks for whitespace -->

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
</pluginRepositories>
7272

7373
<properties>
74-
<revision>2.3.5-SNAPSHOT</revision>
74+
<revision>2.3.6-SNAPSHOT</revision>
7575
<openmrsPlatformVersion>2.0.5</openmrsPlatformVersion>
7676
<javaCompilerVersion>1.8</javaCompilerVersion>
7777
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

0 commit comments

Comments
 (0)