Skip to content

Commit

Permalink
Merge pull request #778 from CDCgov/rename_converter_method
Browse files Browse the repository at this point in the history
Remove `metadata` from Name of `OrderConverter` Method
  • Loading branch information
halprin authored Jan 17, 2024
2 parents 2de2ec6 + 7dd4d80 commit 98a8ab6
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
public interface OrderConverter {
Order<?> convertToOrder(Demographics<?> demographics);

Order<?> convertMetadataToOmlOrder(Order<?> order);
Order<?> convertToOmlOrder(Order<?> order);

Order<?> addContactSectionToPatientResource(Order<?> order);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<Bundle>) order;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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")
}
Expand All @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 98a8ab6

Please sign in to comment.