update ignore
This commit is contained in:
No files matched your search
@@ -0,0 +1,35 @@
|
||||
package clinicalimpression
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"service/pkg/logger"
|
||||
)
|
||||
|
||||
// TODO: Sesuaikan dengan payload internal API ClinicalImpression
|
||||
func MapToInternalAPI(dbData *ClinicalImpressionDB, orgID string) map[string]interface{} {
|
||||
waktu := logger.LocalNow()
|
||||
if dbData.TglKesan.Valid {
|
||||
waktu = dbData.TglKesan.Time
|
||||
}
|
||||
return map[string]interface{}{
|
||||
"clinicalimpression_id": fmt.Sprintf("%d", dbData.IdxKesan),
|
||||
"encounter_id": fmt.Sprintf("%d", dbData.IdxDaftar),
|
||||
"patient_id": dbData.NoMR.String,
|
||||
"date": waktu.Format(time.RFC3339),
|
||||
}
|
||||
}
|
||||
|
||||
func MapToSyncLog(idx int64, fhirID string, reqPayload interface{}, respBody []byte, status string, errMsg string) ClinicalImpressionSyncLog {
|
||||
reqBytes, _ := json.MarshalIndent(reqPayload, "", " ")
|
||||
return ClinicalImpressionSyncLog{
|
||||
IdxKesan: idx,
|
||||
ClinicalImpressionID: fhirID,
|
||||
RequestPayload: string(reqBytes),
|
||||
ResponsePayload: string(respBody),
|
||||
Status: status,
|
||||
ErrorMessage: errMsg,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user