How do I know if the Atlas module has been configured?

Hi @alexis_duque

I am working on prompting the admin to configure the Atlas module when they first start OpenMRS per what I wrote here.

I’m confused because I can’t figure out from AtlasService or AtlasData whether the user has ever configured their atlas pin. I see the method AtlasData.getModuleEnabled() but this only returns true when they have turned on automatic updates. Instead I would like to find a method that returns true after they place their pin, regardless of whether they are sending updates. Does this exist?

(The “workaround” for this is to just change my desired behavior, and keep bugging them to configure the atlas until they turn on automatic updates, or say they want to us to stop asking.)

If it helps, the marker placement is all done on the server side, not locally. A user can go to atlas.openmrs.org and use the same server-side code to create their marker. The local “automatic updates” feature just keeps the any stats (patient, encounter, obs counts & module info) updated once the OpenMRS instance has been linked to a marker.

I don’t think you can turn on automatic updates without having created or linked to a marker…at least, you shouldn’t be able to, since updates can’t happen unless the OpenMRS instance has first been associated with a marker.

Hi @darius,

Does @burke’s answer help you ?

Maybe implementing a new function in the Atlas Module sending a request to the Atlas Server to know if the module has already been registered on the Atlas Server can help you ?

It can be a GET to the Altas Server passing the Atlas Module UUID as parameters (we use it to authenticate the Module on the server side).

Alexis

Perhaps when they do place the pin we can find a way to store some local Boolean saying they have done this.

This isn’t a priority for me, since I think the current behavior is adequate.

More important will be ensuring that things work decently if the user has no internet connection, or it is very slow.

I would think that listening for the link from the Atlas module to a marker would be what Darius would want. Something like:

interface AtlasLinkListener {
  atlasLinkCreated(AtlasMarker marker);
  atlasLinkRemoved(AtlasMarker marker);
}

He could just clear the nag on the initial call to atlasLinkCreated().