congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
SingleValidationMessage.getSeverity
Code IndexAdd Tabnine to your IDE (free)

How to use
getSeverity
method
in
ca.uhn.fhir.validation.SingleValidationMessage

Best Java code snippets using ca.uhn.fhir.validation.SingleValidationMessage.getSeverity (Showing top 18 results out of 315)

origin: jamesagnew/hapi-fhir

public ValidationResult(FhirContext theCtx, List<SingleValidationMessage> theMessages) {
  boolean successful = true;
  myCtx = theCtx;
  myMessages = theMessages;
  for (SingleValidationMessage next : myMessages) {
    next.getSeverity();
    if (next.getSeverity() == null || next.getSeverity().ordinal() > ResultSeverityEnum.WARNING.ordinal()) {
      successful = false;
    }
  }
  myIsSuccessful = successful;
}
origin: jamesagnew/hapi-fhir

private String toDescription() {
  StringBuilder b = new StringBuilder(100);
  if (myMessages.size() > 0) {
    if (myMessages.get(0).getSeverity() != null) {
      b.append(myMessages.get(0).getSeverity().name());
      b.append(" - ");
    }
    b.append(myMessages.get(0).getMessage());
    b.append(" - ");
    b.append(myMessages.get(0).getLocationString());
  } else {
    b.append("No issues");
  }
  return b.toString();
}
origin: jamesagnew/hapi-fhir

@Override
public String lookup(String theKey) {
  if ("line".equals(theKey)) {
    return toString(myMessage.getLocationLine());
  }
  if ("col".equals(theKey)) {
    return toString(myMessage.getLocationCol());
  }
  if ("message".equals(theKey)) {
    return toString(myMessage.getMessage());
  }
  if ("location".equals(theKey)) {
    return toString(myMessage.getLocationString());
  }
  if ("severity".equals(theKey)) {
    return myMessage.getSeverity() != null ? myMessage.getSeverity().name() : null;
  }
  return "";
}
origin: jamesagnew/hapi-fhir

/**
 * Populate an operation outcome with the results of the validation 
 */
public void populateOperationOutcome(IBaseOperationOutcome theOperationOutcome) {
  for (SingleValidationMessage next : myMessages) {
    String location;
    if (isNotBlank(next.getLocationString())) {
      location = next.getLocationString();
    } else if (next.getLocationLine() != null || next.getLocationCol() != null) {
      location = "Line[" + next.getLocationLine() + "] Col[" + next.getLocationCol() + "]";
    } else {
      location = null;
    }
    String severity = next.getSeverity() != null ? next.getSeverity().getCode() : null;
    OperationOutcomeUtil.addIssue(myCtx, theOperationOutcome, severity, next.getMessage(), location, Constants.OO_INFOSTATUS_PROCESSING);
  }
  if (myMessages.isEmpty()) {
    String message = myCtx.getLocalizer().getMessage(ValidationResult.class, "noIssuesDetected");
    OperationOutcomeUtil.addIssue(myCtx, theOperationOutcome, "information", message, null, "informational");
  }
}
origin: jamesagnew/hapi-fhir

int leftWidth = leftString.length();
b.append(ansi().fg(Color.GREEN)).append(leftString);
if (next.getSeverity() != null) {
  b.append(next.getSeverity()).append(ansi().fg(Color.WHITE)).append(" - ");
origin: jamesagnew/hapi-fhir

System.out.println("Message:");
System.out.println(" * Location: " + next.getLocationString());
System.out.println(" * Severity: " + next.getSeverity());
System.out.println(" * Message : " + next.getMessage());
origin: jamesagnew/hapi-fhir

boolean found = false;
for (SingleValidationMessage next : validationResult.getMessages()) {
  if (next.getSeverity().ordinal() >= myAddResponseIssueHeaderOnSeverity) {
    addResponseIssueHeader(theRequestDetails, next);
    found = true;
  if (next.getSeverity().ordinal() >= myFailOnSeverity) {
    postProcessResultOnFailure(theRequestDetails, validationResult);
    fail(theRequestDetails, validationResult);
IBaseOperationOutcome outcome = null;
for (SingleValidationMessage next : validationResult.getMessages()) {
  if (next.getSeverity().ordinal() >= myAddResponseOutcomeHeaderOnSeverity) {
    outcome = validationResult.toOperationOutcome();
    break;
origin: jamesagnew/hapi-fhir

System.out.println(" Next issue " + next.getSeverity() + " - " + next.getLocationString() + " - " + next.getMessage());
origin: ca.uhn.hapi.fhir/hapi-fhir-base

public ValidationResult(FhirContext theCtx, List<SingleValidationMessage> theMessages) {
  boolean successful = true;
  myCtx = theCtx;
  myMessages = theMessages;
  for (SingleValidationMessage next : myMessages) {
    next.getSeverity();
    if (next.getSeverity() == null || next.getSeverity().ordinal() > ResultSeverityEnum.WARNING.ordinal()) {
      successful = false;
    }
  }
  myIsSuccessful = successful;
}
origin: ca.uhn.hapi.fhir/hapi-fhir-base

private String toDescription() {
  StringBuilder b = new StringBuilder(100);
  if (myMessages.size() > 0) {
    if (myMessages.get(0).getSeverity() != null) {
      b.append(myMessages.get(0).getSeverity().name());
      b.append(" - ");
    }
    b.append(myMessages.get(0).getMessage());
    b.append(" - ");
    b.append(myMessages.get(0).getLocationString());
  } else {
    b.append("No issues");
  }
  return b.toString();
}
origin: ca.uhn.hapi.fhir/hapi-fhir-server

@Override
public String lookup(String theKey) {
  if ("line".equals(theKey)) {
    return toString(myMessage.getLocationLine());
  }
  if ("col".equals(theKey)) {
    return toString(myMessage.getLocationCol());
  }
  if ("message".equals(theKey)) {
    return toString(myMessage.getMessage());
  }
  if ("location".equals(theKey)) {
    return toString(myMessage.getLocationString());
  }
  if ("severity".equals(theKey)) {
    return myMessage.getSeverity() != null ? myMessage.getSeverity().name() : null;
  }
  return "";
}
origin: ca.uhn.hapi.fhir/hapi-fhir-base

/**
 * Populate an operation outcome with the results of the validation 
 */
public void populateOperationOutcome(IBaseOperationOutcome theOperationOutcome) {
  for (SingleValidationMessage next : myMessages) {
    String location;
    if (isNotBlank(next.getLocationString())) {
      location = next.getLocationString();
    } else if (next.getLocationLine() != null || next.getLocationCol() != null) {
      location = "Line[" + next.getLocationLine() + "] Col[" + next.getLocationCol() + "]";
    } else {
      location = null;
    }
    String severity = next.getSeverity() != null ? next.getSeverity().getCode() : null;
    OperationOutcomeUtil.addIssue(myCtx, theOperationOutcome, severity, next.getMessage(), location, Constants.OO_INFOSTATUS_PROCESSING);
  }
  if (myMessages.isEmpty()) {
    String message = myCtx.getLocalizer().getMessage(ValidationResult.class, "noIssuesDetected");
    OperationOutcomeUtil.addIssue(myCtx, theOperationOutcome, "information", message, null, "informational");
  }
}
origin: synthetichealth/synthea

if (result.isSuccessful() == false) {
 for (SingleValidationMessage message : result.getMessages()) {
  System.out.println(message.getSeverity().toString() + ": " + message.getMessage());
origin: synthetichealth/synthea

if (result.isSuccessful() == false) {
 for (SingleValidationMessage message : result.getMessages()) {
  System.out.println(message.getSeverity().toString() + ": " + message.getMessage());
origin: synthetichealth/synthea

if (result.isSuccessful() == false) {
 for (SingleValidationMessage message : result.getMessages()) {
  System.out.println(message.getSeverity().toString() + ": " + message.getMessage());
origin: ca.uhn.hapi.fhir/hapi-fhir-server

boolean found = false;
for (SingleValidationMessage next : validationResult.getMessages()) {
  if (next.getSeverity().ordinal() >= myAddResponseIssueHeaderOnSeverity) {
    addResponseIssueHeader(theRequestDetails, next);
    found = true;
  if (next.getSeverity().ordinal() >= myFailOnSeverity) {
    postProcessResultOnFailure(theRequestDetails, validationResult);
    fail(theRequestDetails, validationResult);
IBaseOperationOutcome outcome = null;
for (SingleValidationMessage next : validationResult.getMessages()) {
  if (next.getSeverity().ordinal() >= myAddResponseOutcomeHeaderOnSeverity) {
    outcome = validationResult.toOperationOutcome();
    break;
origin: synthetichealth/synthea

 /**
  * Runs validation on a given resource, logs the results, and returns the response.
  * @param theResource the resource to be validated
  * @return ValidationResult
  */
 public ValidationResult validate(IBaseResource theResource) {
  ValidationResult result = validator.validateWithResult(theResource);
  // Do we have any errors or fatal errors?
  // Show the issues
  for (SingleValidationMessage next : result.getMessages()) {
   switch (next.getSeverity()) {
    case ERROR:
     logger.error(next.getLocationString() + " - " + next.getMessage());
     break;
    case INFORMATION:
     logger.info(next.getLocationString() + " - " + next.getMessage());
     break;
    case WARNING:
     logger.warn(next.getLocationString() + " - " + next.getMessage());
     break;
    case FATAL:
     logger.error(next.getLocationString() + " - " + next.getMessage());
     break;
    default:
     logger.debug(next.getLocationString() + " - " + next.getMessage());
   }
  }
  return result;
 }
}
origin: synthetichealth/synthea

if (message.getSeverity() == ResultSeverityEnum.ERROR) {
 if (!message.getMessage().contains(
   "Element 'ExplanationOfBenefit.id': minimum required = 1, but only found 0")) {
  System.out.println(message.getSeverity() + ": " + message.getMessage());
  Assert.fail(message.getSeverity() + ": " + message.getMessage());
ca.uhn.fhir.validationSingleValidationMessagegetSeverity

Popular methods of SingleValidationMessage

  • getLocationString
  • getMessage
  • <init>
  • setLocationCol
  • setLocationLine
  • setLocationString
  • setMessage
  • setSeverity
  • getLocationCol
  • getLocationLine
  • toString
  • toString

Popular in Java

  • Parsing JSON documents to java classes using gson
  • addToBackStack (FragmentTransaction)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • getSystemService (Context)
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • Graphics2D (java.awt)
    This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
  • Point (java.awt)
    A point representing a location in (x,y) coordinate space, specified in integer precision.
  • FileInputStream (java.io)
    An input stream that reads bytes from a file. File file = ...finally if (in != null) in.clos
  • TreeSet (java.util)
    TreeSet is an implementation of SortedSet. All optional operations (adding and removing) are support
  • Option (scala)
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now