Java Client Add Document

From OpenIndivo Documentation Wiki

Jump to: navigation, search

The addDocument method allows an actor to add a document to a record that exists on the Indivo server. Prior to adding the document, the actor must establish an active session using the authenticate method.

View the Java docs for method definitions and parameter descriptions.

Code examples

Add document

The following sample shows how to authenticate and use the session to add a document to a record. In this case, the document is an annotation and is created using a utility class. Note that the annotation does not actually contain a payload as this is not necessary for demonstration purposes.


String username = "username@indivohealth.org";
String password = "password";
String fullName = "Full Name";
String role = "patient";
AuthenticateResultType authResult = client.authenticate(username, password); IndivoDocumentType doc = DocumentGenerator.generateDefaultDocument( username, fullName, role, DocumentClassificationUrns.ANNOTATION, ContentTypeQNames.ANNOTATION);
AddDocumentResultType addDocumentResult = client.addDocument( authResult.getActorTicket(), username, doc);
Personal tools