|
|
|
@@ -332,6 +332,7 @@ func (c *controller) handleGetPortal(ctx echo.Context) error {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func (c *controller) handleMember(ctx echo.Context) error {
|
|
|
|
func (c *controller) handleMember(ctx echo.Context) error {
|
|
|
|
|
|
|
|
fmt.Println("\n\nHandle member\n\n")
|
|
|
|
var user viewmodel.User
|
|
|
|
var user viewmodel.User
|
|
|
|
if err := ctx.Bind(&user); err != nil {
|
|
|
|
if err := ctx.Bind(&user); err != nil {
|
|
|
|
return routeutils.HandleAPIError(ctx, err)
|
|
|
|
return routeutils.HandleAPIError(ctx, err)
|
|
|
|
@@ -382,11 +383,6 @@ func (c *controller) handleMember(ctx echo.Context) error {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
user.Profiles = append(user.Profiles, profile)
|
|
|
|
user.Profiles = append(user.Profiles, profile)
|
|
|
|
|
|
|
|
|
|
|
|
user, err = c.svc.Users.Create(user, authUser)
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
return routeutils.HandleAPIError(ctx, err)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
eligibility := viewmodel.Eligibility{}
|
|
|
|
eligibility := viewmodel.Eligibility{}
|
|
|
|
eligibility.Provider.ProviderNPI = "1699849786"
|
|
|
|
eligibility.Provider.ProviderNPI = "1699849786"
|
|
|
|
eligibility.Provider.ProviderName = "LITHOLINK CORPORATION"
|
|
|
|
eligibility.Provider.ProviderName = "LITHOLINK CORPORATION"
|
|
|
|
@@ -400,10 +396,13 @@ func (c *controller) handleMember(ctx echo.Context) error {
|
|
|
|
eligibility.ServiceInfo.DateOfService = time.Now()
|
|
|
|
eligibility.ServiceInfo.DateOfService = time.Now()
|
|
|
|
eligibility.ServiceInfo.ServiceTypeCodes = []string{"30"}
|
|
|
|
eligibility.ServiceInfo.ServiceTypeCodes = []string{"30"}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fmt.Println("\n\nGet271\n\n")
|
|
|
|
resp, err := c.bcbsi.BXE.Get271(eligibility)
|
|
|
|
resp, err := c.bcbsi.BXE.Get271(eligibility)
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
fmt.Println("Eligibility Not Found or Error: ", err.Error())
|
|
|
|
fmt.Println("Eligibility Not Found or Error: ", err.Error())
|
|
|
|
} else {
|
|
|
|
return routeutils.ResponseAPINotEligibleError(ctx)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
address := viewmodel.Address{}
|
|
|
|
address := viewmodel.Address{}
|
|
|
|
header := resp.Division.HealthCareEligibilityResponse.LoopHL0030[0].HL_0460[0].HL_0890[0].NM1_0920[0].N3_0950
|
|
|
|
header := resp.Division.HealthCareEligibilityResponse.LoopHL0030[0].HL_0460[0].HL_0890[0].NM1_0920[0].N3_0950
|
|
|
|
body := resp.Division.HealthCareEligibilityResponse.LoopHL0030[0].HL_0460[0].HL_0890[0].NM1_0920[0].N4_0960
|
|
|
|
body := resp.Division.HealthCareEligibilityResponse.LoopHL0030[0].HL_0460[0].HL_0890[0].NM1_0920[0].N4_0960
|
|
|
|
@@ -418,6 +417,7 @@ func (c *controller) handleMember(ctx echo.Context) error {
|
|
|
|
googleMapsAPI, err := maps.NewClient(maps.WithClientIDAndSignature("gme-bluecrossandblue1", "msqgD-jdqCyR0M_1u5C1HION5iI="))
|
|
|
|
googleMapsAPI, err := maps.NewClient(maps.WithClientIDAndSignature("gme-bluecrossandblue1", "msqgD-jdqCyR0M_1u5C1HION5iI="))
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
fmt.Println("Error to instantiate googles api: ", err.Error())
|
|
|
|
fmt.Println("Error to instantiate googles api: ", err.Error())
|
|
|
|
|
|
|
|
return routeutils.ResponseAPINotEligibleError(ctx)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
r := &maps.GeocodingRequest{
|
|
|
|
r := &maps.GeocodingRequest{
|
|
|
|
@@ -427,6 +427,7 @@ func (c *controller) handleMember(ctx echo.Context) error {
|
|
|
|
result, err := googleMapsAPI.Geocode(context.Background(), r)
|
|
|
|
result, err := googleMapsAPI.Geocode(context.Background(), r)
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
fmt.Println("Error to instantiate googles api: ", err.Error())
|
|
|
|
fmt.Println("Error to instantiate googles api: ", err.Error())
|
|
|
|
|
|
|
|
return routeutils.ResponseAPINotEligibleError(ctx)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if len(result) > 0 {
|
|
|
|
if len(result) > 0 {
|
|
|
|
@@ -436,8 +437,15 @@ func (c *controller) handleMember(ctx echo.Context) error {
|
|
|
|
_, err := c.svc.Users.SaveAddress(address)
|
|
|
|
_, err := c.svc.Users.SaveAddress(address)
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
fmt.Println("Error to save address: ", err.Error())
|
|
|
|
fmt.Println("Error to save address: ", err.Error())
|
|
|
|
|
|
|
|
return routeutils.ResponseAPINotEligibleError(ctx)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//Get ZIP code and check if it is participating
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
user, err = c.svc.Users.Create(user, authUser)
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
return routeutils.HandleAPIError(ctx, err)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return routeutils.ResponseAPIOK(ctx, user)
|
|
|
|
return routeutils.ResponseAPIOK(ctx, user)
|
|
|
|
|