Pengambilan Data KFA Pengiriman data medication dan service request
This commit is contained in:
No files matched your search
@@ -4,11 +4,13 @@ import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"service/pkg/logger"
|
||||
)
|
||||
|
||||
// TODO: Sesuaikan dengan payload internal API Immunization
|
||||
func MapToInternalAPI(dbData *ImmunizationDB, orgID string) map[string]interface{} {
|
||||
waktu := time.Now()
|
||||
waktu := logger.LocalNow()
|
||||
if dbData.TglImunisasi.Valid {
|
||||
waktu = dbData.TglImunisasi.Time
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ func (r *repository) GetNextImmunization(ctx context.Context, lastID int64) (*Im
|
||||
return nil, err
|
||||
}
|
||||
|
||||
qb := query.NewSQLQueryBuilder(query.DBTypePostgreSQL).SetSecurityOptions(false, 0)
|
||||
qb := query.NewSQLQueryBuilder(query.DBTypePostgreSQL).SetSecurityOptions(false, 0).SetQueryLogging(false)
|
||||
|
||||
// TODO: Sesuaikan nama tabel imunisasi Anda
|
||||
qSimrs := query.DynamicQuery{
|
||||
@@ -57,7 +57,7 @@ func (r *repository) SaveSatuSehatID(ctx context.Context, idx int64, fhirID stri
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
qb := query.NewSQLQueryBuilder(query.DBTypePostgreSQL).SetSecurityOptions(false, 0)
|
||||
qb := query.NewSQLQueryBuilder(query.DBTypePostgreSQL).SetSecurityOptions(false, 0).SetQueryLogging(false)
|
||||
_, err = qb.ExecuteUpdate(ctx, simrsDB, "public.t_imunisasi", query.UpdateData{Columns: []string{"status_bridging"}, Values: []interface{}{fhirID}}, []query.FilterGroup{query.CreateAndFilterGroup([]query.DynamicFilter{query.CreateEqualFilter("idximunisasi", idx)})})
|
||||
return err
|
||||
}
|
||||
@@ -67,7 +67,7 @@ func (r *repository) SaveSyncLog(ctx context.Context, logData ImmunizationSyncLo
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
qb := query.NewSQLQueryBuilder(query.DBTypePostgreSQL).SetSecurityOptions(false, 0)
|
||||
qb := query.NewSQLQueryBuilder(query.DBTypePostgreSQL).SetSecurityOptions(false, 0).SetQueryLogging(false)
|
||||
insertData := query.InsertData{
|
||||
Columns: []string{"idximunisasi", "immunization_id", "request_payload", "response_payload", "status", "error_message"},
|
||||
Values: []interface{}{logData.IdxImunisasi, logData.ImmunizationID, logData.RequestPayload, logData.ResponsePayload, logData.Status, logData.ErrorMessage},
|
||||
|
||||
Reference in New Issue
Block a user