TRUNK-3896, ORUR01Handler now asks for a location from the LocationService (via Context) for each Encounter. When processing a backlog of 2000 HL7 messages, each additional database hit increases the end running time 2000x.
Soon enough, we will get tired of invalid data coming from the ORUR01Handler. An example of this is when an incoming OBX is marked as ST datatype, the value is always stored in obs.valueText regardless of the concept's datatype. We should probably be using Obs validation, or at least performing some fast version of it, to ensure at least the HL7 data matches our model.
This means hydrating a cache of concepts, and that cache could also contain encounter types, locations, etc for use in creating and subsequently saving each encounter. If we do caching at the Context level, it may help all around ... but I don't know many other services in OpenMRS that process data in such a high volume.
I am willing to help with load testing the ORUR01Handler to demonstrate the performance hit after adding this cache.