Need help creating Order Set metadata

Good day everyone,

The Order Entry UI team is currently working on the order from set functionality and we need help generating an order set metadata similar to the lab orderables metadata which can be found here, steps on how to create the demo data can be found here. Any help would be appreciated

cc: @mseaton @dkayiwa @mogoodrich @ddesimone @desmond @rotimi

1 Like

Are you asking something like how to insert sample data in the corresponding database tables?

Yeah something like that, So when we were setting up Lab orders we got a metadata file which we imported via the import metadata setting in the administrator setting, I believe this loaded data into the database correct me if I am wrong.

So something like this https://wiki.openmrs.org/display/projects/Order+Entry+UI+Administrator+Guide#OrderEntryUIAdministratorGuide-ConfiguringLaboratoryOrderables but for order sets this time.

@daramola98, I thought I posted about this recently, but I can’t find it, so I’ll post again here to make sure.

A team recently created a utility (using python that reads in yaml files) to enable setting up order sets via the REST API. You can find that utility and documentation around it here:

Can you have a look at whether this is something you could use in the short term?

@dkayiwa FYI.

Mike

We will use this in the short term. But in the long term we would have to make the installation similar to that of Lab orderables so new contributors or testers would not have to use this tool everytime they want to setup order sets. Using this means everyone in the team would use this to load data in the database locally.

@daramola98, if you use this tool once to set up the order sets you want, then you can use the Metadatasharing module to export these into a metadatasharing package that others can then import, which would be the same as the Lab Orderables you describe. If you need guidance with how to use the MDS module to achieve this, we can work through that on IRC or here. @dkayiwa FYI

Awesome will work with my teammates to use this tool. Will keep you posted.

Hi @mseaton , I get this error when I try to load the sets.

I followed the instructions in the readme and arrived

@daramola98 - I didn’t write the tool and have never used it, so don’t have a lot of input into the errors. That said, I assume the input sets assume that the metadata that they reference already exist on the server - so if they are referencing a concept by name, then you’ll need this concept on the system already. What I was expecting is that you wouldn’t necessary use the existing yaml files as-is, but use them as a guide to create your own yaml files that represent order sets using concepts and drugs that you already have available on your systems…

Mike

Hi @mseaton ,

We seem to have made progress on using this tool but we are currently facing a blocker, the python script crashes when it tries to hit this endpoint /ordersetattributetype. Below is the block of code where it stops.

    # fetch OrderSetAttributeType UUID values
    r = requests.get(url = API_ENDPOINT + "/ordersetattributetype",
                     auth = (USERID,PASSWORD),
                     headers = HEADERS,
                     verify = False)
    print(r)
    orderSetAttributeTypes = json.loads(r.text)["results"]

    attribsByName = buildDict(orderSetAttributeTypes, key="display")
    attribsByName.get("cycleLength")["uuid"]
    if (DEBUG_MODE == "d"):
        print "[DEBUG] uuidOrderSetAttributes: " + json.dumps(attribsByName)

We then tried this endpoint on postman and got the error below,

cc: @dkayiwa

Hi @mseaton can you please confirm if that endpoint is available only on the humci-pih server?

@daramola98, it is likely that these endpoints utilize features added in the latest (not yet released) OpenMRS core version. You’ll likely need to upgrade to the latest - 2.2.0-SNAPSHOT

Mike

Ok we will try this and get back to you.

How do I go about upgrading to the latest snapshot, I assumed it would be through the manage modules section in system administration but I do not know the module to upgrade.

Hello @mseaton, is this Rest Web Services OMOD what needs to be upgraded? Below is the snapshot of the current version we have.

@desmond and @daramola98, no you need to update the OpenMRS war file. How do you run OpenMRS normally - do you use the SDK and maintain local versions of OpenMRS to develop against? If you use the SDK, have a look at updating the “platform” using the “deploy” command. See here:

https://wiki.openmrs.org/display/docs/OpenMRS+SDK#OpenMRSSDK-Deployingprojects

Something like:

mvn openmrs-sdk:deploy -DserverId=yourserveridhere -Dplatform=2.2.0-SNAPSHOT

@dkayiwa, can you advise?

Thanks, Mike

Thanks @mseaton for the response. We normally use standalone server.

@mseaton we have been able to update the core to use the 2.2.0 snapshot but we still get the same error resource does not exist, are we meant to do anything after upgrading to 2.2.0 snapshot.

@daramola98, sorry about that. Looking now more closely at the documentation, it looks like this tool still relies on an unmerged branch from another fork:

See documentation here. And likely code you need in are in the branches in this fork here. Likely you need this branch specifically. @ilewis, would you be able to advise on this?

All this makes me thing that using this tool to simply start creating order sets for your use case isn’t going to be as easy as I’d hoped. You don’t have a need for these attributes and other features. If you can document what order sets you would like to have created, I (or possibly @dkayiwa) should be able to throw together some quick code that will set those up for you automatically.

Thanks! Mike

Hello @mseaton, sorry for taking long to reply. We were trying to figure out exactly what we need from the order set payload. So draftOder object looks like this: 53

So we figured that order set should contain these attributes. We are still consulting with the guys who did draft section. We also invite your input as we are still not sure on exactly how that endpoint should work. I was of the opinion that, if we were to build the UI for that endpoint should probably be something like drug order form but instead of saving to redux store, it saves to the database as the order set. @dkayiwa 52