Order Entry UI Sprint 4 Announcement

@fred does anyone on the sprint team want to take it on RESTWS-706 as small Java task? :slight_smile: I could code review.

If not, I think we can put the Order Entry ticket in the backlog and note on the ticket that it is dependent on the completion of RESTWS-706. Does that make sense to people?

I will flag RESTWS-706 as community priority as well.

Take care, Mark

I would love to take on this as my first Java task. Might need some assistance getting started though :smile:

cc: @kodero

Sure, just let me know!

As a starting point, I would take a look at the Order Resource test…looks like one of the tests could modified to also confirm that the orders are retrieved in the right order:

Then you can try to modify the actual method to sort the orders and see if you can get the test to pass!

Take care, Mark

Thanks a lot Mark.

@harisu already claimed the ticket on the sprint board.

Possible to re-assign it?

We are about uploading the latest version of our app online for the community to test. However, we have a blocker.

The blocker is concerning adding order frequency. Currently, there is no backend support to add an order frequency - for instance, Once a day, Twice daily etc. A workaround we used while working locally involved adding the order frequency manually to the database.

A cleaner approach to add order frequency would require performing this operation by calling an endpoint. Should we include this as part of our sprint or can the community support us here?

Seen attached screenshot of current backend implementation below.

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

@fred do you mind creating a ticket to supporting adding a new OrderFrequency via rest?

Ticket is available here - link

I don’t have permission to make it ready for work.

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

An even cleaner approach would be if we can distribute a package of the ā€œbest-practiceā€ order frequencies. This would entail:

  1. include this CIEL concept (and all its children) in the referencemetadata module
  2. write a metadata bundle in the referencemetadata module which creates OrderFrequency objects for these (e.g. also setting the frequencyPerDay field).

Doing it this way will give people a comprehensive and curated list, and will also include a list of synonyms (see example).

If you do this ASAP then that list could possibly be included in the RefApp release that’s imminent.

@darius Thanks for this information. I quite agree this would be the best approach.

Looking into the referencemetadata module codebase, I noticed that the CIEL concepts for most of the ā€œbest-practiceā€ order frequencies (e.g Daily, twice daily, etc) have been defined in this file. Is it okay to assume so?
If so, I guess that leaves us with the second point of writing a metadata bundle the orderFrequency objects with the necessary fields?

With help from this vibrant community, I have a feeling that we can pull this off :wink:

fyi, for anyone watching Travis, I didn’t realize that Travis ran against all branch pushes as well:

https://travis-ci.org/openmrs/openmrs-owa-orderentry?utm_source=email&utm_medium=notification

Pretty cool, but this error can be ignored… this branch was just a hack I was working on that I wanted to push up to github for safe-keeping. It’s expected to fail and never meant to be merged into core!

:smiley: It’s okay and just so you know, we might have never found out until you raise a PR or perhaps we try looking into the branches on the repo. Happy hacking…

I hadn’t realized they were already there, but you are correct, they are.

So you would only have to do step 2. That requires Java code, but it’s really more like translating data into Java. Here is an example: https://github.com/openmrs/openmrs-module-referencemetadata/blob/referencemetadata-2.7.1/api/src/main/java/org/openmrs/module/referencemetadata/RolePrivilegeMetadata.java

Okay, thanks @darius. @dkayiwa and @wyclif What do you think? Should we take this up?

Sounds worthwhile to me.

1 Like

@dkayiwa, @darius I have created a issue ticket for this purpose here. Please look into it

I have also been working on this feature but I seem to have a blocker. I noticed that orderFrequency is not included in the CoreConstructor.java convenience methods, so I tried to implement mine but the module would not build. See attached image for more info. Is there anything I should have done better?

public class OrderFrequencyMetaData extends AbstractMetadataBundle { public static class _OrderFrequency{

    public static final String TEST = "aaa-aabha-ahuuha";
}

public static class _Concept {
    public static final String TWICE_DAILY = "160859AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA";
}

public static OrderFrequency orderFrequency(String conceptUuid, String uuid, Double frequencyPerDay) {
    OrderFrequency obj = new OrderFrequency();

    obj.setConcept(Context.getConceptService().getConceptByUuid(conceptUuid));
    obj.setUuid(uuid);
    obj.setFrequencyPerDay(frequencyPerDay);

    return obj;
}

@Override
public void install() throws Exception {
    install(OrderFrequencyMetaData.orderFrequency(
            _Concept.TWICE_DAILY,
            _OrderFrequency.TEST,
            2.5
            ));


}

}

Thanks

@darius @dkayiwa Update: I figured out how to create custom handler for the object. I will let you know more

Update: Tested with one of the concepts and It’s working now. Please look into the ticket so I can start pushing to the new branch. Thanks

@larrystone isn’t there already a handler? https://github.com/openmrs/openmrs-module-metadatadeploy/blob/master/api-1.10/src/main/java/org/openmrs/module/metadatadeploy/handler/impl/OrderFrequencyDeployHandler.java

Oh, but for some weird reason, I got the No handler found exception when I didn’t implement the handler myself. @dkayiwa @darius Please help curate and make the ticket ready for work so that I can share what I currently have. Thanks

I see the challenge now. The current reference metadata repository is using version api-1.7 of the metadatadeploy module whereas the link above is for api-1.10. I will try updating the pom file to use this