comment log
This commit is contained in:
@@ -40,7 +40,7 @@ func SendDataLISMikro(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
log.Println("REQUEST dari frontend:", req)
|
||||
//log.Println("REQUEST dari frontend:", req)
|
||||
|
||||
dataMikro, errData := simrsDB.GetDataMikroBiologiByNoMR(req)
|
||||
if errData != nil {
|
||||
@@ -117,7 +117,7 @@ func SendDataLISMikro(c *gin.Context) {
|
||||
var dokterPengirim string
|
||||
if dataMikroMain.DrOrder != "0" && dataMikroMain.DrOrder != "" {
|
||||
dokterPengirim, errDokter = simrsDB.GetNamaDokter(dataMikroMain.DrOrder)
|
||||
log.Println("DokterOrder kode-nama:", dataMikroMain.DrOrder, " - ", dokterPengirim)
|
||||
//log.Println("DokterOrder kode-nama:", dataMikroMain.DrOrder, " - ", dokterPengirim)
|
||||
if errDokter != nil {
|
||||
log.Println(errDokter)
|
||||
c.JSON(http.StatusBadRequest, gin.H{
|
||||
@@ -128,7 +128,7 @@ func SendDataLISMikro(c *gin.Context) {
|
||||
//return
|
||||
} else if dataMikroMain.DokterPengirim != "" && dataMikroMain.DokterPengirim != "0" {
|
||||
dokterPengirim, errDokter = simrsDB.GetNamaDokter(dataMikroMain.DokterPengirim)
|
||||
log.Println("DokterPengirim kode-nama:", dataMikroMain.DokterPengirim, " - ", dokterPengirim)
|
||||
//log.Println("DokterPengirim kode-nama:", dataMikroMain.DokterPengirim, " - ", dokterPengirim)
|
||||
if errDokter != nil {
|
||||
log.Println(errDokter)
|
||||
c.JSON(http.StatusBadRequest, gin.H{
|
||||
@@ -139,7 +139,7 @@ func SendDataLISMikro(c *gin.Context) {
|
||||
//return
|
||||
} else if dataMikroMain.DokterLab1 != "0" && dataMikroMain.DokterLab1 != "" {
|
||||
dokterPengirim, errDokter = simrsDB.GetNamaDokter(dataMikroMain.DokterLab1)
|
||||
log.Println("DokterLab kode-nama:", dataMikroMain.DokterLab1, " - ", dokterPengirim)
|
||||
//log.Println("DokterLab kode-nama:", dataMikroMain.DokterLab1, " - ", dokterPengirim)
|
||||
if errDokter != nil {
|
||||
log.Println(errDokter)
|
||||
c.JSON(http.StatusBadRequest, gin.H{
|
||||
@@ -150,10 +150,10 @@ func SendDataLISMikro(c *gin.Context) {
|
||||
//return
|
||||
} else if dataMikroMain.Pengirim != "" && dataMikroMain.Pengirim != "0" {
|
||||
dokterPengirim = dataMikroMain.Pengirim
|
||||
log.Println("Pengirim kode-nama:", dataMikroMain.Pengirim, " - ", dokterPengirim)
|
||||
//log.Println("Pengirim kode-nama:", dataMikroMain.Pengirim, " - ", dokterPengirim)
|
||||
} else {
|
||||
dokterPengirim = ""
|
||||
log.Println("dokterPengirim : null")
|
||||
//log.Println("dokterPengirim : null")
|
||||
}
|
||||
|
||||
for _, value := range dataLabMikro {
|
||||
@@ -178,7 +178,7 @@ func SendDataLISMikro(c *gin.Context) {
|
||||
NamaSpesimen: value.JenisKelompok,
|
||||
Pengambilan: "",
|
||||
}
|
||||
log.Println("Sebelum masuk LIS", dataLisMikro)
|
||||
//log.Println("Sebelum masuk LIS", dataLisMikro)
|
||||
resMikro, errMikro := SendLisMikro(dataLisMikro)
|
||||
if errMikro != nil {
|
||||
log.Println(errMikro)
|
||||
@@ -188,7 +188,7 @@ func SendDataLISMikro(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
log.Println(resMikro)
|
||||
//log.Println(resMikro)
|
||||
|
||||
reqUpdate := &mikrobiologi.ReqUpdateLisMikro{
|
||||
IdxOrderMikro: value.IdxOrderMikro,
|
||||
@@ -212,6 +212,6 @@ func SendDataLISMikro(c *gin.Context) {
|
||||
})
|
||||
}
|
||||
}
|
||||
log.Println("RESPONSE", responseMikro)
|
||||
//log.Println("RESPONSE", responseMikro)
|
||||
c.JSON(http.StatusOK, responseMikro)
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ func SendLisMikro(request *mikrobiologi.RequestLISMikro) (*mikrobiologi.Response
|
||||
baseUrl := os.Getenv("LIS_MIKROBIOLOGI_URL")
|
||||
endpoint := os.Getenv("LIS_REGISTERPASIEN")
|
||||
url := baseUrl + endpoint
|
||||
log.Println("URL", url)
|
||||
//log.Println("URL", url)
|
||||
|
||||
reqMarshall, err := json.Marshal(request)
|
||||
if err != nil {
|
||||
@@ -26,7 +26,7 @@ func SendLisMikro(request *mikrobiologi.RequestLISMikro) (*mikrobiologi.Response
|
||||
"Accept": "application/json",
|
||||
"Content-Type": "application/json",
|
||||
}
|
||||
log.Println("REQUEST: ", string(reqMarshall))
|
||||
//log.Println("REQUEST: ", string(reqMarshall))
|
||||
|
||||
req, err := http.NewRequest("POST", url, bytes.NewReader(reqMarshall))
|
||||
if err != nil {
|
||||
@@ -46,13 +46,13 @@ func SendLisMikro(request *mikrobiologi.RequestLISMikro) (*mikrobiologi.Response
|
||||
return nil, err
|
||||
}
|
||||
|
||||
log.Println("dari LIS", response)
|
||||
//log.Println("dari LIS", response)
|
||||
|
||||
res, err := io.ReadAll(response.Body)
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
}
|
||||
|
||||
//log.Println("code:", response.StatusCode)
|
||||
if response.StatusCode != 201 {
|
||||
var responseError *mikrobiologi.ResponseError
|
||||
err = json.Unmarshal(res, &responseError)
|
||||
@@ -68,7 +68,7 @@ func SendLisMikro(request *mikrobiologi.RequestLISMikro) (*mikrobiologi.Response
|
||||
|
||||
var responses *mikrobiologi.Response
|
||||
|
||||
log.Println("RESPONSE: ", string(res))
|
||||
//log.Println("RESPONSE: ", string(res))
|
||||
err = json.Unmarshal(res, &responses)
|
||||
if err != nil {
|
||||
log.Printf("Error unmarshalling response: %v", err)
|
||||
|
||||
Reference in New Issue
Block a user