Class CacheKeyInspector
Utilidad para extraer información estructurada útil para trazas. No usada por la lógica de caché, pero sí por logs y diagnósticos.
public static class CacheKeyInspector
- Inheritance
-
CacheKeyInspector
- Inherited Members
Methods
ExtractAppointmentInfo(string)
Extracts appointment location and date information from the provided key by matching against a predefined appointment-day pattern.
Returns a null location and null date if the key does not match the expected pattern, and returns the matched location with a null date if the date portion cannot be parsed using the yyyyMMdd format.
public static (string? Location, DateTime? Date) ExtractAppointmentInfo(string key)
Parameters
keystringThe input string expected to contain a location and a date in
yyyyMMddformat.
Returns
- (string Location, DateTime? Date)
A tuple containing the extracted
Locationstring and the parsedDate; either value may benullwhen extraction or parsing fails.
ExtractGroupedObservationInfo(string)
Extracts the observation field name and patient identifier from a grouped observation key using a regular expression pattern. Returns a tuple of null values when the key does not match the expected grouped format.
public static (string? Field, string? PatientId) ExtractGroupedObservationInfo(string key)
Parameters
keystringThe grouped observation key to parse.
Returns
- (string Field, string PatientId)
A tuple containing the extracted field name and patient identifier, or
(null, null)if the key does not match the pattern.
ExtractPatientId(string)
Extracts the patient identifier from the given key using a regular expression pattern.
Returns null if the key does not match the expected patient format.
public static string? ExtractPatientId(string key)
Parameters
keystringThe input string from which to extract the patient identifier.
Returns
- string
The extracted patient identifier, or
nullif no match is found.