Needs help with patient's name display at the top section

I have been working on OpenEMR for a while, and recently, I noticed that the top section is not fully utilized, with only limited information displayed. I would like to show more details, such as gender, and possibly change the way it presents the patient’s name. I am aware that this involves PHP and Knockout.js. However, as I examine the code snippet, I am not entirely sure what to modify. I would appreciate it if someone could point me in the right direction.

Hi @JayJack ,
If you want to modify the patient information displayed at the top section, you’ll need to make changes in the Demographics.php file .
For Example, here I have added gender details at the top section by modifying the code in the demographics.php inside setMyPatient function.

  if (empty($date_of_death)) {
                    echo js_escape(" " . xl('DOB') . ": " . oeFormatShortDate($result['DOB_YMD']) . " " . xl('Age') . ": " . getPatientAgeDisplay($result['DOB_YMD'])." Gender : ".$result['sex']);
                } else {
                    echo js_escape(" " . xl('DOB') . ": " . oeFormatShortDate($result['DOB_YMD']) . " " . xl('Age at death') . ": " . oeFormatAge($result['DOB_YMD'], $date_of_death)." Gender : ".$result['sex']);
                }

Output:
Patient Information

If you have any questions or need further assistance, please feel free to contact us at openemr.support@visolve.com .

-Visolve AI Team _ (HG).

1 Like

On the javascript side, you’ll want to look in the interface/main/tabs/js/ folder. The patient_data_view_model.js is a key file for the Knockout.js stuff. The left_nav.setPatient() function in frame_proxies.js is where the patient gets populated throughout the frontend when someone clicks on a patient to update the navbar header. If you look for the left_nav.setPatient function in the codebase you’ll see all the places this gets set.

Hope that helps.

1 Like

Thank you! I really appreciate it.

@stephenwaite I want to push this code to community please give me access to push the code into the community