Stream: implementers
Topic: SchemaBaseValidation R4 Patient Test
vineet gandhi (Feb 28 2019 at 19:54):
Okay..Do we have a unit test doc which contains some test cases for a Patient record json/xml ?
Lloyd McKenzie (Feb 28 2019 at 19:58):
With a purpose of testing what?
We don't have tests that check schema validation because we're pretty confident about how that works.
vineet gandhi (Feb 28 2019 at 20:07):
With a purpose of testing what?
We don't have tests that check schema validation because we're pretty confident about how that works.
Let me clear my requirement first.
I have FHIR patient json coming like below :
https://www.hl7.org/fhir/patient-example-f001-pieter.json.html
Now I wanted to validate the record. So I am using SchemaBaseValidation module which intern uses fhir-single.xsd.
Question :
1. What are some possible rules in xsd? I found two like max length of "Id" can't me more then 64 and Gender can't be any string.
2. Sample java code of using schema validation in java.(Junits can be helpful).
3. We have like 50 threads accessing parallel the below code
FhirValidator validator = context.newValidator();
IValidatorModule module1 = new SchemaBaseValidator(context);
validator.registerValidatorModule(module1);
ValidationResult result = validator.validateWithResult(value);
Is there a way we can improve the throughput?. Currently on average it takes around 900 ms per record which is expensive for our requirement
Lloyd McKenzie (Feb 28 2019 at 20:57):
1. You can read through the schema to see all of the rules, so it's not clear why you're asking for possible rules here
2. There's nothing specific about schema validation to FHIR - you should be able to find sample code for doing schema validation with Java with a Google search or on Stack Overflow. If you want, you can dig into the validator code on the HAPI FHIR reference implementation
3. You may want to write your own thread-safe validator that loads the schema into memory once and then just parses and reads the XML. That said, there's a limit to how fast schema validation can be
Grahame Grieve (Mar 01 2019 at 11:44):
why don't you just use on the normal FHIR validators that is much more effective than the schema validator?
vineet gandhi (Mar 01 2019 at 12:25):
Can u explain more?What is a normal validator.
Eric Haas (Mar 01 2019 at 14:27):
you can start by reading about it here: http://build.fhir.org/validation.html
Lloyd McKenzie (Mar 01 2019 at 18:04):
The "normal validator" may not address his performance issue.
Grahame Grieve (Mar 01 2019 at 18:47):
there's no hint in the sample code for me as to whether we're talking java or C#. But 900ms is about what I'd expect from schema validation
Last updated: Apr 12 2022 at 19:14 UTC