-
Notifications
You must be signed in to change notification settings - Fork 0
Field exclusion
natlibfi-arlehiko edited this page Oct 1, 2018
·
3 revisions
Checks that the record does not contain the configured fields. Fixes the record by removing the configured fields.
All rules must match for the field to be selected for exclusion.
An array which can have following values as elements:
- RegExp: Pattern for matching field tags
-
Object: An object with the following properties:
- tag (RegExp): Pattern to match the field's tags Mandatory
- value (RegExp): Regular expression object for matching a controlfields value. Mutual exclusive with the subfields, ind1 & ind2 properties.
- ind1 (RegExp): Pattern to match the field's ind1 property. Mutual exclusive with the value property.
- ind2 (RegExp): Pattern to match the field's ind2 property. Mutual exclusive with the value property.
-
subfields (Array<Object>): An array of objects with the following properties:
- code (RegExp): Pattern to match the subfield's code Mandatory
- value (RegExp): Pattern to match the subfield's value Mandatory
-
dependencies (Array<Object>): An array of objects with the following properties:
- leader (RegExp): Pattern to match the record's leader
[{
tag: /^500$/
}]
{
"leader": "foo",
"fields": [
{
"tag": "245",
"ind1": " ",
"ind2": " ",
"subfields": [
{
"code": "a",
"value": "Fubar"
}
]
}
]
}
{
"leader": "foo",
"fields": [
{
"tag": "245",
"ind1": " ",
"ind2": " ",
"subfields": [
{
"code": "a",
"value": "Fubar"
}
]
},
{
"tag": "500",
"ind1": " ",
"ind2": " ",
"subfields": [
{
"code": "a",
"value": "Foo Bar Foo Bar Foo Bar"
},
{
"code": "9",
"value": "ALMA<KEEP>"
}
]
}
]
}
[
{
tag: /^500$/,
subfields: [{
code: /9/,
value: /^(?!FENNI<KEEP>).*$/
}]
}]
{
"leader": "foo",
"fields": [
{
"tag": "245",
"ind1": " ",
"ind2": " ",
"subfields": [
{
"code": "a",
"value": "Fubar"
}
]
},
{
"tag": "500",
"ind1": " ",
"ind2": " ",
"subfields": [
{
"code": "a",
"value": "Foo Bar Foo Bar Foo Bar"
},
{
"code": "9",
"value": "FENNI<KEEP>"
}
]
}
]
}
{
"leader": "foo",
"fields": [
{
"tag": "245",
"ind1": " ",
"ind2": " ",
"subfields": [
{
"code": "a",
"value": "Fubar"
}
]
},
{
"tag": "500",
"ind1": " ",
"ind2": " ",
"subfields": [
{
"code": "a",
"value": "Foo Bar Foo Bar Foo Bar"
},
{
"code": "9",
"value": "ALMA<KEEP>"
}
]
}
]
}