Advice needed

Hi, signed up for support because you could ask for advice with Fabrik. I'm sure I could figure a lot of things out by myself, but a general outline for a solution would be appreciated.

I have a therapist who wants the following:

He wants a set of standard plans for clients. A standard plan can consist of:
- supplements
- advices
- blood tests (different kinds)
- medicine

So for different situations there are different plans (with different sets of above options).

So I started to create different lists in Fabrik, for medicin, supplements, advice, etc.

Now I need to combine those lists into a "standard plan" which can be added to a Joomla user (client). How do I go about that?

It even gets a little bit more complicated after that, because when he sits with a client, he wants to select for example "standard plan A" but maybe add some more advice to it etc.

In the end the plan needs to be saved, and editable again, and easily printable.

General instructions would be appreciated.

Many thanks in advance,

Hein
 
Ok - so you need to start with a database design. Here is how I think the database should look:
  1. Clients - a person is the start for all plans.
  2. Plans - assuming that a person could have more than one plan over time.
  3. PlanSupplements - a plan can have 0 or more supplements
  4. PlanAdvices - a plan can have 0 or more advices
  5. PlanBloodTests - a plan can have 0 or more blood tests
  6. PlanMedicines - a plan can have 0 or more medicines
  7. Supplements - a list of available supplements plus other details
  8. Advices?? - a list of standard advices
  9. BloodTests - a list of available Blood Tests plus other details
  10. Medicines - a list of available Medicines plus other details
Note: I suspect that medicine prescribing is a complex area because of the need to try to prevent mis-prescribing - so you may want to do some research about IT requirements for such systems. For example, lots of information to display to the doctor, perhaps hard or soft limits on dosage (per day) and quantity (how many days), perhaps hard or soft limits on combinations of medicines etc. This is also the kind of area where you might buy in data about medicines and import it, so before designing the table, you might want to understand what format the data to import comes in.

As you proceed you may find other tables are needed.

In Fabrik, there is a concept of Repeat Group - so items 3-6 above would be repeat groups against the Plans table - which means that they are displayed together on a form and you can add as many e.g. Supplements to a plan as you need to.

Items 7-10 would be used to look up the item in 3-6 respectively using Fabrik's database join elements, and you would then use this as the basis for displaying other information.

Being realistic, there is a reasonably steep learning curve for Fabrik as a technology (as there would be for any serious web-database development) - so your best bet is to watch the tutorials, and read quite a lot of the wiki before starting the actual development. If you have not done any database development before, then you also have the learning curve on how to develop a database application too.

Good luck. Once you have watched the tutorials and read the wiki, if you get stuck or are having difficulties, please start another thread in the forums.

P.S. If this is a paid development, you might want to think about purchasing a Pro Subscription whilst you are developing as this will get you priority access to Rob / Hugh.
 
Dear Sophist,

Thanks for your elaborate answer. I know it's a bit of a steep learning curve, but I'm pretty smart, so usually I manage over time.

Now I at least have a general idea on what to do and how to research it. I could use the Joomla users as Clients right?

I will start work on it and definitely consider buying a pro subscription for some time if I don't get through.

Thanks again.
 
Only if the user has registered on Joomla - if that is how the site is designed to work i.e. user registers on Joomla and creates an empty plan and the therapist fills it out. But yes.

S
 
Dear Sophist,

I got quite far, and there are a few additional questions I now have. You can see how far I've come actually with the data in the site in my profile.

Question 1:

So I now have the ability to make standard therapy with all required subelements. The following step is the following:
I need to be able to select a customer and make a plan for him which usually consists of a standard therapy and maybe add a few more elements to it (but not change the standard therapy). There are also cases where a person needs to follow 2 therapies. Can this be done? So I could select 2 therapies, and it would show me then both combined (which is: supplements, medicin, tests, advices)? And then save it as his custom plan?

Question 2:
In a standard therapy one can now add standard advices, but one chooses it using the name label. When you look at the details of a therapy, is it also possible to then show the description field of this advice in the overview? So I can print it then?

Many thanks in advance,

Hein
 
Q1. Yes. Though Therapies are a new requirement. So the list of tables is now:

Users - the Joomla users table
Plans - assuming that a person could have more than one plan over time.
PlanTherapies - a plan can have 1 or more standard Therapies
PlanSupplements - a plan can have 0 or more supplements
PlanAdvices - a plan can have 0 or more advices
PlanBloodTests - a plan can have 0 or more blood tests
PlanMedicines - a plan can have 0 or more medicines
Therapies - a list of standard therapies
TherapySupplements - a therapy can have 0 or more supplements
TherapyAdvices - a therapy can have 0 or more advices
TherapyBloodTests - a therapy can have 0 or more blood tests
TherapyMedicines - a therapy can have 0 or more medicines
Supplements - a list of available supplements plus other details
Advices?? - a list of standard advices
BloodTests - a list of available Blood Tests plus other details
Medicines - a list of available Medicines plus other details
Q2. Yes. Not quite sure how to achieve it though.
 
Dear Sophist, I signed up now for the pro support, so maybe you can place this now in that section.

I'd like to get tips on how to get the therapies printed, by which I mean:
I have put together a therapy from the various elements. These elements have some extra variables. So when I want to print a therapy it needs to print for example: how much medicine and how often, but also address of the client, etc. How do I do this best? I hope my question is clear.

Hein
 
hi
Could you let us know which menu link on your test site contains the therapies please?

thx
Rob
 
You can look at the bottom right, the menu is now active. (I also pm'd this to you). Under "Onderdelen" you will find therapies.

So I need directions for 2 things:
I want to create a therapy, and when I print it it needs extra data from for example medicin. Every medicin has a decsription and advice. So when somebody makes a therapy, he adds medicin, or foodsupplements, advice etc. And when I want to print the therapy, it needs to print all this extra stuff.

In the end it will be a little bit different, because what I need to do is as follows:
- a therapist wants to make a new plan for someone, and then chooses a therapy as basis for his plan, and maybe adds/removes things to it. So basically to use the prefilled therapies as a thing to fill default items. More therapies should be able to be combined as well. Any directions would be cool, so I can move again.
 
when I print it it needs extra data from for example medicin. Every
Ok this is quiet involved, so here goes.....

First you may well need to update from github to get this to work.

You will first need to create a custom template for the details view (see here for an introduction http://www.fabrikar.com/forums/index.php?wiki/form-and-details-templates/).
The simplest way here would be to copy the folder components/com_fabrik/views/details/templates/default and rename it it default_print.
Edit your form and assign the new 'default_print' template to the details template option.
Then edit default_print/default_repeatgroup_row.php. This is the layout that defines the layout for repeating group data when its rendered in a <table> structure.

We want to add a <tr> in here to include the additional information found in the medecin list, to load this in we will use the Fabrik Joomla content plugin (http://fabrikar.com/forums/index.php?wiki/content-plugin/), so first check its installed and published.

So add at the bottom of this file:

PHP:
<?php if ($group->id == 17) :?>
<tr class="print-only">
<td colspan="8">
{fabrik view=details id=7 rowid="<?php echo $this->data['tablename___elementname_raw'][$this->i]?> show-title=0}
</td>
</tr>
<?php endif; ?>

replace 'tablename___elementname' with the full element name of the Medicijn database join element found in this group.

The if statement will mean the view is only loaded for the "Voeg medicijnen toe" group.

Now if you view this in a browser you should see the Medicijn data sideloaded under each record.
To hide this from the normal html view but show it on the print view we will need to use css media types http://www.w3schools.com/css/css_mediatypes.asp

So edit template_css.php and replace it with

PHP:
echo "
 
.fabrikGroup {
clear: left;
}
 
@media screen {
  tr.print-only {
display: none
  }
}
@media print
  {
   tr.print-only {
display: block;
  }
}
";
 
Thanks, this is working well :)

I probably have another question soon, about prefilling, but I will get back to you on this one.
 
Dear,

I got that working (for example see:
http://ortho2.newspectives.nl/therapien/details/13/2 )

I want to have it work too for a normal repeatgroup, such as "Overzicht adviezen". I want to add the full advice. I figured I should edit default_repeatgroup.php in my template. If you could help my with the syntax that'd be great.

Now my next question is a bit more difficult I think:

I want my customer to make a "plan" for a pati?nt. It should prefill a plan based on a premade therapy. He should then be able to add and delete from it. But it basically has the same format as the "therapy". How should I go about it?
 
I figured I should edit default_repeatgroup.php in my template.
Yes that's correct. Just before:

PHP:
</div><!-- end control-group -->

You would add this code in

PHP:
if ($element->id === 'tablename___elementname') {?>
{fabrik view=details id=7 rowid="<?php echo $element->value; ?> show-title=0}
<?php }?>

replace 'tablename___elementname' with the full element name

I want my customer to make a "plan" for a pati?nt. It should prefill a plan based on a premade therapy. He should then be able to add and delete from it. But it basically has the same format as the "therapy". How should I go about it?

I think the solution here would be to look at the auto-fill plugin:
http://fabrikar.com/forums/index.php?wiki/autofill-form-plugin/
When you create a new plan, you could get this plugin to load up data from a pre-made therapy.
 
Sorry, but
Code:
</div><!-- end control-group -->

is not in default_repeatgroup.php

I tried putting in your code but that doesn't do anything unfortunately. I could only find the above code in default_group_labels_none.php and default_group_labels_side.php . I tried putting it there but that wasn't a success.
 
Oh yes, my bad, it should be in default_group.php.

If that doesn't work, please fill in the site's ftp details in your 'my sites' page (http://fabrikar.com/you/my-sites/) and let me know

*which template you are working on
* which form id
* what element id

you are using and I'll get it to work for you

-Rob
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top