Request to add sort_weight to order_frequency table

We (Bahmni) need an ability to add sort_weight to the items in “order_frequency” table so that the implementations can change the sort order of items in the “Choose Frequency” dropdown on the drug orders page.

I don’t see any reason not to add this.

@burke?

Hello everyone,

In Bahmni, while prescribing a medication for a patient, the Doctor/Nurse is asked to provide the frequency of the medication from the dropdown as shown below.

We would like to know if the above suggestion of implementing sort_weight can be done as the current sort logic is based on the id of the concepts that are added as frequency.

cc: @ibacher @raff @binduak @angshuonline

2 Likes

I’ll just repeat what @darius said above: “I don’t see any reason not to add this.” The minimum to get this done is to at least create a ticket in the OpenMRS JIRA.

Agreed. Adding order_frequency.sort_weight seems reasonable. I always consider FHIR’s perspective to make sure we aren’t diverging; however, FHIR’s Timing uses period and periodUnit (UCUM unit) for transmitting frequencies, so doesn’t really address/need the sorting of frequency values. So, while it would be nice to add fields like period & period_unit to order_frequency some day, I don’t see any problem with including sort_weight (double) following OpenMRS conventions.

Note that sort_weight in OpenMRS is:

  • double to allow items to be placed anywhere in the sort order without having to change existing sort weights
  • sort_weight is only used to manage sort order by sorting the items in numerical order, so the actual values are meaningless and can change at any time – i.e., if items A, B, C have sort_order values (1, 2, 3) or (0.5, 6, 14) or an hour later have the values (7, 42.4, 5000) should make no difference to applications using sort_weight to sort the items.

Thanks @ibacher and @burke for your inputs. Creating a JIRA issue on the OpenMRS board for the same - [TRUNK-6212] - OpenMRS Issues

Hello @arjung I would like to work on this, but I am relatively new to the OpenMRS system. For starters, I am a little confused on where to make the changes, - is this part of a certain module or part of the openmrs-core??. I also can’t wrap my head around how prescriptions are made in OpenMRS, and I feel like I am going in circles.

I would be really glad if you assisted and pointed me in the right direction, that way my efforts could be of best use. Thanks.