Class IdHelperService

All Implemented Interfaces:

@Service public class IdHelperService extends Object implements IIdHelperService<JpaPid>
This class is used to convert between PIDs (the internal primary key for a particular resource as stored in the HFJ_RESOURCE table), and the public ID that a resource has.

These IDs are sometimes one and the same (by default, a resource that the server assigns the ID of Patient/1 will simply use a PID of 1 and and ID of 1. However, they may also be different in cases where a forced ID is used (an arbitrary client-assigned ID).

This service is highly optimized in order to minimize the number of DB calls as much as possible, since ID resolution is fundamental to many basic operations. This service returns either IResourceLookup or BaseResourcePersistentId depending on the method being called. The former involves an extra database join that the latter does not require, so selecting the right method here is important.