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:
@ -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, "_");
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user