Changes for page 13 Structure Mapping

Last modified by Helena on 2025/09/10 11:19

From version 10.10
edited by Helena
on 2025/05/16 09:18
Change comment: There is no comment for this version
To version 10.9
edited by Helena
on 2025/05/16 09:16
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -187,31 +187,30 @@
187 187  
188 188  Below is an example set of regular expression rules for a particular component.
189 189  
190 -(% style="width:708.294px" %)
191 -|(% style="width:133px" %)**Regex**|(% style="width:377px" %)**Description**|(% style="width:194px" %)**Output**
192 -|(% style="width:133px" %)A|(% style="width:377px" %)Rule match if input = 'A'|(% style="width:194px" %)OUT_A
193 -|(% style="width:133px" %)^[A-G]|(% style="width:377px" %)Rule match if the input starts with letters A to G|(% style="width:194px" %)OUT_B
194 -|(% style="width:133px" %)A~|B|(% style="width:377px" %)Rule match if input is either 'A' or 'B'|(% style="width:194px" %)OUT_C
190 +|Regex|Description|Output
191 +|A|Rule match if input = 'A'|OUT_A
192 +|^[A-G]|Rule match if the input starts with letters A to G|OUT_B
193 +|A~|B|Rule match if input is either 'A' or 'B'|OUT_C
195 195  
196 196  Like all mapping rules, the output is either a Code, a Value or free text depending on the representation of the Component in the target Data Structure Definition.
197 197  
198 198  If the regular expression contains capture groups, these can be used in the definition of the output value, by specifying \//**n** //as an output value where //**n**// is the number of the capture group starting from 1. For example
199 199  
200 -(% style="width:720.294px" %)
201 -|(% style="width:199px" %)**Regex**|(% style="width:126px" %)**Target output**|(% style="width:192px" %)**Example Input**|(% style="width:200px" %)**Example Output**
202 -|(% style="width:199px" %)(((
203 -([0-9]{4})[0-9]([0-9]{1})
204 -)))|(% style="width:126px" %)\1-Q\2|(% style="width:192px" %)200933|(% style="width:200px" %)2009-Q3
199 +|Regex|Target output|Example Input|Example Output
200 +|(((
201 +([0-9]{4})[0-
205 205  
203 +9]([0-9]{1})
204 +)))|\1-Q\2|200933|2009-Q3
205 +
206 206  As regular expression rules can be used as a general catch-all if nothing else matches, the ordering of the rules is important. Rules should be tested starting with the highest priority, moving down the list until a match is found.
207 207  
208 208  The following example shows this:
209 209  
210 -(% style="width:725.294px" %)
211 -|(% style="width:198px" %)**Priority**|(% style="width:148px" %)**Regex**|(% style="width:212px" %)**Description**|(% style="width:164px" %)**Output**
212 -|(% style="width:198px" %)1|(% style="width:148px" %)A|(% style="width:212px" %)Rule match if input = 'A'|(% style="width:164px" %)OUT_A
213 -|(% style="width:198px" %)2|(% style="width:148px" %)B|(% style="width:212px" %)Rule match if input = 'B'|(% style="width:164px" %)OUT_B
214 -|(% style="width:198px" %)3|(% style="width:148px" %)[A-Z]|(% style="width:212px" %)Any character A-Z|(% style="width:164px" %)OUT_C
210 +|Priority|Regex|Description|Output
211 +|1|A|Rule match if input = 'A'|OUT_A
212 +|2|B|Rule match if input = 'B'|OUT_B
213 +|3|[A-Z]|Any character A-Z|OUT_C
215 215  
216 216  The input 'A' matches both the first and the last rule, but the first takes precedence having the higher priority. The output is OUT_A.
217 217  
... ... @@ -223,10 +223,9 @@
223 223  
224 224  For instance:
225 225  
226 -(% style="width:742.294px" %)
227 -|(% style="width:191px" %)**Input String**|(% style="width:154px" %)**Start**|(% style="width:211px" %)**Length**|(% style="width:182px" %)**Output**
228 -|(% style="width:191px" %)ABC_DEF_XYZ|(% style="width:154px" %)5|(% style="width:211px" %)3|(% style="width:182px" %)DEF
229 -|(% style="width:191px" %)XULADS|(% style="width:154px" %)1|(% style="width:211px" %)2|(% style="width:182px" %)XU
225 +|Input String|Start|Length|Output
226 +|ABC_DEF_XYZ|5|3|DEF
227 +|XULADS|1|2|XU
230 230  
231 231  Sub-strings can therefore be used for the conceptual rule //If starts with 'XU' map to Y// as shown in the following example:
232 232