diff --git a/tasks/02-bibliotheca-main.sh b/tasks/02-bibliotheca-main.sh index 18258ad..a62e42b 100755 --- a/tasks/02-bibliotheca-main.sh +++ b/tasks/02-bibliotheca-main.sh @@ -533,7 +533,7 @@ else fi echo -# --------------------------------- 12 E0XXb ---------------------------------- # +# --------------------------------- 13 E0XXb ---------------------------------- # # spec_B_E_14 echo "Selektionsschlüssel E0XXb..." @@ -564,11 +564,87 @@ else fi echo +# --------------------------------- 14 0500 ---------------------------------- # + +# spec_B_T_56 +# TODO: Regeln für ART=GH, ART=L +# TODO: Differenzierung nach MEDGR +echo "Gattung und Status 0500..." +read -r -d '' expression << EXPRESSION +if( + value == 'M', + 'Aan', + if( + value == 'U', + 'Asn', + if( + value == 'A', + 'Ban', + if( + value == 'V', + 'Ban', + if( + and( + value == 'P', + forNonBlank(cells['M|MEDGR'].value,v,if(v == 'SPIEL', true, false),false) + ), + 'Ban', + if( + value == 'P', + 'Lax', + if( + value == 'G', + 'Acn', + if( + value == 'S', + 'AFn', + if( + value == 'Z', + 'Abn', + null + ) + ) + ) + ) + ) + ) + ) + ) +) +EXPRESSION +if curl -fs \ + --data project="${projects[$p]}" \ + --data-urlencode "operations@-" \ + "${endpoint}/command/core/apply-operations$(refine_csrf)" > /dev/null \ + << JSON + [ + { + "op": "core/column-addition", + "engineConfig": { + "facets": [], + "mode": "row-based" + }, + "baseColumnName": "M|ART", + "expression": $(echo "grel:${expression}" | ${jq} -s -R '.') + "onError": "set-to-blank", + "newColumnName": "0500", + "columnInsertIndex": 3 + } + ] +JSON +then + log "transformed ${p} (${projects[$p]})" +else + error "transform ${p} (${projects[$p]}) failed!" +fi +echo + # ================================== EXPORT ================================== # checkpoint "Export"; echo # Export der PICA3-Spalten als CSV +# Spalte 2199 muss vorne stehen, weil später für Sortierung benötigt format="csv" echo "export ${p} to ${format} file using template..." IFS= read -r -d '' template << "TEMPLATE" @@ -577,6 +653,7 @@ with( [ '2199', '0100', + '0500', '2000', '7100B', '7100f', diff --git a/tasks/03-ba-sachsen.sh b/tasks/03-ba-sachsen.sh index 31db0f1..b42fc8a 100755 --- a/tasks/03-ba-sachsen.sh +++ b/tasks/03-ba-sachsen.sh @@ -473,6 +473,7 @@ IFS= read -r -d '' template << "TEMPLATE" {{ if(row.index - row.record.fromRowIndex == 0, '' + '\n' ++ forNonBlank(cells['0500'].value, v, '002@' + ' 0' + v + '\n', '') + forNonBlank(cells['0100'].value, v, '003@' + ' 0' + v + '\n', '') + forNonBlank(cells['2000'].value, v, forEach(v.split('␟'),x,'004A' + ' 0' + x + '\n').join(''), '') + forNonBlank(cells['2199'].value, v, '006Y' + ' 0' + v + '\n', '')