|
@@ -15,6 +15,7 @@ import java.util.regex.Pattern;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
|
|
+import org.apache.poi.util.StringUtil;
|
|
|
import org.json.JSONArray;
|
|
|
import org.json.JSONObject;
|
|
|
import org.json.simple.JSONValue;
|
|
@@ -123,16 +124,17 @@ public class RestApiController {
|
|
|
message = "emptyResourceType";
|
|
|
result = object.toString();
|
|
|
} else {
|
|
|
- String phone = dto.getPatientPhone();
|
|
|
+ String phone = dto.getPatientPhone().trim();
|
|
|
|
|
|
Pattern pattern1 = Pattern.compile("\\d{2,3}-\\d{3,4}-\\d{4}");
|
|
|
Pattern pattern2 = Pattern.compile("\\d{2,3}\\d{3,4}\\d{4}");
|
|
|
Matcher matcher1 = pattern1.matcher(phone);
|
|
|
Matcher matcher2 = pattern2.matcher(phone);
|
|
|
- if (matcher1.matches() || matcher2.matches()) {
|
|
|
+ if (matcher1.matches() || matcher2.matches() || phone.equals("")) {
|
|
|
// true
|
|
|
if (!phone.equals("")) {
|
|
|
- phone = LifeCenterFunction.setPhoneFormat(phone);
|
|
|
+// phone = LifeCenterFunction.setPhoneFormat(phone);
|
|
|
+ phone = LifeCenterFunction.phone(phone);
|
|
|
dto.setPatientPhone2(phone);
|
|
|
}
|
|
|
|