diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/HTMLClientLogger.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/HTMLClientLogger.java index a6d1c2367..88cf249d8 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/HTMLClientLogger.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/HTMLClientLogger.java @@ -57,11 +57,11 @@ public class HTMLClientLogger extends BaseLogger implements ToolingClientLogger @Override public void logRequest(String method, String url, List headers, byte[] body) { + if (DEBUG) { + System.out.println(" txlog req: " +method+" "+url+" "+present(body)); + } if (file == null) return; - if (DEBUG) { - System.out.println("tx: " +method+" "+url+" "+present(body)); - } String id = nextId(); file.println("
"); file.println("

#"+id+"

"); @@ -81,11 +81,11 @@ public class HTMLClientLogger extends BaseLogger implements ToolingClientLogger @Override public void logResponse(String outcome, List headers, byte[] body) { + if (DEBUG) { + System.out.println(" txlog resp: " +outcome+" "+present(body)); + } if (file == null) return; - if (DEBUG) { - System.out.println("tx: " +outcome+" "+present(body)); - } file.println("
");
     file.println(outcome);
     for (String s : headers)  
@@ -106,8 +106,8 @@ public class HTMLClientLogger extends BaseLogger implements ToolingClientLogger
     }
     String cnt = new String(body);
     cnt = cnt.replace("\n", " ").replace("\r", "");
-    if (cnt.length() > 400) {
-      return cnt.substring(0, 398)+"...";
+    if (cnt.length() > 800) {
+      return cnt.substring(0, 798)+"...";
     } else {
       return cnt;
     }
diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/TerminologyCache.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/TerminologyCache.java
index ac8b0a6b4..529204720 100644
--- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/TerminologyCache.java
+++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/context/TerminologyCache.java
@@ -285,6 +285,9 @@ public class TerminologyCache {
   }
 
   public ValidationResult getValidation(CacheToken cacheToken) {
+    if (cacheToken.key == null) {
+      return null;
+    }
     synchronized (lock) {
       NamedCache nc = getNamedCache(cacheToken);
       CacheEntry e = nc.map.get(cacheToken.key);
@@ -296,14 +299,16 @@ public class TerminologyCache {
   }
 
   public void cacheValidation(CacheToken cacheToken, ValidationResult res, boolean persistent) {
-    synchronized (lock) {      
-      NamedCache nc = getNamedCache(cacheToken);
-      CacheEntry e = new CacheEntry();
-      e.request = cacheToken.request;
-      e.persistent = persistent;
-      e.v = res;
-      store(cacheToken, persistent, nc, e);
-    }    
+    if (cacheToken.key != null) {
+      synchronized (lock) {      
+        NamedCache nc = getNamedCache(cacheToken);
+        CacheEntry e = new CacheEntry();
+        e.request = cacheToken.request;
+        e.persistent = persistent;
+        e.v = res;
+        store(cacheToken, persistent, nc, e);
+      }    
+    }
   }
 
   
diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/client/FHIRToolingClient.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/client/FHIRToolingClient.java
index aef519a22..e20c63b3d 100644
--- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/client/FHIRToolingClient.java
+++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/client/FHIRToolingClient.java
@@ -266,11 +266,15 @@ public class FHIRToolingClient {
         if (p.getValue() instanceof PrimitiveType)
           ps += p.getName() + "=" + Utilities.encodeUri(((PrimitiveType) p.getValue()).asStringValue()) + "&";
     ResourceRequest result;
+    URI url = resourceAddress.resolveOperationURLFromClass(resourceClass, name, ps);
     if (complex) {
-      result = client.issuePostRequest(resourceAddress.resolveOperationURLFromClass(resourceClass, name, ps), ByteUtils.resourceToByteArray(params, false, isJson(getPreferredResourceFormat())), getPreferredResourceFormat(),
+      byte[] body = ByteUtils.resourceToByteArray(params, false, isJson(getPreferredResourceFormat()));
+      client.getLogger().logRequest("POST", url.toString(), null, body);
+      result = client.issuePostRequest(url, body, getPreferredResourceFormat(),
           "POST " + resourceClass.getName() + "/$" + name, TIMEOUT_OPERATION_LONG);
     } else {
-      result = client.issueGetResourceRequest(resourceAddress.resolveOperationURLFromClass(resourceClass, name, ps), getPreferredResourceFormat(), "GET " + resourceClass.getName() + "/$" + name, TIMEOUT_OPERATION_LONG);
+      client.getLogger().logRequest("GET", url.toString(), null, null);
+      result = client.issueGetResourceRequest(url, getPreferredResourceFormat(), "GET " + resourceClass.getName() + "/$" + name, TIMEOUT_OPERATION_LONG);
     }
     if (result.isUnsuccessfulRequest()) {
       throw new EFhirClientException("Server returned error code " + result.getHttpStatus(), (OperationOutcome) result.getPayload());
diff --git a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/BaseValidator.java b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/BaseValidator.java
index 798a47d7c..72c442f39 100644
--- a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/BaseValidator.java
+++ b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/BaseValidator.java
@@ -734,7 +734,7 @@ public class BaseValidator {
           fr = ValueSetUtilities.generateImplicitValueSet(reference);
         } 
        
-        timeTracker.tx(t);
+        timeTracker.tx(t, "vs "+uri);
         return fr;
       }
     } else
diff --git a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/TimeTracker.java b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/TimeTracker.java
index cb33273e4..53c0f0a4d 100644
--- a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/TimeTracker.java
+++ b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/TimeTracker.java
@@ -31,7 +31,9 @@ public class TimeTracker {
     overall = overall + (System.nanoTime() - start);
   }
   
-  public void tx(long start) {
+  public void tx(long start, String s) {
+    long ms = (System.nanoTime() - start) / 1000000;
+//    System.out.println("tx: "+ms+" "+s);
     txTime = txTime + (System.nanoTime() - start);
   }
   
diff --git a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/type/QuestionnaireValidator.java b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/type/QuestionnaireValidator.java
index 308775525..1f4a42917 100644
--- a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/type/QuestionnaireValidator.java
+++ b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/type/QuestionnaireValidator.java
@@ -524,7 +524,7 @@ public class QuestionnaireValidator extends BaseValidator {
 
         long t = System.nanoTime();
         ValidationResult res = context.validateCode(new ValidationOptions(stack.getWorkingLang()), c, vs);
-        timeTracker.tx(t);
+        timeTracker.tx(t, "vc "+c.getSystem()+"#"+c.getCode()+" '"+c.getDisplay()+"'");
         if (!res.isOk()) {
           txRule(errors, res.getTxLink(), IssueType.CODEINVALID, value.line(), value.col(), stack.getLiteralPath(), false, I18nConstants.QUESTIONNAIRE_QR_ITEM_BADOPTION, c.getSystem(), c.getCode());
         } else if (res.getSeverity() != null) {