Order Entry UI Sprint 4 Announcement

Taking a step back, the purpose of OrderFrequency.frequencyPerDay is as a convenience to write code that can do things like

  1. calculate how many doses need to be dispensed to the patient
  2. approximate how many drugs would be consumed by all patients in a treatment program

Also, I’d note that this field is optional.

I’m wondering what will make it easiest to write code that consumes this. For example 2, it’s a nice feature to be able to blindly do duration(order) * order.frequency.frequencyPerDay (in which case having frequencyPerDay of 1 is not helpful.

For example 1 I might want to do something more complicated, like

daysBetween(startOfDay(o.effectiveStartDate), endOfDay(o.effectiveEndDate))
* o.frequency.frequencyPerDay

…in this case having frequencyPerDay = 1 would be correct.

My first thought is that we should actually just leave frequencyPerDay null for ONCE, and code would need to know to treat this as a special case.

I could see either doing that, or using the value 1.

@burke any thoughts?

1 Like

Is the patient uuid valid on the demo app? If yes, maybe you can try using sysadmin/Sysadmin123 to log in and see if it works

Please try refresh the page, fill up the spaces provided and try again

Hi @harisu.

Follow the steps below to test your implementation:

  • Visit the online app - link

  • Login with the following credentials:

    • username: admin

    • password: sup3rS3cr3tPassw0rd

  • Visit the app containing a patient uuid - link

  • Proceed to search for: Morphine

  • Enter the drug details using either the Standard Dosage or Free Text tabs.

Note: For test purposes, in order to get a large number of past orders within a short timeframe, I’d suggest you set the duration and unit to a short time. For instance, duration: 2, units: minutes or a shorter timeframe. After 2 minutes, refresh the page. By this time, the drug order would have expired and can be viewed under the Past Drug Orders tab.

cc: @kodero @mogoodrich @dkayiwa @darius

@fred i did as you said and I accessed this https://modules-refapp.openmrs.org/openmrs/ws/rest/v1/order?totalCount=true&limit=4&startIndex=0&CareSetting=outpatient&patient=14845fc8-b7c3-4b1d-9c36-6b77c6ea05a4&status=inactive&t=drugorder&v=full to see the orders and .

false

and couldn’t find the order even using the Login

@larrystone @wyclif @darius @dkayiwa

There are some errors in the URL you are accessing:

  • CareSetting parameter should be: careSetting

  • careSetting value for outpatient should be the uuid: 6f0c9a92-6f24-11e3-af88-005056821db0

That is, the correct URL is: https://modules-refapp.openmrs.org/openmrs/ws/rest/v1/order?totalCount=true&limit=4&startIndex=0&careSetting=6f0c9a92-6f24-11e3-af88-005056821db0&patient=14845fc8-b7c3-4b1d-9c36-6b77c6ea05a4&status=inactive&t=drugorder&v=full

note: You would need to clear your browser periodically or use incognito mode.

To clear your browser cache for the site, follow the steps below:

  • Open your browser dev tools (on Chrome: F12 or Control+Shift+I)

  • Navigate to the Application tab as shown below:

  • Scroll to the bottom and click on Clear site data, as shown below: site cache

  • Proceed to the top left of your browser and right click on your browser reload icon, and select - Empty Cache and Hard Reload, as shown below: reload icon

  • Re-authenticate if you have been logged out, else the app should be working correctly now.

Reply with the result of trying this out.

cc: @darius @dkayiwa @wyclif @kodero @mogoodrich

@fred It ok my code is the one having issues let me work on it. Wish to ask permission to upload the omod when i fixe it.

Alright.

Good to know you can continue working now.

Before uploading the omod, remove the existing one from the app and add your omod. If the app crashes, follow the same steps above to get it back up.

Reply to this post with your feedback.

P.S The task OEUI-113 is dependent on this functionality working as expected and the team would appreciate if you could treat this task as a priority.

Great job :+1:

cc: @darius @dkayiwa @wyclif @kodero @mogoodrich

@fred The app has crashed immediately after i removed the omod and following the instructions you gave it is not starting back.

@darius @dkayiwa @wyclif @mogoodrich

I’d escalate this.

Hi @dkayiwa, https://modules-refapp.openmrs.org/openmrs/ is down.

cc: @darius @wyclif @mogoodrich @kodero

here is the link to the new omod i wanted to install https://drive.google.com/file/d/13T_pv8paF3eeF1EI9HkBAnsu6uMVXJdd/view?usp=sharing

I just uploaded the omod to my local instance of the refApp and it seems not to work yet… Can we see your code, perhaps raise a PR and share the link?

Could you test your implementation using your local instance of the OpenMRS app?

This would be helpful to give you a clear idea of how your code is working.

Also, GitHub commit links where necessary would help.

cc: @dkayiwa @kodero

please have a look at the commit https://github.com/fanyui/openmrs-module-webservices.rest/commit/3bdd035fdaf1e555c30dcef66d5967f8a49a3128 appreciate any mistakes i might be making

Order Entry UI Sprint 4 Progress

Hi everyone,

As we approach the end of the current sprint (sprint 4), permit me to share the project’s progress update on behalf of the team.

The current sprint began on 2018-05-07. Prior to this sprint, we had the following sprints: Order Entry UI Sprint 1 Progress , Order Entry UI Sprint 2 Progress and Order Entry UI Sprint 3 Progress.

Below are the tasks we have been able to complete in the current sprint:

  • Save edited drug order

  • Make a POST request to actually add orders

  • Checking the existence of encounter role

  • Implement updates to POST discontinuing an order

  • Front End Implement Pagination for Active Orders

  • Fix Linter and prop type validation issues

  • Re-implement edit drug draft order

  • Optimize app to use initial state implementation for reducers

  • Bug fix for failing app test file

  • Remove unused files from the app

  • Remove index.test.js file

  • Update reducer test files to improve on the codebase test coverage

  • OEUI-112 Fix cannot execute statement error when adding order

  • RESTWS-707 Fix bug in encounterRole endpoint

We also have some tasks currently in progress and others awaiting code review. See more here - link

Below are screen screenshots of the running app:

Entering drug details:

After clicking the save button:

Newly created drug order:

Edit active drug order: 1 milligram to 2 milligram:

Newly edited draft order: now 2 milligram:

Saved edited draft order:

DIscontinue active order:

Active drug order discontinued, no active order:

Edited and discontiued orders now in Past Drug Orders tab:

cc @dkayiwa @flavia @zeze @larrystone @geofrocker @betty @darius @mogoodrich @kodero

Thanks for sharing the screenshots, and nice progress!

A few comments:

  • “Save” is not the correct label for the button, since it adds a draft, and doesn’t actually save to the DB. I would use “Add” instead, but maybe there’s a better label.
  • I would display the concept’s short name for units (e.g. “mg” not “milligrams”
  • The options for dispensing units should not be the same as the units for prescribing. E.g. you wouldn’t direct the pharmacy to dispense “2 mg” you might ask them to dispense “20 tablets” or “1 bottle”. I don’t know if this is a code issue, or it has to do with the data you have configured.
  • OutPatient -> Outpatient. InPatient -> Inpatient.
  • Do we have to have paging for the active drug orders? It’s a bit distracting to see “1 to 1 of 1 entries.” Having 20 active orders would be on the high end of what is expected, so my initial suggestion is to display all the active orders without the UI showing any paging.
  • “Revise for: Ciprofloxacin” => I would show the entire order you’re revising for context, not just the drug name. For example:
[h3]Revise Ciprofloxacin[/h3]
Current order: Ciprofloxacin 5mg, twice daily, oral, for 5 days total ...
New order:
[form goes here]
  • Instead of “Reason: follow prescription” it should say “As needed for $order.asNeededCondition” More specifically the logic should be like this:

    if (order.asNeeded) {
        output.append(order.asNeededCondition ? `As needed for $order.asNeededCondition` : "As needed")
    }
    
  • In the discontinue active order example, I think I would also include more details of what is being discontinued. E.g. it’s not just “Discontinue Ciprofloxacin” but “Discontinue Ciprofloxacin 5mg, …”

    • It’s possible that you have two active prescriptions for different formulations of the same drug. The more common case of this is that you have a scheduled dose and an as-needed additional dose e.g. “oxycodone 5mg oral every 6 hours” and “oxycodone 5-10mg every 4 hours as needed”.
    • It’s also possible that you’d take a steroid or antihistamine orally and also as a topical cream, or an eye drop.
    • All this is to say that there are cases where just saying “Discontinue $drugName” is not clear enough.
2 Likes

Thanks for the detailed feedback.

Th team would go through all the suggestions you have made here.

Hi @harisu

Do you have this working as expected in your local OpenMRS instance?

Not yet. What is the validation carried out on Units field in the orderEntry form. I keep on receiving illegal value when i inspect the element no matter what value i fill… and also which table is it looking up it data from or senting it data to. I will give in some 3 hours and if i still don’t get it working i will love to free up the issue So the sprint can complete in time. Frankly i didn’t expect this ticket to take this long. Also a little guide on the approach and what is possibly going wrong will be usefull. I’ve used this algorithm for sorting objects it works just fine but in this case i don’t know why it is not sorting… https://github.com/fanyui/openmrs-module-webservices.rest/commit/3bdd035fdaf1e555c30dcef66d5967f8a49a3128

@mogoodrich @darius @larrystone @mogoodrich

I have released https://issues.openmrs.org/browse/RESTWS-706 Till now i’ve still not gotten it to work.