diff --git a/app/Controllers/Patient.php b/app/Controllers/Patient.php index 8407da0..5b15cd7 100644 --- a/app/Controllers/Patient.php +++ b/app/Controllers/Patient.php @@ -36,6 +36,8 @@ class Patient extends BaseController ->getResultArray(); } + $data['refer_master'] = $this->getActiveReferMasters(); + return view('billing/Patient_V', $data); } @@ -130,6 +132,7 @@ class Patient extends BaseController 'udai' => strtoupper((string) $this->request->getPost('input_udai')), 'estimate_dob' => $estimate_dob, ]; + $this->applyPatientReferbyField($data, (string) $this->request->getPost('refer_by_name')); $this->applyPatientAbhaFieldValues($data, $abhaId, $abhaAddress); if ($chk_age === 'on') { @@ -715,6 +718,8 @@ class Patient extends BaseController $query = $this->db->query($sql); $data['blood_group'] = $query->getResult(); + $data['refer_master'] = $this->getActiveReferMasters(); + $sql = "select * from tag_master Order by tag_name"; $query = $this->db->query($sql); $data['tag_master'] = $query->getResult(); @@ -823,6 +828,7 @@ class Patient extends BaseController 'estimate_dob' => $estimate_dob, 'blood_group' => $this->request->getPost('input_blood_group'), ]; + $this->applyPatientReferbyField($data, (string) $this->request->getPost('refer_by_name')); if ($isAbhaVerifiedLocked) { $data['p_fname'] = (string) ($existingPatient['p_fname'] ?? $data['p_fname']); @@ -863,6 +869,28 @@ class Patient extends BaseController ]); } + private function getActiveReferMasters(): array + { + if (! $this->db->tableExists('refer_master')) { + return []; + } + + return $this->db->table('refer_master') + ->where('active', 1) + ->orderBy('f_name', 'ASC') + ->get() + ->getResult(); + } + + private function applyPatientReferbyField(array &$data, string $referByName): void + { + if (! $this->db->fieldExists('referby', 'patient_master')) { + return; + } + + $data['referby'] = trim(strtoupper($referByName)); + } + public function update_aadhar() { if (!$this->request->isAJAX()) { diff --git a/app/Views/Setting/Reffer/reffer_add.php b/app/Views/Setting/Reffer/reffer_add.php index 6249c9b..1fe683c 100644 --- a/app/Views/Setting/Reffer/reffer_add.php +++ b/app/Views/Setting/Reffer/reffer_add.php @@ -15,12 +15,7 @@
- +
diff --git a/app/Views/Setting/Reffer/reffer_edit.php b/app/Views/Setting/Reffer/reffer_edit.php index d5981f1..5424406 100644 --- a/app/Views/Setting/Reffer/reffer_edit.php +++ b/app/Views/Setting/Reffer/reffer_edit.php @@ -16,12 +16,7 @@
- +
diff --git a/app/Views/billing/Patient_V.php b/app/Views/billing/Patient_V.php index 0ecb9c2..a4cdcdc 100644 --- a/app/Views/billing/Patient_V.php +++ b/app/Views/billing/Patient_V.php @@ -236,6 +236,20 @@
+
+
+ + + + + title ?? '') . ' ' . ($row->f_name ?? ''))); ?> + + + +
+
diff --git a/app/Views/billing/Person_Edit_V.php b/app/Views/billing/Person_Edit_V.php index 81604f9..7fa83cb 100644 --- a/app/Views/billing/Person_Edit_V.php +++ b/app/Views/billing/Person_Edit_V.php @@ -238,6 +238,20 @@
+
+
+ + + + + title ?? '') . ' ' . ($row->f_name ?? ''))); ?> + + + +
+
diff --git a/app/Views/billing/Person_profile_V.php b/app/Views/billing/Person_profile_V.php index 565f70f..dd195e0 100644 --- a/app/Views/billing/Person_profile_V.php +++ b/app/Views/billing/Person_profile_V.php @@ -128,6 +128,16 @@
+
+
Refer By
+
+ referby ?? '')) !== '') : ?> + referby ?? '')))) ?> + + Not filled + +
+
Aadhar No.
udai?>
diff --git a/app/Views/billing/ipd/legacy_registration.php b/app/Views/billing/ipd/legacy_registration.php index 7665c9e..7b52e1c 100644 --- a/app/Views/billing/ipd/legacy_registration.php +++ b/app/Views/billing/ipd/legacy_registration.php @@ -256,12 +256,13 @@
- + + - + - +
@@ -308,6 +309,37 @@