Upstream sync
This commit is contained in:
@@ -1,6 +1,10 @@
|
||||
package eligibilityroute
|
||||
|
||||
import (
|
||||
"encoding/xml"
|
||||
"fmt"
|
||||
"html"
|
||||
"strings"
|
||||
"sync"
|
||||
|
||||
"bitbucket.org/nemt/nemt-portal-api/application/applicationservice"
|
||||
@@ -42,8 +46,22 @@ func (c *controller) handleEligibility(ctx echo.Context) error {
|
||||
|
||||
ret, err := c.bcbsi.BXE.CheckEligibility(eligibility)
|
||||
if err != nil {
|
||||
fmt.Println("Error Here: ", err.Error())
|
||||
return routeutils.HandleAPIError(ctx, err)
|
||||
}
|
||||
|
||||
return routeutils.ResponseAPIOK(ctx, ret)
|
||||
if ret.QueryResult.HIPPA271.T271 != "" {
|
||||
xmlString := html.UnescapeString(ret.QueryResult.HIPPA271.T271)
|
||||
xmlReader := strings.NewReader(xmlString)
|
||||
|
||||
var f viewmodel.Interchange271
|
||||
err = xml.NewDecoder(xmlReader).Decode(&f)
|
||||
if err != nil {
|
||||
fmt.Println("Error to unmarshal: ", err.Error())
|
||||
}
|
||||
|
||||
return ctx.JSON(200, f)
|
||||
} else {
|
||||
return routeutils.ResponseAPIOK(ctx, ret)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user