@Override
 public MessageValidationResult validate(TestContext testContext, MessageValidationCommand command)
     throws MessageValidationException {
   try {
     if (testContext instanceof HL7V2TestContext) {
       HL7V2TestContext v2TestContext = (HL7V2TestContext) testContext;
       String title = command.getName();
       String contextType = command.getContextType();
       String message = getMessageContent(command);
       String conformanceProfielId = v2TestContext.getConformanceProfile().getSourceId();
       String integrationProfileXml =
           v2TestContext.getConformanceProfile().getIntegrationProfile().getXml();
       String valueSets = v2TestContext.getVocabularyLibrary().getXml();
       String c1 = v2TestContext.getConstraints().getXml();
       String c2 =
           v2TestContext.getAddditionalConstraints() != null
               ? v2TestContext.getAddditionalConstraints().getXml()
               : null;
       InputStream c1Stream = c1 != null ? IOUtils.toInputStream(c1) : null;
       InputStream c2Stream = c2 != null ? IOUtils.toInputStream(c2) : null;
       List<InputStream> cStreams = new ArrayList<InputStream>();
       if (c1Stream != null) cStreams.add(c1Stream);
       if (c2Stream != null) cStreams.add(c2Stream);
       ConformanceContext c = getConformanceContext(cStreams);
       ValueSetLibrary vsLib =
           valueSets != null ? getValueSetLibrary(IOUtils.toInputStream(valueSets)) : null;
       ValidationProxy vp = new ValidationProxy(title, "NIST", "1.0");
       EnhancedReport report =
           vp.validate(
               message,
               integrationProfileXml,
               c,
               vsLib,
               conformanceProfielId,
               Context.valueOf(contextType));
       return new MessageValidationResult(
           report.to("json").toString(), report.render("iz-report", null));
     } else {
       throw new MessageValidationException(
           "Invalid Context Provided. Expected Context is HL7V2TestContext but found "
               + testContext.getClass().getSimpleName());
     }
   } catch (RuntimeException e) {
     throw new MessageValidationException(e);
   } catch (Exception e) {
     throw new MessageValidationException(e);
   }
 }
 public static String getMessageContent(MessageValidationCommand command) throws MessageException {
   String message = command.getContent();
   if (message == null) {
     throw new MessageException("No message provided");
   }
   return message;
 }