This started out as a learning exercise in XML. The current state of things is, XML files may be created for each segment type (formatted as per installed examples) and when a segment is selected in the viewer the associated segment and field details will be dislayed.
The file name consists of the segment type followed by either the keyword 'base' or an HL7 event-code, e.g. PID_base.xml or PID_I12.xml (for a REF^I12 message type). If a schema file is found for the current message event type and the selected segment, then it will be used, otherwise the program looks for the segment type followed by 'base'. TODO modify this to identify message versions and load the best matching documentation by version.
There is obviously more work to be done in this area, and I may build in a documentation editor to make this easier to maintain. It could also be useful to develop some method for importing and exporting the schema definitions, to help people share the documentation they have produced.