diff --git a/examples/README.md b/examples/README.md index 8ef3555ad..156f064c5 100644 --- a/examples/README.md +++ b/examples/README.md @@ -21,8 +21,8 @@ ## Routing of these files To avoid routing issues, we have decided to use `MSH-11` for routing of test messages ([more context here](/adr/026-hl7-test-message-routing.md)). The values we have decided to use are: -- `D`: for test files **not** to be sent to partners and to be sent manually. Any files under `examples/` and not in `examples/Test/Automated/` should have this value -- `N`: for test files **not** to be sent to partners and sent by a scheduled task. Any files under `examples/Test/Automated/` should have this value +- `D`: for test files **not** to be sent to partners and to be sent manually. Any files under `examples/` and not in `examples/Test/Automated/Assertion/` should have this value +- `N`: for test files **not** to be sent to partners and sent by a scheduled task. Any files under `examples/Test/Automated/Assertion/` should have this value - `T`: for test files to be sent manually to partners. `P` will also be routed to partners **Note**: for some sample files, our transformations **will** rewrite the `MSH-5` and/or `MSH-6` HL7 fields normally used for routing, so we can't rely only on those fields to route. This is the case for most of the files in the `examples/CA` folder. If you are sending any files in that folder and you don't want the message to be delivered to our partner, please make sure `MSH-11` is **not** `T` or `P`. Otherwise the message will be delivered to our partner regardless of what is there in `MSH-5` and `MSH-6`. Please see [this ADR](/adr/026-hl7-test-message-routing.md) for more context @@ -38,7 +38,7 @@ In order to keep the snapshots up-to-date, we have a script that automates the r - The `ORM` messages with ids `003`, `004`, `005`, `006`, `007`, `008`, `009`, `010` in the `Test/Orders` folder were modified to comply with current requirements for ReportStream, as it doesn't yet support HL7 `2.3`: - Added `MSH-9.3` - Changed `MSH-10` to `2.5.1` -- The `MSH-11` value for all sample files in `examples/` (with the exception of files in `examples/Test/Automated/`) was changed to `D`. This is to comply with our routing filters in RS for test messages +- The `MSH-11` value for all sample files in `examples/` (with the exception of files in `examples/Test/Automated/Assertion/`) was changed to `D`. This is to comply with our routing filters in RS for test messages ## Previously renamed files diff --git a/rs-e2e/src/main/java/gov/hhs/cdc/trustedintermediary/rse2e/FileFetcher.java b/rs-e2e/src/main/java/gov/hhs/cdc/trustedintermediary/rse2e/FileFetcher.java index ffdc642bc..3bf197113 100644 --- a/rs-e2e/src/main/java/gov/hhs/cdc/trustedintermediary/rse2e/FileFetcher.java +++ b/rs-e2e/src/main/java/gov/hhs/cdc/trustedintermediary/rse2e/FileFetcher.java @@ -8,5 +8,5 @@ * of this interface should provide a way to retrieve a list of HL7FileStream objects. */ public interface FileFetcher { - List fetchFiles(FileFetchEnum fileFetchEnum); + List fetchFiles(FileFetcherEnum fileFetcherEnum); } diff --git a/rs-e2e/src/main/java/gov/hhs/cdc/trustedintermediary/rse2e/FileFetchEnum.java b/rs-e2e/src/main/java/gov/hhs/cdc/trustedintermediary/rse2e/FileFetcherEnum.java similarity index 60% rename from rs-e2e/src/main/java/gov/hhs/cdc/trustedintermediary/rse2e/FileFetchEnum.java rename to rs-e2e/src/main/java/gov/hhs/cdc/trustedintermediary/rse2e/FileFetcherEnum.java index d6fa82c1a..31838a723 100644 --- a/rs-e2e/src/main/java/gov/hhs/cdc/trustedintermediary/rse2e/FileFetchEnum.java +++ b/rs-e2e/src/main/java/gov/hhs/cdc/trustedintermediary/rse2e/FileFetcherEnum.java @@ -1,6 +1,6 @@ package gov.hhs.cdc.trustedintermediary.rse2e; -public enum FileFetchEnum { +public enum FileFetcherEnum { GOLDEN_COPY, - AUTOMATED + ASSERTION } diff --git a/rs-e2e/src/main/java/gov/hhs/cdc/trustedintermediary/rse2e/external/azure/AzureBlobFileFetcher.java b/rs-e2e/src/main/java/gov/hhs/cdc/trustedintermediary/rse2e/external/azure/AzureBlobFileFetcher.java index aecca799c..3c1e92136 100644 --- a/rs-e2e/src/main/java/gov/hhs/cdc/trustedintermediary/rse2e/external/azure/AzureBlobFileFetcher.java +++ b/rs-e2e/src/main/java/gov/hhs/cdc/trustedintermediary/rse2e/external/azure/AzureBlobFileFetcher.java @@ -5,8 +5,8 @@ import com.azure.storage.blob.BlobContainerClientBuilder; import com.azure.storage.blob.models.BlobItem; import com.azure.storage.blob.models.ListBlobsOptions; -import gov.hhs.cdc.trustedintermediary.rse2e.FileFetchEnum; import gov.hhs.cdc.trustedintermediary.rse2e.FileFetcher; +import gov.hhs.cdc.trustedintermediary.rse2e.FileFetcherEnum; import gov.hhs.cdc.trustedintermediary.rse2e.hl7.HL7FileStream; import java.time.LocalDate; import java.time.ZoneId; @@ -51,15 +51,15 @@ public static FileFetcher getInstance() { } @Override - public List fetchFiles(FileFetchEnum fileFetchEnum) { + public List fetchFiles(FileFetcherEnum fileFetcherEnum) { List relevantFiles = new ArrayList<>(); LocalDate today = LocalDate.now(TIME_ZONE); String pathPrefix = AzureBlobHelper.buildDatePathPrefix(today); - if (FileFetchEnum.AUTOMATED == fileFetchEnum) { - pathPrefix += "Automated/"; + if (FileFetcherEnum.ASSERTION == fileFetcherEnum) { + pathPrefix += "Assertion/"; } else { pathPrefix += "GoldenCopy/"; } diff --git a/rs-e2e/src/main/java/gov/hhs/cdc/trustedintermediary/rse2e/external/azure/AzureBlobOrganizer.java b/rs-e2e/src/main/java/gov/hhs/cdc/trustedintermediary/rse2e/external/azure/AzureBlobOrganizer.java index d6481d03f..fb222fedd 100644 --- a/rs-e2e/src/main/java/gov/hhs/cdc/trustedintermediary/rse2e/external/azure/AzureBlobOrganizer.java +++ b/rs-e2e/src/main/java/gov/hhs/cdc/trustedintermediary/rse2e/external/azure/AzureBlobOrganizer.java @@ -15,7 +15,7 @@ public class AzureBlobOrganizer { public static final String GOLDEN_COPY = "GoldenCopy/"; - public static final String AUTOMATED = "Automated/"; + public static final String ASSERTION = "Assertion/"; private final BlobContainerClient blobContainerClient; protected final Logger logger = ApplicationContext.getImplementation(Logger.class); @@ -31,10 +31,10 @@ private void deleteOldBlobs(String testType, ZoneId timeZone) { } } - // Organize blob into folder structure: YEAR/MONTH/DAY/Automated_OR_GoldenCopy/SOURCE_NAME + // Organize blob into folder structure: YEAR/MONTH/DAY/Assertion_OR_GoldenCopy/SOURCE_NAME public void organizeAndCleanupBlobsByDate(int retentionDays, ZoneId timeZone) { deleteOldBlobs(GOLDEN_COPY, timeZone); - deleteOldBlobs(AUTOMATED, timeZone); + deleteOldBlobs(ASSERTION, timeZone); for (BlobItem blobItem : blobContainerClient.listBlobs()) { String sourceName = blobItem.getName(); try { @@ -58,7 +58,7 @@ public void organizeAndCleanupBlobsByDate(int retentionDays, ZoneId timeZone) { continue; } - String testTypeAndSourceName = AUTOMATED + sourceName; + String testTypeAndSourceName = ASSERTION + sourceName; if (sourceBlob.getBlobName().contains("GOLDEN-COPY")) { testTypeAndSourceName = GOLDEN_COPY + sourceName; } diff --git a/rs-e2e/src/main/java/gov/hhs/cdc/trustedintermediary/rse2e/external/localfile/LocalFileFetcher.java b/rs-e2e/src/main/java/gov/hhs/cdc/trustedintermediary/rse2e/external/localfile/LocalFileFetcher.java index ae4f4c8e1..53ea35677 100644 --- a/rs-e2e/src/main/java/gov/hhs/cdc/trustedintermediary/rse2e/external/localfile/LocalFileFetcher.java +++ b/rs-e2e/src/main/java/gov/hhs/cdc/trustedintermediary/rse2e/external/localfile/LocalFileFetcher.java @@ -1,7 +1,7 @@ package gov.hhs.cdc.trustedintermediary.rse2e.external.localfile; -import gov.hhs.cdc.trustedintermediary.rse2e.FileFetchEnum; import gov.hhs.cdc.trustedintermediary.rse2e.FileFetcher; +import gov.hhs.cdc.trustedintermediary.rse2e.FileFetcherEnum; import gov.hhs.cdc.trustedintermediary.rse2e.hl7.HL7FileStream; import java.io.IOException; import java.io.InputStream; @@ -27,9 +27,9 @@ public static FileFetcher getInstance() { } @Override - public List fetchFiles(FileFetchEnum fileFetchEnum) { + public List fetchFiles(FileFetcherEnum fileFetcherEnum) { String rse2ELocalInputFilePath = "../examples/Test/Automated/"; - if (FileFetchEnum.AUTOMATED == fileFetchEnum) { + if (FileFetcherEnum.ASSERTION == fileFetcherEnum) { rse2ELocalInputFilePath += "Assertion/"; } else { rse2ELocalInputFilePath += "GoldenCopy/Expected/"; diff --git a/rs-e2e/src/test/groovy/gov/hhs/cdc/trustedintermediary/rse2e/AutomatedTest.groovy b/rs-e2e/src/test/groovy/gov/hhs/cdc/trustedintermediary/rse2e/AutomatedTest.groovy index 74f641fbf..3e80209a6 100644 --- a/rs-e2e/src/test/groovy/gov/hhs/cdc/trustedintermediary/rse2e/AutomatedTest.groovy +++ b/rs-e2e/src/test/groovy/gov/hhs/cdc/trustedintermediary/rse2e/AutomatedTest.groovy @@ -64,8 +64,8 @@ class AutomatedTest extends Specification { def "test defined assertions on relevant messages"() { given: - azureFiles = azureFileFetcher.fetchFiles(FileFetchEnum.AUTOMATED) - localFiles = localFileFetcher.fetchFiles(FileFetchEnum.AUTOMATED) + azureFiles = azureFileFetcher.fetchFiles(FileFetcherEnum.ASSERTION) + localFiles = localFileFetcher.fetchFiles(FileFetcherEnum.ASSERTION) def rulesToEvaluate = engine.getRules() def matchedFiles = fileMatcher.matchFiles(azureFiles, localFiles) @@ -86,8 +86,8 @@ class AutomatedTest extends Specification { def "test golden copy files on actual files"() { given: - azureFiles = azureFileFetcher.fetchFiles(FileFetchEnum.GOLDEN_COPY) - localFiles = localFileFetcher.fetchFiles(FileFetchEnum.GOLDEN_COPY) + azureFiles = azureFileFetcher.fetchFiles(FileFetcherEnum.GOLDEN_COPY) + localFiles = localFileFetcher.fetchFiles(FileFetcherEnum.GOLDEN_COPY) def matchedFiles = fileMatcher.matchFiles(azureFiles, localFiles) when: