SPECIAL OFFER: Only $69 for access to everything in OSTraining for 1 year! You save $75! 
Join today and get access to 1,000's of books and videos. Learn WordPress, Drupal, Magento, Joomla and more! Sign up today!

Coding PHP

3 years 11 months ago #121169 by clementlo
Coding PHP was created by clementlo
Hi,

I need help with understanding the PHP code. I looked into the open source electronic medical records ( www.open-emr.org ).

I want to know what sort of PHP code they are using so I can modify the code. I also had watched the PHP tutorial in OStraining but I think the PHP code involved is much more complex than that.

I would appreciate if you can advise me what PHP tutorial will be suitable for me.

Attached in this forum is the snapshot of the PHP code.

Please advise.

Thanks

This message has an attachment image.
Please log in or register to see it.

Please Log in to join the conversation.

3 years 11 months ago #121178 by Valentin
Replied by Valentin on topic Coding PHP
Hi clementlo,

It's impossible to know which specific code they are using by just seeing his website, unless the source code is available.

What end result do you want to achieve? Please explain with details

Kind regards,
Valentín

Follow us on Twitter - twitter.com/OSTraining
Like us on Facebook - facebook.com/ostraining

Please Log in to join the conversation.

3 years 11 months ago #121205 by clementlo
Replied by clementlo on topic Coding PHP
Dear Valentin,

I intend to modify the PHP to suit my use.

I will send you the codes through email on support@training.com as I am aware your security feature prevent me from putting on this forum.

I intend to move lines of 302-376 to integrate with lines 461 to 467.

Please advise.

Thanks

Please Log in to join the conversation.

3 years 11 months ago #121224 by Valentin
Replied by Valentin on topic Coding PHP
Hi Clementlo,

I intend to move lines of 302-376 to integrate with lines 461 to 467.

The code looks fine, those are two methods, however I need more context to understand your concern. For example: are you getting an error or something when you call multiprintcss_header()?

Kind regards,
Valentín

Follow us on Twitter - twitter.com/OSTraining
Like us on Facebook - facebook.com/ostraining

Please Log in to join the conversation.

3 years 11 months ago #121289 by clementlo
Replied by clementlo on topic Coding PHP
Dear Valentin,

Yes, I am getting the error when I shift from the code from the header to the footer.

I sent you the modified codes through support@ostraining.com

Please advise.

Thanks.

Please Log in to join the conversation.

3 years 11 months ago - 3 years 11 months ago #121313 by Bill
Replied by Bill on topic Coding PHP
Hi Clementlo,

What changes are you making? Lines 302-376 include one whole function 'multiprintcss_header' and part of another function. 'multiprintcss_header' takes an argument that wouldn't be available in the target code.

I'm looking at the file you sent us - is this the already modified code?
bill

Follow us on Twitter - twitter.com/OSTraining
Like us on Facebook - facebook.com/ostraining

Please Log in to join the conversation.

3 years 11 months ago #121357 by clementlo
Replied by clementlo on topic Coding PHP
Dear Bill,

Thank you for your reply.

Yes, the file I sent you is already a modified code. I moved Lines 321-376 to Lines 443-470.

I tried to run it but it did not work.

Please advise.

Thanks

Please Log in to join the conversation.

3 years 11 months ago #121380 by Nick
Replied by Nick on topic Coding PHP
Hi clementlo ,

Sorry if I missed this detail, but it doesn't appear to have been mentioned yet ... what specific error message are you getting?

Looking forward to helping.

Kind regards,
Nick

Follow us on Twitter - twitter.com/OSTraining
Like us on Facebook - facebook.com/ostraining

Please Log in to join the conversation.

3 years 10 months ago #121420 by clementlo
Replied by clementlo on topic Coding PHP
Dear Nick,

The had been mentioned as below.

function multiprintcss_footer() {
echo ("<div class='signdiv'>\n");
echo (xl('Signature') . ":________________________________<br>");
echo (xl('Date') . ": " . date('Y-m-d'));
echo ("</div>\n");
echo ("</div>\n");
echo ('<b><span class="large">' . $p->provider->get_name_display() . '</span></b>'. '<br>');

if ($GLOBALS) {
if ($GLOBALS) {
echo ('<span class="large"><b>' . xl('DEA') . ':</b>' . $p->provider->federal_drug_id . '</span><br>');
}
else {
echo ('<b><span class="large">' . xl('DEA') . ':</span></b> ________________________<br>' );
}
}
if ($GLOBALS) {
if ($GLOBALS) {
echo ('<span class="large"><b>' . xl('NPI') . ':</b>' . $p->provider->npi . '</span><br>');
}
else {
echo ('<b><span class="large">' . xl('NPI') . ':</span></b> ________________________<br>');
}
}
if ($GLOBALS) {
if ($GLOBALS) {
echo ('<span class="large"><b>' . xl('State Lic. #') . ':</b>' . $p->provider->state_license_number . '</span><br>');
}
else {
echo ('<b><span class="large">' . xl('State Lic. #') . ':</span></b> ________________________<br>');
}
}
}

However, no specific error. It just won't appear like what I want it to be.

Please advise.

Thanks

Please Log in to join the conversation.

3 years 10 months ago #121427 by Nick
Replied by Nick on topic Coding PHP
Thanks for clarifying! What do you want it to appear as and what result are you getting instead? Could you upload some screenshots?

Looking forward to helping.

Kind regards,
Nick

Follow us on Twitter - twitter.com/OSTraining
Like us on Facebook - facebook.com/ostraining

Please Log in to join the conversation.

3 years 10 months ago #121462 by clementlo
Replied by clementlo on topic Coding PHP
Dear Nick,

Thanks for your reply.

I attached the screenshot on this forum.

I circled the details which I intend to have it appear at the bottom but it did not happen.

Please advise.

This message has an attachment image.
Please log in or register to see it.

Please Log in to join the conversation.

3 years 10 months ago - 3 years 10 months ago #121469 by Valentin
Replied by Valentin on topic Coding PHP
Hi Clementlo,
May you identify the specific PHP code that print that content?
Move the syntax that print that content at the very end, as in your screenshot.

My guess tells me is this part:
echo ('<b><span class="large">' . $p->provider->get_name_display() . '</span></b>'. '<br>');
 
if ($GLOBALS) {
if ($GLOBALS) {
echo ('<span class="large"><b>' . xl('DEA') . ':</b>' . $p->provider->federal_drug_id . '</span><br>');
}
else {
echo ('<b><span class="large">' . xl('DEA') . ':</span></b> ________________________<br>' );
}
}

Kind regards,
Valentín

Follow us on Twitter - twitter.com/OSTraining
Like us on Facebook - facebook.com/ostraining

Please Log in to join the conversation.

3 years 10 months ago #121484 by clementlo
Replied by clementlo on topic Coding PHP
Dear Valentin,

The syntax that print the content is as below.

function multiprintcss_header($p) {
echo("<div class='paddingdiv'>\n");
$this->providerid = $p->provider->id;
echo ("<table cellspacing='0' cellpadding='0' width='100%'>\n");
echo ("<tr>\n");
echo ("<td></td>\n");
echo ("<td>\n");
echo ("<img WIDTH='68pt' src='./interface/pic/" . $GLOBALS . "' />");
echo ("</td>\n");
echo ("</tr>\n");
echo ("<tr>\n");
echo ("<td>\n");
$res = sqlQuery("SELECT concat('<b>',f.name,'</b>\n',f.street,'\n',f.city,', ',f.state,' ',f.postal_code,'\nTel:',f.phone,if(f.fax != '',concat('\nFax: ',f.fax),'')) addr FROM users JOIN facility AS f ON f.name = users.facility where users.id ='" . mysql_real_escape_string($p->provider->id) . "'");
$patterns = array ('/\n/','/Tel:/','/Fax:/');
$replace = array ('<br>', xl('Tel').':', xl('Fax').':');
$res = preg_replace($patterns, $replace, $res);
echo ('<span class="large">' . $res . '</span>');
echo ("</td>\n");
echo ("<td>\n");
echo ('<b><span class="large">' . $p->provider->get_name_display() . '</span></b>'. '<br>');

if ($GLOBALS) {
if ($GLOBALS) {
echo ('<span class="large"><b>' . xl('DEA') . ':</b>' . $p->provider->federal_drug_id . '</span><br>');
}
else {
echo ('<b><span class="large">' . xl('DEA') . ':</span></b> ________________________<br>' );
}
}
if ($GLOBALS) {
if ($GLOBALS) {
echo ('<span class="large"><b>' . xl('NPI') . ':</b>' . $p->provider->npi . '</span><br>');
}
else {
echo ('<b><span class="large">' . xl('NPI') . ':</span></b> ________________________<br>');
}
}
if ($GLOBALS) {
if ($GLOBALS) {
echo ('<span class="large"><b>' . xl('State Lic. #') . ':</b>' . $p->provider->state_license_number . '</span><br>');
}
else {
echo ('<b><span class="large">' . xl('State Lic. #') . ':</span></b> ________________________<br>');
}
}
echo ("</td>\n");
echo ("</tr>\n");
echo ("<tr>\n");


I did move the syntax as you told me at the very end but no result at all. The details did not appear at the bottom.

Please advise.

Thanks

Please Log in to join the conversation.

3 years 10 months ago #121511 by Valentin
Replied by Valentin on topic Coding PHP
Hi Clementlo,

I mean, at the very bottom. Try after:
echo ("</td>\n");
echo ("</tr>\n");
echo ("<tr>\n");

Kind regards,
Valentín

Follow us on Twitter - twitter.com/OSTraining
Like us on Facebook - facebook.com/ostraining

Please Log in to join the conversation.

3 years 10 months ago #121544 by clementlo
Replied by clementlo on topic Coding PHP
Dear Valentin,

I tried to insert the code like you mentioned but no change. The details did not appear at the bottom. The codes are as below.

function multiprintcss_footer() {
echo ("<div class='signdiv'>\n");
echo (xl('Signature') . ":________________________________<br>");
echo (xl('Date') . ": " . date('Y-m-d'));
echo ("</div>\n");
echo ("</div>\n");
echo ("</td>\n");
echo ("</tr>\n");
echo ("<tr>\n");
echo ('<b><span class="large">' . $p->provider->get_name_display() . '</span></b>'. '<br>');

if ($GLOBALS) {
if ($GLOBALS) {
echo ('<span class="large"><b>' . xl('DEA') . ':</b>' . $p->provider->federal_drug_id . '</span><br>');
}
else {
echo ('<b><span class="large">' . xl('DEA') . ':</span></b> ________________________<br>' );
}
}
}

Please advise.

Thanks

Please Log in to join the conversation.

3 years 10 months ago #121546 by Valentin
Replied by Valentin on topic Coding PHP
This is interesting!
Do you noticed any difference in the output in comparison with your previous screenshot ?

Kind regards,
Valentín

Follow us on Twitter - twitter.com/OSTraining
Like us on Facebook - facebook.com/ostraining

Please Log in to join the conversation.

3 years 10 months ago #121548 by clementlo
Replied by clementlo on topic Coding PHP
Dear Valentin,

No different at all.

Please advise what is the next step.

Thanks

Please Log in to join the conversation.

3 years 10 months ago - 3 years 10 months ago #121559 by Valentin
Replied by Valentin on topic Coding PHP
May you send all the required files from your project compressed in a ZIP to reproduce the issue in my local computer and see if we're missing something? Do it to support@ostraining.com - include the url of this forum topic in the message, then reply here.

Kind regards,
Valentín

Follow us on Twitter - twitter.com/OSTraining
Like us on Facebook - facebook.com/ostraining

Please Log in to join the conversation.

3 years 10 months ago #121562 by clementlo
Replied by clementlo on topic Coding PHP
Dear Valentin,

The whole project is a huge files to allow you to reproduce the issue. You can download it from the website. www.open-emr.org/wiki/index.php/OpenEMR_Downloads

I will send you a file that contains the code I mentioned through the email. You can then add into the file onto the software.

Thanks

Please Log in to join the conversation.

3 years 10 months ago #121583 by Valentin
Replied by Valentin on topic Coding PHP
Hi Clementlo,

Sorry for being a pain, I'm using Mac OS. The process is a bit overwhelming as described here .

Is there a chance you may upload the project in a live server to see it in action? In that way I can check easily via FTP.

We appreciate your patience

Kind regards,
Valentín

Follow us on Twitter - twitter.com/OSTraining
Like us on Facebook - facebook.com/ostraining

Please Log in to join the conversation.

3 years 10 months ago #121602 by clementlo
Replied by clementlo on topic Coding PHP
Dear Valentin,

I have made it available on the website. The URL for this website is www.openemr.drclementlo.com/openemr-4.2....ame.php?site=default

For username and password, I will send you an email to support@ostraining.com.

To print out the copy of prescription, please click on the patient/client on left hand side.

Next, you will see a patient named Subject, Test. Click on it. It will bring you up the patient case note.

Click Edit on prescription which is at the most left hand bottom corner. It will show you a list of medication.

Click Print HTML will show you the template of the prescription.

I hope this help.

If you have any problem with it, please let me know.

Attached in this email is the snapshot of the Openemr.

Thanks

This message has an attachment image.
Please log in or register to see it.

Please Log in to join the conversation.

3 years 10 months ago - 3 years 10 months ago #121643 by Valentin
Replied by Valentin on topic Coding PHP
Hi Clementlo,

Thanks for the detailed instructions. I would like to access via FTP to play with C_Prescription.class.php and see what's going on. Include the path to that file in your server also.

We appreciate your patience

Kind regards,
Valentín

Follow us on Twitter - twitter.com/OSTraining
Like us on Facebook - facebook.com/ostraining

Please Log in to join the conversation.

3 years 10 months ago #121657 by clementlo
Replied by clementlo on topic Coding PHP
Dear Valentin,

Thank you for your reply. I had created a dedicated FTP for this Openemr.

I will email you the host, username and password to support@ostraining.com.

Please Log in to join the conversation.

3 years 10 months ago - 3 years 10 months ago #121660 by Valentin
Replied by Valentin on topic Coding PHP
The code that prints the content is between lines 596-615
File: /openemr-4.2.0/controllers/C_Prescription.class.php

Each of these lines print a section of the final result:
$this->multiprintcss_header($p);
$this->multiprintcss_body($p);
$this->multiprintcss_footer();

Each line print the sections below:


That being said, check multiprintcss_header() function line: 302-376 - to change the code to your needs and reorder to print the information based on your screenshot . As I can see you would need to split multiprintcss_header() function to extract the logo and "Administrator" and "DEA" elements to display below all the content.

Kind regards,
Valentín

Follow us on Twitter - twitter.com/OSTraining
Like us on Facebook - facebook.com/ostraining

This message has an attachment image.
Please log in or register to see it.

Please Log in to join the conversation.

3 years 10 months ago #121664 by clementlo
Replied by clementlo on topic Coding PHP
Dear Valentin,

I changed the code for footer at lines 436 to 452 show the details can be showed on footer but it is not working.

The codes are below:

function multiprintcss_footer() {
echo ("<div class='signdiv'>\n");
echo (xl('Signature') . ":________________________________<br>");
echo (xl('Date') . ": " . date('Y-m-d'));
echo ("</div>\n");
echo ("</div>\n");

if ($GLOBALS) {
if ($GLOBALS) {
echo ('<span class="large"><b>' . xl('DEA') . ':</b>' . $p->provider->federal_drug_id . '</span><br>');
}
else {
echo ('<b><span class="large">' . xl('DEA') . ':</span></b> ________________________<br>' );
}
}
}
}

Please advise the next step.

Thanks

This message has attachments images.
Please log in or register to see it.

Please Log in to join the conversation.

3 years 10 months ago - 3 years 10 months ago #121683 by Valentin
Replied by Valentin on topic Coding PHP
Hi Clementlo,

What result are you getting after doing click in Print HTML for the prescription? Please attach the screenshot

Kind regards,
Valentín

Follow us on Twitter - twitter.com/OSTraining
Like us on Facebook - facebook.com/ostraining

Please Log in to join the conversation.

3 years 10 months ago #121693 by clementlo
Replied by clementlo on topic Coding PHP
Dear Valentin,

I was unable to get any result to print as it won't work at all.

I attached the snapshot on this forum earlier on.

If you want to have a look yourself, please log in and see the problem.

Thanks

Please Log in to join the conversation.

3 years 10 months ago #121695 by Valentin
Replied by Valentin on topic Coding PHP
Ah! The changes broken other areas of the site.

Unfortunately, it seems there is no easy way to reorganize the code to change the order of the elements without breaking other areas of the site.

Kind regards,
Valentín

Follow us on Twitter - twitter.com/OSTraining
Like us on Facebook - facebook.com/ostraining

Please Log in to join the conversation.

3 years 10 months ago #121699 by clementlo
Replied by clementlo on topic Coding PHP
Dear Valentin,

Thank you for your reply.

Do you have any better idea to solve this problem?

Please Log in to join the conversation.

3 years 10 months ago - 3 years 10 months ago #121719 by Valentin
Replied by Valentin on topic Coding PHP
Hi Clementlo,

It would require to hire a developer that can customize the code to your needs. We have lists of recommended devs for Joomla , WordPress and Drupal , however they may help you since they know PHP.

Please consider email them for a quote.

Kind regards,
Valentín

Follow us on Twitter - twitter.com/OSTraining
Like us on Facebook - facebook.com/ostraining

Please Log in to join the conversation.

Join today and get access to 1,000's of books and videos. Learn WordPress, Drupal, Magento, Joomla and more! Sign up today!