From 7dd4d804ab847d77e0d58735bbd9fcf4c9e1fd30 Mon Sep 17 00:00:00 2001 From: halprin Date: Tue, 16 Jan 2024 15:49:50 -0700 Subject: [PATCH] Remove metadata from name of OrderConverter method --- .../cdc/trustedintermediary/etor/orders/OrderConverter.java | 2 +- .../trustedintermediary/etor/orders/SendOrderUseCase.java | 2 +- .../external/hapi/HapiOrderConverter.java | 2 +- .../etor/orders/SendOrderUseCaseTest.groovy | 6 +++--- .../external/hapi/HapiOrderConverterTest.groovy | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/etor/src/main/java/gov/hhs/cdc/trustedintermediary/etor/orders/OrderConverter.java b/etor/src/main/java/gov/hhs/cdc/trustedintermediary/etor/orders/OrderConverter.java index 0f754cf38..47cecfcfb 100644 --- a/etor/src/main/java/gov/hhs/cdc/trustedintermediary/etor/orders/OrderConverter.java +++ b/etor/src/main/java/gov/hhs/cdc/trustedintermediary/etor/orders/OrderConverter.java @@ -8,7 +8,7 @@ public interface OrderConverter { Order convertToOrder(Demographics demographics); - Order convertMetadataToOmlOrder(Order order); + Order convertToOmlOrder(Order order); Order addContactSectionToPatientResource(Order order); diff --git a/etor/src/main/java/gov/hhs/cdc/trustedintermediary/etor/orders/SendOrderUseCase.java b/etor/src/main/java/gov/hhs/cdc/trustedintermediary/etor/orders/SendOrderUseCase.java index c713efefd..46e1e0841 100644 --- a/etor/src/main/java/gov/hhs/cdc/trustedintermediary/etor/orders/SendOrderUseCase.java +++ b/etor/src/main/java/gov/hhs/cdc/trustedintermediary/etor/orders/SendOrderUseCase.java @@ -27,7 +27,7 @@ public void convertAndSend(final Order order, String receivedSubmissionId) savePartnerMetadataForReceivedOrder(receivedSubmissionId, order); - var omlOrder = converter.convertMetadataToOmlOrder(order); + var omlOrder = converter.convertToOmlOrder(order); metadata.put(order.getFhirResourceId(), EtorMetadataStep.ORDER_CONVERTED_TO_OML); omlOrder = converter.addContactSectionToPatientResource(omlOrder); diff --git a/etor/src/main/java/gov/hhs/cdc/trustedintermediary/external/hapi/HapiOrderConverter.java b/etor/src/main/java/gov/hhs/cdc/trustedintermediary/external/hapi/HapiOrderConverter.java index dfd8fa0e8..ac3b3cdfa 100644 --- a/etor/src/main/java/gov/hhs/cdc/trustedintermediary/external/hapi/HapiOrderConverter.java +++ b/etor/src/main/java/gov/hhs/cdc/trustedintermediary/external/hapi/HapiOrderConverter.java @@ -94,7 +94,7 @@ public HapiOrder convertToOrder(final Demographics demographics) { } @Override - public Order convertMetadataToOmlOrder(Order order) { + public Order convertToOmlOrder(Order order) { logger.logInfo("Converting order to have OML metadata"); var hapiOrder = (Order) order; diff --git a/etor/src/test/groovy/gov/hhs/cdc/trustedintermediary/etor/orders/SendOrderUseCaseTest.groovy b/etor/src/test/groovy/gov/hhs/cdc/trustedintermediary/etor/orders/SendOrderUseCaseTest.groovy index 2b6f51427..4c99280eb 100644 --- a/etor/src/test/groovy/gov/hhs/cdc/trustedintermediary/etor/orders/SendOrderUseCaseTest.groovy +++ b/etor/src/test/groovy/gov/hhs/cdc/trustedintermediary/etor/orders/SendOrderUseCaseTest.groovy @@ -42,7 +42,7 @@ class SendOrderUseCaseTest extends Specification { sendOrder.convertAndSend(mockOrder, receivedSubmissionId) then: - 1 * mockConverter.convertMetadataToOmlOrder(mockOrder) >> mockOmlOrder + 1 * mockConverter.convertToOmlOrder(mockOrder) >> mockOmlOrder 1 * mockConverter.addContactSectionToPatientResource(mockOmlOrder) >> mockOmlOrder 1 * mockSender.sendOrder(mockOmlOrder) >> Optional.of(sentSubmissionId) 1 * sendOrder.metadata.put(_, EtorMetadataStep.ORDER_CONVERTED_TO_OML) @@ -89,7 +89,7 @@ class SendOrderUseCaseTest extends Specification { then: 1 * mockLogger.logError(_, _) - 1 * mockConverter.convertMetadataToOmlOrder(order) >> omlOrder + 1 * mockConverter.convertToOmlOrder(order) >> omlOrder 1 * mockConverter.addContactSectionToPatientResource(omlOrder) >> omlOrder 1 * mockSender.sendOrder(omlOrder) >> Optional.of("sentId") } @@ -106,7 +106,7 @@ class SendOrderUseCaseTest extends Specification { SendOrderUseCase.getInstance().convertAndSend(order, "receivedId") then: - 1 * mockConverter.convertMetadataToOmlOrder(order) >> omlOrder + 1 * mockConverter.convertToOmlOrder(order) >> omlOrder 1 * mockConverter.addContactSectionToPatientResource(omlOrder) >> omlOrder 1 * mockSender.sendOrder(omlOrder) >> Optional.of("sentId") 1 * mockLogger.logError(_, partnerMetadataException) diff --git a/etor/src/test/groovy/gov/hhs/cdc/trustedintermediary/external/hapi/HapiOrderConverterTest.groovy b/etor/src/test/groovy/gov/hhs/cdc/trustedintermediary/external/hapi/HapiOrderConverterTest.groovy index f499e227d..ca02f473f 100644 --- a/etor/src/test/groovy/gov/hhs/cdc/trustedintermediary/external/hapi/HapiOrderConverterTest.groovy +++ b/etor/src/test/groovy/gov/hhs/cdc/trustedintermediary/external/hapi/HapiOrderConverterTest.groovy @@ -159,7 +159,7 @@ class HapiOrderConverterTest extends Specification { "ORM")))) when: - def convertedOrderBundle = HapiOrderConverter.getInstance().convertMetadataToOmlOrder(mockOrder).getUnderlyingOrder() as Bundle + def convertedOrderBundle = HapiOrderConverter.getInstance().convertToOmlOrder(mockOrder).getUnderlyingOrder() as Bundle then: def convertedMessageHeader = convertedOrderBundle.getEntry().get(1).getResource() as MessageHeader @@ -170,7 +170,7 @@ class HapiOrderConverterTest extends Specification { def "adds the message header to specify OML"() { when: - def convertedOrderBundle = HapiOrderConverter.getInstance().convertMetadataToOmlOrder(mockOrder).getUnderlyingOrder() as Bundle + def convertedOrderBundle = HapiOrderConverter.getInstance().convertToOmlOrder(mockOrder).getUnderlyingOrder() as Bundle then: def convertedMessageHeader = convertedOrderBundle.getEntry().get(1).getResource() as MessageHeader