# Interface IAdmissionService

Namespace
  adas_core.Application.Services.Interfaces

Assembly
  adas-core.Application.dll

    public interface IAdmissionService : IApiRequestService

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

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

## Methods

### AdmitPatient(Admission, bool)

Admits a patient based on the provided admission details, optionally registering the patient as new.

    Task AdmitPatient(Admission admission, bool isNew = false)

#### Parameters

`admission` Admission

  The admission information used to process the patient admission.

`isNew` bool

  Indicates whether the patient is being admitted for the first time. Defaults to `false`.

#### Returns

Task

### CountAdmissionsByUnitId(ObjectId)

Asynchronously counts the number of admissions associated with the specified unit identifier.

    Task<long> CountAdmissionsByUnitId(ObjectId unitId)

#### Parameters

`unitId` ObjectId

  The MongoDB ObjectId of the unit whose admissions should be counted.

#### Returns

Task<long>

  A task that represents the asynchronous operation, containing the total count of admissions for the given unit.

### DeleteAdmissionAsync(Admission)

Asynchronously deletes the specified admission record.

    Task DeleteAdmissionAsync(Admission admission)

#### Parameters

`admission` Admission

  The admission entity to remove.

#### Returns

Task

### DeleteAdmissionByIdAsync(ObjectId)

Asynchronously deletes an admission record identified by the specified admission ID.

    Task DeleteAdmissionByIdAsync(ObjectId admissionId)

#### Parameters

`admissionId` ObjectId

  The unique identifier of the admission to delete.

#### Returns

Task

### DeleteAdmissionsByUnitId(ObjectId)

Deletes all admissions associated with the specified unit identifier.

    Task DeleteAdmissionsByUnitId(ObjectId unitId)

#### Parameters

`unitId` ObjectId

  The identifier of the unit whose admissions will be deleted.

#### Returns

Task

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

Deletes a patient master list item identified by the specified options, units, and type name.

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

#### Parameters

`opt` OptionList

  The option list used to identify the master list item to delete.

`unitList` IEnumerable<Unit>

  The collection of units associated with the master list item.

`typeName` string

  The name of the type associated with the master list item.

#### Returns

Task

### GetAdmissionByIdAsync(ObjectId)

Asynchronously retrieves an admission by its unique identifier, returning `null` when no matching admission is found.

    Task<Admission?> GetAdmissionByIdAsync(ObjectId admissionId)

#### Parameters

`admissionId` ObjectId

  The unique identifier of the admission to retrieve.

#### Returns

Task<Admission>

  A task that represents the asynchronous operation, containing the Admission if found, or `null` if no admission matches the specified identifier.

### GetAdmissionByLocation(PatientLocation)

Retrieves a list of admissions associated with the specified patient location.

    Task<List<Admission>> GetAdmissionByLocation(PatientLocation location)

#### Parameters

`location` PatientLocation

  The patient location used to filter the admissions.

#### Returns

Task<List<Admission>>

  A task that represents the asynchronous operation, containing a list of admissions for the given location.

### GetAdmissionByPatientNumber(string)

Retrieves the admission record associated with the specified patient number, returning `null` when no matching admission is found.

    Task<Admission?> GetAdmissionByPatientNumber(string patientNumber)

#### Parameters

`patientNumber` string

  The unique patient number used to look up the admission.

#### Returns

Task<Admission>

  A task that resolves to the matching Admission, or `null` if no admission exists for the given patient number.

### GetAdmissionByPointOfCareId(ObjectId)

Asynchronously retrieves the list of admissions associated with the specified point of care identifier.

    Task<List<Admission>> GetAdmissionByPointOfCareId(ObjectId id)

#### Parameters

`id` ObjectId

  The MongoDB.Bson.ObjectId of the point of care used to filter the admissions.

#### Returns

Task<List<Admission>>

  A task that represents the asynchronous operation. The task result contains a list of Admission objects matching the specified point of care id, or an empty list if no admissions are found.

### GetAdmissionByPointOfCareIdAndLocale(ObjectId, LocaleEnum)

Retrieves the list of admissions associated with the specified point of care, localized for the given locale.

    Task<List<Admission>> GetAdmissionByPointOfCareIdAndLocale(ObjectId pocId, LocaleEnum locale)

#### Parameters

`pocId` ObjectId

  The identifier of the point of care whose admissions are being queried.

`locale` LocaleEnum

  The locale used to localize the returned admission data.

#### Returns

Task<List<Admission>>

  A task that resolves to the list of admissions matching the point of care and locale; an empty list when no matches are found.

### GetAdmissionByUnitIdWithOutPoC(ObjectId)

Retrieves a list of admissions associated with the specified unit identifier, excluding any Point of Care (PoC) related admissions.

    Task<List<Admission>> GetAdmissionByUnitIdWithOutPoC(ObjectId unitId)

#### Parameters

`unitId` ObjectId

  The unique identifier of the unit whose admissions should be retrieved.

#### Returns

Task<List<Admission>>

  A task that represents the asynchronous operation. The task result contains a list of admissions for the specified unit, excluding PoC admissions.

### GetAdmissionsAsync()

Asynchronously retrieves a collection of admissions.

    Task<IEnumerable<Admission>> GetAdmissionsAsync()

#### Returns

Task<IEnumerable<Admission>>

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

### InsertAdmission(Admission)

Asynchronously inserts a new admission record and returns the created entry, or null if the insertion was not performed.

    Task<Admission?> InsertAdmission(Admission admission)

#### Parameters

`admission` Admission

  The admission entity to be inserted into the data store.

#### Returns

Task<Admission>

  A task that represents the asynchronous operation. The task result contains the inserted Admission, or null when no record is produced.

### ReturnPatientToAdmissions(ObjectId)

Processes the return of a patient to the admissions workflow, typically used when a patient needs to be re-queued or reinstated for admission processing.

    Task ReturnPatientToAdmissions(ObjectId patientId)

#### Parameters

`patientId` ObjectId

  The unique identifier of the patient to be returned to admissions.

#### Returns

Task

### ReturnPatientToAdmissions(ObjectId, Admission)

Asynchronously returns a patient to the admissions workflow using the specified admission record.

    Task ReturnPatientToAdmissions(ObjectId patientId, Admission adm)

#### Parameters

`patientId` ObjectId

  The unique identifier of the patient being returned to admissions.

`adm` Admission

  The admission record associated with the patient being returned.

#### Returns

Task

### SearchByPatientNumberAndDistinctUnit(string, ObjectId)

Searches for a patient by their patient number within the specified unit, returning the matching patient search result or null if no match is found.

    Task<PatientSearch?> SearchByPatientNumberAndDistinctUnit(string patientNumber, ObjectId unitId)

#### Parameters

`patientNumber` string

  The patient number used to identify the patient.

`unitId` ObjectId

  The identifier of the unit in which the patient is being searched.

#### Returns

Task<PatientSearch>

  A task that returns the matching PatientSearch if found; otherwise, null.

### UpdateAdmissionAsync(Admission)

Asynchronously updates an existing admission record with the provided information.

    Task UpdateAdmissionAsync(Admission admission)

#### Parameters

`admission` Admission

  The admission entity containing the updated data to be persisted.

#### Returns

Task

  A task that represents the asynchronous update operation.

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

Updates a patient master list item based on the provided option change and related unit and type information.

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

#### Parameters

`opt` UpdateOptionMasterListDto

  The update option master list data transfer object containing the change details.

`unitList` IEnumerable<Unit>

  The collection of units associated with the master list item change.

`typeName` string

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

#### Returns

Task

  A task that represents the asynchronous update operation.