1
0
mirror of https://github.com/pcvolkmer/etl-processor.git synced 2025-07-04 07:22:55 +00:00

fix: removed gaps system from GPAS pseudonym value. Also added clean up method, which will replace filename invalid characters witch '_'. (#11)

This commit is contained in:
jlidke
2023-09-04 15:41:22 +02:00
committed by GitHub
parent 2f32834de0
commit bf8f87b261
2 changed files with 22 additions and 1 deletions

View File

@ -127,7 +127,21 @@ public class GpasPseudonymGenerator implements Generator {
.orElseGet(ParametersParameterComponent::new).getValue();
// pseudonym
return identifier.getSystem() + "|" + identifier.getValue();
return sanitizeValue(identifier.getValue());
}
/**
* Allow only filename friendly values
*
* @param psnValue GAPS pseudonym value
* @return cleaned up value
*/
public static String sanitizeValue(String psnValue) {
// pattern to match forbidden characters
String forbiddenCharsRegex = "[\\\\/:*?\"<>|;]";
// Replace all forbidden characters with underscores
return psnValue.replaceAll(forbiddenCharsRegex, "_");
}