24 lines
884 B
PHP
24 lines
884 B
PHP
<?php
|
|
// models/Patient.php
|
|
// Mock class to simulate HIS Integration
|
|
|
|
class Patient {
|
|
// In a real application, this would connect to the HIS Database (e.g., HOSxP)
|
|
// using a separate PDO connection in Read-Only mode.
|
|
|
|
public static function searchByHN($hn) {
|
|
// Mock data
|
|
$mock_patients = [
|
|
'123456' => ['hn' => '123456', 'name' => 'นายใจดี รักสงบ', 'age' => 45, 'gender' => 'ชาย'],
|
|
'654321' => ['hn' => '654321', 'name' => 'ด.ญ.มานี มีตา', 'age' => 8, 'gender' => 'หญิง'],
|
|
'987654' => ['hn' => '987654', 'name' => 'นายสมหมาย สบายใจ', 'age' => 60, 'gender' => 'ชาย']
|
|
];
|
|
|
|
if (isset($mock_patients[$hn])) {
|
|
return $mock_patients[$hn];
|
|
}
|
|
|
|
return null;
|
|
}
|
|
}
|