Forum - XML Standard

 View Only

Example parsing of a patient record

  • 1.  Example parsing of a patient record

    Posted 05-06-2021 03:02 PM
    Benjamin May

    Good morning all!

    Does anyone have an example of just using PatientXMLReader to read out all the fields? Is there javadoc available anywhere for the full package? Thanks in advance!

    Fabian Depry

    Hello,

    There is no javadoc available for the Java NAACCR XML library, but most of the public methods in that project do have good comments.

    The best example to use the PatientXmlReader is its unit test:
    https://github.com/imsweb/naaccr-xml/blob/master/src/test/java/com/imsweb/naaccrxml/PatientXmlReaderTest.java

    The main class (NaaccrXmlUtils) also has methods that translate flat to XML and XML to flat; those are also good example of using the PatientXmlReader to read all the available fields in a data file (See NaaccrXmlUtils.xmlToFlat() for example):

    https://github.com/imsweb/naaccr-xml/blob/master/src/main/java/com/imsweb/naaccrxml/NaaccrXmlUtils.java

    I hope that helps.