-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Show latest lab test per day chronologically, disabled doublig of dates in table * Add date filter to lab tests table * fixed 2 rubocop offenses * added date range rules * added place holder for empty data and added defauld dates * rewrite to use AR (was SQL), some logic moved to the Model * moved min and max date range vaues into configuration * fixed rubocop offenses related with using dates without timezone * fixed naming, AGAIN authorization in lab tests controller and few another fixes * fixed messages on empty records, empty records in specific date range * important but founded and fixed! fix: Associate lab tests with selected patient * fixed values render in table * removed extra variable * Fix formating and naming --------- Co-authored-by: aksafan <[email protected]>
- Loading branch information
1 parent
d85edaa
commit 4936834
Showing
7 changed files
with
113 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<div class="mb-6 flex justify-between items-center"> | ||
<%= form_with(url: lab_tests_path, method: :get, class: "inline-flex items-center") do |f| %> | ||
<div class="inline-flex items-center"> | ||
<span class="mr-3 text-sm font-medium"><%= t('lab_tests.lab_test_date_filter.from') %></span> | ||
<%= f.date_field :start_date, | ||
value: params[:start_date] || Rails.application.config.x.lab_test_date_range[:default_start_date].call, | ||
min: Rails.application.config.x.lab_test_date_range[:min_date], | ||
max: Rails.application.config.x.lab_test_date_range[:max_date], | ||
onchange: "this.nextElementSibling.nextElementSibling.min=this.value", | ||
class: "rounded-md border border-gray-300 py-2 px-3 mr-6", | ||
placeholder: "mm/dd/yyyy" %> | ||
|
||
<span class="mr-3 text-sm font-medium"><%= t('lab_tests.lab_test_date_filter.to') %></span> | ||
<%= f.date_field :end_date, | ||
value: params[:end_date] || Rails.application.config.x.lab_test_date_range[:default_end_date].call, | ||
min: params[:start_date] || Rails.application.config.x.lab_test_date_range[:min_date], | ||
max: Rails.application.config.x.lab_test_date_range[:max_date], | ||
class: "rounded-md border border-gray-300 py-2 px-3 mr-6", | ||
placeholder: "mm/dd/yyyy" %> | ||
|
||
<%= f.submit t('lab_tests.lab_test_date_filter.filter'), | ||
class: "primary-button" %> | ||
</div> | ||
<% end %> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<div class="flex flex-col items-center justify-center w-full p-4"> | ||
<div class="flex justify-center w-full"> | ||
<svg fill="#000" height="50px" width="50px" version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 512.001 512.001" xml:space="preserve"> | ||
<g id="SVGRepo_bgCarrier" stroke-width="0"></g> | ||
<g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g> | ||
<g id="SVGRepo_iconCarrier"> | ||
<g> | ||
<g> | ||
<path d="M363.801,0.001H54.872C24.615,0.001,0,24.616,0,54.874v402.254c0,30.256,24.615,54.872,54.872,54.872h55.403 c5.073,0,9.186-4.113,9.186-9.186c0-5.073-4.113-9.186-9.186-9.186H54.872c-20.126,0-36.5-16.373-36.5-36.5V54.874 c0-20.126,16.373-36.501,36.5-36.501h308.929c5.074,0,9.186-4.113,9.186-9.186C372.987,4.114,368.876,0.001,363.801,0.001z"></path> | ||
</g> | ||
</g> | ||
<g> | ||
<g> | ||
<path d="M457.128,0.002h-56.581c-5.074,0-9.186,4.113-9.186,9.186c0,5.073,4.111,9.185,9.185,9.185h56.581 c20.128,0,36.501,16.375,36.501,36.5v402.254c0,20.126-16.373,36.5-36.501,36.5H147.021c-5.073,0-9.186,4.113-9.186,9.186 c0,5.073,4.113,9.186,9.186,9.186h310.107c30.257,0,54.873-24.615,54.873-54.872V54.874 C512.001,24.617,487.385,0.002,457.128,0.002z"></path> | ||
</g> | ||
</g> | ||
<g> | ||
<g> | ||
<path d="M320.286,256l53.998-53.998c3.587-3.588,3.587-9.404,0-12.99l-51.296-51.294c-3.586-3.588-9.403-3.588-12.99,0 l-53.998,53.996l-53.998-53.996c-3.588-3.588-9.404-3.588-12.99,0l-51.294,51.294c-3.588,3.588-3.588,9.404,0,12.99L191.714,256 l-53.998,53.998c-3.588,3.588-3.588,9.403,0,12.99l51.294,51.294c1.722,1.723,4.059,2.691,6.495,2.691 c2.436,0,4.773-0.968,6.495-2.691l53.998-53.998l53.998,53.998c1.722,1.723,4.059,2.691,6.495,2.691 c2.436,0,4.773-0.968,6.495-2.691l51.296-51.294c3.587-3.587,3.587-9.404,0-12.99L320.286,256z M316.492,354.796l-53.998-53.998 c-1.793-1.794-4.145-2.691-6.495-2.691c-2.35,0-4.702,0.897-6.495,2.691l-53.998,53.998l-38.304-38.304l53.998-53.996 c1.723-1.723,2.691-4.059,2.691-6.495c0-2.436-0.968-4.772-2.691-6.495l-53.998-53.998l38.304-38.304l53.998,53.998 c3.588,3.588,9.404,3.588,12.99,0l53.998-53.998l38.304,38.304l-53.998,53.998c-1.723,1.723-2.691,4.059-2.691,6.495 c0,2.436,0.968,4.772,2.691,6.495l53.998,53.996L316.492,354.796z"></path> | ||
</g> | ||
</g> | ||
</g> | ||
</svg> | ||
</div> | ||
<div class="flex flex-col items-center justify-center max-w-md mx-auto text-center p-4"> | ||
<h3 class="font-medium text-gray-900 mb-2 text-lg sm:text-xl"> | ||
<%= t('lab_tests.lab_test_no_data_placeholder.no_data_title') %> | ||
</h3> | ||
|
||
<% if params[:start_date].present? && params[:end_date].present? %> | ||
<p class="text-gray-500 text-sm sm:text-base"> | ||
<%= t('lab_tests.lab_test_no_data_placeholder.no_data_message_with_dates', | ||
start_date: Date.parse(params[:start_date]).strftime("%B %d, %Y"), | ||
end_date: Date.parse(params[:end_date]).strftime("%B %d, %Y")) %> | ||
</p> | ||
<% else %> | ||
<p class="text-gray-500 text-sm sm:text-base"> | ||
<%= t('lab_tests.lab_test_no_data_placeholder.no_data_message_no_dates') %> | ||
</p> | ||
<% end %> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters