udpate insert patient
This commit is contained in:
@@ -11,15 +11,7 @@ import (
|
||||
func (s *DatabaseService) InsertPatient(req *patient.Patient) error {
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
|
||||
defer cancel()
|
||||
_, err := s.DB.Collection("patient").InsertOne(ctx, patient.Patient{
|
||||
ID: req.ID,
|
||||
NoRM: req.NoRM,
|
||||
Name: req.Name,
|
||||
Telecom: req.Telecom,
|
||||
Gender: req.Gender,
|
||||
BirthDate: req.BirthDate,
|
||||
Address: req.Address,
|
||||
})
|
||||
_, err := s.DB.Collection("patient").InsertOne(ctx, req)
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user