From af17fd9f04e39fa3421a3e517a4e535264c2238d Mon Sep 17 00:00:00 2001
From: Piotr Gawron <piotr.gawron@uni.lu>
Date: Wed, 1 Mar 2017 17:46:02 +0100
Subject: [PATCH] prc subject should have screening number like PRC-xxx

---
 .../main/java/smash/appointment/parse/PrcControlParser.java  | 5 +++++
 .../main/java/smash/appointment/parse/PrcFlyingParser.java   | 5 +++++
 .../main/java/smash/appointment/parse/PrcSubjectsParser.java | 5 +++++
 3 files changed, 15 insertions(+)

diff --git a/appointment-import/src/main/java/smash/appointment/parse/PrcControlParser.java b/appointment-import/src/main/java/smash/appointment/parse/PrcControlParser.java
index a74ed7b3..e0c6e4f5 100644
--- a/appointment-import/src/main/java/smash/appointment/parse/PrcControlParser.java
+++ b/appointment-import/src/main/java/smash/appointment/parse/PrcControlParser.java
@@ -15,6 +15,11 @@ public class PrcControlParser extends SubjectParser {
 		if (number.trim().isEmpty()) {
 			return "";
 		} else {
+			if (number.length() == 1) {
+				number = "00" + number;
+			} else if (number.length() == 2) {
+				number = "0" + number;
+			}
 			return "P-" + number;
 		}
 	}
diff --git a/appointment-import/src/main/java/smash/appointment/parse/PrcFlyingParser.java b/appointment-import/src/main/java/smash/appointment/parse/PrcFlyingParser.java
index 53821a72..58f34460 100644
--- a/appointment-import/src/main/java/smash/appointment/parse/PrcFlyingParser.java
+++ b/appointment-import/src/main/java/smash/appointment/parse/PrcFlyingParser.java
@@ -15,6 +15,11 @@ public class PrcFlyingParser extends SubjectParser {
 		if (number.trim().isEmpty()) {
 			return "";
 		} else {
+			if (number.length() == 1) {
+				number = "00" + number;
+			} else if (number.length() == 2) {
+				number = "0" + number;
+			}
 			return "P-" + number;
 		}
 	}
diff --git a/appointment-import/src/main/java/smash/appointment/parse/PrcSubjectsParser.java b/appointment-import/src/main/java/smash/appointment/parse/PrcSubjectsParser.java
index 3dd5fcad..b9dcbab8 100644
--- a/appointment-import/src/main/java/smash/appointment/parse/PrcSubjectsParser.java
+++ b/appointment-import/src/main/java/smash/appointment/parse/PrcSubjectsParser.java
@@ -15,6 +15,11 @@ public class PrcSubjectsParser extends SubjectParser {
 		if (number.trim().isEmpty()) {
 			return "";
 		} else {
+			if (number.length() == 1) {
+				number = "00" + number;
+			} else if (number.length() == 2) {
+				number = "0" + number;
+			}
 			return "P-" + number;
 		}
 	}
-- 
GitLab