本文整理汇总了Java中org.hl7.fhir.dstu3.hapi.validation.DefaultProfileValidationSupport类的典型用法代码示例。如果您正苦于以下问题:Java DefaultProfileValidationSupport类的具体用法?Java DefaultProfileValidationSupport怎么用?Java DefaultProfileValidationSupport使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DefaultProfileValidationSupport类属于org.hl7.fhir.dstu3.hapi.validation包,在下文中一共展示了DefaultProfileValidationSupport类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: main
import org.hl7.fhir.dstu3.hapi.validation.DefaultProfileValidationSupport; //导入依赖的package包/类
public static void main(String[] args) {
// Create an incomplete encounter (status is required)
Encounter enc = new Encounter();
enc.addIdentifier().setSystem("http://acme.org/encNums").setValue("12345");
// Create a new validator
FhirValidator validator = FhirContext.forDstu3().newValidator();
// Cache this object! Supplies structure definitions
DefaultProfileValidationSupport support = new DefaultProfileValidationSupport();
// Create the validator
FhirInstanceValidator module = new FhirInstanceValidator(support);
validator.registerValidatorModule(module);
// Did we succeed?
IParser parser = FhirContext.forDstu3().newXmlParser().setPrettyPrint(true);
System.out.println(parser.encodeResourceToString(validator.validateWithResult(enc).toOperationOutcome()));
}
示例2: validateProfileDstu3
import org.hl7.fhir.dstu3.hapi.validation.DefaultProfileValidationSupport; //导入依赖的package包/类
public void validateProfileDstu3() {
// START SNIPPET: validateFiles
FhirContext ctx = FhirContext.forDstu3();
FhirValidator validator = ctx.newValidator();
// Typically if you are doing profile validation, you want to disable
// the schema/schematron validation since the profile will specify
// all the same rules (and more)
validator.setValidateAgainstStandardSchema(false);
validator.setValidateAgainstStandardSchematron(false);
// FhirInstanceValidator is the validation module that handles
// profile validation. So, create an InstanceValidator module
// and register it to the validator.
FhirInstanceValidator instanceVal = new FhirInstanceValidator();
validator.registerValidatorModule(instanceVal);
// FhirInstanceValidator requires an instance of "IValidationSupport" in
// order to function. This module is used by the validator to actually obtain
// all of the resources it needs in order to perform validation. Specifically,
// the validator uses it to fetch StructureDefinitions, ValueSets, CodeSystems,
// etc, as well as to perform terminology validation.
//
// The implementation used here (ValidationSupportChain) is allows for
// multiple implementations to be used in a chain, where if a specific resource
// is needed the whole chain is tried and the first module which is actually
// able to answer is used. The first entry in the chain that we register is
// the DefaultProfileValidationSupport, which supplies the "built-in" FHIR
// StructureDefinitions and ValueSets
ValidationSupportChain validationSupportChain = new ValidationSupportChain();
validationSupportChain.addValidationSupport(new DefaultProfileValidationSupport());
instanceVal.setValidationSupport(validationSupportChain);
// END SNIPPET: validateFiles
}
示例3: setUp
import org.hl7.fhir.dstu3.hapi.validation.DefaultProfileValidationSupport; //导入依赖的package包/类
@Before
public void setUp() throws IOException {
final String sdString = IOUtils.toString(getClass().getResourceAsStream("/customPatientSd.xml"), StandardCharsets.UTF_8);
final IParser parser = ourCtx.newXmlParser();
sd = parser.parseResource(StructureDefinition.class, sdString);
workerContext = new HapiWorkerContext(ourCtx, new DefaultProfileValidationSupport());
}
示例4: beforeClass
import org.hl7.fhir.dstu3.hapi.validation.DefaultProfileValidationSupport; //导入依赖的package包/类
@BeforeClass
public static void beforeClass() {
ourEngine = new FHIRPathEngine(new HapiWorkerContext(ourCtx, new DefaultProfileValidationSupport()));
}
示例5: beforeClass
import org.hl7.fhir.dstu3.hapi.validation.DefaultProfileValidationSupport; //导入依赖的package包/类
@BeforeClass
public static void beforeClass() {
ourValidationSupport = new DefaultProfileValidationSupport();
}