Two Part Question - How can this be done?

Discussions related to customizing hooks. Hooks are documented at http://bigprof.com/appgini/help/advanced-topics/hooks/
Post Reply
jhart
Posts: 12
Joined: 2018-07-21 20:31

Two Part Question - How can this be done?

Post by jhart » 2018-07-27 11:19

First question: I have added the following code in my dv hooks file and it works PERFECT

/* if this is the print preview, don't modify the detail view */
if(isset($_REQUEST['dvprint_x'])) return;

ob_start(); ?>

<div id="form-tabs">
<ul class="nav nav-tabs">
<li class="active"><a href="#Note-info" data-toggle="tab">Note Detail</a></li>
<li><a href="#Session-info" data-toggle="tab">Session Details</a></li>
<li><a href="#Patient-info" data-toggle="tab">Patient Details</a></li>
<li><a href="#Closeout-info" data-toggle="tab">Close Out Details</a></li>
<li><a href="#Approve-info" data-toggle="tab">Approve Progress Note</a></li>
</ul>

<ul class="tab-content">
<div class="tab-pane active form-horizontal" id="Note-info"></div>
<div class="tab-pane form-horizontal" id="Session-info"></div>
<div class="tab-pane form-horizontal" id="Patient-info"></div>
<div class="tab-pane form-horizontal" id="Closeout-info"></div>
<div class="tab-pane form-horizontal" id="Approve-info"></div>
</ul>
</div>

<style>
#form-tabs .nav-tabs a{ display: block !important; }
</style>

<script>
$j(function(){
$j('#form-tabs').appendTo('#Clients_dv_form');

/* fields to move to the Client info tab */
$j('#ID').parents('.form-group').appendTo('#Note-info-info');
$j('#Client').parents('.form-group').appendTo('#Note-info');
$j('#BHISProvider').parents('.form-group').appendTo('#Note-info');
$j('#Procedure').parents('.form-group').appendTo('#Note-info');
$j('#Modifier').parents('.form-group').appendTo('#Note-info');
$j('#Units').parents('.form-group').appendTo('#Note-info');
$j('#StartTime').parents('.form-group').appendTo('#Note-info');

/* fields to move to the Personal info tab */
$j('#Location').parents('.form-group').appendTo('#Session-info');
$j('#PersonsPresent').parents('.form-group').appendTo('#Session-info');
$j('#TreatmentGoals').parents('.form-group').appendTo('#Session-info');
$j('#TreatmentInt').parents('.form-group').appendTo('#Session-info');
$j('#ResponseInter').parents('.form-group').appendTo('#Session-info');

/* fields to move to the Services info tab */
$j('#CurrentSuicidal').parents('.form-group').appendTo('#Patient-info');
$j('#SuicidalNotes').parents('.form-group').appendTo('#Patient-info');
$j('#CurrentHomicidal').parents('.form-group').appendTo('#Patient-info');
$j('#HomicidalNotes').parents('.form-group').appendTo('#Patient-info');
$j('#OtherThoughts').parents('.form-group').appendTo('#Patient-info');
$j('#OtherNotes').parents('.form-group').appendTo('#Patient-info');
$j('#CurrentSubstance').parents('.form-group').appendTo('#Patient-info');

/* fields to move to the Services info tab */
$j('#ServiceReferrals').parents('.form-group').appendTo('#Closeout-info');
$j('#NextSession').parents('.form-group').appendTo('#Closeout-info');
$j('#NextSessionNotes').parents('.form-group').appendTo('#Closeout-info');

/* fields to move to the Services info tab */
$j('#Provider').parents('.form-group').appendTo('#Approve-info');
$j('#NoteComplete').parents('.form-group').appendTo('#Approve-info');

})
</script>

<?php
$tabs = ob_get_contents();
ob_end_clean();

$html .= $tabs;


If you look at the Note Detail attachment, I would like to add a paragraph of text above the "Provider" field in this tab. How would I accomplish this?
Users.png
Users.png (49.79 KiB) Viewed 2750 times
Second Question: In the above tab I have the Provider field set to: <%%creatorUsername%%>
I have a table in my solution that lists employees:
Note Detail.png
Note Detail.png (45.94 KiB) Viewed 2750 times
Is it possible to associate this table's Items to the system users so that when they create these records I can "inject" the FullNameTitle field into this field instead of the <%%creatorUsername%%>. What I am trying to accomplish is the system would autofill this field based on who is signed into the system and not allow users to enter another users info. I hope this makes sense.

Thanks in advance for any help!

pbottcher
AppGini Super Hero
AppGini Super Hero
Posts: 1635
Joined: 2018-04-01 10:12

Re: Two Part Question - How can this be done?

Post by pbottcher » 2018-07-27 13:33

Hi,

for part1 you can use something like

Code: Select all

$j("<p>Test</p>" ).prependTo('[class=form-group]:first-child');


for part2 of your question you can look at

https://forums.appgini.com/phpbb/viewto ... wner#p8411
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.

jhart
Posts: 12
Joined: 2018-07-21 20:31

Re: Two Part Question - How can this be done?

Post by jhart » 2018-07-28 18:29

I have added the code but now the tab is blank and doesn't display the Test text or the fields.
Attachments
pic2.png
pic2.png (14.26 KiB) Viewed 2728 times
Pic1.png
Pic1.png (8.69 KiB) Viewed 2728 times

pbottcher
AppGini Super Hero
AppGini Super Hero
Posts: 1635
Joined: 2018-04-01 10:12

Re: Two Part Question - How can this be done?

Post by pbottcher » 2018-07-30 08:19

Hi,

please replace

$j("<p>Test</p>" ).prependTo('[class=form-group]:#Approve-info');

with

Code: Select all

$j('<p>Text to be displayed</p>').appendTo('#Approve-info);
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.

jhart
Posts: 12
Joined: 2018-07-21 20:31

Re: Two Part Question - How can this be done?

Post by jhart » 2018-07-30 14:45

When I add this to the hooks file the fields are now displayed above the tabs and the tabs are empty and the text is not displayed.
Attachments
2018-07-30.png
2018-07-30.png (65.84 KiB) Viewed 2682 times

pbottcher
AppGini Super Hero
AppGini Super Hero
Posts: 1635
Joined: 2018-04-01 10:12

Re: Two Part Question - How can this be done?

Post by pbottcher » 2018-07-30 16:15

can u post your function pls
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.

Post Reply