Public API to fetch global_property in OpenMRS.

Tags: #<Tag:0x00007fe2e69e6210> #<Tag:0x00007fe2e69e60f8> #<Tag:0x00007fe2e69e5ef0> #<Tag:0x00007fe2e69e5b30>

Hello People,

We are working on Running Bahmni Appointments scheduling on OpenMRS. As part of this, while initializing the app we are trying to figure out if this app is running on Bahmni or OpenMRS, based on that we will have to manage the login.

We wanted to leverage global_properties for this. We wanted to know if there is an API which can be used to fetch value of defined global_property. If Yes, We would like to know if that API is public, Since this has to be done before login.

Please let us know. Thank You

CC @angshuonline @dkayiwa @mksd @mksrom @rrameshbtech @binduak @snehabagri

hi @mddubey , Looking at out swagger document here https://demo.openmrs.org/openmrs/module/webservices/rest/apiDocs.htm. I dont think we support that API , however , that shouldnt be something very hard to do. see our rest framework here

cc @ruhanga @samuel34

Hello @mozzy, Thanks for the quick response.

There is already such API available in Bahmni, 2nd API in This Controller. Though we would like to use something for which we don’t need to specify a dependency on Bahmni-Core (mostly OpenMRS-Webservices). We will check if it could be moved to openmrs or not.

Let us know if there are some other thoughts.

do you mean getting it into the community supported module ?
At the time you can create a ticket and create a PR to the community supported repo, but usually that may take some little time to get merged in. Probably at the time you can implement it into your custom supported module.

cc @ruhanga Platform Release Manager

Yes, that’s what I meant. I will need to make sure, if it can be back-ported to specific webservices version, which bahmni is using. As of now it uses version 2.17.

with the rest module , we dont do back porting, because the module is built up with different conditional resources (sub-modules) for different Core versions.

You just make sure you add your change in the conditonal resource (maven submodule) that corresponds to the core version you want to run

1 Like

Ohh okay! I remember it now. Thanks for the information.

1 Like

Are you looking for something like this? https://demo.openmrs.org/openmrs/ws/rest/v1/systemsetting/addresshierarchy.started

1 Like

oh fine , ive accesed it

Actuality your very right @dkayiwa, I have just remebered Global properties are actualy the system settings :grinning: . I dont know how i missed out that. @mddubey , just take a look atthe full resource documentation in swagger

1 Like

Was trying out with https://demo.openmrs.org/openmrs/ws/rest/v1/systemsetting?q=atlas.id

and got the results below

{
  "results": [
    {
      "uuid": "94faf250-d1a9-4acf-b704-46fe9e2db33a",
      "display": "Atlas - Id = b35a0e5d-72b8-4f33-9074-49df991862e2",
      "links": [
        {
          "rel": "self",
          "uri": "http://demo.openmrs.org/openmrs/ws/rest/v1/systemsetting/94faf250-d1a9-4acf-b704-46fe9e2db33a"
        }
      ]
    }
  ]
}
1 Like

Thanks a lot, @dkayiwa and @mozzy . This is what I was looking for. In an initial exploration, it looks like I can access it without logging in as well, so this solves my problem.

yes true , you can acces the server via that end point without validating a session.

1 Like