Skip to content

Commit

Permalink
changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jorg3lopez committed Nov 3, 2023
1 parent 889bab4 commit 28c66f2
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public void sendOrder(final Order<?> order) throws UnableToSendOrderException {
logger.logInfo("Sending the order to the hard drive at {}", fileLocation.toAbsolutePath());

try {
metaData.put(order.getFhirResourceId(), MetaDataStep.RECEIVED_FROM_REPORT_STREAM);
metaData.put(order.getFhirResourceId(), MetaDataStep.SENT_TO_REPORT_STREAM);
String serialized = fhir.encodeResourceToJson(order.getUnderlyingOrder());
Files.writeString(fileLocation, serialized, StandardCharsets.UTF_8);
} catch (Exception e) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package gov.hhs.cdc.trustedintermediary

import gov.hhs.cdc.trustedintermediary.etor.orders.Order
import org.hl7.fhir.r4.model.Bundle

/**
* A mock implementation of the {@link Order} interface that is easy to use in tests.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ private PrivateMetricMetaData() {}
@Override
public void put(String bundleId, MetaDataStep step) {
MetaDataEntry entry = extractMetricsFromBundle(bundleId, step);
metadataMap.put("BundleId", entry.bundleId);
metadataMap.put("Entry Time", entry.entryTime);
metadataMap.put("Entry Step", entry.entryStep);
metadataMap.put("BundleId", entry.bundleId());
metadataMap.put("Entry Time", entry.entryTime());
metadataMap.put("Entry Step", entry.entryStep());
logger.logMap("MetaData Event Occured:", metadataMap);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,4 @@ public static LoggingEventBuilder addFatalMarker(LoggingEventBuilder loggingBuil
Marker fatal = MarkerFactory.getMarker("FATAL");
return loggingBuilder.addMarker(fatal);
}

public static LoggingEventBuilder buildLogBuilder(Logger logger, Level level) {
return logger.atLevel(level).setMessage("");
}
}
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
package gov.hhs.cdc.trustedintermediary.metadata;

import java.util.Date;
import java.time.Instant;

/** An instance of a metadata event to be used for internal troubleshooting of messages */
public class MetaDataEntry {
public record MetaDataEntry(String bundleId, MetaDataStep entryStep, Instant entryTime) {

public MetaDataStep entryStep;
public Date entryTime;
public String bundleId;

public MetaDataEntry(String bundleId, MetaDataStep step) {
this.entryTime = new Date();
this.bundleId = bundleId;
this.entryStep = step;
public MetaDataEntry(String bundleId, MetaDataStep entryStep) {
this(bundleId, entryStep, Instant.now());
}
}

0 comments on commit 28c66f2

Please sign in to comment.