# Need help creating Order Set metadata

**URL:** <https://talk.openmrs.org/t/need-help-creating-order-set-metadata/20178>\
**Category:** Development\
**Created:** [October 17, 2018, 10:00am UTC](https://talk.openmrs.org/t/need-help-creating-order-set-metadata/20178 "2018-10-17T10:00:04Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![daramola98](https://talk.openmrs.org/letter_avatar/daramola98/32/5_5575768a8748004e209b776fc1b2916d.png) [@daramola98](https://talk.openmrs.org/u/daramola98)\
**Post date:** [October 17, 2018, 10:00am UTC](https://talk.openmrs.org/t/need-help-creating-order-set-metadata/20178/1 "2018-10-17T10:00:04Z")

</div>

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](https://issues.openmrs.org/browse/OEUI-174), steps on how to create the demo data can be found [here](https://issues.openmrs.org/browse/OEUI-268?focusedCommentId=251818&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-251818). Any help would be appreciated

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

---

<div class="post-metadata">

**Author:** ![dkayiwa](https://talk.openmrs.org/user_avatar/talk.openmrs.org/dkayiwa/32/179_2.png) [@dkayiwa](https://talk.openmrs.org/u/dkayiwa)\
**Post date:** [October 17, 2018, 12:08pm UTC](https://talk.openmrs.org/t/need-help-creating-order-set-metadata/20178/2 "2018-10-17T12:08:15Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![daramola98](https://talk.openmrs.org/letter_avatar/daramola98/32/5_5575768a8748004e209b776fc1b2916d.png) [@daramola98](https://talk.openmrs.org/u/daramola98)\
**Post date:** [October 17, 2018, 12:25pm UTC](https://talk.openmrs.org/t/need-help-creating-order-set-metadata/20178/3 "2018-10-17T12:25:14Z")

</div>

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](https://wiki.openmrs.org/display/projects/Order+Entry+UI+Administrator+Guide#OrderEntryUIAdministratorGuide-ConfiguringLaboratoryOrderables) but for order sets this time.

---

<div class="post-metadata">

**Author:** ![mseaton](https://talk.openmrs.org/user_avatar/talk.openmrs.org/mseaton/32/8088_2.png) [@mseaton](https://talk.openmrs.org/u/mseaton)\
**Post date:** [October 17, 2018, 1:27pm UTC](https://talk.openmrs.org/t/need-help-creating-order-set-metadata/20178/4 "2018-10-17T13:27:16Z")

</div>

@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:

> <https://github.com/dearmasm/openmrs-module-oncology/blob/master/utils/YAAR_DOCS.md>

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

@dkayiwa FYI.

Mike

---

<div class="post-metadata">

**Author:** ![daramola98](https://talk.openmrs.org/letter_avatar/daramola98/32/5_5575768a8748004e209b776fc1b2916d.png) [@daramola98](https://talk.openmrs.org/u/daramola98)\
**Post date:** [October 17, 2018, 1:37pm UTC](https://talk.openmrs.org/t/need-help-creating-order-set-metadata/20178/5 "2018-10-17T13:37:46Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![mseaton](https://talk.openmrs.org/user_avatar/talk.openmrs.org/mseaton/32/8088_2.png) [@mseaton](https://talk.openmrs.org/u/mseaton)\
**Post date:** [October 17, 2018, 1:51pm UTC](https://talk.openmrs.org/t/need-help-creating-order-set-metadata/20178/6 "2018-10-17T13:51:03Z")

</div>

@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

---

<div class="post-metadata">

**Author:** ![daramola98](https://talk.openmrs.org/letter_avatar/daramola98/32/5_5575768a8748004e209b776fc1b2916d.png) [@daramola98](https://talk.openmrs.org/u/daramola98)\
**Post date:** [October 17, 2018, 2:18pm UTC](https://talk.openmrs.org/t/need-help-creating-order-set-metadata/20178/7 "2018-10-17T14:18:13Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![daramola98](https://talk.openmrs.org/letter_avatar/daramola98/32/5_5575768a8748004e209b776fc1b2916d.png) [@daramola98](https://talk.openmrs.org/u/daramola98)\
**Post date:** [October 17, 2018, 8:18pm UTC](https://talk.openmrs.org/t/need-help-creating-order-set-metadata/20178/8 "2018-10-17T20:18:14Z")

</div>

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

 ![13%20PM](https://talk.openmrs.org/uploads/default/original/2X/4/487ccb57e19a75083250516110ebd3a31cdd95f7.png)

I followed the instructions in the readme and arrived

---

<div class="post-metadata">

**Author:** ![mseaton](https://talk.openmrs.org/user_avatar/talk.openmrs.org/mseaton/32/8088_2.png) [@mseaton](https://talk.openmrs.org/u/mseaton)\
**Post date:** [October 18, 2018, 5:01am UTC](https://talk.openmrs.org/t/need-help-creating-order-set-metadata/20178/9 "2018-10-18T05:01:45Z")

</div>

@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

---

<div class="post-metadata">

**Author:** ![daramola98](https://talk.openmrs.org/letter_avatar/daramola98/32/5_5575768a8748004e209b776fc1b2916d.png) [@daramola98](https://talk.openmrs.org/u/daramola98)\
**Post date:** [October 18, 2018, 1:55pm UTC](https://talk.openmrs.org/t/need-help-creating-order-set-metadata/20178/10 "2018-10-18T13:55:11Z")

</div>

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,

 ![32%20PM](https://talk.openmrs.org/uploads/default/original/2X/d/d41bfe180db960a81772b3149ed9ad9559007e3e.png)

cc: @dkayiwa

---

<div class="post-metadata">

**Author:** ![daramola98](https://talk.openmrs.org/letter_avatar/daramola98/32/5_5575768a8748004e209b776fc1b2916d.png) [@daramola98](https://talk.openmrs.org/u/daramola98)\
**Post date:** [October 19, 2018, 9:12am UTC](https://talk.openmrs.org/t/need-help-creating-order-set-metadata/20178/11 "2018-10-19T09:12:17Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![mseaton](https://talk.openmrs.org/user_avatar/talk.openmrs.org/mseaton/32/8088_2.png) [@mseaton](https://talk.openmrs.org/u/mseaton)\
**Post date:** [October 19, 2018, 1:28pm UTC](https://talk.openmrs.org/t/need-help-creating-order-set-metadata/20178/12 "2018-10-19T13:28:10Z")

</div>

@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

---

<div class="post-metadata">

**Author:** ![daramola98](https://talk.openmrs.org/letter_avatar/daramola98/32/5_5575768a8748004e209b776fc1b2916d.png) [@daramola98](https://talk.openmrs.org/u/daramola98)\
**Post date:** [October 19, 2018, 1:34pm UTC](https://talk.openmrs.org/t/need-help-creating-order-set-metadata/20178/13 "2018-10-19T13:34:43Z")

</div>

Ok we will try this and get back to you.

---

<div class="post-metadata">

**Author:** ![daramola98](https://talk.openmrs.org/letter_avatar/daramola98/32/5_5575768a8748004e209b776fc1b2916d.png) [@daramola98](https://talk.openmrs.org/u/daramola98)\
**Post date:** [October 19, 2018, 1:37pm UTC](https://talk.openmrs.org/t/need-help-creating-order-set-metadata/20178/14 "2018-10-19T13:37:16Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![desmond](https://talk.openmrs.org/user_avatar/talk.openmrs.org/desmond/32/8302_2.png) [@desmond](https://talk.openmrs.org/u/desmond)\
**Post date:** [October 22, 2018, 9:42am UTC](https://talk.openmrs.org/t/need-help-creating-order-set-metadata/20178/15 "2018-10-22T09:42:45Z")

</div>

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

 ![53](https://talk.openmrs.org/uploads/default/original/2X/a/aed2ca18807dcde35aaea51e71d3970c1c893fec.png)

---

<div class="post-metadata">

**Author:** ![mseaton](https://talk.openmrs.org/user_avatar/talk.openmrs.org/mseaton/32/8088_2.png) [@mseaton](https://talk.openmrs.org/u/mseaton)\
**Post date:** [October 22, 2018, 12:41pm UTC](https://talk.openmrs.org/t/need-help-creating-order-set-metadata/20178/16 "2018-10-22T12:41:07Z")

</div>

@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](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

---

<div class="post-metadata">

**Author:** ![desmond](https://talk.openmrs.org/user_avatar/talk.openmrs.org/desmond/32/8302_2.png) [@desmond](https://talk.openmrs.org/u/desmond)\
**Post date:** [October 22, 2018, 1:25pm UTC](https://talk.openmrs.org/t/need-help-creating-order-set-metadata/20178/17 "2018-10-22T13:25:38Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![daramola98](https://talk.openmrs.org/letter_avatar/daramola98/32/5_5575768a8748004e209b776fc1b2916d.png) [@daramola98](https://talk.openmrs.org/u/daramola98)\
**Post date:** [October 24, 2018, 9:34am UTC](https://talk.openmrs.org/t/need-help-creating-order-set-metadata/20178/18 "2018-10-24T09:34:03Z")

</div>

@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.

---

<div class="post-metadata">

**Author:** ![mseaton](https://talk.openmrs.org/user_avatar/talk.openmrs.org/mseaton/32/8088_2.png) [@mseaton](https://talk.openmrs.org/u/mseaton)\
**Post date:** [October 24, 2018, 1:30pm UTC](https://talk.openmrs.org/t/need-help-creating-order-set-metadata/20178/19 "2018-10-24T13:30:21Z")

</div>

@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](https://github.com/openmrs/openmrs-module-oncology). And likely code you need in are in the [branches in this fork here](https://github.com/idlewis/openmrs-module-webservices.rest/branches). Likely you need [this branch specifically](https://github.com/idlewis/openmrs-module-webservices.rest/tree/integration). @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

---

<div class="post-metadata">

**Author:** ![desmond](https://talk.openmrs.org/user_avatar/talk.openmrs.org/desmond/32/8302_2.png) [@desmond](https://talk.openmrs.org/u/desmond)\
**Post date:** [October 26, 2018, 6:57am UTC](https://talk.openmrs.org/t/need-help-creating-order-set-metadata/20178/20 "2018-10-26T06:57:55Z")

</div>

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](https://talk.openmrs.org/uploads/default/original/2X/d/dad093f47c405f77de3ff0cd9ee1bf1c0c2bbdff.png)

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](https://talk.openmrs.org/uploads/default/original/2X/a/a910b776352366eef14b6e9aa1ebbeb7138010ab.png)

[Next page](https://talk.openmrs.org/t/need-help-creating-order-set-metadata/20178.md?page=2)
