org.openmrs.hl7
Interface HL7Service

All Superinterfaces:
OpenmrsService
All Known Implementing Classes:
HL7ServiceImpl

@Transactional
public interface HL7Service
extends OpenmrsService

OpenMRS HL7 API


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. use saveHL7InArchive(HL7InArchive)
 void createHL7InError(HL7InError hl7InError)
          Deprecated. use saveHL7InError(HL7InError)
 void createHL7InQueue(HL7InQueue hl7InQueue)
          Deprecated. use saveHL7InQueue(HL7InQueue)
 void createHL7Source(HL7Source hl7Source)
          Deprecated. use saveHL7Source(HL7Source)
 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. use purgeHL7InArchive(HL7InArchive)
 void deleteHL7InError(HL7InError hl7InError)
          Deprecated. use purgeHL7InError(HL7InError)
 void deleteHL7InQueue(HL7InQueue hl7InQueue)
          Deprecated. use purgeHL7InQueue(HL7InQueue)
 void deleteHL7Source(HL7Source hl7Source)
          Deprecated. use purgeHL7Source(HL7Source)
 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 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. use getAllHL7InArchives()
 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. use getAllHL7InErrors()
 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. use getAllHL7InQueues()
 HL7Source getHL7Source(java.lang.Integer hl7SourceId)
          Auto generated method comment
 HL7Source getHL7Source(java.lang.String name)
          Deprecated. use getHL7SourceByName(String)
 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. use getAllHL7Sources()
 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 hl7String)
          Parses the given string and returns the resulting Message
 HL7InQueue processHL7InQueue(HL7InQueue inQueue)
          Process the given HL7InQueue item.
 ca.uhn.hl7v2.model.Message processHL7Message(ca.uhn.hl7v2.model.Message hl7Message)
          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 updateHL7InArchive(HL7InArchive hl7InArchive)
          Deprecated. use saveHL7InArchive(HL7InArchive)
 void updateHL7InError(HL7InError hl7InError)
          Deprecated. use saveHL7InError(HL7InError)
 void updateHL7Source(HL7Source hl7Source)
          Deprecated. use saveHL7Source(HL7Source)
 
Methods inherited from interface org.openmrs.api.OpenmrsService
onShutdown, onStartup
 

Method Detail

setHL7DAO

void setHL7DAO(HL7DAO dao)
Auto generated method comment

Parameters:
dao -

saveHL7Source

@Authorized(value="Update HL7 Source")
HL7Source saveHL7Source(HL7Source hl7Source)
                        throws APIException
Save the given hl7Source to the database

Parameters:
hl7Source - the source to save
Returns:
the saved source
Throws:
APIException

createHL7Source

@Deprecated
@Authorized(value="Update HL7 Source")
void createHL7Source(HL7Source hl7Source)
                     throws APIException
Deprecated. use saveHL7Source(HL7Source)

Throws:
APIException

getHL7Source

@Transactional(readOnly=true)
@Authorized(value="View HL7 Source")
HL7Source getHL7Source(java.lang.Integer hl7SourceId)
                       throws APIException
Auto generated method comment

Parameters:
hl7SourceId -
Returns:
HL7Sourceobject for given identifier
Throws:
APIException

getHL7SourceByName

@Transactional(readOnly=true)
@Authorized(value="View HL7 Source")
HL7Source getHL7SourceByName(java.lang.String name)
                             throws APIException
Get the hl7 source object from the database that has the given name

Parameters:
name - string to 'search' on
Returns:
hl7 source object
Throws:
APIException

getHL7Source

@Deprecated
@Transactional(readOnly=true)
@Authorized(value="View HL7 Source")
HL7Source getHL7Source(java.lang.String name)
Deprecated. use getHL7SourceByName(String)


getAllHL7Sources

@Transactional(readOnly=true)
@Authorized(value="View HL7 Source")
java.util.List<HL7Source> getAllHL7Sources()
                                           throws APIException
Get all of the hl7 source objects from the database. This includes retired ones

Returns:
list of hl7 source objects
Throws:
APIException

getHL7Sources

@Deprecated
@Transactional(readOnly=true)
@Authorized(value="View HL7 Source")
java.util.Collection<HL7Source> getHL7Sources()
Deprecated. use getAllHL7Sources()


updateHL7Source

@Deprecated
@Authorized(value="Update HL7 Source")
void updateHL7Source(HL7Source hl7Source)
Deprecated. use saveHL7Source(HL7Source)


retireHL7Source

@Authorized(value="Update HL7 Source")
HL7Source retireHL7Source(HL7Source hl7Source)
                          throws APIException
Mark the given hl7Source as no longer active

Parameters:
hl7Source - the source to retire
Returns:
the retired source
Throws:
APIException

purgeHL7Source

@Authorized(value="Purge HL7 Source")
void purgeHL7Source(HL7Source hl7Source)
                    throws APIException
Completely remove the source from the database. This should only be used in rare cases. See retireHL7Source(HL7Source)

Parameters:
hl7Source -
Throws:
APIException

deleteHL7Source

@Deprecated
@Authorized(value="Update HL7 Source")
void deleteHL7Source(HL7Source hl7Source)
Deprecated. use purgeHL7Source(HL7Source)

See Also:
retireHL7Source(HL7Source)

saveHL7InQueue

@Authorized(value={"Update HL7 Inbound Queue","Add HL7 Inbound Queue"},
            requireAll=false)
HL7InQueue saveHL7InQueue(HL7InQueue hl7InQueue)
                          throws APIException
Save the given hl7InQueue to the database

Parameters:
hl7InQueue - the queue item to save
Returns:
the saved queue item
Throws:
APIException
Expected behavior:
add generated uuid if uuid is null

createHL7InQueue

@Deprecated
@Authorized(value="Add HL7 Inbound Queue")
void createHL7InQueue(HL7InQueue hl7InQueue)
Deprecated. use saveHL7InQueue(HL7InQueue)


getHL7InQueue

@Transactional(readOnly=true)
@Authorized(value="View HL7 Inbound Queue")
HL7InQueue getHL7InQueue(java.lang.Integer hl7InQueueId)
                         throws APIException
Get the hl7 queue item with the given primary key id

Parameters:
hl7InQueueId - the id to search on
Returns:
the desired hl7InQueue object or null if none found
Throws:
APIException

getAllHL7InQueues

@Transactional(readOnly=true)
@Authorized(value="View HL7 Inbound Queue")
java.util.List<HL7InQueue> getAllHL7InQueues()
                                             throws APIException
Return a list of all hl7 in queues in the database

Returns:
all hl7 queue items
Throws:
APIException

getHL7InQueueBatch

@Transactional(readOnly=true)
@Authorized(value="View HL7 Inbound Queue")
java.util.List<HL7InQueue> getHL7InQueueBatch(int start,
                                                                            int length,
                                                                            int messageState,
                                                                            java.lang.String query)
                                              throws APIException
Return a list of all hl7 in queues based on batch settings and a query string

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
Since:
1.7

countHL7InQueue

@Transactional(readOnly=true)
@Authorized(value="View HL7 Inbound Queue")
java.lang.Integer countHL7InQueue(int messageState,
                                                                java.lang.String query)
                                  throws APIException
the total count of all HL7InQueue objects in the database

Parameters:
messageState - HL7InQueue status
query - search string
Returns:
the count of matching HL7InQueue items
Throws:
APIException
Since:
1.7

getHL7InErrorBatch

@Transactional(readOnly=true)
@Authorized(value="View HL7 Inbound Queue")
java.util.List<HL7InError> getHL7InErrorBatch(int start,
                                                                            int length,
                                                                            java.lang.String query)
                                              throws APIException
Return a list of all hl7 in errors based on batch settings and a query string

Parameters:
start - beginning index
length - size of the batch
query - search string
Returns:
all matching hl7 queue items within batch window
Throws:
APIException
Since:
1.7

countHL7InError

@Transactional(readOnly=true)
@Authorized(value="View HL7 Inbound Queue")
java.lang.Integer countHL7InError(java.lang.String query)
                                  throws APIException
the total count of all HL7InError objects in the database

Parameters:
query - search string
Returns:
the count of matching HL7InError items
Throws:
APIException
Since:
1.7

getHL7InArchiveBatch

@Transactional(readOnly=true)
@Authorized(value="View HL7 Inbound Archive")
java.util.List<HL7InArchive> getHL7InArchiveBatch(int start,
                                                                                int length,
                                                                                int messageState,
                                                                                java.lang.String query)
                                                  throws APIException
Return a list of all hl7 in archives based on batch settings and a query string

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
Since:
1.7

countHL7InArchive

@Transactional(readOnly=true)
@Authorized(value="View HL7 Inbound Archive")
java.lang.Integer countHL7InArchive(int messageState,
                                                                  java.lang.String query)
                                    throws APIException
the total count of all HL7InArchive objects in the database

Parameters:
messageState - status of the HL7InArchive message
query - search string
Returns:
the count of matching HL7InArchive items
Throws:
APIException
Since:
1.7

getHL7InQueues

@Deprecated
@Transactional(readOnly=true)
@Authorized(value="View HL7 Inbound Queue")
java.util.Collection<HL7InQueue> getHL7InQueues()
Deprecated. use getAllHL7InQueues()


getNextHL7InQueue

@Transactional(readOnly=true)
@Authorized(value="View HL7 Inbound Queue")
HL7InQueue getNextHL7InQueue()
                             throws APIException
Get the first queue item in the database

Returns:
the first queue item
Throws:
APIException

purgeHL7InQueue

@Authorized(value="Purge HL7 Inbound Queue")
void purgeHL7InQueue(HL7InQueue hl7InQueue)
Completely delete the hl7 in queue item from the database.

Parameters:
hl7InQueue -

deleteHL7InQueue

@Deprecated
@Authorized(value="Delete HL7 Inbound Queue")
void deleteHL7InQueue(HL7InQueue hl7InQueue)
Deprecated. use purgeHL7InQueue(HL7InQueue)


saveHL7InArchive

@Authorized(value={"Update HL7 Inbound Archive","Add HL7 Inbound Archive"},
            requireAll=false)
HL7InArchive saveHL7InArchive(HL7InArchive hl7InArchive)
                              throws APIException
Save the given hl7 in archive to the database

Parameters:
hl7InArchive - the archive to save
Returns:
the saved archive item
Throws:
APIException

createHL7InArchive

@Deprecated
@Authorized(value="Add HL7 Inbound Archive")
void createHL7InArchive(HL7InArchive hl7InArchive)
Deprecated. use saveHL7InArchive(HL7InArchive)


getHL7InArchive

@Transactional(readOnly=true)
@Authorized(value="View HL7 Inbound Archive")
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 getHL7InArchiveByUuid(String)

Parameters:
hl7InArchiveId - the id to search on
Returns:
the matching archive item

getHL7InArchiveByUuid

HL7InArchive getHL7InArchiveByUuid(java.lang.String uuid)
                                   throws APIException
Get the archive item with the given uuid

Parameters:
uuid - to search on
Returns:
the archive with the matching uuid if any found
Throws:
APIException
Since:
Version 1.7

getHL7InArchiveByState

@Transactional(readOnly=true)
@Authorized(value="View HL7 Inbound Archive")
java.util.List<HL7InArchive> getHL7InArchiveByState(java.lang.Integer state)
                                                    throws APIException
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.

Returns:
list of archive items that match the state
Throws:
APIException
Since:
1.5

getHL7InQueueByState

@Transactional(readOnly=true)
@Authorized(value="View HL7 Inbound Queue")
java.util.List<HL7InQueue> getHL7InQueueByState(java.lang.Integer state)
                                                throws APIException
Get the queue items given a state (deleted, error, pending, processing, processed).

Returns:
list of hl7 queue items that match the given state
Throws:
APIException
Since:
1.7

getAllHL7InArchives

@Transactional(readOnly=true)
@Authorized(value="View HL7 Inbound Archive")
java.util.List<HL7InArchive> getAllHL7InArchives()
                                                 throws APIException
Get all archive hl7 queue items from the database

Returns:
list of archive items
Throws:
APIException

getHL7InArchives

@Deprecated
@Transactional(readOnly=true)
@Authorized(value="View HL7 Inbound Archive")
java.util.Collection<HL7InArchive> getHL7InArchives()
Deprecated. use getAllHL7InArchives()


updateHL7InArchive

@Deprecated
@Authorized(value="Update HL7 Inbound Archive")
void updateHL7InArchive(HL7InArchive hl7InArchive)
Deprecated. use saveHL7InArchive(HL7InArchive)


purgeHL7InArchive

@Authorized(value="Purge HL7 Inbound Archive")
void purgeHL7InArchive(HL7InArchive hl7InArchive)
                       throws APIException
Completely delete the hl7 in archive item from the database

Parameters:
hl7InArchive - the archived item to delete
Throws:
APIException

deleteHL7InArchive

@Deprecated
@Authorized(value="Delete HL7 Inbound Archive")
void deleteHL7InArchive(HL7InArchive hl7InArchive)
Deprecated. use purgeHL7InArchive(HL7InArchive)


saveHL7InError

@Authorized(value={"Update HL7 Inbound Exception","Add HL7 Inbound Exception"},
            requireAll=false)
HL7InError saveHL7InError(HL7InError hl7InError)
                          throws APIException
Save the given error item to the database

Parameters:
hl7InError - the item to save
Returns:
the saved item
Throws:
APIException

createHL7InError

@Deprecated
@Authorized(value="Add HL7 Inbound Exception")
void createHL7InError(HL7InError hl7InError)
Deprecated. use saveHL7InError(HL7InError)


getHL7InError

@Transactional(readOnly=true)
@Authorized(value="View HL7 Inbound Exception")
HL7InError getHL7InError(java.lang.Integer hl7InErrorId)
                         throws APIException
Get the error item with the given id

Parameters:
hl7InErrorId - the id to search on
Returns:
the matching error item
Throws:
APIException

getAllHL7InErrors

@Transactional(readOnly=true)
@Authorized(value="View HL7 Inbound Exception")
java.util.List<HL7InError> getAllHL7InErrors()
                                             throws APIException
Get all HL7InError items from the database

Returns:
a List object with all HL7InError items from the database
Throws:
APIException

getHL7InErrors

@Deprecated
@Transactional(readOnly=true)
@Authorized(value="View HL7 Inbound Exception")
java.util.Collection<HL7InError> getHL7InErrors()
Deprecated. use getAllHL7InErrors()


updateHL7InError

@Deprecated
@Authorized(value="Update HL7 Inbound Exception")
void updateHL7InError(HL7InError hl7InError)
Deprecated. use saveHL7InError(HL7InError)


purgeHL7InError

@Authorized(value="Purge HL7 Inbound Exception")
void purgeHL7InError(HL7InError hl7InError)
                     throws APIException
Completely remove this error item from the database

Parameters:
hl7InError - the item to remove
Throws:
APIException

deleteHL7InError

@Deprecated
@Authorized(value="Delete HL7 Inbound Exception")
void deleteHL7InError(HL7InError hl7InError)
Deprecated. use purgeHL7InError(HL7InError)


resolveUserId

java.lang.Integer resolveUserId(ca.uhn.hl7v2.model.v25.datatype.XCN xcn)
                                throws ca.uhn.hl7v2.HL7Exception
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

java.lang.Integer resolvePersonId(ca.uhn.hl7v2.model.v25.datatype.XCN xcn)
                                  throws ca.uhn.hl7v2.HL7Exception
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

resolveLocationId

java.lang.Integer resolveLocationId(ca.uhn.hl7v2.model.v25.datatype.PL pl)
                                    throws ca.uhn.hl7v2.HL7Exception
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

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

resolvePersonFromIdentifiers

Person resolvePersonFromIdentifiers(ca.uhn.hl7v2.model.v25.datatype.CX[] identifiers)
                                    throws ca.uhn.hl7v2.HL7Exception
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

Parameters:
identifiers - CX identifier list from an identifier (either PID or NK1)
Returns:
The internal id number of a Person based on one of the given identifiers, or null if the Person is not found
Throws:
ca.uhn.hl7v2.HL7Exception
Expected behavior:
find a person based on a patient identifier, find a person based on a UUID, find a person based on the internal person ID, return null if no person is found

garbageCollect

void garbageCollect()
Clean up the current memory consumption


encounterCreated

@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

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

Parameters:
encounter -

processHL7InQueue

HL7InQueue processHL7InQueue(HL7InQueue inQueue)
                             throws ca.uhn.hl7v2.HL7Exception
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.

Parameters:
inQueue - the HL7InQueue to parse and save all encounters/obs to the db
Returns:
the processed HL7InQueue
Throws:
ca.uhn.hl7v2.HL7Exception
Expected behavior:
create HL7InArchive after successful parsing, create HL7InError after failed parsing, fail if given inQueue is already marked as processing, parse oru r01 message using overridden parser provided by a module

parseHL7String

@Logging(ignoreAllArgumentValues=true)
ca.uhn.hl7v2.model.Message parseHL7String(java.lang.String hl7String)
                                          throws ca.uhn.hl7v2.HL7Exception
Parses the given string and returns the resulting Message

Parameters:
hl7String - the hl7 string to parse and save
Returns:
the Message that the given hl7 string represents
Throws:
ca.uhn.hl7v2.HL7Exception
See Also:
processHL7InQueue(HL7InQueue)
Expected behavior:
parse the given string into Message

processHL7Message

ca.uhn.hl7v2.model.Message processHL7Message(ca.uhn.hl7v2.model.Message hl7Message)
                                             throws ca.uhn.hl7v2.HL7Exception
Parses the given Message and saves the resulting content to the database

Parameters:
hl7Message - the Message to process and save to the db.
Returns:
the processed message
Throws:
ca.uhn.hl7v2.HL7Exception
See Also:
#processHL7String(String)}, processHL7InQueue(HL7InQueue)
Expected behavior:
save hl7Message to the database, parse message type supplied by module

migrateHl7InArchivesToFileSystem

@Authorized(requireAll=true,
            value={"View HL7 Inbound Archive","Purge HL7 Inbound Archive","Add HL7 Inbound Queue"})
void migrateHl7InArchivesToFileSystem(java.util.Map<java.lang.String,java.lang.Integer> progressStatusMap)
                                      throws APIException
Method is called by the archives migration thread to transfer hl7 in archives from the hl7_in_archives database table to the file system

Parameters:
progressStatusMap - the map holding the number of archives transferred and failed transfers
Throws:
APIException

getUuidFromIdentifiers

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

Parameters:
identifiers -
Returns:
the UUID or null
Throws:
ca.uhn.hl7v2.HL7Exception
Expected behavior:
return null if no UUID found, find a UUID in any position of the array, not fail if multiple similar UUIDs exist in identifiers, not fail if no assigning authority is found, fail if multiple different UUIDs exist in identifiers

createPersonFromNK1

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

Parameters:
nk1 - the NK1 segment with person information
Returns:
the newly formed (but not saved) person
Throws:
ca.uhn.hl7v2.HL7Exception
Expected behavior:
return a saved new person, return a Patient if valid patient identifiers exist, fail if a person with the same UUID exists, fail on an invalid gender, fail if no gender specified, fail if no birthdate specified

loadHL7InArchiveData

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

Parameters:
archives -
Throws:
APIException
Since:
1.7

loadHL7InArchiveData

void loadHL7InArchiveData(HL7InArchive archive)
                          throws APIException
Loads HL7 data from the filesystem for an archived HL7InArchive

Parameters:
archive -
Throws:
APIException
Since:
1.7

OpenMRS-1.7.x

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