=== Summary: 675 files | 7 generated | 484 fresh | 4605 untracked | 4268 adopted | 355 marked | 466 validated-ok | 2+0 stale (sig+body) | 0 skipped | 0 failed | elapsed 11:08:11.442 (40091.44s) ===
This commit is contained in:
@@ -13,6 +13,7 @@ namespace adas_core.Application.Services;
|
||||
/// Provides operations for managing patient care plans, implementing the contract defined by <see cref="IPatientCarePlanService"/>.
|
||||
/// Serves as the concrete service layer responsible for handling care plan related business logic.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=22e8377 -->
|
||||
public class PatientCarePlanService : IPatientCarePlanService
|
||||
{
|
||||
private readonly IArchivePatientCarePlanService _archivePatientCarePlanService;
|
||||
@@ -55,6 +56,7 @@ public class PatientCarePlanService : IPatientCarePlanService
|
||||
/// </summary>
|
||||
/// <param name="patientId">The unique identifier of the patient whose care plans are to be retrieved.</param>
|
||||
/// <returns>A task representing the asynchronous operation, containing a list of <see cref="PatientCarePlan"/> for the patient, or an empty list if an error occurs.</returns>
|
||||
/// <!-- aidoc:v1 sig=9706d89 body=ccd645c -->
|
||||
public async Task<List<PatientCarePlan>> FindByPatientId(ObjectId patientId)
|
||||
{
|
||||
try
|
||||
@@ -74,6 +76,7 @@ public class PatientCarePlanService : IPatientCarePlanService
|
||||
/// </summary>
|
||||
/// <param name="userId">The unique identifier of the user whose patient care plans are being retrieved.</param>
|
||||
/// <returns>A task that represents the asynchronous operation, containing a list of <see cref="PatientCarePlan"/> objects for the user, or an empty list if an error occurs.</returns>
|
||||
/// <!-- aidoc:v1 sig=7520aa9 body=666052d -->
|
||||
public async Task<List<PatientCarePlan>> FindByUserId(ObjectId userId)
|
||||
{
|
||||
try
|
||||
@@ -92,6 +95,7 @@ public class PatientCarePlanService : IPatientCarePlanService
|
||||
/// Retrieves all patient care plans from the repository, returning an empty list if an error occurs while fetching the data.
|
||||
/// </summary>
|
||||
/// <returns>A task that represents the asynchronous operation, containing a list of <see cref="PatientCarePlan"/> objects, or an empty list if the retrieval fails.</returns>
|
||||
/// <!-- aidoc:v1 sig=6a558a7 body=19f83a8 -->
|
||||
public async Task<List<PatientCarePlan>> FindAll()
|
||||
{
|
||||
try
|
||||
@@ -109,6 +113,7 @@ public class PatientCarePlanService : IPatientCarePlanService
|
||||
/// Inserts a new patient care plan into the repository, stamping it with the current UTC time, and records an audit log entry for the operation. Any errors encountered during the insertion or audit logging are caught and logged without rethrowing.
|
||||
/// </summary>
|
||||
/// <param name="patientCarePlan">The patient care plan entity to be inserted into the repository.</param>
|
||||
/// <!-- aidoc:v1 sig=cbefa20 body=2a84bb1 -->
|
||||
public async Task InsertOneAsync(PatientCarePlan patientCarePlan)
|
||||
{
|
||||
try
|
||||
@@ -129,6 +134,7 @@ public class PatientCarePlanService : IPatientCarePlanService
|
||||
/// </summary>
|
||||
/// <param name="patientWithFinishedProcedure">The patient associated with the finished procedure whose care plan items are being archived.</param>
|
||||
/// <param name="itemsToArchive">The list of care plan options to archive.</param>
|
||||
/// <!-- aidoc:v1 sig=6d8145d body=dab75f5 -->
|
||||
public async Task ArchiveCarePlanFromJob(Patient patientWithFinishedProcedure, List<OptionList> itemsToArchive)
|
||||
{
|
||||
var systemUser = await _userRepository.GetOrCreateSystemUser();
|
||||
@@ -153,6 +159,7 @@ public class PatientCarePlanService : IPatientCarePlanService
|
||||
/// Archives all care plans associated with the specified patient by moving them to the archive service, removing them from the active repository, and creating audit log entries for each archived record.
|
||||
/// </summary>
|
||||
/// <param name="patientid">The identifier of the patient whose care plans will be archived.</param>
|
||||
/// <!-- aidoc:v1 sig=8a48aa7 body=4ede7e2 -->
|
||||
public async Task ArchiveByPatientId(ObjectId patientid)
|
||||
{
|
||||
var carePlansToArchive = await FindByPatientId(patientid);
|
||||
@@ -170,6 +177,7 @@ public class PatientCarePlanService : IPatientCarePlanService
|
||||
/// <param name="patientid">The unique identifier of the patient whose care plan records will be updated.</param>
|
||||
/// <param name="patientId">The new object identifier that will replace the old identifier in the matching care plan records.</param>
|
||||
/// <param name="oldId">The existing object identifier to be replaced by the new identifier.</param>
|
||||
/// <!-- aidoc:v1 sig=9a63bf8 body=c2a07bf -->
|
||||
public async Task UpdateManyObjectId(string patientid, ObjectId patientId, ObjectId oldId)
|
||||
{
|
||||
await _patientCarePlanRepository.UpdateManyObjectId(patientid, patientId, oldId);
|
||||
|
||||
Reference in New Issue
Block a user