Tabnine Logo
ResultSeverityEnum
Code IndexAdd Tabnine to your IDE (free)

How to use
ResultSeverityEnum
in
ca.uhn.fhir.validation

Best Java code snippets using ca.uhn.fhir.validation.ResultSeverityEnum (Showing top 20 results out of 315)

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

/**
 * Sets the minimum severity at which an issue detected by the validator will result in a header being added to the
 * response. Default is {@link ResultSeverityEnum#INFORMATION}. Set to <code>null</code> to disable this behaviour.
 * 
 * @see #setResponseHeaderName(String)
 * @see #setResponseHeaderValue(String)
 */
public void setAddResponseHeaderOnSeverity(ResultSeverityEnum theSeverity) {
  myAddResponseIssueHeaderOnSeverity = theSeverity != null ? theSeverity.ordinal() : null;
}
origin: jamesagnew/hapi-fhir

public static ResultSeverityEnum fromCode(String theCode) {
  if (ourValues == null) {
    HashMap<String, ResultSeverityEnum> values = new HashMap<String, ResultSeverityEnum>();
    for (ResultSeverityEnum next : values()) {
      values.put(next.getCode(), next);
    }
    ourValues = Collections.unmodifiableMap(values);
  }
  return ourValues.get(theCode);
}
origin: jamesagnew/hapi-fhir

private void doValidate(IValidationContext<?> theCtx) {
  List<ValidationMessage> messages = validate(theCtx);
  for (ValidationMessage riMessage : messages) {
    SingleValidationMessage hapiMessage = new SingleValidationMessage();
    if (riMessage.getCol() != -1) {
      hapiMessage.setLocationCol(riMessage.getCol());
    }
    if (riMessage.getLine() != -1) {
      hapiMessage.setLocationLine(riMessage.getLine());
    }
    hapiMessage.setLocationString(riMessage.getLocation());
    hapiMessage.setMessage(riMessage.getMessage());
    if (riMessage.getLevel() != null) {
      hapiMessage.setSeverity(ResultSeverityEnum.fromCode(riMessage.getLevel().toCode()));
    }
    theCtx.addValidationMessage(hapiMessage);
  }
}
origin: jamesagnew/hapi-fhir

/**
 * If the validation produces a result with at least the given severity, a header with the name
 * specified by {@link #setResponseOutcomeHeaderName(String)} will be added containing a JSON encoded
 * OperationOutcome resource containing the validation results.
 */
public ResultSeverityEnum getAddResponseOutcomeHeaderOnSeverity() {
  return myAddResponseOutcomeHeaderOnSeverity != null ? ResultSeverityEnum.values()[myAddResponseOutcomeHeaderOnSeverity] : null;
}
origin: jamesagnew/hapi-fhir

@Override
public String toString() {
  ToStringBuilder b = new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE);
  if (myLocationCol != null || myLocationLine != null) {
    b.append("col", myLocationCol);
    b.append("row", myLocationLine);
  }
  if (myLocationString != null) {
    b.append("locationString", myLocationString);
  }
  b.append("message", myMessage);
  if (mySeverity != null) {
    b.append("severity", mySeverity.getCode());
  }
  return b.toString();
}
origin: synthetichealth/synthea

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

private void doValidate(IValidationContext<?> theCtx) {
  List<ValidationMessage> messages = validate(theCtx);
  for (ValidationMessage riMessage : messages) {
    SingleValidationMessage hapiMessage = new SingleValidationMessage();
    if (riMessage.getCol() != -1) {
      hapiMessage.setLocationCol(riMessage.getCol());
    }
    if (riMessage.getLine() != -1) {
      hapiMessage.setLocationLine(riMessage.getLine());
    }
    hapiMessage.setLocationString(riMessage.getLocation());
    hapiMessage.setMessage(riMessage.getMessage());
    if (riMessage.getLevel() != null) {
      hapiMessage.setSeverity(ResultSeverityEnum.fromCode(riMessage.getLevel().toCode()));
    }
    theCtx.addValidationMessage(hapiMessage);
  }
}
origin: ca.uhn.hapi.fhir/hapi-fhir-server

/**
 * If the validation produces a result with at least the given severity, a header with the name
 * specified by {@link #setResponseOutcomeHeaderName(String)} will be added containing a JSON encoded
 * OperationOutcome resource containing the validation results.
 */
public ResultSeverityEnum getAddResponseOutcomeHeaderOnSeverity() {
  return myAddResponseOutcomeHeaderOnSeverity != null ? ResultSeverityEnum.values()[myAddResponseOutcomeHeaderOnSeverity] : null;
}
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: synthetichealth/synthea

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

/**
 * If the validation produces a result with at least the given severity, a header with the name
 * specified by {@link #setResponseOutcomeHeaderName(String)} will be added containing a JSON encoded
 * OperationOutcome resource containing the validation results.
 */
public void setAddResponseOutcomeHeaderOnSeverity(ResultSeverityEnum theAddResponseOutcomeHeaderOnSeverity) {
  myAddResponseOutcomeHeaderOnSeverity = theAddResponseOutcomeHeaderOnSeverity != null ? theAddResponseOutcomeHeaderOnSeverity.ordinal() : null;
}
origin: jamesagnew/hapi-fhir

private void doValidate(IValidationContext<?> theCtx) {
  List<ValidationMessage> messages = validate(theCtx);
  for (ValidationMessage riMessage : messages) {
    SingleValidationMessage hapiMessage = new SingleValidationMessage();
    if (riMessage.getCol() != -1) {
      hapiMessage.setLocationCol(riMessage.getCol());
    }
    if (riMessage.getLine() != -1) {
      hapiMessage.setLocationLine(riMessage.getLine());
    }
    hapiMessage.setLocationString(riMessage.getLocation());
    hapiMessage.setMessage(riMessage.getMessage());
    if (riMessage.getLevel() != null) {
      hapiMessage.setSeverity(ResultSeverityEnum.fromCode(riMessage.getLevel().toCode()));
    }
    theCtx.addValidationMessage(hapiMessage);
  }
}
origin: ca.uhn.hapi.fhir/hapi-fhir-base

public static ResultSeverityEnum fromCode(String theCode) {
  if (ourValues == null) {
    HashMap<String, ResultSeverityEnum> values = new HashMap<String, ResultSeverityEnum>();
    for (ResultSeverityEnum next : values()) {
      values.put(next.getCode(), next);
    }
    ourValues = Collections.unmodifiableMap(values);
  }
  return ourValues.get(theCode);
}
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: ca.uhn.hapi.fhir/hapi-fhir-base

@Override
public String toString() {
  ToStringBuilder b = new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE);
  if (myLocationCol != null || myLocationLine != null) {
    b.append("col", myLocationCol);
    b.append("row", myLocationLine);
  }
  if (myLocationString != null) {
    b.append("locationString", myLocationString);
  }
  b.append("message", myMessage);
  if (mySeverity != null) {
    b.append("severity", mySeverity.getCode());
  }
  return b.toString();
}
origin: synthetichealth/synthea

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

/**
 * Sets the minimum severity at which an issue detected by the validator will fail/reject the request. Default is
 * {@link ResultSeverityEnum#ERROR}. Set to <code>null</code> to disable this behaviour.
 */
public void setFailOnSeverity(ResultSeverityEnum theSeverity) {
  myFailOnSeverity = theSeverity != null ? theSeverity.ordinal() : null;
}
origin: jamesagnew/hapi-fhir

private void doValidate(IValidationContext<?> theCtx) {
  List<ValidationMessage> messages = validate(theCtx);
  for (ValidationMessage riMessage : messages) {
    SingleValidationMessage hapiMessage = new SingleValidationMessage();
    if (riMessage.getCol() != -1) {
      hapiMessage.setLocationCol(riMessage.getCol());
    }
    if (riMessage.getLine() != -1) {
      hapiMessage.setLocationLine(riMessage.getLine());
    }
    hapiMessage.setLocationString(riMessage.getLocation());
    hapiMessage.setMessage(riMessage.getMessage());
    if (riMessage.getLevel() != null) {
      hapiMessage.setSeverity(ResultSeverityEnum.fromCode(riMessage.getLevel().toCode()));
    }
    theCtx.addValidationMessage(hapiMessage);
  }
}
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();
}
ca.uhn.fhir.validationResultSeverityEnum

Most used methods

  • fromCode
  • name
  • ordinal
  • values
  • getCode
  • toString

Popular in Java

  • Finding current android device location
  • getResourceAsStream (ClassLoader)
  • getSharedPreferences (Context)
  • getApplicationContext (Context)
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • JCheckBox (javax.swing)
  • JList (javax.swing)
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
  • CodeWhisperer alternatives
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