Interface IPatientRepository
- Namespace
- adas_core.Application.Repositories.Interfaces
- Assembly
- adas-core.Application.dll
public interface IPatientRepository : IMongoRepository<Patient>
- Inherited Members
- Extension Methods
Methods
CountByUnitId(ObjectId)
Asynchronously retrieves the total count of records associated with the specified unit identifier.
Task<long> CountByUnitId(ObjectId unitId)
Parameters
unitIdObjectIdThe identifier of the unit whose associated records should be counted.
Returns
- Task<long>
A task that represents the asynchronous operation, containing the total count of matching records.
Delete(ObjectId)
Deletes the item identified by the specified identifier.
Task Delete(ObjectId id)
Parameters
idObjectIdThe identifier of the item to delete.
Returns
DeleteMasterListOption(List<ObjectId>, OptionList, string)
Deletes the specified master list option and returns the patients affected by its removal.
Task<IEnumerable<Patient>> DeleteMasterListOption(List<ObjectId> unitIds, OptionList opt, string typeName)
Parameters
unitIdsList<ObjectId>The identifiers of the units whose master list option should be deleted.
optOptionListThe master list option to remove.
typeNamestringThe name of the master list type to which the option belongs.
Returns
- Task<IEnumerable<Patient>>
A task that yields the collection of patients impacted by deleting the master list option.
FindAll()
Asynchronously retrieves all Patient records.
Task<List<Patient>> FindAll()
Returns
- Task<List<Patient>>
A task that represents the asynchronous operation, containing a list of all Patient entities.
FindAllPatientWithFinishedProcedures(int)
Asynchronously retrieves all patients who have completed procedures, filtering by the number of minutes that have elapsed since the procedure end date for archival purposes.
Task<List<Patient>> FindAllPatientWithFinishedProcedures(int archiveProcedureEndDateAfterMinutes)
Parameters
archiveProcedureEndDateAfterMinutesintThe number of minutes after the procedure end date used to determine which finished procedures are eligible for archive retrieval.
Returns
- Task<List<Patient>>
A task that represents the asynchronous operation. The task result contains a list of patients with finished procedures matching the archive criteria.
FindAllPatientWithFinishedTests(int)
Asynchronously retrieves all patients whose tests have finished based on the specified archive end date threshold.
Task<List<Patient>> FindAllPatientWithFinishedTests(int archiveTestEndDateAfterMinutes)
Parameters
archiveTestEndDateAfterMinutesintThe number of minutes after which a test is considered finished and eligible for retrieval.
Returns
- Task<List<Patient>>
A task that represents the asynchronous operation, containing a list of patients with finished tests.
FindAllPatientWithFinishedTreatment(int)
Retrieves all patients whose treatment has been finished and is eligible for archival based on the specified end date threshold.
Task<List<Patient>> FindAllPatientWithFinishedTreatment(int archiveTreatmentEndDateAfterMinutes)
Parameters
archiveTreatmentEndDateAfterMinutesintThe number of minutes after the treatment end date used as the archival threshold.
Returns
- Task<List<Patient>>
A task that represents the asynchronous operation, containing a list of patients with finished treatments that meet the archival criteria.
FindById(ObjectId)
Retrieves a patient by their unique identifier, returning null when no matching patient exists.
Task<Patient?> FindById(ObjectId id)
Parameters
idObjectIdThe unique MongoDB.Bson.ObjectId of the patient to look up.
Returns
- Task<Patient>
A Task<TResult> that resolves to the matching Patient, or
nullif no patient is found.
FindByLocation(PatientLocation)
Asynchronously retrieves a Patient associated with the specified location, or null if no patient is found at that location.
Task<Patient?> FindByLocation(PatientLocation location)
Parameters
locationPatientLocationThe location used to look up the patient.
Returns
- Task<Patient>
A task that represents the asynchronous operation, containing the Patient if found; otherwise, null.
FindByPatientId(ObjectId)
Asynchronously retrieves a patient from the data store by their unique identifier.
Task<Patient?> FindByPatientId(ObjectId patientId)
Parameters
patientIdObjectIdThe unique identifier of the patient to look up.
Returns
- Task<Patient>
A task that represents the asynchronous operation. The task result contains the matching Patient if one is found; otherwise,
null.
FindByPatientId(string)
Asynchronously retrieves a Patient that matches the specified patient identifier.
Task<Patient?> FindByPatientId(string patientId)
Parameters
patientIdstringThe unique identifier of the patient to look up.
Returns
- Task<Patient>
A task that represents the asynchronous operation, containing the matching Patient if found; otherwise,
null.
FindByPatientNumber(string)
Asynchronously retrieves a Patient by their unique patient number.
Returns null when no patient matches the provided identifier.
Task<Patient?> FindByPatientNumber(string patientNumber)
Parameters
patientNumberstringThe unique patient number used to look up the patient.
Returns
- Task<Patient>
A Task<TResult> containing the matching Patient, or
nullif no patient is found.
FindByPointOfCare(ObjectId)
Asynchronously retrieves the list of patients associated with the specified point of care.
Task<List<Patient>> FindByPointOfCare(ObjectId pointOfCare)
Parameters
pointOfCareObjectIdThe unique identifier of the point of care used to filter patients.
Returns
- Task<List<Patient>>
A task that represents the asynchronous operation, containing the list of patients matching the specified point of care.
FindByPointOfCare(string)
Asynchronously retrieves a list of patients associated with the specified point of care.
Task<List<Patient>> FindByPointOfCare(string pointOfCare)
Parameters
pointOfCarestringThe point of care identifier used to filter patients.
Returns
- Task<List<Patient>>
A task that represents the asynchronous operation, containing a list of patients matching the specified point of care.
FindByPointOfCareId(ObjectId)
Retrieves a patient by their point-of-care identifier, returning null when no matching patient is found.
Task<Patient?> FindByPointOfCareId(ObjectId pointOfCare)
Parameters
pointOfCareObjectIdThe unique identifier of the point-of-care location used to look up the patient.
Returns
- Task<Patient>
A task that resolves to the matching Patient, or
nullif no patient is associated with the specified point-of-care id.
FindByUnitAndPocId(ObjectId, ObjectId)
Asynchronously retrieves the patient matching the specified unit and point of care identifier.
Task<Patient> FindByUnitAndPocId(ObjectId unit, ObjectId pointOfCare)
Parameters
unitObjectIdThe identifier of the unit used to locate the patient.
pointOfCareObjectIdThe point of care identifier used together with the unit to locate the patient.
Returns
FindDischargedPatients()
Asynchronously retrieves a list of patients who have been discharged.
Task<List<Patient>> FindDischargedPatients()
Returns
- Task<List<Patient>>
A task representing the asynchronous operation, containing a list of discharged Patient records.
FindInActivePoC()
Asynchronously retrieves a list of patients who have an inactive Point of Care (PoC) assignment.
Task<List<Patient>> FindInActivePoC()
Returns
- Task<List<Patient>>
A task that represents the asynchronous operation. The task result contains a list of Patient objects with inactive PoC status.
FindInInactivePoC()
Asynchronously retrieves a list of patients who are currently marked as inactive points of contact (PoC).
Task<List<Patient>> FindInInactivePoC()
Returns
- Task<List<Patient>>
A task that represents the asynchronous operation. The task result contains a list of inactive PoC patients.
FindPatientsNotUpdatedSince(DateTime)
Retrieves a list of patients whose records have not been updated since the specified date.
Task<List<Patient>> FindPatientsNotUpdatedSince(DateTime date)
Parameters
dateDateTimeThe cutoff date; patients last updated before this date will be included in the result.
Returns
- Task<List<Patient>>
A task that represents the asynchronous operation. The task result contains a list of Patient objects that have not been updated since the specified date.
GetPaginatedPatients(PaginationFilter)
Retrieves a paginated, fluent query of patients based on the specified pagination filter.
IFindFluent<Patient, Patient> GetPaginatedPatients(PaginationFilter filter)
Parameters
filterPaginationFilterThe pagination filter that defines page size, page number, and additional criteria applied to the patient query.
Returns
- IFindFluent<Patient, Patient>
An MongoDB.Driver.IFindFluent<TDocument, TProjection> representing the paginated patient query that can be further composed before execution.
GetPatientsByUnitIds(List<ObjectId>, string)
Asynchronously retrieves a list of Patient objects associated with the specified unit identifiers and patient type.
Task<List<Patient>> GetPatientsByUnitIds(List<ObjectId> unitIds, string typeName)
Parameters
unitIdsList<ObjectId>The list of unit identifiers used to filter the patients to be returned.
typeNamestringThe name of the patient type used to further refine the query results.
Returns
- Task<List<Patient>>
A Task<TResult> that represents the asynchronous operation, containing a list of Patient objects matching the provided unit identifiers and type.
SearchByPatientNumberAndDistinctUnit(string, ObjectId)
Asynchronously searches for a patient by their patient number within a specific unit, ensuring the patient is associated with a distinct unit.
Task<Patient?> SearchByPatientNumberAndDistinctUnit(string patientNumber, ObjectId unitId)
Parameters
patientNumberstringThe unique patient number used to identify the patient.
unitIdObjectIdThe identifier of the unit to constrain the search to a distinct unit context.
Returns
- Task<Patient>
A task that represents the asynchronous operation. The task result contains the matching Patient if found; otherwise,
null.
Update(Patient)
Updates the information of an existing patient in the system.
Task Update(Patient patient)
Parameters
patientPatientThe patient entity containing the updated information to be persisted.
Returns
UpdateAttendingDoctor(ObjectId, Person)
Updates the attending doctor for the record identified by the specified id.
Task UpdateAttendingDoctor(ObjectId id, Person attendingDoctor)
Parameters
idObjectIdThe identifier of the record whose attending doctor will be updated.
attendingDoctorPersonThe person to be set as the new attending doctor.
Returns
UpdateLocation(ObjectId, ObjectId)
Updates the location of the entity identified by the specified identifier.
Task UpdateLocation(ObjectId id, ObjectId location)
Parameters
idObjectIdThe identifier of the entity whose location will be updated.
locationObjectIdThe identifier of the new location to associate with the entity.
Returns
UpdateLocation(ObjectId, PatientLocation)
Asynchronously updates the location of a patient identified by the specified identifier.
Task UpdateLocation(ObjectId id, PatientLocation location)
Parameters
idObjectIdThe unique identifier of the patient whose location is to be updated.
locationPatientLocationThe new patient location data to apply to the existing record.
Returns
UpdateMasterListOption(List<ObjectId>, UpdateOptionMasterListDto, string)
Updates a master list option for the specified units and returns the patients affected by the change.
Task<List<Patient>> UpdateMasterListOption(List<ObjectId> unitIds, UpdateOptionMasterListDto opt, string typeName)
Parameters
unitIdsList<ObjectId>The list of unit identifiers whose patients should be considered for the update.
optUpdateOptionMasterListDtoThe DTO containing the master list option update details.
typeNamestringThe name of the option type being updated.
Returns
- Task<List<Patient>>
A task that resolves to the list of patients impacted by the master list option update.
UpdateOne(Patient)
Updates an existing patient record and returns the updated patient, or null if the patient was not found.
Task<Patient?> UpdateOne(Patient updatedPatient)
Parameters
updatedPatientPatientThe patient containing the updated information.
Returns
- Task<Patient>
A task that represents the asynchronous operation. The task result contains the updated Patient, or null if no matching patient exists.
UpdatePatientData(ObjectId, string, Person, bool)
Updates the patient data identified by the specified id, optionally updating the patient number when updatePatientNumber is true.
Task UpdatePatientData(ObjectId id, string patientNumber, Person data, bool updatePatientNumber = true)
Parameters
idObjectIdThe unique identifier of the patient to update.
patientNumberstringThe patient number associated with the patient.
dataPersonThe new person data to apply to the patient record.
updatePatientNumberboolIndicates whether the patient number should be updated; defaults to true.
Returns
UpdatePatientDemographicData(ObjectId, Patient)
Updates the demographic data of an existing patient identified by the given identifier.
Task<Patient?> UpdatePatientDemographicData(ObjectId patientId, Patient person)
Parameters
patientIdObjectIdThe unique identifier of the patient whose demographic data is to be updated.
personPatientThe patient object containing the updated demographic information.
Returns
- Task<Patient>
A task that represents the asynchronous operation. The task result contains the updated Patient, or
nullif the patient was not found.
UpdatePatientIncomingData(ObjectId, Patient)
Updates the incoming data for the specified patient and returns the updated patient record.
Task<Patient?> UpdatePatientIncomingData(ObjectId patientId, Patient person)
Parameters
patientIdObjectIdThe unique identifier of the patient whose incoming data should be updated.
personPatientThe patient object containing the incoming data to apply.