Stream: implementers
Topic: How to generate xsd and sch schema from structureDefinition?
Andersson Paz (Apr 09 2018 at 16:31):
Hi, I have a tool in php to generate class from xsd roesources schemas and trying to generate structures definition (profiling), but its only for validataion right? I not having validation tool in php, not yet. I will like generate class on fly from my profile, but need this in xsd-sch schema.
Somebody can help me? Thanks!
Lloyd McKenzie (Apr 09 2018 at 20:59):
To clarify - you're asking if there are xsds and schematron files for profiles?
Andersson Paz (Apr 09 2018 at 21:27):
No, I am searching a tool to generate xsds and schematron file from a profile. Thanks!
Lloyd McKenzie (Apr 09 2018 at 22:34):
The IGPublisher tool will produce schematron files. We haven't found trying to generate XSDs very useful because most profiles define different constraints on different repetitions and XSDs can't handle that.
Andersson Paz (Apr 10 2018 at 00:51):
ohhh thanks very much, I wa trying to execute the IGPublisher but my default jre was 1.7 and not worked a few weeks ago
Andersson Paz (Apr 10 2018 at 00:53):
Do you have an example? I am trying with terminology Server at http://tx.fhir.org/r3 and default r4 but not work
Andersson Paz (Apr 10 2018 at 00:57):
java -jar org.hl7.fhir.igpublisher.2.jar -source patient.json -destination ./ -tx http://tx.fhir.org/r3
Andersson Paz (Apr 10 2018 at 01:09):
patient.json is the default profile in fhir for patient https://www.hl7.org/fhir/patient.profile.json
Andersson Paz (Apr 10 2018 at 01:11):
I'm doing something definitely very wrong!
Andersson Paz (Apr 10 2018 at 01:12):
Sorry!
Lloyd McKenzie (Apr 10 2018 at 02:29):
The IGPublisher doesn't convert a single profile - you need to set up an implementation guide project. Alternatively, you could take a look at the code and figure out how to invoke the schematron generator alone.
Lloyd McKenzie (Apr 10 2018 at 02:29):
IGPublisher documentation is here: http://wiki.hl7.org/index.php?title=IG_Publisher_Documentation
(and discussion of issues is on the #IG creation stream)
Grahame Grieve (Apr 10 2018 at 07:28):
it should be possible to generate schematrons and schemas for a single profile. It's just a matter of packaging up the logic, which all exists.
Grahame Grieve (Apr 10 2018 at 07:29):
btw, with regard to producing schemas, this is possible, though it degrades on slices, as Lloyd points out. But it can still rule out elements that are never used in any slice
Lloyd McKenzie (Apr 10 2018 at 13:33):
You only want to rule out elements that are actively prohibited by the profile - which most profiles shouldn't do. (Prohibiting ignorable elements significantly raises costs for other systems to integrate.)
Andersson Paz (Apr 10 2018 at 18:41):
I have it! thanks! I'll get to work!
Andersson Paz (Apr 11 2018 at 02:40):
waoo is a geat tool! too complex! I managed to execute an example recently.
Andersson Paz (Apr 11 2018 at 02:51):
But it does not generate the xsd only sch ... I will try to validate the resources with the structuredefinition class that I have in php... Thank you very much!
Last updated: Apr 12 2022 at 19:14 UTC