C2025-024 Electronic Procedures Phase 2 - XML Export

Multi-Unit RO Resolution
This commit is contained in:
2025-07-23 15:26:45 -04:00
parent ecb9a805e5
commit 20c31153de
2 changed files with 125 additions and 24 deletions

View File

@@ -17,31 +17,48 @@ namespace VEPROMS
#pragma warning restore S101 // Types should be named in PascalCase
{
private readonly AnnotationTypeInfo _AnnotationType;
private readonly int _UnitIndex;
private readonly string multiseparator = ",";
private static Regex _ROAccPageTokenPattern = new Regex("[<][^<>-]+-[^<>]+[>]");
public dlgExportImportEP(string mode, FolderInfo folderInfo, frmVEPROMS myFrmVEPROMS, int annotationTypeId, int unitIndex) : base(mode, folderInfo, myFrmVEPROMS, (E_UCFImportOptions) 0)
public dlgExportImportEP(string mode, FolderInfo folderInfo, frmVEPROMS myFrmVEPROMS, int annotationTypeId, int unitIndex) : base(mode, folderInfo, myFrmVEPROMS, (E_UCFImportOptions)0)
{
_AnnotationType = AnnotationTypeInfo.Get(annotationTypeId);
_UnitIndex = unitIndex;
_ExportBothConvertedandNot = true;
DocReplace = new Dictionary<int, byte[]>();
FormClosed += OnClose;
Text = $"{mode} Electronic Procedure ({_AnnotationType.Name}) Dialog for {folderInfo.Name}";
}
_AnnotationType = AnnotationTypeInfo.Get(annotationTypeId);
_UnitIndex = unitIndex;
_ExportBothConvertedandNot = true;
DocReplace = new Dictionary<int, byte[]>();
FormClosed += OnClose;
Text = $"{mode} Electronic Procedure ({_AnnotationType.Name}) Dialog for {folderInfo.Name}";
public dlgExportImportEP(string mode, DocVersionInfo docVersionInfo, frmVEPROMS myFrmVEPROMS, int annotationTypeId, int unitIndex) : base(mode, docVersionInfo, myFrmVEPROMS, (E_UCFImportOptions)0)
{
_AnnotationType = AnnotationTypeInfo.Get(annotationTypeId);
_UnitIndex = unitIndex;
_ExportBothConvertedandNot = true;
DocReplace = new Dictionary<int, byte[]>();
FormClosed += OnClose;
Text = $"{mode} Electronic Procedure ({_AnnotationType.Name}) Dialog for {docVersionInfo.Name} of {docVersionInfo.MyFolder.Name}";
if (_UnitIndex > 0)
{
foreach (DocVersionInfo docver in MyFolder.FolderDocVersions)
{
docver.DocVersionConfig.SelectedSlave = _UnitIndex;
foreach (ItemInfo proc in docver.Procedures)
proc.MyProcedure.MyDocVersion.DocVersionConfig.SelectedSlave = _UnitIndex;
}
}
}
public dlgExportImportEP(string mode, ProcedureInfo procedureInfo, frmVEPROMS myFrmVEPROMS, int annotationTypeId, int unitIndex) : base(mode, procedureInfo, myFrmVEPROMS, (E_UCFImportOptions)0)
public dlgExportImportEP(string mode, DocVersionInfo docVersionInfo, frmVEPROMS myFrmVEPROMS, int annotationTypeId, int unitIndex) : base(mode, docVersionInfo, myFrmVEPROMS, (E_UCFImportOptions)0)
{
_AnnotationType = AnnotationTypeInfo.Get(annotationTypeId);
_UnitIndex = unitIndex;
_ExportBothConvertedandNot = true;
DocReplace = new Dictionary<int, byte[]>();
FormClosed += OnClose;
Text = $"{mode} Electronic Procedure ({_AnnotationType.Name}) Dialog for {docVersionInfo.Name} of {docVersionInfo.MyFolder.Name}";
if (_UnitIndex > 0)
{
MyDocVersion.DocVersionConfig.SelectedSlave = _UnitIndex;
foreach (ItemInfo proc in MyDocVersion.Procedures)
proc.MyProcedure.MyDocVersion.DocVersionConfig.SelectedSlave = _UnitIndex;
}
}
public dlgExportImportEP(string mode, ProcedureInfo procedureInfo, frmVEPROMS myFrmVEPROMS, int annotationTypeId, int unitIndex) : base(mode, procedureInfo, myFrmVEPROMS, (E_UCFImportOptions)0)
{
_AnnotationType = AnnotationTypeInfo.Get(annotationTypeId);
_UnitIndex = unitIndex;
@@ -49,6 +66,13 @@ namespace VEPROMS
DocReplace = new Dictionary<int, byte[]>();
FormClosed += OnClose;
Text = $"{mode} Electronic Procedure ({_AnnotationType.Name}) Dialog for {procedureInfo.DisplayNumber}";
if (_UnitIndex > 0)
{
MyProcedure.MyDocVersion.DocVersionConfig.SelectedSlave = _UnitIndex;
MyProcedure.MyProcedure.MyDocVersion.DocVersionConfig.SelectedSlave = _UnitIndex;
}
}
//Overridden function to handle export of EP data
@@ -320,8 +344,32 @@ namespace VEPROMS
}
//clear objects to release memory
//and unset the unit (SelectedSlave)
private void OnClose(object sender, EventArgs e)
{
if (MyProcedure != null)
{
MyProcedure.MyDocVersion.DocVersionConfig.SelectedSlave = 0;
MyProcedure.MyProcedure.MyDocVersion.DocVersionConfig.SelectedSlave = 0;
}
if (MyDocVersion != null)
{
MyDocVersion.DocVersionConfig.SelectedSlave = 0;
foreach (ItemInfo proc in MyDocVersion.Procedures)
proc.MyProcedure.MyDocVersion.DocVersionConfig.SelectedSlave = _UnitIndex;
}
if (MyFolder != null)
{
foreach (DocVersionInfo docver in MyFolder.FolderDocVersions)
{
docver.DocVersionConfig.SelectedSlave = _UnitIndex;
foreach (ItemInfo proc in docver.Procedures)
proc.MyProcedure.MyDocVersion.DocVersionConfig.SelectedSlave = _UnitIndex;
}
}
DocReplace.Clear();
DocReplace = null;
}