# Interface IMasterListServiceFactory

Namespace
  adas_core.Application.Services.Interfaces

Assembly
  adas-core.Application.dll

    public interface IMasterListServiceFactory

Extension Methods
  NumberUtils.IsNumber(object)
  NumberUtils.ToDouble(object)
  ObjectUtils.ToStr(object?)

## Methods

### GetMasterListById(MasterListType, ObjectId, LocaleEnum?)

Retrieves a master list entry by its identifier and type, optionally filtered by the specified data locale.

    Task<object?> GetMasterListById(MasterListType masterListType, ObjectId masterListId, LocaleEnum? dataLocale)

#### Parameters

`masterListType` MasterListType

  The type of the master list to query.

`masterListId` ObjectId

  The unique identifier of the master list entry to retrieve.

`dataLocale` LocaleEnum?

  The optional locale used to resolve localized data; when null, no locale filtering is applied.

#### Returns

Task<object>

  A task that yields the matching master list entry as an object, or null if no entry is found.

### GetMasterListOptionById(MasterListType, ObjectId, ObjectId, LocaleEnum?)

Retrieves a master list option by its identifier, optionally localized to the specified data locale. Returns null if no matching option is found.

    Task<object?> GetMasterListOptionById(MasterListType masterListType, ObjectId masterListId, ObjectId masterListOptionId, LocaleEnum? dataLocale)

#### Parameters

`masterListType` MasterListType

  The type of master list to search within.

`masterListId` ObjectId

  The identifier of the master list containing the option.

`masterListOptionId` ObjectId

  The identifier of the master list option to retrieve.

`dataLocale` LocaleEnum?

  The optional locale used to localize the returned option data.

#### Returns

Task<object>

  A task that yields the matching master list option as an object, or null if not found.

### GetMasterListSpecificType(MasterListType)

Gets the specific Type associated with the given master list type, mapping the master list category to its corresponding implementation type.

    Type GetMasterListSpecificType(MasterListType masterListType)

#### Parameters

`masterListType` MasterListType

  The master list type whose associated Type should be returned.

#### Returns

Type

  The Type that corresponds to the specified `masterListType`.

### GetPatientTraslated(Unit?, LocaleEnum?, Patient?)

Retrieves a translated Patient based on the provided `unit` and `locale`. Returns `null` when the `patient`, `unit`, or `locale` is not provided or no translation is found.

    Task<Patient?> GetPatientTraslated(Unit? unit, LocaleEnum? locale, Patient? patient)

#### Parameters

`unit` Unit

  The organizational unit context used to look up the translation. May be `null`.

`locale` LocaleEnum?

  The target locale for the translation. May be `null`.

`patient` Patient

  The patient to be translated. May be `null`.

#### Returns

Task<Patient>

  A Task<TResult> that resolves to the translated Patient, or `null` if no translation is available.

### GetService(Type)

Gets the service object of the specified type.

    object GetService(Type serviceType)

#### Parameters

`serviceType` Type

  An object that specifies the type of service object to get.

#### Returns

object

  A service object of type `serviceType`, or `null` if there is no service object of that type registered.

### GetService(MasterListType)

Retrieves a service instance from the master list based on the specified service name.

    object GetService(MasterListType serviceName)

#### Parameters

`serviceName` MasterListType

  The MasterListType identifier used to look up the desired service.

#### Returns

object

  An object representing the resolved service, or null if no matching service is found.

### GetTypedMasterList(MasterListType, MasterList)

Retrieves a typed representation of the specified `masterList` based on the given `masterListType`.

    object? GetTypedMasterList(MasterListType masterListType, MasterList masterList)

#### Parameters

`masterListType` MasterListType

  The type that determines how the master list should be converted or filtered.

`masterList` MasterList

  The master list to be returned in a typed form.

#### Returns

object

  A typed object representing the master list, or `null` if no matching type is found.

### InsertMasterList(MasterListType, MasterList)

Inserts a new MasterList record based on the specified `masterListType`.

    Task<object?> InsertMasterList(MasterListType masterListType, MasterList masterList)

#### Parameters

`masterListType` MasterListType

  The type of master list to insert.

`masterList` MasterList

  The master list entity to be inserted.

#### Returns

Task<object>

  A task that represents the asynchronous insert operation. The result contains the inserted master list data, or `null` if the insert was not successful.

### StringNurseObs()

Retrieves a list of nurse observation entries as string values.

    List<string> StringNurseObs()

#### Returns

List<string>

  A List<T> of string containing the nurse observation data.

### UpdateMasterList(MasterListType, MasterList)

Asynchronously updates an existing master list entry based on the specified master list type and master list data.

    Task<object?> UpdateMasterList(MasterListType masterListType, MasterList masterList)

#### Parameters

`masterListType` MasterListType

  The type of master list to update, used to determine the target list or category.

`masterList` MasterList

  The master list entity containing the updated data to be persisted.

#### Returns

Task<object>

  A task that represents the asynchronous update operation. The result is an object containing the updated master list information, or `null` if no matching record was found.