Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

In the event that there are no handlers registered for a specific type, the module will store the payload as an unstructured "blob" in the OpenMRS database. Any document-type data such as PDFs or image data can be stored this way. Blobs will be saved as observations linked to a new encounter for the specified patient. The Unstructured Storage module provides appropriate obs handlers for this functionality, and therefore the Content Handler module will not handle the implementation. It will simply treat an unstructured payload as a complex observation, but will however provide a code handler instance for use by the getContentHandler method.

Interfaces

Source

Code Block
languagejava
titleContentHandlerService
public interface ContentHandlerService extends OpenMRSServiceOpenmrsService {
 
	        
        /** To be called by interface modules */
	
         * Returns a content handler for a specified content type.
         * Will return a default handler for unknown types.
         */
        ContentHandler getContentHandler(String contentType);
 
	 
        /** To be called by processor modules on startup */
	
         * Register a content handler for a specified content type.
         */
        void registerContentHandler(String contentType, ContentHandler prototype) throws AlreadyRegisteredException, InvalidContentTypeException;
	    
        /** To
         * Deregister the current handler assigned for the specified content type.
         *
         * This method should be called by processor modules on shutdown.
         */
	        void deregisterContentHandler(String contentType);
}

 

Source

Code Block
languagejava
titleContentHandler
public interface ContentHandler {
 
	void
        /**
         * Parse and store clinical content for the specified patient.
         */
        Encounter saveContent(Patient patient, Provider provider, EncounterRole role, EncounterType encounterType, Content content);


        /**
         * Retrieve the content associated with the specified encounter uuid.
         */
        Content fetchContent(String encounterUuid);

        /**
         * Retrieve the content associated with the specified encounter id.
         */
        Content fetchContent(int encounterId);
	void saveContent


        /**
         * Retrieve a list of formatted encounters for a specified patient.
         */
        List<Content> queryEncounters(Patient patient, StringDate documentIdfrom, StringDate contentto);
 
	String fetchDocument(String documentId);
	List<String>
        
        /**
         * Retrieve a list of formatted encounters for a specified patient.
         */
        List<Content> queryEncounters(Patient patient, List<EncounterType> encounterTypes, Date from, Date to);
 
	


        /**
         * Create a clone of this handler.
         */
        ContentHandler cloneHandler();
}