Adding document upload to the android client

I am adding functionality to upload documents in the adroid app but was not able to find similar thing on the website on demo.openmrs.org While going through the wiki I came across this article https://wiki.openmrs.org/pages/viewpage.action?pageId=36668565 Should I just go ahead and add a new concept on the demo.openmrs.org and then send the documents as POST request to the endpoint or there is some other way too.

cc @avijitghosh82 @raff

@raff should be able to help you with this, I think he’s posted instructions in the issue page. If the reference app doesn’t have an existing UI for document upload, go ahead with your own.

The document upload/view functionality can be added by installing e.g. https://github.com/mekomsolutions/openmrs-module-visitdocumentsui (it is not part of Ref App thus it is not installed on demo nor refapp). However you do not need that to work on https://issues.openmrs.org/browse/AC-401

Here’s how you can upload and fetch a document as a complex obs:

You do need a concept to specify a handler and say what is stored in the complex obs.

Let’s focus on doing a Minimum Viable Product (MVP). To start with I’d just expect a user to create the concept manually (REST doesn’t yet allow us to create a complex concept so we can’t do it automatically or even find such concepts). Expect that there’s a complex concept with the “Generic Visit Document” name (it’s probably not the best idea, but good enough for MVP). Find that in AC and upload files using that concept as obs. Similarly when displaying uploaded items, search for obs with that concept and list files for download (showing thumbnails for images would be great). It should get us to the point when we can upload/fetch visit documents from Android Client.

@burke, @darius, @mksd, @akanter, how to best model storing visit documents using concepts? CIEL doesn’t come with any entries in concept_complex so it doesn’t give any hints. Do we have some best practices described elsewhere?

Not sure if this helps, we just did this for setting the default concept complex for VDUI. So basically we made sure that a default concept complex would be available, that’s it.

I cannot the files imported in the sample code. For example import org.openmrs.ConceptComplex should point to a file ConceptComplex in /openmrs/ in the code. But the file is not there in /openmrs in the code

It’s here: openmrs-core/api/src/main/java/org/openmrs/ConceptComplex.java

ConceptComplex is a class that has been part of OpenMRS Core for quite a while, whatever you are doing should depend on OpenMRS Core API, every module does (like this for example.)