Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ken patient finder and tab settings #3124

Merged

Conversation

kchapple
Copy link
Sponsor Contributor

@kchapple kchapple commented Mar 8, 2020

Fixes #

Short description of what this resolves:

This pull request addresses 3 issues:
1- When creating a "Facility" field in the patient demographics layout, and adding it to the patient finder columns, the facility name would not be displayed. This was because there was not a facility type implemented in the options function that generated a plain text field. This was added by using the facility service to map the facility ID to the facility name so it can be displayed.

2- There is currently no way to specify default column ordering (sort direction) on patient list columns. This pull request addresses this issue by adding a list option for Sort_Direction, as well as adding a sort direction column to the Patient List Columns list, so the user can specify the default sort direction (for a date-created for example.) This does not change the default behavior, which is "asc" for all columns.

3- There was not the ability to have None as an option for the second default tab. I added the ability to select "None" in globals settings for the second default tab, and also cleaned up some of the dead code in the tabs view model. This does not change the default behavior.

Changes proposed in this pull request:

@kchapple
Copy link
Sponsor Contributor Author

kchapple commented Mar 8, 2020

@bradymiller @sjpadgett Here are some small features that have been requested that I would like to contribute. Thank you!

app_view_model.application_data.tabs.tabsList()[0].url(<?php echo json_encode("../".$_SESSION['frame1url']); ?>);
app_view_model.application_data.tabs.tabsList()[0].name(<?php echo json_encode($_SESSION['frame1target']); ?>);
// Use session variables and tabStatus object to set up initial/default first tab
app_view_model.application_data.tabs.tabsList.push(new tabStatus("Loading...",<?php echo json_encode("../".$_SESSION['frame1url']); ?>,<?php echo json_encode($_SESSION['frame1target']); ?>,true,true,false));
Copy link
Sponsor Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

translate:

app_view_model.application_data.tabs.tabsList.push(new tabStatus(<?php echo xlj("Loading"); ?> + "...",<?php echo json_encode("../".$_SESSION['frame1url']); ?>,<?php echo json_encode($_SESSION['frame1target']); ?>,true,true,false));

Copy link
Sponsor Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

app_view_model.application_data.tabs.tabsList()[1].url(<?php echo json_encode("../".$_SESSION['frame2url']); ?>);
app_view_model.application_data.tabs.tabsList()[1].name(<?php echo json_encode($_SESSION['frame2target']); ?>);
// Use session variables and tabStatus object to set up initial/default second tab, if none is set in globals, this tab will not be displayed initially
app_view_model.application_data.tabs.tabsList.push(new tabStatus("Loading...",<?php echo json_encode("../".$_SESSION['frame2url']); ?>,<?php echo json_encode($_SESSION['frame2target']); ?>,true,false,false));
Copy link
Sponsor Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

translate the Loading like done above

Copy link
Sponsor Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@@ -419,4 +419,15 @@ CREATE TABLE `pro_assessments` (

#IfNotRow2D list_options list_id LBF_Validations option_id future_date
INSERT INTO `list_options` (`list_id`,`option_id`,`title`,`notes`, `seq`) VALUES ('LBF_Validations','future_date','Future Date','{\"futureDate\":{\"message\":\"must be future date\"}}','32');

#IfNotRow2D list_options list_id lists option_id Sort_Direction
INSERT INTO `list_options` (`list_id`, `option_id`, `title`, `seq`, `is_default`, `activity`) VALUES ('lists', 'Sort_Direction', 'Sort Direction', 306, 1, 1);
Copy link
Sponsor Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would make seq 1 here and is_default 0 (since that is what is done on most of the list titles)

Copy link
Sponsor Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

#EndIf

#IfNotRow2D list_options list_id Sort_Direction option_id 1
INSERT INTO `list_options` (`list_id`, `option_id`, `title`, `seq`, `is_default`, `activity`) VALUES ('Sort_Direction', '1', 'desc', 2, 0, 1);
Copy link
Sponsor Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for the seq on these, start at 10 and increment by 10 (this gives breathing room if wish to add other items in the future). Plus the asc/desc titles seem to be very technical language. Would there be a less technical way to state these options (for folks that may not know was asc/desc mean) (if not, then keep it as is).

Copy link
Sponsor Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

sql/database.sql Outdated Show resolved Hide resolved
@bradymiller
Copy link
Sponsor Member

hi @kchapple , Review complete. If you address these minor issues and it's testing well for you, then will bring it into the codebase. thanks!

"list_id = 'ptlistcols' AND activity = 1 ORDER BY seq, title");
while ($row = sqlFetchArray($res)) {
$colname = $row['option_id'];
$colorder = generate_display_field(array('data_type'=>'1','list_id'=>'Sort_Direction'), $row['toggle_setting_1']);
Copy link
Sponsor Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Been looking into this. do note that this will translate what is returned, so it could get change to something else :)
Will be better to grab the title directly via a sql query from list_options.

Copy link
Sponsor Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@kchapple
Copy link
Sponsor Contributor Author

kchapple commented Mar 10, 2020 via email

@sjpadgett
Copy link
Sponsor Member

hi guys, are we close on bringing this in?

…slate because it might change the string for 'asc' and 'desc' which would make the datatables sorting malfunction
@kchapple
Copy link
Sponsor Contributor Author

@sjpadgett I just committed a change so that the system won't translate the sort direction (cause that would break the datatables.) Waiting on our friend travis.

@sjpadgett
Copy link
Sponsor Member

Thanks for this. I'll be testing along with some other test i'm into now and will let you know. Want to get in so other PR can catch up.
As always, appreciate the contribution.

@sjpadgett sjpadgett merged commit 584bc07 into openemr:master Mar 11, 2020
@sjpadgett
Copy link
Sponsor Member

working well I especially like the none for second tab.

@kchapple
Copy link
Sponsor Contributor Author

Sweet, thanks!

@sjpadgett sjpadgett mentioned this pull request Mar 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants