Interface IAdmissionRepository
- Namespace
- adas_core.Application.Repositories.Interfaces
- Assembly
- adas-core.Application.dll
public interface IAdmissionRepository : IMongoRepository<Admission>
- Inherited Members
- Extension Methods
Methods
CountByUnitId(ObjectId)
Asynchronously counts the number of records associated with the specified unit identifier.
Task<long> CountByUnitId(ObjectId unitId)
Parameters
unitIdObjectIdThe identifier of the unit used to filter the records.
Returns
- Task<long>
A task that represents the asynchronous operation. The task result contains the count of matching records.
Delete(ObjectId)
Deletes the entity identified by the specified identifier.
Task Delete(ObjectId id)
Parameters
idObjectIdThe unique identifier of the entity to delete.
Returns
DeleteAdmissionsByUnitId(ObjectId)
Asynchronously deletes admissions associated with the specified unit identifier.
Task<bool> DeleteAdmissionsByUnitId(ObjectId unitId)
Parameters
unitIdObjectIdThe identifier of the unit whose admissions will be deleted.
Returns
- Task<bool>
A task that represents the asynchronous operation, containing a value indicating the result of the deletion.
DeleteMasterListOption(List<ObjectId>, OptionList, string)
Deletes the specified option from the master list for the given units and type, returning the affected admissions.
Task<IEnumerable<Admission>> DeleteMasterListOption(List<ObjectId> unitIds, OptionList opt, string typeName)
Parameters
unitIdsList<ObjectId>The list of unit identifiers whose master list option should be deleted.
optOptionListThe option to be removed from the master list.
typeNamestringThe name of the type associated with the master list option.
Returns
- Task<IEnumerable<Admission>>
A task that represents the asynchronous operation, containing the collection of Admission records affected by the deletion.
FindAll()
Asynchronously retrieves all admission records.
Task<IEnumerable<Admission>> FindAll()
Returns
- Task<IEnumerable<Admission>>
A task that represents the asynchronous operation. The task result contains an IEnumerable<T> with all available admissions.
FindById(ObjectId)
Asynchronously retrieves an Admission entity by its unique identifier, returning null when no matching record is found.
Task<Admission?> FindById(ObjectId id)
Parameters
idObjectIdThe MongoDB.Bson.ObjectId of the Admission to look up.
Returns
- Task<Admission>
A task that represents the asynchronous operation. The task result contains the matching Admission, or
nullif no admission exists with the specified identifier.
FindByLocation(PatientLocation)
Asynchronously retrieves a list of admissions associated with the specified patient location.
Task<List<Admission>> FindByLocation(PatientLocation location)
Parameters
locationPatientLocationThe patient location used to filter and find the relevant admissions.
Returns
- Task<List<Admission>>
A task that represents the asynchronous operation, containing a list of admissions matching the given location.
FindByNhc(string)
Retrieves an admission record that matches the specified NHC (Número de Historia Clínica) identifier, or null when no matching admission exists.
Task<Admission?> FindByNhc(string nhc)
Parameters
nhcstringThe NHC (clinical history number) used to look up the admission.
Returns
- Task<Admission>
A task that resolves to the matching Admission, or
nullif no admission is found for the given NHC.
FindByOrigin(string)
Asynchronously retrieves a collection of admissions filtered by the specified origin.
Task<IEnumerable<Admission>?> FindByOrigin(string origin)
Parameters
originstringThe origin value used to filter the admissions.
Returns
- Task<IEnumerable<Admission>>
A task that represents the asynchronous operation, containing a collection of matching admissions, or
nullif no admissions are found for the given origin.
FindByPointOfCareId(ObjectId)
Retrieves a list of admissions associated with the specified point of care identifier.
Task<List<Admission>> FindByPointOfCareId(ObjectId pocId)
Parameters
pocIdObjectIdThe unique identifier of the point of care used to filter the admissions.
Returns
- Task<List<Admission>>
A task that represents the asynchronous operation, containing the list of admissions matching the specified point of care identifier.
FindByUnitIds(List<ObjectId>)
Asynchronously retrieves a list of admissions associated with the specified unit identifiers.
Task<List<Admission>> FindByUnitIds(List<ObjectId> unitIds)
Parameters
unitIdsList<ObjectId>The list of unit identifiers used to look up the corresponding admissions.
Returns
- Task<List<Admission>>
A task that represents the asynchronous operation, containing the list of admissions matching the provided unit identifiers.
GetAdmissionByUnitIdWithOutPoC(ObjectId)
Asynchronously retrieves a list of admissions associated with the specified unit, excluding Point of Care (PoC) entries.
Task<List<Admission>> GetAdmissionByUnitIdWithOutPoC(ObjectId unitId)
Parameters
unitIdObjectIdThe unique identifier of the unit whose admissions are being retrieved.
Returns
- Task<List<Admission>>
A task that represents the asynchronous operation, containing a list of Admission records linked to the given unit, with PoC entries excluded.
InsertOneAsyncAndReturn(Admission)
Asynchronously inserts a new Admission record into the data store and returns the resulting entity.
Task<Admission?> InsertOneAsyncAndReturn(Admission origin)
Parameters
Returns
- Task<Admission>
A task that represents the asynchronous insert operation, containing the inserted Admission, or
nullif no result is returned.
SearchByPatientNumberAndDistinctUnit(string, ObjectId)
Searches for an admission matching the specified patient number and unit, returning a distinct result.
Task<Admission?> SearchByPatientNumberAndDistinctUnit(string patientNumber, ObjectId unitId)
Parameters
patientNumberstringThe patient's identifier used to locate the admission.
unitIdObjectIdThe unique identifier of the unit to filter the search.
Returns
Update(Admission)
Updates the specified admission record asynchronously.
Task Update(Admission admission)
Parameters
admissionAdmissionThe admission entity containing the updated information.
Returns
UpdateLocation(ObjectId, ObjectId)
Updates the location of an entity identified by the specified identifier to a new location.
Task UpdateLocation(ObjectId id, ObjectId newLocation)
Parameters
idObjectIdThe unique identifier of the entity whose location is to be updated.
newLocationObjectIdThe identifier of the new location to assign to the entity.
Returns
UpdateMasterListOption(List<ObjectId>, UpdateOptionMasterListDto, string)
Updates the master list option for the specified units based on the provided options and type, returning the affected admissions.
Task<IEnumerable<Admission>> UpdateMasterListOption(List<ObjectId> unitIds, UpdateOptionMasterListDto opt, string typeName)
Parameters
unitIdsList<ObjectId>The list of unit identifiers whose master list option should be updated.
optUpdateOptionMasterListDtoThe data transfer object containing the new master list option values to apply.
typeNamestringThe name of the option type to be updated.
Returns
- Task<IEnumerable<Admission>>
A task that represents the asynchronous operation, containing the collection of admissions affected by the update.
UpdatePatient(ObjectId, Person)
Updates an existing patient record identified by the specified identifier with the provided patient information.
Task UpdatePatient(ObjectId id, Person patient)
Parameters
idObjectIdThe unique identifier of the patient to update.
patientPersonThe patient object containing the updated information to apply.