# Interface IDischargeService

Namespace
  adas_core.Application.Services.Interfaces

Assembly
  adas-core.Application.dll

    public interface IDischargeService : IApiRequestService

Inherited Members
  IApiRequestService.SaveRequestAsync(ApiRequest)
  IApiRequestService.SaveRequest(ApiRequest)

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

## Methods

### CountDischargesByUnitId(ObjectId)

Asynchronously counts the number of discharge records associated with the specified unit.

    Task<long> CountDischargesByUnitId(ObjectId unitId)

#### Parameters

`unitId` ObjectId

  The identifier of the unit whose discharges should be counted.

#### Returns

Task<long>

  A task that represents the asynchronous operation, containing the total number of discharges for the specified unit.

### DeleteDischargeAsync(Discharge)

Asynchronously deletes the specified discharge record.

    Task DeleteDischargeAsync(Discharge discharge)

#### Parameters

`discharge` Discharge

  The discharge entity to be removed.

#### Returns

Task

### DeleteDischargeByIdAsync(ObjectId)

Asynchronously deletes a discharge record identified by the specified identifier.

    Task DeleteDischargeByIdAsync(ObjectId dischargeId)

#### Parameters

`dischargeId` ObjectId

  The unique identifier of the discharge to delete.

#### Returns

Task

### DeleteDischargesByUnitId(ObjectId)

Deletes discharge records associated with the specified unit identifier.

    Task DeleteDischargesByUnitId(ObjectId unitId)

#### Parameters

`unitId` ObjectId

  The unique identifier of the unit whose discharge records should be removed.

#### Returns

Task

### DeletePatientMasterListItem(OptionList, IEnumerable<Unit>, string)

Deletes the specified patient master list item associated with the given option list and units.

    Task DeletePatientMasterListItem(OptionList opt, IEnumerable<Unit> unitList, string typeName)

#### Parameters

`opt` OptionList

  The option list containing the patient master list item to delete.

`unitList` IEnumerable<Unit>

  The collection of units associated with the item to be deleted.

`typeName` string

  The name of the type used to identify the patient master list item.

#### Returns

Task

  A task that represents the asynchronous delete operation.

### GetDischargeByIdAsync(ObjectId)

Asynchronously retrieves a discharge record by its unique identifier, returning null if no matching discharge is found.

    Task<Discharge?> GetDischargeByIdAsync(ObjectId dischargeId)

#### Parameters

`dischargeId` ObjectId

  The unique identifier of the discharge to look up.

#### Returns

Task<Discharge>

  A task that represents the asynchronous operation, containing the Discharge if found, or null when no record matches the provided identifier.

### GetDischargeByLocation(PatientLocation)

Retrieves the discharge record associated with the specified patient location, returning null if no matching discharge is found.

    Task<Discharge?> GetDischargeByLocation(PatientLocation location)

#### Parameters

`location` PatientLocation

  The patient location used to look up the discharge record.

#### Returns

Task<Discharge>

  A task that represents the asynchronous operation. The task result contains the matching Discharge if found, or null if no discharge is associated with the specified location.

### GetDischargeByPatientId(ObjectId)

Retrieves the discharge record associated with the specified patient identifier.

    Task<Discharge?> GetDischargeByPatientId(ObjectId patientId)

#### Parameters

`patientId` ObjectId

  The unique identifier of the patient whose discharge record is being requested.

#### Returns

Task<Discharge>

  A Task<TResult> that resolves to the matching Discharge if found; otherwise, `null`.

### GetDischargeByPointOfCareId(ObjectId)

Retrieves a discharge record associated with the specified point of care location identifier.

    Task<Discharge?> GetDischargeByPointOfCareId(ObjectId location)

#### Parameters

`location` ObjectId

  The ObjectId of the point of care location used to look up the discharge.

#### Returns

Task<Discharge>

  A task that represents the asynchronous operation. The task result contains the matching Discharge if found, or `null` if no discharge exists for the specified point of care location.

### GetDischargeByPointOfCareIdWithLocale(ObjectId, LocaleEnum)

Retrieves the discharge associated with the specified point of care location, returning localized data for the requested locale. Returns null when no matching discharge is found.

    Task<Discharge?> GetDischargeByPointOfCareIdWithLocale(ObjectId location, LocaleEnum dataLocale)

#### Parameters

`location` ObjectId

  The identifier of the point of care location whose discharge should be retrieved.

`dataLocale` LocaleEnum

  The locale used to determine the language of the returned discharge data.

#### Returns

Task<Discharge>

  A task containing the matching Discharge, or null if no discharge exists for the given location.

### GetDischargesAsync()

Asynchronously retrieves a collection of discharge records.

    Task<IEnumerable<Discharge>> GetDischargesAsync()

#### Returns

Task<IEnumerable<Discharge>>

  A task that represents the asynchronous operation. The task result contains an enumerable collection of Discharge objects.

### InsertDischarge(Discharge)

Inserts a new discharge record into the data store. Returns the inserted Discharge entity, or null if the record could not be created.

    Task<Discharge?> InsertDischarge(Discharge discharge)

#### Parameters

`discharge` Discharge

  The Discharge entity containing the data to be inserted.

#### Returns

Task<Discharge>

  A Task<TResult> that resolves to the inserted Discharge, or null when the insertion does not produce a result.

### SendDischargeBroadcast(Discharge, OperationType)

Sends a broadcast notification for the specified discharge based on the given operation type.

    void SendDischargeBroadcast(Discharge discharge, OperationType operation)

#### Parameters

`discharge` Discharge

  The discharge entity to be included in the broadcast.

`operation` OperationType

  The type of operation (e.g., create, update, delete) that determines the broadcast context.

### UpdateDischargeAsync(Discharge)

Asynchronously updates an existing discharge record in the data store.

    Task UpdateDischargeAsync(Discharge discharge)

#### Parameters

`discharge` Discharge

  The Discharge entity containing the updated information to persist.

#### Returns

Task

### UpdatePatientMasterListItemChange(UpdateOptionMasterListDto, IEnumerable<Unit>, string)

Updates a patient master list item change using the provided update options, applying the change across the specified unit list and master list type.

    Task UpdatePatientMasterListItemChange(UpdateOptionMasterListDto opt, IEnumerable<Unit> unitList, string typeName)

#### Parameters

`opt` UpdateOptionMasterListDto

  The update options describing the change to apply to the patient master list item.

`unitList` IEnumerable<Unit>

  The collection of units to which the master list item change should be applied.

`typeName` string

  The name of the master list type that identifies which list the item belongs to.

#### Returns

Task