Wiki

Clone wiki

itk-payloads / endoflifecare / EOLCParsing

Parsing an End of Life Care Document

Firstly, you will need to download the latest itk-payloads.jar file, and put it in your classpath.

Now, you can take an XML end of life care document, and turn it into a set of java objects. First, create the overall ClinicalDocument object that you want to populate with data from the XML:

 
import uk.nhs.interoperability.payloads.endoflifecarev1.*;
public class EndOfLifeCareParseTest {
	public static void main(String[] args) {
		ClinicalDocument doc = new ClinicalDocument();

Call the parse method, passing in your xml document:

		doc.parse(xml);

You can now call the relevant getters to get the values from the document:

		String documentID = document.getDocumentId();
		Date dateOfBirth = document.getPatient().getBirthTime().getDate();

Back

Updated