Java Code Examples for ca.uhn.fhir.context.FhirContext#getValidationSupport()

The following examples show how to use ca.uhn.fhir.context.FhirContext#getValidationSupport() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: StructureDefinitions.java    From bunsen with Apache License 2.0 4 votes vote down vote up
/**
 * Creates a new instance with the given context.
 *
 * @param context the FHIR context.
 */
public StructureDefinitions(FhirContext context) {

  this.context = context;
  this.validationSupport = context.getValidationSupport();
}
 
Example 2
Source File: UsCoreStu3ProfileProvider.java    From bunsen with Apache License 2.0 4 votes vote down vote up
@Override
public void loadStructureDefinitions(FhirContext context) {

  IContextValidationSupport defaultSupport = context.getValidationSupport();

  PrePopulatedValidationSupport support = new PrePopulatedValidationSupport();

  List<StructureDefinition> defaultDefinitions =
      defaultSupport.fetchAllStructureDefinitions(context);

  for (StructureDefinition definition:  defaultDefinitions) {

    support.addStructureDefinition(definition);

  }

  addUsCoreDefinitions(support, context);

  context.setValidationSupport(support);
}
 
Example 3
Source File: BunsenTestStu3ProfileProvider.java    From bunsen with Apache License 2.0 4 votes vote down vote up
@Override
public void loadStructureDefinitions(FhirContext context) {

  IContextValidationSupport defaultSupport = context.getValidationSupport();

  PrePopulatedValidationSupport support = new PrePopulatedValidationSupport();

  List<StructureDefinition> defaultDefinitions =
      defaultSupport.fetchAllStructureDefinitions(context);

  for (StructureDefinition definition : defaultDefinitions) {

    support.addStructureDefinition(definition);

  }

  addBunsenTestStu3ProfileDefinitions(support, context);

  context.setValidationSupport(support);
}