org.openmrs.hl7.impl
Class HL7ServiceImpl

java.lang.Object
  extended by org.openmrs.api.impl.BaseOpenmrsService
      extended by org.openmrs.hl7.impl.HL7ServiceImpl
All Implemented Interfaces:
OpenmrsService, HL7Service

public class HL7ServiceImpl
extends BaseOpenmrsService
implements HL7Service

OpenMRS HL7 API default methods This class shouldn't be instantiated by itself. Use the Context

See Also:
HL7Service

Field Summary
protected  HL7DAO dao
           
 
Method Summary
 java.lang.Integer countHL7InArchive(int messageState, java.lang.String query)
          the total count of all HL7InArchive objects in the database
 java.lang.Integer countHL7InError(java.lang.String query)
          the total count of all HL7InError objects in the database
 java.lang.Integer countHL7InQueue(int messageState, java.lang.String query)
          the total count of all HL7InQueue objects in the database
 void createHL7InArchive(HL7InArchive hl7InArchive)
          Deprecated.  
 void createHL7InError(HL7InError hl7InError)
          Deprecated.  
 void createHL7InQueue(HL7InQueue hl7InQueue)
          Deprecated.  
 void createHL7Source(HL7Source hl7Source)
          Deprecated.  
 Person createPersonFromNK1(ca.uhn.hl7v2.model.v25.segment.NK1 nk1)
          creates a Person from information held in an NK1 segment; if valid PatientIdentifiers exist, a Patient will be created and returned
 void deleteHL7InArchive(HL7InArchive hl7InArchive)
          Deprecated.  
 void deleteHL7InError(HL7InError hl7InError)
          Deprecated.  
 void deleteHL7InQueue(HL7InQueue hl7InQueue)
          Deprecated.  
 void deleteHL7Source(HL7Source hl7Source)
          Deprecated.  
 void encounterCreated(Encounter encounter)
          Deprecated. This method is no longer needed. When an encounter is created in the ROUR01 handler, it is created with all obs. Any AOP hooking should be done on the EncounterService.createEncounter(Encounter) method
 void garbageCollect()
          Clean up the current memory consumption
 java.util.List<HL7InArchive> getAllHL7InArchives()
          Get all archive hl7 queue items from the database
 java.util.List<HL7InError> getAllHL7InErrors()
          Get all HL7InError items from the database
 java.util.List<HL7InQueue> getAllHL7InQueues()
          Return a list of all hl7 in queues in the database
 java.util.List<HL7Source> getAllHL7Sources()
          Get all of the hl7 source objects from the database.
 HL7InArchive getHL7InArchive(java.lang.Integer hl7InArchiveId)
          Get the archive item with the given id, If hl7 archives were moved to the file system, you can't do a look up by hl7ArchiveId, instead call HL7Service.getHL7InArchiveByUuid(String)
 java.util.List<HL7InArchive> getHL7InArchiveBatch(int start, int length, int messageState, java.lang.String query)
          Return a list of all hl7 in archives based on batch settings and a query string
 java.util.List<HL7InArchive> getHL7InArchiveByState(java.lang.Integer state)
          If hl7 migration has been run and the state matches that of processed items, the method returns a list of all archives in the file system, for any other state , it returns an empty list, this is because all archives would have a status of 'processed' after migration and all deleted archives moved back into the queue with a status of 'deleted' otherwise it returns archives with a matching state if migration hasn't yet been run.
 HL7InArchive getHL7InArchiveByUuid(java.lang.String uuid)
          Get the archive item with the given uuid
 java.util.Collection<HL7InArchive> getHL7InArchives()
          Deprecated.  
 HL7InError getHL7InError(java.lang.Integer hl7InErrorId)
          Get the error item with the given id
 java.util.List<HL7InError> getHL7InErrorBatch(int start, int length, java.lang.String query)
          Return a list of all hl7 in errors based on batch settings and a query string
 java.util.Collection<HL7InError> getHL7InErrors()
          Deprecated.  
 HL7InQueue getHL7InQueue(java.lang.Integer hl7InQueueId)
          Get the hl7 queue item with the given primary key id
 java.util.List<HL7InQueue> getHL7InQueueBatch(int start, int length, int messageState, java.lang.String query)
          Return a list of all hl7 in queues based on batch settings and a query string
 java.util.List<HL7InQueue> getHL7InQueueByState(java.lang.Integer state)
          Get the queue items given a state (deleted, error, pending, processing, processed).
 java.util.Collection<HL7InQueue> getHL7InQueues()
          Deprecated.  
 HL7Source getHL7Source(java.lang.Integer hl7SourceId)
          Auto generated method comment
 HL7Source getHL7Source(java.lang.String name)
          Deprecated.  
 HL7Source getHL7SourceByName(java.lang.String name)
          Get the hl7 source object from the database that has the given name
 java.util.Collection<HL7Source> getHL7Sources()
          Deprecated.  
static HL7ServiceImpl getInstance()
          Singleton Factory method
 HL7InQueue getNextHL7InQueue()
          Get the first queue item in the database
 java.lang.String getUuidFromIdentifiers(ca.uhn.hl7v2.model.v25.datatype.CX[] identifiers)
          finds a UUID from an array of identifiers
 void loadHL7InArchiveData(HL7InArchive archive)
          Loads HL7 data from the filesystem for an archived HL7InArchive
 void loadHL7InArchiveData(java.util.List<HL7InArchive> archives)
          Loads data for a list of HL7 archives from the filesystem
 void migrateHl7InArchivesToFileSystem(java.util.Map<java.lang.String,java.lang.Integer> progressStatusMap)
          Method is called by the archives migration thread to transfer hl7 in archives from the hl7_in_archives database table to the file system
 ca.uhn.hl7v2.model.Message parseHL7String(java.lang.String hl7Message)
          Parses the given string and returns the resulting Message
 HL7InQueue processHL7InQueue(HL7InQueue hl7InQueue)
          Process the given HL7InQueue item.
 ca.uhn.hl7v2.model.Message processHL7Message(ca.uhn.hl7v2.model.Message message)
          Parses the given Message and saves the resulting content to the database
 void purgeHL7InArchive(HL7InArchive hl7InArchive)
          Completely delete the hl7 in archive item from the database
 void purgeHL7InError(HL7InError hl7InError)
          Completely remove this error item from the database
 void purgeHL7InQueue(HL7InQueue hl7InQueue)
          Completely delete the hl7 in queue item from the database.
 void purgeHL7Source(HL7Source hl7Source)
          Completely remove the source from the database.
 java.lang.Integer resolveLocationId(ca.uhn.hl7v2.model.v25.datatype.PL pl)
           
 java.lang.Integer resolvePatientId(ca.uhn.hl7v2.model.v25.segment.PID pid)
           
 Person resolvePersonFromIdentifiers(ca.uhn.hl7v2.model.v25.datatype.CX[] identifiers)
          determines a person (or patient) based on identifiers from a CX array, as found in a PID or NK1 segment; the first resolving identifier in the list wins
 java.lang.Integer resolvePersonId(ca.uhn.hl7v2.model.v25.datatype.XCN xcn)
           
 java.lang.Integer resolveUserId(ca.uhn.hl7v2.model.v25.datatype.XCN xcn)
           
 HL7Source retireHL7Source(HL7Source hl7Source)
          Mark the given hl7Source as no longer active
 HL7InArchive saveHL7InArchive(HL7InArchive hl7InArchive)
          Save the given hl7 in archive to the database
 HL7InError saveHL7InError(HL7InError hl7InError)
          Save the given error item to the database
 HL7InQueue saveHL7InQueue(HL7InQueue hl7InQueue)
          Save the given hl7InQueue to the database
 HL7Source saveHL7Source(HL7Source hl7Source)
          Save the given hl7Source to the database
 void setHL7DAO(HL7DAO dao)
          Auto generated method comment
 void setHL7Handlers(java.util.Map<java.lang.String,ca.uhn.hl7v2.app.Application> handlers)
          Sets the given handlers as router applications that are available to HAPI when it is parsing an hl7 message.
This method is usually used by Spring and the handlers are set in the applicationContext-server.xml method.
The key in the map is a string like "ORU_R01" where the first part is the message type and the second is the trigger event.
 void setParser(ca.uhn.hl7v2.parser.GenericParser parser)
          Used by spring to inject the parser
 void setRouter(ca.uhn.hl7v2.app.MessageTypeRouter router)
          Used by spring to inject the router
 void updateHL7InArchive(HL7InArchive hl7InArchive)
          Deprecated.  
 void updateHL7InError(HL7InError hl7InError)
          Deprecated.  
 void updateHL7Source(HL7Source hl7Source)
          Deprecated.  
 
Methods inherited from class org.openmrs.api.impl.BaseOpenmrsService
onShutdown, onStartup
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.openmrs.api.OpenmrsService
onShutdown, onStartup
 

Field Detail

dao

protected HL7DAO dao
Method Detail

getInstance

public static HL7ServiceImpl getInstance()
Singleton Factory method

Returns:
a singleton instance of this HL7ServiceImpl class

setHL7DAO

public void setHL7DAO(HL7DAO dao)
Description copied from interface: HL7Service
Auto generated method comment

Specified by:
setHL7DAO in interface HL7Service
See Also:
HL7Service.setHL7DAO(org.openmrs.hl7.db.HL7DAO)

setParser

public void setParser(ca.uhn.hl7v2.parser.GenericParser parser)
Used by spring to inject the parser

Parameters:
parser - the parser to use

setRouter

public void setRouter(ca.uhn.hl7v2.app.MessageTypeRouter router)
Used by spring to inject the router

Parameters:
router - the router to use

saveHL7Source

public HL7Source saveHL7Source(HL7Source hl7Source)
                        throws APIException
Description copied from interface: HL7Service
Save the given hl7Source to the database

Specified by:
saveHL7Source in interface HL7Service
Parameters:
hl7Source - the source to save
Returns:
the saved source
Throws:
APIException
See Also:
HL7Service.saveHL7Source(org.openmrs.hl7.HL7Source)

purgeHL7Source

public void purgeHL7Source(HL7Source hl7Source)
                    throws APIException
Description copied from interface: HL7Service
Completely remove the source from the database. This should only be used in rare cases. See HL7Service.retireHL7Source(HL7Source)

Specified by:
purgeHL7Source in interface HL7Service
Throws:
APIException
See Also:
HL7Service.purgeHL7Source(org.openmrs.hl7.HL7Source)

retireHL7Source

public HL7Source retireHL7Source(HL7Source hl7Source)
                          throws APIException
Description copied from interface: HL7Service
Mark the given hl7Source as no longer active

Specified by:
retireHL7Source in interface HL7Service
Parameters:
hl7Source - the source to retire
Returns:
the retired source
Throws:
APIException
See Also:
HL7Service.retireHL7Source(org.openmrs.hl7.HL7Source)

createHL7Source

@Deprecated
public void createHL7Source(HL7Source hl7Source)
Deprecated. 

Specified by:
createHL7Source in interface HL7Service
See Also:
HL7Service.createHL7Source(org.openmrs.hl7.HL7Source)

getHL7Source

public HL7Source getHL7Source(java.lang.Integer hl7SourceId)
Description copied from interface: HL7Service
Auto generated method comment

Specified by:
getHL7Source in interface HL7Service
Returns:
HL7Sourceobject for given identifier
See Also:
HL7Service.getHL7Source(java.lang.Integer)

getAllHL7Sources

public java.util.List<HL7Source> getAllHL7Sources()
                                           throws APIException
Description copied from interface: HL7Service
Get all of the hl7 source objects from the database. This includes retired ones

Specified by:
getAllHL7Sources in interface HL7Service
Returns:
list of hl7 source objects
Throws:
APIException
See Also:
HL7Service.getAllHL7Sources()

getHL7SourceByName

public HL7Source getHL7SourceByName(java.lang.String name)
                             throws APIException
Description copied from interface: HL7Service
Get the hl7 source object from the database that has the given name

Specified by:
getHL7SourceByName in interface HL7Service
Parameters:
name - string to 'search' on
Returns:
hl7 source object
Throws:
APIException
See Also:
HL7Service.getHL7SourceByName(java.lang.String)

getHL7Source

@Deprecated
public HL7Source getHL7Source(java.lang.String name)
Deprecated. 

Specified by:
getHL7Source in interface HL7Service
See Also:
HL7Service.getHL7Source(java.lang.String)

getHL7Sources

@Deprecated
public java.util.Collection<HL7Source> getHL7Sources()
Deprecated. 

Specified by:
getHL7Sources in interface HL7Service
See Also:
HL7Service.getHL7Sources()

updateHL7Source

@Deprecated
public void updateHL7Source(HL7Source hl7Source)
Deprecated. 

Specified by:
updateHL7Source in interface HL7Service
See Also:
HL7Service.updateHL7Source(org.openmrs.hl7.HL7Source)

deleteHL7Source

@Deprecated
public void deleteHL7Source(HL7Source hl7Source)
Deprecated. 

Specified by:
deleteHL7Source in interface HL7Service
See Also:
HL7Service.deleteHL7Source(org.openmrs.hl7.HL7Source)

getAllHL7InQueues

public java.util.List<HL7InQueue> getAllHL7InQueues()
                                             throws APIException
Description copied from interface: HL7Service
Return a list of all hl7 in queues in the database

Specified by:
getAllHL7InQueues in interface HL7Service
Returns:
all hl7 queue items
Throws:
APIException
See Also:
HL7Service.getAllHL7InQueues()

getHL7InQueueBatch

public java.util.List<HL7InQueue> getHL7InQueueBatch(int start,
                                                     int length,
                                                     int messageState,
                                                     java.lang.String query)
                                              throws APIException
Description copied from interface: HL7Service
Return a list of all hl7 in queues based on batch settings and a query string

Specified by:
getHL7InQueueBatch in interface HL7Service
Parameters:
start - beginning index
length - size of the batch
messageState - status of the HL7InQueue message
query - search string
Returns:
all matching hl7 queue items within batch window
Throws:
APIException
See Also:
org.openmrs.hl7.HL7Service#getHL7InQueueBatch(int, int, java.lang.String)

getHL7InErrorBatch

public java.util.List<HL7InError> getHL7InErrorBatch(int start,
                                                     int length,
                                                     java.lang.String query)
                                              throws APIException
Description copied from interface: HL7Service
Return a list of all hl7 in errors based on batch settings and a query string

Specified by:
getHL7InErrorBatch in interface HL7Service
Parameters:
start - beginning index
length - size of the batch
query - search string
Returns:
all matching hl7 queue items within batch window
Throws:
APIException
See Also:
HL7Service.getHL7InErrorBatch(int, int, java.lang.String)

getHL7InArchiveBatch

public java.util.List<HL7InArchive> getHL7InArchiveBatch(int start,
                                                         int length,
                                                         int messageState,
                                                         java.lang.String query)
                                                  throws APIException
Description copied from interface: HL7Service
Return a list of all hl7 in archives based on batch settings and a query string

Specified by:
getHL7InArchiveBatch in interface HL7Service
Parameters:
start - beginning index
length - size of the batch
messageState - status of the HL7InArchive message
query - search string
Returns:
all matching hl7 archive items within batch window
Throws:
APIException
See Also:
org.openmrs.hl7.HL7Service#getHL7InArchiveBatch(int, int, java.lang.String)

countHL7InQueue

public java.lang.Integer countHL7InQueue(int messageState,
                                         java.lang.String query)
                                  throws APIException
Description copied from interface: HL7Service
the total count of all HL7InQueue objects in the database

Specified by:
countHL7InQueue in interface HL7Service
Parameters:
messageState - HL7InQueue status
query - search string
Returns:
the count of matching HL7InQueue items
Throws:
APIException
See Also:
HL7Service.countHL7InQueue(int, java.lang.String)

countHL7InError

public java.lang.Integer countHL7InError(java.lang.String query)
                                  throws APIException
Description copied from interface: HL7Service
the total count of all HL7InError objects in the database

Specified by:
countHL7InError in interface HL7Service
Parameters:
query - search string
Returns:
the count of matching HL7InError items
Throws:
APIException
See Also:
HL7Service.countHL7InError(java.lang.String)

countHL7InArchive

public java.lang.Integer countHL7InArchive(int messageState,
                                           java.lang.String query)
                                    throws APIException
Description copied from interface: HL7Service
the total count of all HL7InArchive objects in the database

Specified by:
countHL7InArchive in interface HL7Service
Parameters:
messageState - status of the HL7InArchive message
query - search string
Returns:
the count of matching HL7InArchive items
Throws:
APIException
See Also:
HL7Service.countHL7InArchive(int, java.lang.String)

purgeHL7InQueue

public void purgeHL7InQueue(HL7InQueue hl7InQueue)
Description copied from interface: HL7Service
Completely delete the hl7 in queue item from the database.

Specified by:
purgeHL7InQueue in interface HL7Service
See Also:
HL7Service.purgeHL7InQueue(org.openmrs.hl7.HL7InQueue)

saveHL7InQueue

public HL7InQueue saveHL7InQueue(HL7InQueue hl7InQueue)
                          throws APIException
Description copied from interface: HL7Service
Save the given hl7InQueue to the database

Specified by:
saveHL7InQueue in interface HL7Service
Parameters:
hl7InQueue - the queue item to save
Returns:
the saved queue item
Throws:
APIException
See Also:
HL7Service.saveHL7InQueue(org.openmrs.hl7.HL7InQueue)

createHL7InQueue

@Deprecated
public void createHL7InQueue(HL7InQueue hl7InQueue)
Deprecated. 

Specified by:
createHL7InQueue in interface HL7Service
See Also:
HL7Service.createHL7InQueue(org.openmrs.hl7.HL7InQueue)

getHL7InQueue

public HL7InQueue getHL7InQueue(java.lang.Integer hl7InQueueId)
Description copied from interface: HL7Service
Get the hl7 queue item with the given primary key id

Specified by:
getHL7InQueue in interface HL7Service
Parameters:
hl7InQueueId - the id to search on
Returns:
the desired hl7InQueue object or null if none found
See Also:
HL7Service.getHL7InQueue(java.lang.Integer)

getHL7InQueues

@Deprecated
public java.util.Collection<HL7InQueue> getHL7InQueues()
Deprecated. 

Specified by:
getHL7InQueues in interface HL7Service
See Also:
HL7Service.getHL7InQueues()

getNextHL7InQueue

public HL7InQueue getNextHL7InQueue()
Description copied from interface: HL7Service
Get the first queue item in the database

Specified by:
getNextHL7InQueue in interface HL7Service
Returns:
the first queue item
See Also:
HL7Service.getNextHL7InQueue()

deleteHL7InQueue

@Deprecated
public void deleteHL7InQueue(HL7InQueue hl7InQueue)
Deprecated. 

Specified by:
deleteHL7InQueue in interface HL7Service
See Also:
HL7Service.deleteHL7InQueue(org.openmrs.hl7.HL7InQueue)

getHL7InArchiveByState

public java.util.List<HL7InArchive> getHL7InArchiveByState(java.lang.Integer state)
                                                    throws APIException
Description copied from interface: HL7Service
If hl7 migration has been run and the state matches that of processed items, the method returns a list of all archives in the file system, for any other state , it returns an empty list, this is because all archives would have a status of 'processed' after migration and all deleted archives moved back into the queue with a status of 'deleted' otherwise it returns archives with a matching state if migration hasn't yet been run.

Specified by:
getHL7InArchiveByState in interface HL7Service
Returns:
list of archive items that match the state
Throws:
APIException
See Also:
HL7Service.getHL7InArchiveByState(java.lang.Integer)

getHL7InQueueByState

public java.util.List<HL7InQueue> getHL7InQueueByState(java.lang.Integer state)
                                                throws APIException
Description copied from interface: HL7Service
Get the queue items given a state (deleted, error, pending, processing, processed).

Specified by:
getHL7InQueueByState in interface HL7Service
Returns:
list of hl7 queue items that match the given state
Throws:
APIException
See Also:
HL7Service.getHL7InQueueByState(java.lang.Integer)

getAllHL7InArchives

public java.util.List<HL7InArchive> getAllHL7InArchives()
                                                 throws APIException
Description copied from interface: HL7Service
Get all archive hl7 queue items from the database

Specified by:
getAllHL7InArchives in interface HL7Service
Returns:
list of archive items
Throws:
APIException
See Also:
HL7Service.getAllHL7InArchives()

purgeHL7InArchive

public void purgeHL7InArchive(HL7InArchive hl7InArchive)
                       throws APIException
Description copied from interface: HL7Service
Completely delete the hl7 in archive item from the database

Specified by:
purgeHL7InArchive in interface HL7Service
Parameters:
hl7InArchive - the archived item to delete
Throws:
APIException
See Also:
HL7Service.purgeHL7InArchive(org.openmrs.hl7.HL7InArchive)

saveHL7InArchive

public HL7InArchive saveHL7InArchive(HL7InArchive hl7InArchive)
                              throws APIException
Description copied from interface: HL7Service
Save the given hl7 in archive to the database

Specified by:
saveHL7InArchive in interface HL7Service
Parameters:
hl7InArchive - the archive to save
Returns:
the saved archive item
Throws:
APIException
See Also:
HL7Service.saveHL7InArchive(org.openmrs.hl7.HL7InArchive)

createHL7InArchive

@Deprecated
public void createHL7InArchive(HL7InArchive hl7InArchive)
Deprecated. 

Specified by:
createHL7InArchive in interface HL7Service
See Also:
HL7Service.createHL7InArchive(org.openmrs.hl7.HL7InArchive)

getHL7InArchive

public HL7InArchive getHL7InArchive(java.lang.Integer hl7InArchiveId)
Description copied from interface: HL7Service
Get the archive item with the given id, If hl7 archives were moved to the file system, you can't do a look up by hl7ArchiveId, instead call HL7Service.getHL7InArchiveByUuid(String)

Specified by:
getHL7InArchive in interface HL7Service
Parameters:
hl7InArchiveId - the id to search on
Returns:
the matching archive item
See Also:
HL7Service.getHL7InArchive(java.lang.Integer)

getHL7InArchives

@Deprecated
public java.util.Collection<HL7InArchive> getHL7InArchives()
Deprecated. 

Specified by:
getHL7InArchives in interface HL7Service
See Also:
HL7Service.getHL7InArchives()

updateHL7InArchive

@Deprecated
public void updateHL7InArchive(HL7InArchive hl7InArchive)
Deprecated. 

Specified by:
updateHL7InArchive in interface HL7Service
See Also:
HL7Service.updateHL7InArchive(org.openmrs.hl7.HL7InArchive)

deleteHL7InArchive

@Deprecated
public void deleteHL7InArchive(HL7InArchive hl7InArchive)
Deprecated. 

Specified by:
deleteHL7InArchive in interface HL7Service
See Also:
HL7Service.deleteHL7InArchive(org.openmrs.hl7.HL7InArchive)

getAllHL7InErrors

public java.util.List<HL7InError> getAllHL7InErrors()
                                             throws APIException
Description copied from interface: HL7Service
Get all HL7InError items from the database

Specified by:
getAllHL7InErrors in interface HL7Service
Returns:
a List object with all HL7InError items from the database
Throws:
APIException
See Also:
HL7Service.getAllHL7InErrors()

purgeHL7InError

public void purgeHL7InError(HL7InError hl7InError)
                     throws APIException
Description copied from interface: HL7Service
Completely remove this error item from the database

Specified by:
purgeHL7InError in interface HL7Service
Parameters:
hl7InError - the item to remove
Throws:
APIException
See Also:
HL7Service.purgeHL7InError(org.openmrs.hl7.HL7InError)

saveHL7InError

public HL7InError saveHL7InError(HL7InError hl7InError)
                          throws APIException
Description copied from interface: HL7Service
Save the given error item to the database

Specified by:
saveHL7InError in interface HL7Service
Parameters:
hl7InError - the item to save
Returns:
the saved item
Throws:
APIException
See Also:
HL7Service.saveHL7InError(org.openmrs.hl7.HL7InError)

createHL7InError

@Deprecated
public void createHL7InError(HL7InError hl7InError)
Deprecated. 

Specified by:
createHL7InError in interface HL7Service
See Also:
HL7Service.createHL7InError(org.openmrs.hl7.HL7InError)

getHL7InError

public HL7InError getHL7InError(java.lang.Integer hl7InErrorId)
Description copied from interface: HL7Service
Get the error item with the given id

Specified by:
getHL7InError in interface HL7Service
Parameters:
hl7InErrorId - the id to search on
Returns:
the matching error item
See Also:
HL7Service.getHL7InError(java.lang.Integer)

getHL7InErrors

@Deprecated
public java.util.Collection<HL7InError> getHL7InErrors()
Deprecated. 

Specified by:
getHL7InErrors in interface HL7Service
See Also:
HL7Service.getHL7InErrors()

updateHL7InError

@Deprecated
public void updateHL7InError(HL7InError hl7InError)
Deprecated. 

Specified by:
updateHL7InError in interface HL7Service
See Also:
HL7Service.updateHL7InError(org.openmrs.hl7.HL7InError)

deleteHL7InError

@Deprecated
public void deleteHL7InError(HL7InError hl7InError)
Deprecated. 

Specified by:
deleteHL7InError in interface HL7Service
See Also:
HL7Service.deleteHL7InError(org.openmrs.hl7.HL7InError)

resolveUserId

public java.lang.Integer resolveUserId(ca.uhn.hl7v2.model.v25.datatype.XCN xcn)
                                throws ca.uhn.hl7v2.HL7Exception
Specified by:
resolveUserId in interface HL7Service
Parameters:
xcn - HL7 component of data type XCN (extended composite ID number and name for persons) (see HL7 2.5 manual Ch.2A.86)
Returns:
Internal ID # of the specified user, or null if that user can't be found or is ambiguous
Throws:
ca.uhn.hl7v2.HL7Exception

resolvePersonId

public java.lang.Integer resolvePersonId(ca.uhn.hl7v2.model.v25.datatype.XCN xcn)
                                  throws ca.uhn.hl7v2.HL7Exception
Specified by:
resolvePersonId in interface HL7Service
Parameters:
xcn - HL7 component of data type XCN (extended composite ID number and name for persons) (see HL7 2.5 manual Ch.2A.86)
Returns:
Internal ID # of the specified person, or null if that person can't be found or is ambiguous
Throws:
ca.uhn.hl7v2.HL7Exception
See Also:
HL7Service.resolvePersonId(ca.uhn.hl7v2.model.v25.datatype.XCN)

resolveLocationId

public java.lang.Integer resolveLocationId(ca.uhn.hl7v2.model.v25.datatype.PL pl)
                                    throws ca.uhn.hl7v2.HL7Exception
Specified by:
resolveLocationId in interface HL7Service
Parameters:
pl - HL7 component of data type PL (person location) (see Ch 2.A.53)
Returns:
internal identifier of the specified location, or null if it is not found or ambiguous
Throws:
ca.uhn.hl7v2.HL7Exception

resolvePatientId

public java.lang.Integer resolvePatientId(ca.uhn.hl7v2.model.v25.segment.PID pid)
                                   throws ca.uhn.hl7v2.HL7Exception
Specified by:
resolvePatientId in interface HL7Service
Parameters:
pid - A PID segment of an hl7 message
Returns:
The internal id number of the Patient described by the PID segment, or null of the patient is not found, or if the PID segment is ambiguous
Throws:
ca.uhn.hl7v2.HL7Exception

resolvePersonFromIdentifiers

public Person resolvePersonFromIdentifiers(ca.uhn.hl7v2.model.v25.datatype.CX[] identifiers)
                                    throws ca.uhn.hl7v2.HL7Exception
Description copied from interface: HL7Service
determines a person (or patient) based on identifiers from a CX array, as found in a PID or NK1 segment; the first resolving identifier in the list wins

Specified by:
resolvePersonFromIdentifiers in interface HL7Service
Parameters:
identifiers - CX identifier list from an identifier (either PID or NK1)
Returns:
The internal id number of the Patient based on one of the given identifiers, or null if the patient is not found
Throws:
ca.uhn.hl7v2.HL7Exception

garbageCollect

public void garbageCollect()
Description copied from interface: HL7Service
Clean up the current memory consumption

Specified by:
garbageCollect in interface HL7Service
See Also:
HL7Service.garbageCollect()

encounterCreated

@Deprecated
public void encounterCreated(Encounter encounter)
Deprecated. This method is no longer needed. When an encounter is created in the ROUR01 handler, it is created with all obs. Any AOP hooking should be done on the EncounterService.createEncounter(Encounter) method

Description copied from interface: HL7Service
This method is called after an encounter and its obs are created. This method can be removed once we have obs groups being created correctly

Specified by:
encounterCreated in interface HL7Service
See Also:
HL7Service.encounterCreated(org.openmrs.Encounter)

processHL7InQueue

public HL7InQueue processHL7InQueue(HL7InQueue hl7InQueue)
                             throws ca.uhn.hl7v2.HL7Exception
Description copied from interface: HL7Service
Process the given HL7InQueue item.
If an error occurs while processing, a new HL7InError is created and saved.
If no error occurs, a new HL7InArchive is created and saved.
The given HL7InQueue is removed from the hl7 in queue table regardless of success or failure of the processing.

Specified by:
processHL7InQueue in interface HL7Service
Parameters:
hl7InQueue - the HL7InQueue to parse and save all encounters/obs to the db
Returns:
the processed HL7InQueue
Throws:
ca.uhn.hl7v2.HL7Exception
See Also:
HL7Service.processHL7InQueue(org.openmrs.hl7.HL7InQueue)

parseHL7String

public ca.uhn.hl7v2.model.Message parseHL7String(java.lang.String hl7Message)
                                          throws ca.uhn.hl7v2.HL7Exception
Description copied from interface: HL7Service
Parses the given string and returns the resulting Message

Specified by:
parseHL7String in interface HL7Service
Parameters:
hl7Message - the hl7 string to parse and save
Returns:
the Message that the given hl7 string represents
Throws:
ca.uhn.hl7v2.HL7Exception
See Also:
org.openmrs.hl7.HL7Service#parseHL7Message(java.lang.String)

getHL7InArchiveByUuid

public HL7InArchive getHL7InArchiveByUuid(java.lang.String uuid)
                                   throws APIException
Description copied from interface: HL7Service
Get the archive item with the given uuid

Specified by:
getHL7InArchiveByUuid in interface HL7Service
Parameters:
uuid - to search on
Returns:
the archive with the matching uuid if any found
Throws:
APIException
See Also:
HL7Service.getHL7InArchiveByUuid(java.lang.String)

processHL7Message

public ca.uhn.hl7v2.model.Message processHL7Message(ca.uhn.hl7v2.model.Message message)
                                             throws ca.uhn.hl7v2.HL7Exception
Description copied from interface: HL7Service
Parses the given Message and saves the resulting content to the database

Specified by:
processHL7Message in interface HL7Service
Parameters:
message - the Message to process and save to the db.
Returns:
the processed message
Throws:
ca.uhn.hl7v2.HL7Exception
See Also:
HL7Service.processHL7Message(ca.uhn.hl7v2.model.Message)

setHL7Handlers

public void setHL7Handlers(java.util.Map<java.lang.String,ca.uhn.hl7v2.app.Application> handlers)
Sets the given handlers as router applications that are available to HAPI when it is parsing an hl7 message.
This method is usually used by Spring and the handlers are set in the applicationContext-server.xml method.
The key in the map is a string like "ORU_R01" where the first part is the message type and the second is the trigger event.

Parameters:
handlers - a map from MessageName to Application object

createPersonFromNK1

public Person createPersonFromNK1(ca.uhn.hl7v2.model.v25.segment.NK1 nk1)
                           throws ca.uhn.hl7v2.HL7Exception
Description copied from interface: HL7Service
creates a Person from information held in an NK1 segment; if valid PatientIdentifiers exist, a Patient will be created and returned

Specified by:
createPersonFromNK1 in interface HL7Service
Parameters:
nk1 - the NK1 segment with person information
Returns:
the newly formed (but not saved) person
Throws:
ca.uhn.hl7v2.HL7Exception
See Also:
HL7Service.createPersonFromNK1(ca.uhn.hl7v2.model.v25.segment.NK1)

getUuidFromIdentifiers

public java.lang.String getUuidFromIdentifiers(ca.uhn.hl7v2.model.v25.datatype.CX[] identifiers)
                                        throws ca.uhn.hl7v2.HL7Exception
Description copied from interface: HL7Service
finds a UUID from an array of identifiers

Specified by:
getUuidFromIdentifiers in interface HL7Service
Returns:
the UUID or null
Throws:
ca.uhn.hl7v2.HL7Exception
See Also:
HL7Service.getUuidFromIdentifiers(ca.uhn.hl7v2.model.v25.datatype.CX[])

loadHL7InArchiveData

public void loadHL7InArchiveData(java.util.List<HL7InArchive> archives)
                          throws APIException
Description copied from interface: HL7Service
Loads data for a list of HL7 archives from the filesystem

Specified by:
loadHL7InArchiveData in interface HL7Service
Throws:
APIException
See Also:
HL7Service.loadHL7InArchiveData(List)

loadHL7InArchiveData

public void loadHL7InArchiveData(HL7InArchive archive)
                          throws APIException
Description copied from interface: HL7Service
Loads HL7 data from the filesystem for an archived HL7InArchive

Specified by:
loadHL7InArchiveData in interface HL7Service
Throws:
APIException
See Also:
HL7Service.loadHL7InArchiveData(HL7InArchive)

migrateHl7InArchivesToFileSystem

public void migrateHl7InArchivesToFileSystem(java.util.Map<java.lang.String,java.lang.Integer> progressStatusMap)
                                      throws APIException
Description copied from interface: HL7Service
Method is called by the archives migration thread to transfer hl7 in archives from the hl7_in_archives database table to the file system

Specified by:
migrateHl7InArchivesToFileSystem in interface HL7Service
Parameters:
progressStatusMap - the map holding the number of archives transferred and failed transfers
Throws:
APIException
See Also:
HL7Service.migrateHl7InArchivesToFileSystem(Map)

OpenMRS-1.7.x

Generated Apr 27 2012 10:06 PM. NOTE - these libraries are in active development and subject to change