Varian-Code-Samples
Varian-Code-Samples copied to clipboard
Importing Patient / PlanSetup from XML
I would like to write unit tests for my scripts and need a way to load Patient and PlanSetup from a local file.
I came across these two wiki pages on exporting ESAPI objects to XML: https://github.com/VarianAPIs/Varian-Code-Samples/wiki/Code-Sample---Patient-XML https://github.com/VarianAPIs/Varian-Code-Samples/wiki/Code-Sample---Plan-XML
Before I found these wiki pages, I wrote something similar using XmlSerializer, which is also working fine.
I am running into problems however trying to deserialize the XML files back to a Patient / PlanSetup, because the ReadXml method is not implemented for these classes. Do you have tips on how to do this? We are using ESAPI version 16.1.4.4.