Prod will have much more messages than Dev, you need to add something in your query that is using an indexed field, if you want to search by MRN.
If you have the Enslib HL7 SearchTable enabled on the business host you are looking at then the below query can help.
SELECT RawContent
FROM EnsLib_HL7.Message
WHERE ID IN (SELECT
DocId
FROM EnsLib_HL7.SearchTable
WHERE PropId = 4 AND PropValue = 'MRN'
)
ORDER BY TimeCreated Desc
Things might be on the same network, but on virtual machines spread across different data centers / physical servers, so definitely some level of HA for sure if you have more than one instance. You got to take and work with what's available. If in future, that client has network separation also available then you can increase your level of HA, but not having HA isn't right.
Probably you can have your document limit listed in a lookup table to begin with, lets say Limit = 100 to begin with.
Then within your business process, add an if-else section, where the test condition is to evaluate current time against the XXXX and YYYY times you have in mind. If the current time is within your XXXX and YYYY, plus the limit is > 0 from the lookup table, you send the document and decrease the lookup table value by 1.
On the else condition, you just send the document without checking the limit value from the table, but update the lookup table again to your limit (100).
The key here is accessing and updating the lookup table value from within your business process.
Hope this makes sense.