As a Developer, I want to improve the latency and reliability of patient and staff identifier retrieval from Mobile MVI Service.
Mobile MVI Service 1.28+ now supports Cache-Control headers to optionally retrieve cached identifiers, and to return cached identifiers in the case of an error response from MVI:
final ResponseEntity<List<PersonIdentifier>> staffIdentifiersResponse = mviApi
.getStaffIdentifiersWithHttpInfo(
idType,
id,
SENDER_ID,
null,
null,
CacheControl
.maxAge(Duration.ofHours(1))
.staleIfError(Duration.ofHours(12))
.getHeaderValue()
);
// example of getting the data age:
final List<String> ageHeader = staffIdentifiersResponse.getHeaders().get(HttpHeaders.AGE);
int ageSeconds = 0;
if (isNotEmpty(ageHeader)) {
ageSeconds = Integer.parseInt(ageHeader.get(0));
}
Acceptance Criteria:
Any time that CES retrieves patient identifiers from Mobile MVI Service, it requests a response from cache first if the data was cached within the last 6 hours, then falls back to live MPI data, then falls back to the cache if the live call fails and the data was cached within the last 48 hours.
Uses a cache-control header value of "max-age: 21600, stale-if-error: 172800"
Allow overriding the default max age with MVI_PATIENT_IDS_CACHE_MAX_AGE
Allow overriding the default stale-if-error with MVI_PATIENT_IDS_CACHE_STALE_IF_ERROR
Any time that CES retrieves staff identifiers from Mobile MVI Service, it requests a response from cache first if the data was cached within the last 2 hours, then falls back to live MPI data, then falls back to the cache if the live call fails and the data was cached within the last 48 hours.
Uses a cache-control header value of "max-age: 7200, stale-if-error: 172800"
Allow overriding the default max age with MVI_STAFF_IDS_CACHE_MAX_AGE
Allow overriding the default stale-if-error with MVI_STAFF_IDS_CACHE_STALE_IF_ERROR
CES-457: https://issues.mobilehealth.va.gov/browse/CES-457
Mobile MVI Service 1.28+ now supports Cache-Control headers to optionally retrieve cached identifiers, and to return cached identifiers in the case of an error response from MVI:
Acceptance Criteria:
Any time that CES retrieves patient identifiers from Mobile MVI Service, it requests a response from cache first if the data was cached within the last 6 hours, then falls back to live MPI data, then falls back to the cache if the live call fails and the data was cached within the last 48 hours. Uses a
cache-control
header value of "max-age: 21600, stale-if-error: 172800" Allow overriding the default max age with MVI_PATIENT_IDS_CACHE_MAX_AGE Allow overriding the default stale-if-error with MVI_PATIENT_IDS_CACHE_STALE_IF_ERROR Any time that CES retrieves staff identifiers from Mobile MVI Service, it requests a response from cache first if the data was cached within the last 2 hours, then falls back to live MPI data, then falls back to the cache if the live call fails and the data was cached within the last 48 hours. Uses acache-control
header value of "max-age: 7200, stale-if-error: 172800" Allow overriding the default max age with MVI_STAFF_IDS_CACHE_MAX_AGE Allow overriding the default stale-if-error with MVI_STAFF_IDS_CACHE_STALE_IF_ERROR