diff --git a/PROMS/Formats/epall/EPFormatTST1.xml b/PROMS/Formats/epall/EPFormatTST1.xml index 1aa1e26e..cd99e3c7 100644 Binary files a/PROMS/Formats/epall/EPFormatTST1.xml and b/PROMS/Formats/epall/EPFormatTST1.xml differ diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs index a425bfdc..c8f681e0 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/ItemExt.cs @@ -2144,7 +2144,8 @@ namespace VEPROMS.CSLA.Library filtered.Add(EP); //check for intersections between unfiltered list and step type list - if (EP.validforsteptypes.Any(steptypelist.Contains)) + List tmpEP = EP.validforsteptypes(); + if (tmpEP.Any(steptypelist.Contains)) filtered.Add(EP); } diff --git a/PROMS/VEPROMS.CSLA.Library/Format/EPFormatFile.cs b/PROMS/VEPROMS.CSLA.Library/Format/EPFormatFile.cs index 75595fe1..456f043d 100644 --- a/PROMS/VEPROMS.CSLA.Library/Format/EPFormatFile.cs +++ b/PROMS/VEPROMS.CSLA.Library/Format/EPFormatFile.cs @@ -272,6 +272,7 @@ namespace VEPROMS.CSLA.Library return LazyLoad(ref _text, "@text"); } } + //roid of group item that individual sub-items will be the choices for the list/combobox for ROSINGLE and ROMULTI private LazyLoad _rosource; public string rosource { @@ -280,6 +281,22 @@ namespace VEPROMS.CSLA.Library return LazyLoad(ref _rosource, "@rosource"); } } + //the columns in the RO that will be included in the exports + private LazyLoad _returncols; + public List returncols() + { + try + { + string tmp = LazyLoad(ref _returncols, "@returncols"); + return tmp.Split(',').Select(p => p.Trim()).ToList(); + } + catch + { + throw new ArgumentException($"Error in returncols for EP file: {((EPFormatFile)MyParentFormat).Name}.xml, field: {name}"); + } + } + + //number of lines for a multi-line text box to span private LazyLoad _numlines; public int numlines { @@ -295,27 +312,26 @@ namespace VEPROMS.CSLA.Library } //step types that the EPForma Item is valid for (as a list of types) private LazyLoad _validforsteptypes; - public List validforsteptypes + public List validforsteptypes() { - get + try { - try - { - string tmp = LazyLoad(ref _validforsteptypes, "@validforsteptypes"); - return tmp.Split(',').Select(p => p.Trim()).ToList(); - } - catch - { - throw new ArgumentException($"Error in validforsteptypes for EP file: {((EPFormatFile) MyParentFormat).Name}.xml, field: {name}"); - } + string tmp = LazyLoad(ref _validforsteptypes, "@validforsteptypes"); + return tmp.Split(',').Select(p => p.Trim()).ToList(); + } + catch + { + throw new ArgumentException($"Error in validforsteptypes for EP file: {((EPFormatFile) MyParentFormat).Name}.xml, field: {name}"); } } public bool IsValidForStepType(string StepType) { - return validforsteptypes.Contains(StepType); + List tmp = validforsteptypes(); + return tmp.Contains(StepType); } //return a list of items based on the ROsource specified in the EPFormat File + //will return all RO items under the Group that's roid = the rosource public List getROList(AnnotationInfo currAnn, bool includeblank) { if (string.IsNullOrEmpty(rosource)) @@ -329,7 +345,7 @@ namespace VEPROMS.CSLA.Library string roid = FormatRoidKey(rosource, false); rochild[] children = lookup.GetRoChildrenByRoid(roid); - List mylist = children.Select(x => new ROListItem(x.title, x.roid)).ToList(); + List mylist = children.Select(x => new ROListItem(x.title, x.roid.Substring(0, 12))).ToList(); if (includeblank) mylist.Insert(0, new ROListItem("", "")); @@ -340,6 +356,39 @@ namespace VEPROMS.CSLA.Library throw new ArgumentException($"Error in rosource for EP file: {((EPFormatFile)MyParentFormat).Name}.xml, field: {name}"); } } + + + //return a list of values for the specified ROID + //given the EP items return columns + //will return all RO items under the Group that's roid = the rosource + public List getROValuesList(AnnotationInfo currAnn, string roid) + { + if (string.IsNullOrEmpty(roid)) + return new List(); + + List values = new List(); + DocVersionInfo MyDocVersion = currAnn.MyItem.MyDocVersion; + ROFSTLookup lookup = MyDocVersion.DocVersionAssociations[0].MyROFst.GetROFSTLookup(MyDocVersion); + rochild ro = lookup.GetRoChild(roid); + + List rtncols = returncols(); + + if (rtncols.Count == 0) + { + values.Add(ro.value); + } + else + { + foreach (string rcol in rtncols) + { + rochild ro_indiv = Array.Find(ro.children, x => x.appid.EndsWith($".{rcol}")); + if (ro_indiv.value != null) values.Add(ro_indiv.value); + } + } + + return values; + + } } #endregion //C2025-023 - Electronic Procedures - Modifications to PROMS