Update Rules Patient Identity Fix Version

This commit is contained in:
mikael-zakaria 2025-11-24 15:17:33 +07:00
parent c388c03749
commit 5a3eb5a63d
2 changed files with 7 additions and 7 deletions

View File

@ -80,11 +80,11 @@ class Patient extends Controller {
// Khusus untuk Override PATIDT // Khusus untuk Override PATIDT
$type = $input['PatIdt']['IdentifierType'] ?? null; $type = $input['PatIdt']['IdentifierType'] ?? null;
$identifierRulesMap = [ $identifierRulesMap = [
'KTP' => 'required|regex_match[/^[0-9]{16}$/]', 'KTP' => 'required|regex_match[/^[0-9]{16}$/]', // 16 pas digit numeric
'PASS' => 'required|regex_match[/^[A-Za-z0-9]{6,9}$/]', 'PASS' => 'required|regex_match[/^[A-Za-z0-9]{1,9}$/]', // alphanumeric max 9
'SSN' => 'required|regex_match[/^[0-9]{3}-[0-9]{2}-[0-9]{4}$/]', 'SSN' => 'required|regex_match[/^[0-9]{9}$/]', // numeric, pas 9 digit
'SIM' => 'required|regex_match[/^[A-Za-z0-9]{12,14}$/]', 'SIM' => 'required|regex_match[/^[0-9]{19,20}$/]', // numeric 1920 digit
'KTAS' => 'required|regex_match[/^[A-Za-z0-9]{12,15}$/]', 'KITAS' => 'required|regex_match[/^[0-9]{11}$/]', // numeric, pas 11 digit
]; ];
if ($type === null || $type === '') { if ($type === null || $type === '') {
$identifierRule = 'permit_empty|max_length[255]'; $identifierRule = 'permit_empty|max_length[255]';
@ -126,7 +126,7 @@ class Patient extends Controller {
$this->rules['PatIdt.IdentifierType'] = 'required'; $this->rules['PatIdt.IdentifierType'] = 'required';
$this->rules['PatIdt.Identifier'] = $identifierRule; $this->rules['PatIdt.Identifier'] = $identifierRule;
} }
if (!$this->validateData($input, $this->rules)) { return $this->failValidationErrors($this->validator->getErrors()); } if (!$this->validateData($input, $this->rules)) { return $this->failValidationErrors($this->validator->getErrors()); }
try { try {
$InternalPID = $this->model->updatePatient($input); $InternalPID = $this->model->updatePatient($input);

View File

@ -21,7 +21,7 @@ class PatientModel extends BaseModel {
protected $deletedField = 'DelDate'; protected $deletedField = 'DelDate';
public function getPatients($filters = []) { public function getPatients($filters = []) {
$qname = "LOWER(CONCAT_WS(' ', IFNULL(Prefix,''), IFNULL(NameFirst,''), IFNULL(NameMiddle,''), IFNULL(NameLast,''), IFNULL(NameMaiden,''), IFNULL(Suffix,'')))"; $qname = "CONCAT_WS(' ', IFNULL(Prefix,''), IFNULL(NameFirst,''), IFNULL(NameMiddle,''), IFNULL(NameLast,''), IFNULL(NameMaiden,''), IFNULL(Suffix,''))";
$this->select("InternalPID, PatientID, $qname as FullName, Gender, Birthdate, EmailAddress1 as Email, MobilePhone"); $this->select("InternalPID, PatientID, $qname as FullName, Gender, Birthdate, EmailAddress1 as Email, MobilePhone");