Hisp India Modules, Openmrs API with angular

Hello, I have Hisp India openmrs modules (Hospitalcore, billing module, patient-queue…) set up on reference application 2.8.1. It runs okay. I will like to build angular app and will have to leverage openmrs API. How best can I approach this such that functionalities of billing should be exposed?

Hello @echo2roy I see two scenarios here but not sure of which one you are considering and so I will try to give an idea on both

  1. You want to build the angular app inside the module(inside openmrs)

To archieve this, you will have to leverage the UI framework where you can build the app inside the GSPs like it has been done for different apps for example here in Attachments module and other modules like CoreApps, RegistrationsApp. However, the apps built in here use AngularJs which means you may be constrained to use Angular 1.x if you are to leverage the already existing utility services or you can go ahead with the newer versions and build your own utility classes as you see fit.

  1. You want to build the app independent of Openmrs

The best way to go about this is to expose Rest End Points that you can then feed on. You can checkout this guide to archieve this All the best…

6 Likes

Understood @reagan, I wasn’t aware of the option of “building the app in the module”. Thanks for that eye opener but I think I will read through the guide you have shared on exposing the api. I’m looking forward to build an app independent of Openmrs. Thanks

3 Likes

Hi @reagan what are the pros and cons of the two pathways?

1 Like

@simpa The simple answer is Implementation requirements

That being said: if you want to access APIs with an app outside Openmrs then you can expose the REST end points(we already have made of these for different objects) see here and feed on them

2 Likes