Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle summary update being reverted by patient update #172

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions patients/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ type service struct {
dbClient *mongo.Client
logger *zap.SugaredLogger

clinics clinics.Service
clinics clinics.Service
custodialService CustodialService
deletionsRepo DeletionsRepository
patientsRepo Repository
Expand Down Expand Up @@ -88,6 +88,10 @@ func (s *service) Update(ctx context.Context, update PatientUpdate) (*Patient, e
return nil, err
}

if update.Patient.Summary != nil {
update.Patient.Summary = nil
}

if err := s.enforceMrnSettings(ctx, update.ClinicId, &update.UserId, &update.Patient); err != nil {
return nil, err
}
Expand Down Expand Up @@ -141,8 +145,8 @@ func (s *service) Remove(ctx context.Context, clinicId string, userId string, de
}

deletion := Deletion{
Patient: *patient,
DeletedTime: time.Now(),
Patient: *patient,
DeletedTime: time.Now(),
DeletedByUserId: deletedByUserId,
}

Expand Down