...
/// <summary>
/// Write all data to one Nhax file.
/// </summary>
/// <param name="fullPath">Full path to Nhax file</param>
/// <param name="password">Password to access the file</param>
/// <param name="nhaxFileCreatedCallback">Function called when Nhax file is written. The function is called with the name of the file that is written. Can be set to null.</param>
/// <param name="overwriteExistingFiles">True existing files will be overwritten. If false an error will be reported if file exists.</param>
/// <param name="compressData">If true data are compressed</param>
public NhaxWriter(string fullPath, string password, NhaxFileCreatedCallback nhaxFileCreatedCallback = null, bool overwriteExistingFiles = false, bool compressData = true)
/// <summary>
/// NhaxWriter constructor that writes data to one or more Nhax files.
/// If more than one Nhax file are created the file will contain a Misc section containing al Misc data provided. The user section will only contain users that are referenced by patients or actions.
/// </summary>
/// <param name="path">Path where the files is stored</param>
/// <param name="filePrefix">The prefix of the Nhax file. The file name is "filePrefix-dddddd" where d is digit e.g. "file-000001", "file-000002"</param>
/// <param name="password">Password to access the file</param>
/// <param name="nhaxFileCreatedCallback">Function called when Nhax file is written. The function is called with the name of the file that is written. Can be set to null.</param>
/// <param name="overwriteExistingFiles">True existing files will be overwritten. If false an error will be reported if file exists.</param>
/// <param name="compressData">If true data are compressed</param>
/// <param name="maxFileSize">Max size of created file. When this size is reached a new Nhax file is created and data written to this file.</param>
/// <param name="maxPatients">Max patients written to file. When this size is reached new Nhax file is created and data written to this file.</param>
public NhaxWriter(string path, string filePrefix, string password, NhaxFileCreatedCallback nhaxFileCreatedCallback = null, bool overwriteExistingFiles = false, bool compressData = true, long maxFileSize = ConstMaxFileSize, int maxPatients=ConstMaxPatients)
When the NhaxWriter instance has been created WriteUsers and WriteMiscData must be called in order to add users and add Misc data to the Nhax file. These functions must be called before the WritePatient is called. Each call of WritePatient will add a patient to the Nhax file.
...
/// <summary>
/// Initializing Nhax file reader
/// </summary>
/// <param name="password">Password if Nhax file is encrypted</param>
public ValidateResult Initialize(string filePath, string password)
/// <summary>
/// Initializing Nhax stream reader
/// </summary>
/// <param name="inStream">Stream that contains Nhax formatted data</param>
/// <param name="password">Password if Nhax data is encrypted</param>
/// <returns></returns>
public ValidateResult Initialize(Stream inStream, string password)
Be aware that the Nhax reader implements the idisposable interface. It is important to called the dispose function.
...