Interface IConfigObservationService
- Namespace
- adas_core.Application.Services.Interfaces
- Assembly
- adas-core.Application.dll
public interface IConfigObservationService
- Extension Methods
Methods
CreateConfig(ConfigObservation)
Asynchronously creates a new configuration based on the provided observation data.
Task<ConfigObservation?> CreateConfig(ConfigObservation configObservation)
Parameters
configObservationConfigObservationThe observation data used to create the configuration.
Returns
- Task<ConfigObservation>
A task that represents the asynchronous operation, containing the created ConfigObservation, or
nullif the configuration could not be created.
DeleteSingleConfigObservationItem(ConfigObservation)
Asynchronously deletes a single configuration observation item from the underlying store.
Task<bool> DeleteSingleConfigObservationItem(ConfigObservation configObservationItem)
Parameters
configObservationItemConfigObservationThe configuration observation item to be deleted.
Returns
- Task<bool>
A task that represents the asynchronous operation. The task result contains a boolean value indicating whether the deletion was successful.
Get(string)
Asynchronously retrieves a ConfigObservation identified by the given name. Returns null when no matching configuration observation is found.
Task<ConfigObservation?> Get(string name)
Parameters
namestringThe name of the configuration observation to retrieve.
Returns
- Task<ConfigObservation>
A Task<TResult> that yields the matching ConfigObservation, or null if no observation is found.
GetAllCompact()
Retrieves all configuration observations in a compact format.
Task<ConfigObservationDto> GetAllCompact()
Returns
- Task<ConfigObservationDto>
A task representing the asynchronous operation that returns a ConfigObservationDto containing the compact representation of all configuration observations.
GetAllConfigs(CancellationToken)
Retrieves all configuration observations asynchronously.
Task<ICollection<ConfigObservation>> GetAllConfigs(CancellationToken ct = default)
Parameters
ctCancellationTokenThe cancellation token used to cancel the asynchronous operation.
Returns
- Task<ICollection<ConfigObservation>>
A task that represents the asynchronous operation. The task result contains a collection of ConfigObservation objects representing all available configurations.
GetByCodeSysAndCode(string, string)
Retrieves a ConfigObservation identified by the specified coding system and code.
Returns null when no matching configuration observation is found.
Task<ConfigObservation?> GetByCodeSysAndCode(string codingSystem, string code)
Parameters
codingSystemstringThe coding system used to identify the configuration observation (e.g., ICD, SNOMED).
codestringThe code within the given coding system that uniquely identifies the configuration observation.
Returns
- Task<ConfigObservation>
A ConfigObservation if a match is found; otherwise,
null.
GetConfigById(ObjectId)
Retrieves a configuration observation by its unique identifier.
Task<ConfigObservation?> GetConfigById(ObjectId id)
Parameters
idObjectIdThe unique identifier of the configuration observation to retrieve.
Returns
- Task<ConfigObservation>
A task that represents the asynchronous operation. The task result contains the ConfigObservation if a matching record is found, or
nullif no configuration exists for the specified id.
GetConfigNames()
Asynchronously retrieves the list of available configuration names.
Task<List<string>> GetConfigNames()
Returns
- Task<List<string>>
A task that represents the asynchronous operation, containing a list of configuration names.
GetConfigNames(string)
Asynchronously retrieves a list of configuration names associated with the specified identifier.
Task<List<string>> GetConfigNames(string id)
Parameters
idstringThe identifier used to look up the associated configuration names.
Returns
- Task<List<string>>
A task that represents the asynchronous operation. The task result contains a list of configuration names.
GetConfigObservationItem(string)
Retrieves the configuration observation items associated with the specified name.
Task<IEnumerable<ConfigObservation>?> GetConfigObservationItem(string name)
Parameters
namestringThe name used to look up the configuration observation items.
Returns
- Task<IEnumerable<ConfigObservation>>
A task that represents the asynchronous operation. The result contains a collection of ConfigObservation items matching the provided name, or
nullif no matching items are found.
GetConfigObservationItemsByName(string)
Retrieves configuration observation items that match the specified name.
Task<IEnumerable<ConfigObservation>> GetConfigObservationItemsByName(string name)
Parameters
namestringThe name used to filter the configuration observation items.
Returns
- Task<IEnumerable<ConfigObservation>>
A task that represents the asynchronous operation. The task result contains the collection of ConfigObservation items matching the specified name.
GetPaginatedItems(PaginationFilter)
Retrieves a paginated collection of ConfigObservation items based on the supplied filter criteria.
Task<PaginationResponse<ConfigObservation>> GetPaginatedItems(PaginationFilter filter)
Parameters
filterPaginationFilterThe pagination filter that defines the page size, page number, and query criteria used to retrieve the configuration observations.
Returns
- Task<PaginationResponse<ConfigObservation>>
A task that represents the asynchronous operation, containing a PaginationResponse<T> with the requested items and pagination metadata.
GetSingleConfigObservationItem(string?, string?, string?, string?)
Retrieves a single configuration observation item based on the provided code, coding system, name, and original name.
Task<ConfigObservation?> GetSingleConfigObservationItem(string? code, string? codingSystem, string? name, string? originalName)
Parameters
codestringThe code used to identify the configuration observation item.
codingSystemstringThe coding system associated with the code.
namestringThe name of the configuration observation item.
originalNamestringThe original name of the configuration observation item.
Returns
- Task<ConfigObservation>
A task that represents the asynchronous operation. The task result contains the matching ConfigObservation, or
nullif no item is found.
Get<T>(T, bool)
Retrieves the ConfigObservation associated with the specified patient observation, optionally restricting the lookup to a match performed by name only.
Task<ConfigObservation?> Get<T>(T obs, bool onlyByName = false) where T : BasePatientObservation
Parameters
obsTThe patient observation whose corresponding configuration observation is being requested.
onlyByNameboolWhen
true, limits the lookup to a name-based match; otherwise, other matching criteria may be applied.
Returns
- Task<ConfigObservation>
A task that represents the asynchronous operation. The task result contains the matching ConfigObservation, or
nullif no matching observation is found.
Type Parameters
T
GroupedObservationStatus(GroupedField, Result, string, object, double?, double?)
Determines the status of a grouped observation field based on the provided result, value, and optional threshold range.
Task<StatusEnum.Type> GroupedObservationStatus(GroupedField groupedField, GroupedObservationEnum.Result result, string name, object value, double? min, double? max)
Parameters
groupedFieldGroupedFieldThe grouped field associated with the observation.
resultGroupedObservationEnum.ResultThe result of the grouped observation used to evaluate the status.
namestringThe name of the field or value being evaluated.
valueobjectThe value associated with the grouped observation.
mindouble?The optional minimum threshold for the value.
maxdouble?The optional maximum threshold for the value.
Returns
- Task<StatusEnum.Type>
A task that represents the asynchronous operation. The task result contains the evaluated StatusEnum.Type for the grouped observation.
Map(PatientTreatment)
Asynchronously maps the specified PatientTreatment to a populated PatientTreatment instance, returning null when the treatment cannot be resolved.
Task<PatientTreatment?> Map(PatientTreatment treatment)
Parameters
treatmentPatientTreatmentThe PatientTreatment to be mapped.
Returns
- Task<PatientTreatment>
A Task<TResult> that yields the mapped PatientTreatment, or null if no mapping result is available.
Map<T>(T, bool)
Maps a patient observation to a corresponding target observation of the same type, optionally restricting the lookup to name-based matching only.
Task<T?> Map<T>(T obs, bool onlyByName = false) where T : BasePatientObservation
Parameters
obsTThe source patient observation to be mapped.
onlyByNameboolWhen set to
true, the mapping is performed using the observation's name only; otherwise, additional matching criteria are considered. Defaults tofalse.
Returns
- Task<T>
A task that represents the asynchronous operation. The task result contains the mapped patient observation of type
T, ornullif no matching observation is found.
Type Parameters
T
RemoveConfigItem(ObjectId)
Asynchronously removes the configuration item identified by the specified identifier and returns the resulting observation.
Task<ConfigObservation?> RemoveConfigItem(ObjectId id)
Parameters
idObjectIdThe unique identifier of the configuration item to remove.
Returns
- Task<ConfigObservation>
A task that represents the asynchronous operation. The task result contains the ConfigObservation describing the removed configuration item, or
nullif no matching item was found.
RemoveConfigItem(string)
Asynchronously removes the configuration item with the specified name.
Task<ConfigObservation?> RemoveConfigItem(string itemName)
Parameters
itemNamestringThe name of the configuration item to remove.
Returns
- Task<ConfigObservation>
A task that represents the asynchronous operation. The task result contains a ConfigObservation describing the removed item, or
nullif no matching item was found.
RetentionActions<T>(T)
Performs retention actions for the specified patient observation and returns the resulting retention outcome.
Task<ObservatitonRetentionResult?> RetentionActions<T>(T obs) where T : BasePatientObservation
Parameters
obsTThe patient observation of type
Ton which retention actions will be executed.
Returns
- Task<ObservatitonRetentionResult>
A task that represents the asynchronous retention operation. The task result contains the ObservatitonRetentionResult produced by the retention actions, or
nullwhen no retention result is produced.
Type Parameters
T
UpdateConfig(ConfigObservation)
Updates an existing configuration observation and returns the updated result.
Task<ConfigObservation?> UpdateConfig(ConfigObservation configObservation)
Parameters
configObservationConfigObservationThe configuration observation containing the data to update.
Returns
- Task<ConfigObservation>
A task that resolves to the updated ConfigObservation, or
nullwhen no matching configuration is found.