C2025-024 Electronic Procedures - Phase 2 (PROMS XML output)

Fix Regular Expression RO Resolution for when multi ROs  and multi-unit
This commit is contained in:
2025-08-06 14:41:15 -04:00
parent 28c681a562
commit b5a9462e95

View File

@@ -1999,6 +1999,7 @@ namespace VEPROMS
if (_UnitIndex != 0 && docver != null)
{
docver.DocVersionConfig.SelectedSlave = _UnitIndex;
ciText = DisplayText.ResolveUnitSpecific(docver, ciText);
if (ci.ContentRoUsageCount > 0)
@@ -2012,16 +2013,18 @@ namespace VEPROMS
string roid = ROFSTLookup.FormatRoidKey(RO.ROID, true);
ROFSTLookup.rochild roc = lookup.GetRoChild(roid);
//need to search / replace in content info
string lookFor = string.Format(@"(<START\](\\[^v \\]+)*\\v0(\\[^v '?{{}}~\\]+)*( |\\u[0-9]{{1,4}}?|\\'[0-9a-fA-F]{{2}}|\\[{{}}~]))(.*?)((\\[^v'?{{}}~ \\]+)*\\v(\\[^v \\]+)* #Link:ReferencedObject:{0} .*?\[END>)", RO.ROUsageID);
string lookFor = string.Format(@"(?<=((<START\](\\[^v \\]+)*\\v0(\\[^v '?{{}}~\\]+)*( |\\u[0-9]{{1,4}}?|\\'[0-9a-fA-F]{{2}}|\\[{{}}~])))(.*?))((\\[^v'?{{}}~ \\]+)*\\v(\\[^v \\]+)* #Link:ReferencedObject:{0} .*?\[END>)", RO.ROUsageID);
Match m = Regex.Match(ciText, lookFor, RegexOptions.Singleline);
if (m != null && m.Groups.Count > 1)
{
ciText = ciText.Replace($"{m.Groups[1].Value}{m.Groups[5].Value}{m.Groups[6].Value}", $"{m.Groups[1].Value}{roc.value}{m.Groups[6].Value}");
ciText = ciText.Replace($"{m.Groups[1].Value}{m.Groups[6].Value}{m.Groups[7].Value}", $"{m.Groups[1].Value}{roc.value}{m.Groups[7].Value}");
}
}
}
}
docver.DocVersionConfig.SelectedSlave = 0;
}