These Acknowledgements should be used with all HIPAA transactions sent in batch mode or real-time as instructed by the real-time transaction's TR3 document.
The TA1 segment does not always need to be sent, but should be when requested by the submitter, as described in X12.5 section 3.2.2. And should be used when instructed by a transaction's TR3 document.
The 999 acknowledgement should be used by all batch transactions, and as required for real-time transctions, normally when there is a syntactical error that would prevent the normal real-time response associated with a real-time transaction from being generated. For example, if a real-time 270 transaction had a syntactical error that would prevent the receiver from processing the 270 transaction and not being able to process a 271 response transaction, then a 999 transaction should be sent to report the syntactical error of the 270 transaction.