Skip to content

Commit

Permalink
Merge pull request #399 from SMI/hotfix/ctp-messages
Browse files Browse the repository at this point in the history
Hotfix - Fix missing JSON fields from CTP output
  • Loading branch information
rkm authored Sep 20, 2020
2 parents 35f0655 + c251f7f commit 9bfc3fb
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 6 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

-

## [1.12.2] - 2020-09-18

- Fix missing JSON fields from CTP output

## [1.12.1] - 2020-09-15

- Remove reference to MongoDB.Driver in Smi.Common.MongoDb.csproj since it caused a version conflict in the output packages
Expand Down Expand Up @@ -418,7 +422,8 @@ First stable release after importing the repository from the private [SMIPlugin]
- Anonymous `MappingTableName` must now be fully specified to pass validation (e.g. `mydb.mytbl`). Previously skipping database portion was supported.


[Unreleased]: https://github.com/SMI/SmiServices/compare/v1.12.1...develop
[Unreleased]: https://github.com/SMI/SmiServices/compare/v1.12.2...develop
[1.12.2]: https://github.com/SMI/SmiServices/compare/v1.12.1...v1.12.2
[1.12.1]: https://github.com/SMI/SmiServices/compare/v1.12.0...v1.12.1
[1.12.0]: https://github.com/SMI/SmiServices/compare/v1.11.1...v1.12.0
[1.11.1]: https://github.com/SMI/SmiServices/compare/v1.11.0...v1.11.1
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[![Total alerts](https://img.shields.io/lgtm/alerts/g/SMI/SmiServices.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/SMI/SmiServices/alerts/)
[![Coverage Status](https://coveralls.io/repos/github/SMI/SmiServices/badge.svg)](https://coveralls.io/github/SMI/SmiServices)

Version: `1.12.1`
Version: `1.12.2`

# SMI Services

Expand Down
6 changes: 3 additions & 3 deletions src/SharedAssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
[assembly: AssemblyCulture("")]

// These should be overwritten by release builds
[assembly: AssemblyVersion("1.12.1")]
[assembly: AssemblyFileVersion("1.12.1")]
[assembly: AssemblyInformationalVersion("1.12.1")] // This one can have the extra build info after it
[assembly: AssemblyVersion("1.12.2")]
[assembly: AssemblyFileVersion("1.12.2")]
[assembly: AssemblyInformationalVersion("1.12.2")] // This one can have the extra build info after it
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
booter/
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@ public class ExtractedFileStatusMessage extends ExtractMessage implements IMessa
@FieldRequired
public String DicomFilePath;

@FieldRequired
public String OutputFilePath;

@FieldRequired
public ExtractedFileStatus Status;

@FieldRequired
public String StatusMessage;

/** @return the filePath */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ public void handleDeliveryImpl(String consumerTag, Envelope envelope, BasicPrope
}

statusMessage.StatusMessage = msg;
statusMessage.OutputFilePath = "";
statusMessage.Status = ExtractedFileStatus.FileMissing;

_statusMessageProducer.SendMessage(statusMessage, _routingKey_failure, header);
Expand Down Expand Up @@ -134,6 +135,7 @@ public void handleDeliveryImpl(String consumerTag, Envelope envelope, BasicPrope
_logger.error(msg);

statusMessage.StatusMessage = msg;
statusMessage.OutputFilePath = "";
statusMessage.Status = ExtractedFileStatus.FileMissing;

_statusMessageProducer.SendMessage(statusMessage, _routingKey_failure, header);
Expand All @@ -155,13 +157,15 @@ public void handleDeliveryImpl(String consumerTag, Envelope envelope, BasicPrope

if (status == CtpAnonymisationStatus.Anonymised) {

statusMessage.StatusMessage = "";
statusMessage.OutputFilePath = extractFileMessage.OutputPath;
statusMessage.Status = ExtractedFileStatus.Anonymised;
routingKey = _routingKey_success;

} else {

statusMessage.StatusMessage = _anonTool.getLastStatus();
statusMessage.OutputFilePath = "";
statusMessage.Status = ExtractedFileStatus.ErrorWontRetry;
routingKey = _routingKey_failure;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ public void testBasicAnonymise_Failure() throws InterruptedException {
_logger.info("Message received");
_logger.info("\n" + recvd.toString());

assertEquals("FilePaths do not match", null, recvd.OutputFilePath);
assertEquals("FilePaths do not match", "", recvd.OutputFilePath);
assertEquals(ExtractedFileStatus.FileMissing, recvd.Status);
} else {
fail("Did not receive message");
Expand Down

0 comments on commit 9bfc3fb

Please sign in to comment.