Question
· Aug 31, 2017

Archive SDA from Post processor

How to Archive SDA from Post processor and save it in txt file at some location.

Discussion (1)0
Log in or sign up to continue

Without more detail on your specific use case, I am going to assume you already have either a standard SDA3 Container Object or you have a typical SDA Container as a Stream

First create a new FileCharacterStream:

  1. Create a new %Stream.FileCharacter Object (i.e. set tFileStream = ##class(%Stream.FileCharacter).%New())
  2. Next set tFileStream.Filename = "<your file name/path>". Ensure Cache has the proper privileges to write to the supplied file path.

If you have a HS.SDA3.Container Object:

  1. Assuming your container object is named, "tSDA", run: set tStatus = tSDA.ToQuickXMLStream(.tFileStream)
  2. Next Run: do tFileStream.%Save()

If you have a SDA3 Stream:

  1. Assuming your stream is named, "tSDAStream", run: do tFileStream.CopyFromAndSave(tSDAStream)

Regards,

Matt Spielman

Product Manager, HealthShare Information Exchange