# Options for OpenMRS drug management

**URL:** <https://talk.openmrs.org/t/options-for-openmrs-drug-management/1719>\
**Category:** Development\
**Created:** [April 19, 2015, 8:53pm UTC](https://talk.openmrs.org/t/options-for-openmrs-drug-management/1719 "2015-04-19T20:53:20Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![dkseelro](https://talk.openmrs.org/letter_avatar/dkseelro/32/5_5575768a8748004e209b776fc1b2916d.png) [@dkseelro](https://talk.openmrs.org/u/dkseelro)\
**Post date:** [March 20, 2017, 8:07pm UTC](https://talk.openmrs.org/t/options-for-openmrs-drug-management/1719/21 "2017-03-20T20:07:39Z")

</div>

i am also trying to do same, wanted to create prescription and share with patient and get it printed., can you share omod file of orderenteryui module i need that,

---

<div class="post-metadata">

**Author:** ![dkseelro](https://talk.openmrs.org/letter_avatar/dkseelro/32/5_5575768a8748004e209b776fc1b2916d.png) [@dkseelro](https://talk.openmrs.org/u/dkseelro)\
**Post date:** [March 21, 2017, 6:08am UTC](https://talk.openmrs.org/t/options-for-openmrs-drug-management/1719/22 "2017-03-21T06:08:21Z")

</div>

Thanks for your resonse, unfortunately i dont have setup, so cant complie that. can you please share omod file with me so i can test, i understand disclaimer.

---

<div class="post-metadata">

**Author:** ![mksd](https://talk.openmrs.org/user_avatar/talk.openmrs.org/mksd/32/11729_2.png) [@mksd](https://talk.openmrs.org/u/mksd)\
**Post date:** [March 21, 2017, 6:18am UTC](https://talk.openmrs.org/t/options-for-openmrs-drug-management/1719/23 "2017-03-21T06:18:57Z")

</div>

[https://modules.openmrs.org/#/show/266/](https://modules.openmrs.org/#/show/266/)

---

<div class="post-metadata">

**Author:** ![dkseelro](https://talk.openmrs.org/letter_avatar/dkseelro/32/5_5575768a8748004e209b776fc1b2916d.png) [@dkseelro](https://talk.openmrs.org/u/dkseelro)\
**Post date:** [March 21, 2017, 7:05am UTC](https://talk.openmrs.org/t/options-for-openmrs-drug-management/1719/24 "2017-03-21T07:05:44Z")

</div>

Thanks @mksd i really appreciate it.

i believe it snapshot module, can you please share complete one so i can test it out, meanwhile i have also installed it and getting no drug into it.

 ![](https://talk.openmrs.org/uploads/default/original/2X/a/aa8022711aed27ea6097294bf5158b95931631c1.jpg) please suggest.

---

<div class="post-metadata">

**Author:** ![mksd](https://talk.openmrs.org/user_avatar/talk.openmrs.org/mksd/32/11729_2.png) [@mksd](https://talk.openmrs.org/u/mksd)\
**Post date:** [March 21, 2017, 10:41am UTC](https://talk.openmrs.org/t/options-for-openmrs-drug-management/1719/25 "2017-03-21T10:41:17Z")

</div>

Did you read this thread: ‘[Drug dispense and administration in OrderEntryUi](https://talk.openmrs.org/t/drug-dispense-and-administration-in-orderentryui/4212)’? And in particular [from here](https://talk.openmrs.org/t/drug-dispense-and-administration-in-orderentryui/4212/5?u=mksd) regarding your issue.

---

<div class="post-metadata">

**Author:** ![hpardess](https://talk.openmrs.org/letter_avatar/hpardess/32/5_5575768a8748004e209b776fc1b2916d.png) [@hpardess](https://talk.openmrs.org/u/hpardess)\
**Post date:** [March 22, 2017, 8:55am UTC](https://talk.openmrs.org/t/options-for-openmrs-drug-management/1719/26 "2017-03-22T08:55:41Z")

</div>

If you check the console, there is client side error. here the screen shot,

 ![](https://talk.openmrs.org/uploads/default/original/2X/0/04324bb83fe647a39c901773ba74ced0aa8c4004.PNG)

> Syntax Error: Token ‘.’ is an unexpected token at column 15 of the expression [setting | omrs.display] starting at [.display].

Solution for above error:

[Here is the file you should edit](https://github.com/mekomsolutions/openmrs-module-orderentryui/blob/dev/omod/src/main/webapp/pages/drugOrders.gsp)

```

```

- {{ setting | omrs.display }} 

Just replace the {{ setting | omrs.display }} with {{ setting.display }}

---

<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:** [March 22, 2017, 1:05pm UTC](https://talk.openmrs.org/t/options-for-openmrs-drug-management/1719/27 "2017-03-22T13:05:54Z")

</div>

@hpardess are you doing a pull request with your suggested changes?

---

<div class="post-metadata">

**Author:** ![hpardess](https://talk.openmrs.org/letter_avatar/hpardess/32/5_5575768a8748004e209b776fc1b2916d.png) [@hpardess](https://talk.openmrs.org/u/hpardess)\
**Post date:** [March 22, 2017, 10:17pm UTC](https://talk.openmrs.org/t/options-for-openmrs-drug-management/1719/28 "2017-03-22T22:17:37Z")

</div>

During testing I found the suggested solution and it worked for me somehow. Therefore, i suggested this and @mksd can decide whether it is write or not. because he know the purpose of that statement. so i am not doing pull request with suggested changes right now. I left it to the main developer to decide.

---

<div class="post-metadata">

**Author:** ![hpardess](https://talk.openmrs.org/letter_avatar/hpardess/32/5_5575768a8748004e209b776fc1b2916d.png) [@hpardess](https://talk.openmrs.org/u/hpardess)\
**Post date:** [March 22, 2017, 10:27pm UTC](https://talk.openmrs.org/t/options-for-openmrs-drug-management/1719/29 "2017-03-22T22:27:52Z")

</div>

The reason of not listing drugs is a client side error as posted previously

> [@Options for OpenMRS drug management](https://talk.openmrs.org/t/options-for-openmrs-drug-management/1719/17):
>
> Yes, I used the dev branch. It returns the list of drugs but not shown in drop-down because of client side error. Expected array but received: {“$$state”:{“status”:0}}

As i traced the request, the serverside sends request with list of matched drugs as array but getDrugs() function ( [openmrs-module-uicommons/blob/master/omod/src/main/webapp/resources/scripts/services/drugService.js](https://github.com/openmrs/openmrs-module-uicommons/blob/master/omod/src/main/webapp/resources/scripts/services/drugService.js) ) does not parse the the received data correctly which cause following error,

> Expected array but received: {“$$state”:{“status”:0}}

Can anyone please fix following function:

```
getDrugs: function(params) {
    return Drug.query(params).$promise.then(function(res) {
        return res.results;
    });
}
```

cc: @darius

---

<div class="post-metadata">

**Author:** ![mksd](https://talk.openmrs.org/user_avatar/talk.openmrs.org/mksd/32/11729_2.png) [@mksd](https://talk.openmrs.org/u/mksd)\
**Post date:** [March 23, 2017, 2:15am UTC](https://talk.openmrs.org/t/options-for-openmrs-drug-management/1719/30 "2017-03-23T02:15:16Z")

</div>

This is because in the meantime Angular was upgraded. See [‘Upgrade angular version in UICommons’ here.](https://talk.openmrs.org/t/upgrade-angular-version-in-uicommons/7161/2)

So basically this code works up to a certain version of UI Commons. I guess there would be no harm at making the change you suggested. OEUI’s POM should also stop depending on the distro. I mean all these things are the consequence of OEUI not being actively developed, as warned.

> [@dkayiwa](#):
>
> @hpardess are you doing a pull request with your suggested changes?

Translation: you **should** make a PR 😉Altogether you should take the lead on OEUI and others will help you, rather than leaving “the main developer to decide”. This is a piece of work started by @darius that we took over briefly and discontinued, there is no main developer anymore behind it. And we have no plans to do anything with it in the foreseeable future.

---

<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:** [March 23, 2017, 9:00am UTC](https://talk.openmrs.org/t/options-for-openmrs-drug-management/1719/31 "2017-03-23T09:00:13Z")

</div>

@hpardess this will get you started with making pull requests: [https://wiki.openmrs.org/display/docs/Pull+Request+Tips](https://wiki.openmrs.org/display/docs/Pull+Request+Tips)

---

<div class="post-metadata">

**Author:** ![hpardess](https://talk.openmrs.org/letter_avatar/hpardess/32/5_5575768a8748004e209b776fc1b2916d.png) [@hpardess](https://talk.openmrs.org/u/hpardess)\
**Post date:** [March 23, 2017, 8:12pm UTC](https://talk.openmrs.org/t/options-for-openmrs-drug-management/1719/32 "2017-03-23T20:12:21Z")

</div>

Thanks @mksd for guidance.

Follwoing link really help me to understand how to deal with that bug and fix it. I will make a pull request.

> [@mksd](#):
>
> This is because in the meantime Angular was upgraded. See ‘Upgrade angular version in UICommons’ here.

Also regarding OEUI not listing the drugs. I fixed it locally that issue was also because of angularjs version change that could not handle asynchronous data in drop-down.

---

<div class="post-metadata">

**Author:** ![hpardess](https://talk.openmrs.org/letter_avatar/hpardess/32/5_5575768a8748004e209b776fc1b2916d.png) [@hpardess](https://talk.openmrs.org/u/hpardess)\
**Post date:** [March 23, 2017, 9:12pm UTC](https://talk.openmrs.org/t/options-for-openmrs-drug-management/1719/33 "2017-03-23T21:12:38Z")

</div>

If anyone else want to fix it locally. here is the codes line to be fixed

- Step 1
- [mekomsolutions/openmrs-module-orderentryui \> drugOrders.gsp](https://github.com/mekomsolutions/openmrs-module-orderentryui/blob/dev/omod/src/main/webapp/pages/drugOrders.gsp)
- [openmrs/openmrs-module-orderentryui \> drugOrders.gsp](https://github.com/openmrs/openmrs-module-orderentryui/blob/master/omod/src/main/webapp/pages/drugOrders.gsp)

> {{ setting | omrs.display }}

replace it with

> {{ setting | omrsDisplay }}

- Step 2
- [openmrs/openmrs-module-uicommons \> select-drug.js](https://github.com/openmrs/openmrs-module-uicommons/blob/master/omod/src/main/webapp/resources/scripts/directives/select-drug.js)

```
$scope.search = function(term) {
    return DrugService.getDrugs({ q: term });
}
```

replace it with

```
$scope.search = function(term) {
    return DrugService.getDrugs({ q: term }).then(function(result){
        return result;
    });
}
```

also

```
'typeahead="drug as drug.display for drug in search($viewValue) | filter:$viewValue" ' +
```

replace it with

```
'typeahead="drug as drug.display for drug in search($viewValue)" ' +
```

---

<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:** [March 23, 2017, 9:32pm UTC](https://talk.openmrs.org/t/options-for-openmrs-drug-management/1719/34 "2017-03-23T21:32:56Z")

</div>

@hpardess do you mind opening a pull request? At least for the sake of those who are not coders. By the way, creating a pull request is a practical way of expressing your gratitude for all that you are using previously done by others. 🙂

---

<div class="post-metadata">

**Author:** ![hpardess](https://talk.openmrs.org/letter_avatar/hpardess/32/5_5575768a8748004e209b776fc1b2916d.png) [@hpardess](https://talk.openmrs.org/u/hpardess)\
**Post date:** [March 24, 2017, 7:51pm UTC](https://talk.openmrs.org/t/options-for-openmrs-drug-management/1719/35 "2017-03-24T19:51:13Z")

</div>

Sure I will. I am really interested to join the community not only as implementer but as developer too. I read the wiki page regarding Pull Request but i felt it will take longer to do that so i posted by founded solution to help other and also not forget till it do pull request.

---

<div class="post-metadata">

**Author:** ![hpardess](https://talk.openmrs.org/letter_avatar/hpardess/32/5_5575768a8748004e209b776fc1b2916d.png) [@hpardess](https://talk.openmrs.org/u/hpardess)\
**Post date:** [March 25, 2017, 6:21pm UTC](https://talk.openmrs.org/t/options-for-openmrs-drug-management/1719/36 "2017-03-25T18:21:39Z")

</div>

I can not save and sign the drug order. here is the screen shot,

 ![](https://talk.openmrs.org/uploads/default/original/2X/7/75beb98ae8790a44599bec431e7ff6b0baec2c07.PNG)

```
{"error":
{"message":"[provider on class org.openmrs.Encounter]",
"code":"org.openmrs.module.webservices.rest.web.resource.impl.BaseDelegatingResource:705",
"detail":"org.openmrs.module.webservices.rest.web.response.ConversionException: provider on class org.openmrs.Encounter\r\n\tat org.openmrs.module.webservices.rest.web.resource.impl.BaseDelegatingResource.getProperty(BaseDelegatingResource.java:705)\r\n\tat org.openmrs.module.webservices.rest.web.resource.impl.BaseDelegatingResource.setConvertedProperties(BaseDelegatingResource.java:608)\r\n\tat org.openmrs.module.webservices.rest.web.resource.impl.DelegatingCrudResource.create(DelegatingCrudResource.java:93)\r\n\tat org.openmrs.module.webservices.rest.web.v1_0.controller.MainResourceController.create(MainResourceController.java:91)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\r\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\r\n\tat java.lang.reflect.Method.invoke(Method.java:498)\r\n\tat org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:177)\r\n\tat org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:446)\r\n\tat org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:434)\r\n\tat org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:943)\r\n\tat org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:877)\r\n\tat org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:966)\r\n\tat org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:868)\r\n\tat javax.servlet.http.HttpServlet.service(HttpServlet.java:707)\r\n\tat org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:842)\r\n\tat javax.servlet.http.HttpServlet.service(HttpServlet.java:790)\r\n\tat org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:816)\r\n\tat org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1686)\r\n\tat org.openmrs.module.web.filter.ForcePasswordChangeFilter.doFilter(ForcePasswordChangeFilter.java:60)\r\n\tat org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1669)\r\n\tat org.openmrs.module.web.filter.ModuleFilterChain.doFilter(ModuleFilterChain.java:72)\r\n\tat org.openmrs.web.filter.GZIPFilter.doFilterInternal(GZIPFilter.java:64)\r\n\tat org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)\r\n\tat org.openmrs.module.web.filter.ModuleFilterChain.doFilter(ModuleFilterChain.java:70)\r\n\tat org.openmrs.module.webservices.rest.web.filter.AuthorizationFilter.doFilter(AuthorizationFilter.java:108)\r\n\tat org.openmrs.module.web.filter.ModuleFilterChain.doFilter(ModuleFilterChain.java:70)\r\n\tat org.springframework.web.filter.ShallowEtagHeaderFilter.doFilterInternal(ShallowEtagHeaderFilter.java:82)\r\n\tat org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)\r\n\tat org.openmrs.module.web.filter.ModuleFilterChain.doFilter(ModuleFilterChain.java:70)\r\n\tat org.openmrs.module.owa.filter.OwaFilter.doFilter(OwaFilter.java:57)\r\n\tat org.openmrs.module.web.filter.ModuleFilterChain.doFilter(ModuleFilterChain.java:70)\r\n\tat org.openmrs.module.xforms.web.XformsFilter.doFilter(XformsFilter.java:69)\r\n\tat org.openmrs.module.web.filter.ModuleFilterChain.doFilter(ModuleFilterChain.java:70)\r\n\tat org.openmrs.module.web.filter.ModuleFilter.doFilter(ModuleFilter.java:54)\r\n\tat org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1669)\r\n\tat org.openmrs.web.filter.OpenmrsFilter.doFilterInternal(OpenmrsFilter.java:108)\r\n\tat org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)\r\n\tat org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1669)\r\n\tat org.springframework.orm.hibernate4.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:150)\r\n\tat org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)\r\n\tat org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1669)\r\n\tat org.openmrs.web.filter.StartupFilter.doFilter(StartupFilter.java:105)\r\n\tat org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1669)\r\n\tat org.openmrs.web.filter.StartupFilter.doFilter(StartupFilter.java:105)\r\n\tat org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1669)\r\n\tat org.openmrs.web.filter.StartupFilter.doFilter(StartupFilter.java:105)\r\n\tat org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1669)\r\n\tat org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)\r\n\tat org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)\r\n\tat org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1669)\r\n\tat org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:581)\r\n\tat org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)\r\n\tat org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)\r\n\tat org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226)\r\n\tat org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1156)\r\n\tat org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:511)\r\n\tat org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)\r\n\tat org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1088)\r\n\tat org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)\r\n\tat org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:213)\r\n\tat org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:109)\r\n\tat org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:119)\r\n\tat org.eclipse.jetty.server.Server.handle(Server.java:517)\r\n\tat org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:306)\r\n\tat org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:242)\r\n\tat org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:245)\r\n\tat org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)\r\n\tat org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:75)\r\n\tat org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceAndRun(ExecuteProduceConsume.java:213)\r\n\tat org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:147)\r\n\tat org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:654)\r\n\tat org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:572)\r\n\tat java.lang.Thread.run(Thread.java:745)\r\n
Caused by: java.lang.NoSuchMethodException: Property 'provider' has no getter method\r\n\tat org.apache.commons.beanutils.PropertyUtilsBean.getSimpleProperty(PropertyUtilsBean.java:1127)\r\n\tat org.apache.commons.beanutils.PropertyUtilsBean.getNestedProperty(PropertyUtilsBean.java:686)\r\n\tat org.apache.commons.beanutils.PropertyUtilsBean.getProperty(PropertyUtilsBean.java:715)\r\n\tat org.apache.commons.beanutils.PropertyUtils.getProperty(PropertyUtils.java:290)\r\n\tat org.openmrs.module.webservices.rest.web.resource.impl.BaseDelegatingResource.getProperty(BaseDelegatingResource.java:699)\r\n\t... 74 more\r\n"}}
```

Any suggestion on how to solve it?

---

<div class="post-metadata">

**Author:** ![mksd](https://talk.openmrs.org/user_avatar/talk.openmrs.org/mksd/32/11729_2.png) [@mksd](https://talk.openmrs.org/u/mksd)\
**Post date:** [March 26, 2017, 6:37am UTC](https://talk.openmrs.org/t/options-for-openmrs-drug-management/1719/37 "2017-03-26T06:37:03Z")

</div>

Your issue vaguely reminds me of something that we faced in the very early days of peaking at OEUI: ‘[orderentryui - provider is undefined in order-entry.js](https://talk.openmrs.org/t/orderentryui-provider-is-undefined-in-order-entry-js/3586)’. Perhaps will it help, at least by giving you ways to troubleshoot further your actual issue.

---

<div class="post-metadata">

**Author:** ![hpardess](https://talk.openmrs.org/letter_avatar/hpardess/32/5_5575768a8748004e209b776fc1b2916d.png) [@hpardess](https://talk.openmrs.org/u/hpardess)\
**Post date:** [April 6, 2017, 10:25pm UTC](https://talk.openmrs.org/t/options-for-openmrs-drug-management/1719/38 "2017-04-06T22:25:39Z")

</div>

Here is the issue created: [https://issues.openmrs.org/browse/ORDER-25](https://issues.openmrs.org/browse/ORDER-25)

---

<div class="post-metadata">

**Author:** ![hpardess](https://talk.openmrs.org/letter_avatar/hpardess/32/5_5575768a8748004e209b776fc1b2916d.png) [@hpardess](https://talk.openmrs.org/u/hpardess)\
**Post date:** [May 21, 2017, 7:34am UTC](https://talk.openmrs.org/t/options-for-openmrs-drug-management/1719/39 "2017-05-21T07:34:50Z")

</div>

I could not fix the this error yet. @wyclif, could you please look for this error and suggest the solution? [Options for OpenMRS drug management](https://talk.openmrs.org/t/options-for-openmrs-drug-management/1719/36?u=hpardess)

I observed the same error message in another post ([Can't create Obs through REST with many levels of groupMembers](https://talk.openmrs.org/t/cant-create-obs-through-rest-with-many-levels-of-groupmembers/9505/2)) but it is fixed. I have the webservices.rest-2.19.0 module in my local machine.

---

<div class="post-metadata">

**Author:** ![wyclif](https://talk.openmrs.org/user_avatar/talk.openmrs.org/wyclif/32/19607_2.png) [@wyclif](https://talk.openmrs.org/u/wyclif)\
**Post date:** [May 22, 2017, 2:50pm UTC](https://talk.openmrs.org/t/options-for-openmrs-drug-management/1719/40 "2017-05-22T14:50:34Z")

</div>

Have you looked at the encounter resource for details on how to create an encounter based on the OpenMRS version you are running? From the error message, it appears like you’re setting the provider fields on the encounter as of 1.9, encounter has no `provider` fields, it should be `encounterProviders`, each encounter provider is a provider and an encounter role.

[Previous page](https://talk.openmrs.org/t/options-for-openmrs-drug-management/1719.md?page=1)

[Next page](https://talk.openmrs.org/t/options-for-openmrs-drug-management/1719.md?page=3)
