Page 1 of 1

Two Part Question - How can this be done?

Posted: 2018-07-27 11:19
by jhart
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 3628 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 3628 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!

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

Posted: 2018-07-27 13:33
by pbottcher
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

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

Posted: 2018-07-28 18:29
by jhart
I have added the code but now the tab is blank and doesn't display the Test text or the fields.

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

Posted: 2018-07-30 08:19
by pbottcher
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);

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

Posted: 2018-07-30 14:45
by jhart
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.

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

Posted: 2018-07-30 16:15
by pbottcher
can u post your function pls