From 2e5444bed88ec3a96292ffe8bd5c477982462237 Mon Sep 17 00:00:00 2001 From: Senad Uka Date: Wed, 16 May 2018 18:30:59 +0200 Subject: [PATCH] Upstream sync --- .../eligibility/bcbsi/bcbsimodel/response.go | 284 +++ application/third/eligibility/bcbsi/bxe.go | 41 +- application/viewmodel/bxe.go | 285 +++ config.dev.toml | 4 +- config.stg.toml | 4 +- returnExample.xml | 1602 +++++++++++++++++ server/authorization/organization.go | 8 + server/authorization/user.go | 2 +- server/router/eligibilityroute/controller.go | 20 +- server/router/usersroute/controller.go | 71 +- server/validation/user.go | 67 + 11 files changed, 2370 insertions(+), 18 deletions(-) create mode 100644 returnExample.xml create mode 100644 server/validation/user.go diff --git a/application/third/eligibility/bcbsi/bcbsimodel/response.go b/application/third/eligibility/bcbsi/bcbsimodel/response.go index 88f0afd..9c6a2c7 100644 --- a/application/third/eligibility/bcbsi/bcbsimodel/response.go +++ b/application/third/eligibility/bcbsi/bcbsimodel/response.go @@ -42,3 +42,287 @@ type EntityResponse struct { Name string `json:"name"` Status bool `json:"status"` } + +type Interchange271 struct { + XMLName xml.Name `json:"-" xml:"Interchange"` + Isa ISA271 `json:"isa,omitempty" xml:"ISA"` + Division Division271 `json:"division,omitempty" xml:"Division"` + IEA IEA271 `json:"iea,omitempty" xml:"IEA"` +} + +type IEA271 struct { + IEA01 string `json:"iea01,omitempty" xml:"IEA01"` + IEA02 string `json:"iea02,omitempty" xml:"IEA02"` +} + +type ISA271 struct { + Isa01 string `json:"isa01,omitempty" xml:"ISA01"` + Isa02 string `json:"isa02,omitempty" xml:"ISA02"` + Isa03 string `json:"isa03,omitempty" xml:"ISA03"` + Isa04 string `json:"isa04,omitempty" xml:"ISA04"` + Isa05 string `json:"isa05,omitempty" xml:"ISA05"` + Isa06 string `json:"isa06,omitempty" xml:"ISA06"` + Isa07 string `json:"isa07,omitempty" xml:"ISA07"` + Isa08 string `json:"isa08,omitempty" xml:"ISA08"` + Isa09 string `json:"isa09,omitempty" xml:"ISA09"` + Isa10 string `json:"isa10,omitempty" xml:"ISA10"` + Isa11 string `json:"isa11,omitempty" xml:"ISA11"` + Isa12 string `json:"isa12,omitempty" xml:"ISA12"` + Isa13 string `json:"isa13,omitempty" xml:"ISA13"` + Isa14 string `json:"isa14,omitempty" xml:"ISA14"` + Isa15 string `json:"isa15,omitempty" xml:"ISA15"` + Isa16 string `json:"isa16,omitempty" xml:"ISA16"` +} + +type Division271 struct { + GS GS271 `json:"gs,omitempty" xml:"GS"` + HealthCareEligibilityResponse HealthCareEligibilityBenefitResponse271 `json:"eligibility_response,omitempty" xml:"Health_Care_Eligibility_Benefit_Response"` + GE GE271 `json:"ge,omitempty" xml:"GE"` +} + +type GS271 struct { + GS01 string `json:"gs01,omitempty" xml:"GS01"` + GS02 string `json:"gs02,omitempty" xml:"GS02"` + GS03 string `json:"gs03,omitempty" xml:"GS03"` + GS04 string `json:"gs04,omitempty" xml:"GS04"` + GS05 string `json:"gs05,omitempty" xml:"GS05"` + GS06 string `json:"gs06,omitempty" xml:"GS06"` + GS07 string `json:"gs07,omitempty" xml:"GS07"` + GS08 string `json:"gs08,omitempty" xml:"GS08"` +} + +type GE271 struct { + GE01 string `json:"ge01,omitempty" xml:"GE01"` + GE02 string `json:"ge02,omitempty" xml:"GE02"` +} + +type HealthCareEligibilityBenefitResponse271 struct { + ST0010 ST `json:"st0010,omitempty" xml:"ST_0010"` + BHT0020 BHT `json:"bht0020,omitempty" xml:"BHT_0020"` + LoopHL0030 []LoopHL0030271 `json:"hl0030,omitempty" xml:"Loop_HL_0030"` +} + +type ST struct { + ST01 string `json:"st01,omitempty" xml:"ST01"` + ST02 string `json:"st02,omitempty" xml:"ST02"` + ST03 string `json:"st03,omitempty" xml:"ST03"` + ST04 string `json:"st04,omitempty" xml:"ST04"` + ST05 string `json:"st05,omitempty" xml:"ST05"` + ST06 string `json:"st06,omitempty" xml:"ST06"` + ST07 string `json:"st07,omitempty" xml:"ST07"` + ST08 string `json:"st08,omitempty" xml:"ST08"` + ST09 string `json:"st09,omitempty" xml:"ST09"` + ST10 string `json:"st10,omitempty" xml:"ST10"` + ST11 string `json:"st11,omitempty" xml:"ST11"` + ST12 string `json:"st12,omitempty" xml:"ST12"` + ST13 string `json:"st13,omitempty" xml:"ST13"` + ST14 string `json:"st14,omitempty" xml:"ST14"` + ST15 string `json:"st15,omitempty" xml:"ST15"` + ST16 string `json:"st16,omitempty" xml:"ST16"` +} + +type BHT struct { + BHT01 string `json:"bht01,omitempty" xml:"BHT01"` + BHT02 string `json:"bht02,omitempty" xml:"BHT02"` + BHT03 string `json:"bht03,omitempty" xml:"BHT03"` + BHT04 string `json:"bht04,omitempty" xml:"BHT04"` + BHT05 string `json:"bht05,omitempty" xml:"BHT05"` + BHT06 string `json:"bht06,omitempty" xml:"BHT06"` + BHT07 string `json:"bht07,omitempty" xml:"BHT07"` + BHT08 string `json:"bht08,omitempty" xml:"BHT08"` + BHT09 string `json:"bht09,omitempty" xml:"BHT09"` + BHT10 string `json:"bht10,omitempty" xml:"BHT10"` + BHT11 string `json:"bht11,omitempty" xml:"BHT11"` + BHT12 string `json:"bht12,omitempty" xml:"BHT12"` + BHT13 string `json:"bht13,omitempty" xml:"BHT13"` + BHT14 string `json:"bht14,omitempty" xml:"BHT14"` + BHT15 string `json:"bht15,omitempty" xml:"BHT15"` + BHT16 string `json:"bht16,omitempty" xml:"BHT16"` +} + +type LoopHL0030271 struct { + HL_0030 HL `json:"hl_0030,omitempty" xml:"HL_0030"` + NM1_0060 []LoopNM10060 `json:"nm1_0060,omitempty" xml:"Loop_NM1_0060"` + HL_0460 []LoopHL0460 `json:"hl_0460,omitempty" xml:"Loop_HL_0460"` +} + +type LoopHL0460 struct { + HL_0460 HL `json:"hl_0460,omitempty" xml:"HL_0460"` + NM1_0490 []LoopNM10490 `json:"nm1_0490,omitempty" xml:"Loop_NM1_0490"` + HL_0890 []LoopHL0890 `json:"hl_0890,omitempty" xml:"Loop_HL_0890"` +} + +type LoopNM10490 struct { + NM1_0490 NM1 `json:"nm1_0490,omitempty" xml:"NM1_0490"` +} + +type LoopHL0890 struct { + HL_0890 HL `json:"hl_0890,omitempty" xml:"HL_0890"` + TRN_0900 TRN `json:"trn_0900,omitempty" xml:"TRN_0900"` + NM1_0920 []LoopNM10920 `json:"nm1_0920,omitempty" xml:"Loop_NM1_0920"` +} + +type REF struct { + REF01 string `json:"ref01,omitempty" xml:"REF01"` + REF02 string `json:"ref02,omitempty" xml:"REF02"` + REF03 string `json:"ref03,omitempty" xml:"REF03"` + REF04 string `json:"ref04,omitempty" xml:"REF04"` + REF05 string `json:"ref05,omitempty" xml:"REF05"` + REF06 string `json:"ref06,omitempty" xml:"REF06"` + REF07 string `json:"ref07,omitempty" xml:"REF07"` + REF08 string `json:"ref08,omitempty" xml:"REF08"` + REF09 string `json:"ref09,omitempty" xml:"REF09"` + REF10 string `json:"ref10,omitempty" xml:"REF10"` + REF11 string `json:"ref11,omitempty" xml:"REF11"` + REF12 string `json:"ref12,omitempty" xml:"REF12"` + REF13 string `json:"ref13,omitempty" xml:"REF13"` + REF14 string `json:"ref14,omitempty" xml:"REF14"` + REF15 string `json:"ref15,omitempty" xml:"REF15"` + REF16 string `json:"ref16,omitempty" xml:"REF16"` +} + +type N3 struct { + N301 string `json:"n301,omitempty" xml:"N301"` + N302 string `json:"n302,omitempty" xml:"N302"` + N303 string `json:"n303,omitempty" xml:"N303"` + N304 string `json:"n304,omitempty" xml:"N304"` + N305 string `json:"n305,omitempty" xml:"N305"` + N306 string `json:"n306,omitempty" xml:"N306"` + N307 string `json:"n307,omitempty" xml:"N307"` + N308 string `json:"n308,omitempty" xml:"N308"` + N309 string `json:"n309,omitempty" xml:"N309"` + N310 string `json:"n310,omitempty" xml:"N310"` + N311 string `json:"n311,omitempty" xml:"N311"` + N312 string `json:"n312,omitempty" xml:"N312"` + N313 string `json:"n313,omitempty" xml:"N313"` + N314 string `json:"n314,omitempty" xml:"N314"` + N315 string `json:"n315,omitempty" xml:"N315"` + N316 string `json:"n316,omitempty" xml:"N316"` +} + +type N4 struct { + N401 string `json:"n401,omitempty" xml:"N401"` + N402 string `json:"n402,omitempty" xml:"N402"` + N403 string `json:"n403,omitempty" xml:"N403"` + N404 string `json:"n404,omitempty" xml:"N404"` + N405 string `json:"n405,omitempty" xml:"N405"` + N406 string `json:"n406,omitempty" xml:"N406"` + N407 string `json:"n407,omitempty" xml:"N407"` + N408 string `json:"n408,omitempty" xml:"N408"` + N409 string `json:"n409,omitempty" xml:"N409"` + N410 string `json:"n410,omitempty" xml:"N410"` + N411 string `json:"n411,omitempty" xml:"N411"` + N412 string `json:"n412,omitempty" xml:"N412"` + N413 string `json:"n413,omitempty" xml:"N413"` + N414 string `json:"n414,omitempty" xml:"N414"` + N415 string `json:"n415,omitempty" xml:"N415"` + N416 string `json:"n416,omitempty" xml:"N416"` +} + +type LoopNM10920 struct { + NM1_0920 NM1 `json:"nm1_0920,omitempty" xml:"NM1_0920"` + REF_0930 []REF `json:"ref_0930,omitempty" xml:"REF_0930"` + N3_0950 N3 `json:"n3_0950,omitempty" xml:"N3_0950"` + N4_0960 N4 `json:"n4_0960,omitempty" xml:"N4_0960"` + DMG_1000 DMG `json:"dmg_1000,omitempty" xml:"DMG_1000"` + INS_1010 INS `json:"ins_1010,omitempty" xml:"INS_1010"` +} + +type DMG struct { + DMG01 string `json:"dmg01,omitempty" xml:"DMG01"` + DMG02 string `json:"dmg02,omitempty" xml:"DMG02"` + DMG03 string `json:"dmg03,omitempty" xml:"DMG03"` + DMG04 string `json:"dmg04,omitempty" xml:"DMG04"` + DMG05 string `json:"dmg05,omitempty" xml:"DMG05"` + DMG06 string `json:"dmg06,omitempty" xml:"DMG06"` + DMG07 string `json:"dmg07,omitempty" xml:"DMG07"` + DMG08 string `json:"dmg08,omitempty" xml:"DMG08"` + DMG09 string `json:"dmg09,omitempty" xml:"DMG09"` + DMG10 string `json:"dmg10,omitempty" xml:"DMG10"` + DMG11 string `json:"dmg11,omitempty" xml:"DMG11"` + DMG12 string `json:"dmg12,omitempty" xml:"DMG12"` + DMG13 string `json:"dmg13,omitempty" xml:"DMG13"` + DMG14 string `json:"dmg14,omitempty" xml:"DMG14"` + DMG15 string `json:"dmg15,omitempty" xml:"DMG15"` + DMG16 string `json:"dmg16,omitempty" xml:"DMG16"` +} + +type INS struct { + INS01 string `json:"ins01,omitempty" xml:"INS01"` + INS02 string `json:"ins02,omitempty" xml:"INS02"` + INS03 string `json:"ins03,omitempty" xml:"INS03"` + INS04 string `json:"ins04,omitempty" xml:"INS04"` + INS05 string `json:"ins05,omitempty" xml:"INS05"` + INS06 string `json:"ins06,omitempty" xml:"INS06"` + INS07 string `json:"ins07,omitempty" xml:"INS07"` + INS08 string `json:"ins08,omitempty" xml:"INS08"` + INS09 string `json:"ins09,omitempty" xml:"INS09"` + INS10 string `json:"ins10,omitempty" xml:"INS10"` + INS11 string `json:"ins11,omitempty" xml:"INS11"` + INS12 string `json:"ins12,omitempty" xml:"INS12"` + INS13 string `json:"ins13,omitempty" xml:"INS13"` + INS14 string `json:"ins14,omitempty" xml:"INS14"` + INS15 string `json:"ins15,omitempty" xml:"INS15"` + INS16 string `json:"ins16,omitempty" xml:"INS16"` +} + +type TRN struct { + TRN01 string `json:"trn01,omitempty" xml:"TRN01"` + TRN02 string `json:"trn02,omitempty" xml:"TRN02"` + TRN03 string `json:"trn03,omitempty" xml:"TRN03"` + TRN04 string `json:"trn04,omitempty" xml:"TRN04"` + TRN05 string `json:"trn05,omitempty" xml:"TRN05"` + TRN06 string `json:"trn06,omitempty" xml:"TRN06"` + TRN07 string `json:"trn07,omitempty" xml:"TRN07"` + TRN08 string `json:"trn08,omitempty" xml:"TRN08"` + TRN09 string `json:"trn09,omitempty" xml:"TRN09"` + TRN10 string `json:"trn10,omitempty" xml:"TRN10"` + TRN11 string `json:"trn11,omitempty" xml:"TRN11"` + TRN12 string `json:"trn12,omitempty" xml:"TRN12"` + TRN13 string `json:"trn13,omitempty" xml:"TRN13"` + TRN14 string `json:"trn14,omitempty" xml:"TRN14"` + TRN15 string `json:"trn15,omitempty" xml:"TRN15"` + TRN16 string `json:"trn16,omitempty" xml:"TRN16"` +} + +type HL struct { + HL01 string `json:"hl01,omitempty" xml:"HL01"` + HL02 string `json:"hl02,omitempty" xml:"HL02"` + HL03 string `json:"hl03,omitempty" xml:"HL03"` + HL04 string `json:"hl04,omitempty" xml:"HL04"` + HL05 string `json:"hl05,omitempty" xml:"HL05"` + HL06 string `json:"hl06,omitempty" xml:"HL06"` + HL07 string `json:"hl07,omitempty" xml:"HL07"` + HL08 string `json:"hl08,omitempty" xml:"HL08"` + HL09 string `json:"hl09,omitempty" xml:"HL09"` + HL10 string `json:"hl10,omitempty" xml:"HL10"` + HL11 string `json:"hl11,omitempty" xml:"HL11"` + HL12 string `json:"hl12,omitempty" xml:"HL12"` + HL13 string `json:"hl13,omitempty" xml:"HL13"` + HL14 string `json:"hl14,omitempty" xml:"HL14"` + HL15 string `json:"hl15,omitempty" xml:"HL15"` + HL16 string `json:"hl16,omitempty" xml:"HL16"` +} + +type LoopNM10060 struct { + NM10060 NM1 `json:"nm1_0060,omitempty" xml:"NM1_0060"` +} + +type NM1 struct { + NM101 string `json:"nm101,omitempty" xml:"NM101"` + NM102 string `json:"nm102,omitempty" xml:"NM102"` + NM103 string `json:"nm103,omitempty" xml:"NM103"` + NM104 string `json:"nm104,omitempty" xml:"NM104"` + NM105 string `json:"nm105,omitempty" xml:"NM105"` + NM106 string `json:"nm106,omitempty" xml:"NM106"` + NM107 string `json:"nm107,omitempty" xml:"NM107"` + NM108 string `json:"nm108,omitempty" xml:"NM108"` + NM109 string `json:"nm109,omitempty" xml:"NM109"` + NM110 string `json:"nm110,omitempty" xml:"NM110"` + NM111 string `json:"nm111,omitempty" xml:"NM111"` + NM112 string `json:"nm112,omitempty" xml:"NM112"` + NM113 string `json:"nm113,omitempty" xml:"NM113"` + NM114 string `json:"nm114,omitempty" xml:"NM114"` + NM115 string `json:"nm115,omitempty" xml:"NM115"` + NM116 string `json:"nm116,omitempty" xml:"NM116"` +} diff --git a/application/third/eligibility/bcbsi/bxe.go b/application/third/eligibility/bcbsi/bxe.go index 26daff3..c1bd0a1 100644 --- a/application/third/eligibility/bcbsi/bxe.go +++ b/application/third/eligibility/bcbsi/bxe.go @@ -5,7 +5,9 @@ import ( "crypto/md5" "encoding/hex" "encoding/xml" + "errors" "fmt" + "html" "io/ioutil" "net/http" "strings" @@ -72,14 +74,37 @@ func (s bxeService) GetPayerDetails(subscriberID string) ([]bcbsimodel.EntityRes return response, nil } -func (s bxeService) CheckEligibility(eligibility viewmodel.Eligibility) (bcbsimodel.MemberEligibilityResponse, error) { - payer, err := s.GetPayerDetails(eligibility.Subscriber.SubscriberID) +func (s bxeService) Get271(eligibility viewmodel.Eligibility) (bcbsimodel.Interchange271, error) { + resp, err := s.CheckEligibility(eligibility) if err != nil { - return bcbsimodel.MemberEligibilityResponse{}, err + return bcbsimodel.Interchange271{}, err } - eligibility.Payer.PayerID = payer[0].ID - eligibility.Payer.PayerName = payer[0].Name + if resp.QueryResult.HIPPA271.T271 != "" { + xmlString := html.UnescapeString(resp.QueryResult.HIPPA271.T271) + xmlReader := strings.NewReader(xmlString) + + var f bcbsimodel.Interchange271 + err = xml.NewDecoder(xmlReader).Decode(&f) + if err != nil { + fmt.Println("Error to unmarshal: ", err.Error()) + return bcbsimodel.Interchange271{}, err + } + + return f, nil + } else { + return bcbsimodel.Interchange271{}, errors.New("No 271 response") + } +} + +func (s bxeService) CheckEligibility(eligibility viewmodel.Eligibility) (bcbsimodel.MemberEligibilityResponse, error) { + // payer, err := s.GetPayerDetails(eligibility.Subscriber.SubscriberID) + // if err != nil { + // return bcbsimodel.MemberEligibilityResponse{}, err + // } + + eligibility.Payer.PayerID = "621" + eligibility.Payer.PayerName = "blue_cross_blue_shield_il" envelope := bcbsimodel.GetEnvelope(eligibility) apiKey := s.cfg.BXE.APIKey @@ -99,14 +124,14 @@ func (s bxeService) CheckEligibility(eligibility viewmodel.Eligibility) (bcbsimo resp, err := client.Do(req) if err != nil { - fmt.Println("Error WebService: ", err) + fmt.Println("Error WebService Request: ", err) return bcbsimodel.MemberEligibilityResponse{}, err } defer resp.Body.Close() bReturn, err := ioutil.ReadAll(resp.Body) if err != nil { - fmt.Println("Error WebService: ", err) + fmt.Println("Error WebService getting byte: ", err) return bcbsimodel.MemberEligibilityResponse{}, err } @@ -118,7 +143,7 @@ func (s bxeService) CheckEligibility(eligibility viewmodel.Eligibility) (bcbsimo var result bcbsimodel.EnvelopeResponse err = xml.Unmarshal([]byte(sResponse), &result) if err != nil { - fmt.Println("Error WebService: ", err) + fmt.Println("Error WebService getting object: ", err) return bcbsimodel.MemberEligibilityResponse{}, err } diff --git a/application/viewmodel/bxe.go b/application/viewmodel/bxe.go index ff1e4de..4893993 100644 --- a/application/viewmodel/bxe.go +++ b/application/viewmodel/bxe.go @@ -1,6 +1,7 @@ package viewmodel import ( + "encoding/xml" "time" ) @@ -53,3 +54,287 @@ type ServiceInfo struct { DateOfService time.Time `json:"date_of_service,omitempty"` ServiceTypeCodes []string `json:"service_type_codes,omitempty"` } + +type Interchange271 struct { + XMLName xml.Name `json:"-" xml:"Interchange"` + Isa ISA271 `json:"isa,omitempty" xml:"ISA"` + Division Division271 `json:"division,omitempty" xml:"Division"` + IEA IEA271 `json:"iea,omitempty" xml:"IEA"` +} + +type IEA271 struct { + IEA01 string `json:"iea01,omitempty" xml:"IEA01"` + IEA02 string `json:"iea02,omitempty" xml:"IEA02"` +} + +type ISA271 struct { + Isa01 string `json:"isa01,omitempty" xml:"ISA01"` + Isa02 string `json:"isa02,omitempty" xml:"ISA02"` + Isa03 string `json:"isa03,omitempty" xml:"ISA03"` + Isa04 string `json:"isa04,omitempty" xml:"ISA04"` + Isa05 string `json:"isa05,omitempty" xml:"ISA05"` + Isa06 string `json:"isa06,omitempty" xml:"ISA06"` + Isa07 string `json:"isa07,omitempty" xml:"ISA07"` + Isa08 string `json:"isa08,omitempty" xml:"ISA08"` + Isa09 string `json:"isa09,omitempty" xml:"ISA09"` + Isa10 string `json:"isa10,omitempty" xml:"ISA10"` + Isa11 string `json:"isa11,omitempty" xml:"ISA11"` + Isa12 string `json:"isa12,omitempty" xml:"ISA12"` + Isa13 string `json:"isa13,omitempty" xml:"ISA13"` + Isa14 string `json:"isa14,omitempty" xml:"ISA14"` + Isa15 string `json:"isa15,omitempty" xml:"ISA15"` + Isa16 string `json:"isa16,omitempty" xml:"ISA16"` +} + +type Division271 struct { + GS GS271 `json:"gs,omitempty" xml:"GS"` + HealthCareEligibilityResponse HealthCareEligibilityBenefitResponse271 `json:"eligibility_response,omitempty" xml:"Health_Care_Eligibility_Benefit_Response"` + GE GE271 `json:"ge,omitempty" xml:"GE"` +} + +type GS271 struct { + GS01 string `json:"gs01,omitempty" xml:"GS01"` + GS02 string `json:"gs02,omitempty" xml:"GS02"` + GS03 string `json:"gs03,omitempty" xml:"GS03"` + GS04 string `json:"gs04,omitempty" xml:"GS04"` + GS05 string `json:"gs05,omitempty" xml:"GS05"` + GS06 string `json:"gs06,omitempty" xml:"GS06"` + GS07 string `json:"gs07,omitempty" xml:"GS07"` + GS08 string `json:"gs08,omitempty" xml:"GS08"` +} + +type GE271 struct { + GE01 string `json:"ge01,omitempty" xml:"GE01"` + GE02 string `json:"ge02,omitempty" xml:"GE02"` +} + +type HealthCareEligibilityBenefitResponse271 struct { + ST0010 ST `json:"st0010,omitempty" xml:"ST_0010"` + BHT0020 BHT `json:"bht0020,omitempty" xml:"BHT_0020"` + LoopHL0030 []LoopHL0030271 `json:"hl0030,omitempty" xml:"Loop_HL_0030"` +} + +type ST struct { + ST01 string `json:"st01,omitempty" xml:"ST01"` + ST02 string `json:"st02,omitempty" xml:"ST02"` + ST03 string `json:"st03,omitempty" xml:"ST03"` + ST04 string `json:"st04,omitempty" xml:"ST04"` + ST05 string `json:"st05,omitempty" xml:"ST05"` + ST06 string `json:"st06,omitempty" xml:"ST06"` + ST07 string `json:"st07,omitempty" xml:"ST07"` + ST08 string `json:"st08,omitempty" xml:"ST08"` + ST09 string `json:"st09,omitempty" xml:"ST09"` + ST10 string `json:"st10,omitempty" xml:"ST10"` + ST11 string `json:"st11,omitempty" xml:"ST11"` + ST12 string `json:"st12,omitempty" xml:"ST12"` + ST13 string `json:"st13,omitempty" xml:"ST13"` + ST14 string `json:"st14,omitempty" xml:"ST14"` + ST15 string `json:"st15,omitempty" xml:"ST15"` + ST16 string `json:"st16,omitempty" xml:"ST16"` +} + +type BHT struct { + BHT01 string `json:"bht01,omitempty" xml:"BHT01"` + BHT02 string `json:"bht02,omitempty" xml:"BHT02"` + BHT03 string `json:"bht03,omitempty" xml:"BHT03"` + BHT04 string `json:"bht04,omitempty" xml:"BHT04"` + BHT05 string `json:"bht05,omitempty" xml:"BHT05"` + BHT06 string `json:"bht06,omitempty" xml:"BHT06"` + BHT07 string `json:"bht07,omitempty" xml:"BHT07"` + BHT08 string `json:"bht08,omitempty" xml:"BHT08"` + BHT09 string `json:"bht09,omitempty" xml:"BHT09"` + BHT10 string `json:"bht10,omitempty" xml:"BHT10"` + BHT11 string `json:"bht11,omitempty" xml:"BHT11"` + BHT12 string `json:"bht12,omitempty" xml:"BHT12"` + BHT13 string `json:"bht13,omitempty" xml:"BHT13"` + BHT14 string `json:"bht14,omitempty" xml:"BHT14"` + BHT15 string `json:"bht15,omitempty" xml:"BHT15"` + BHT16 string `json:"bht16,omitempty" xml:"BHT16"` +} + +type LoopHL0030271 struct { + HL_0030 HL `json:"hl_0030,omitempty" xml:"HL_0030"` + NM1_0060 []LoopNM10060 `json:"nm1_0060,omitempty" xml:"Loop_NM1_0060"` + HL_0460 []LoopHL0460 `json:"hl_0460,omitempty" xml:"Loop_HL_0460"` +} + +type LoopHL0460 struct { + HL_0460 HL `json:"hl_0460,omitempty" xml:"HL_0460"` + NM1_0490 []LoopNM10490 `json:"nm1_0490,omitempty" xml:"Loop_NM1_0490"` + HL_0890 []LoopHL0890 `json:"hl_0890,omitempty" xml:"Loop_HL_0890"` +} + +type LoopNM10490 struct { + NM1_0490 NM1 `json:"nm1_0490,omitempty" xml:"NM1_0490"` +} + +type LoopHL0890 struct { + HL_0890 HL `json:"hl_0890,omitempty" xml:"HL_0890"` + TRN_0900 TRN `json:"trn_0900,omitempty" xml:"TRN_0900"` + NM1_0920 []LoopNM10920 `json:"nm1_0920,omitempty" xml:"Loop_NM1_0920"` +} + +type REF struct { + REF01 string `json:"ref01,omitempty" xml:"REF01"` + REF02 string `json:"ref02,omitempty" xml:"REF02"` + REF03 string `json:"ref03,omitempty" xml:"REF03"` + REF04 string `json:"ref04,omitempty" xml:"REF04"` + REF05 string `json:"ref05,omitempty" xml:"REF05"` + REF06 string `json:"ref06,omitempty" xml:"REF06"` + REF07 string `json:"ref07,omitempty" xml:"REF07"` + REF08 string `json:"ref08,omitempty" xml:"REF08"` + REF09 string `json:"ref09,omitempty" xml:"REF09"` + REF10 string `json:"ref10,omitempty" xml:"REF10"` + REF11 string `json:"ref11,omitempty" xml:"REF11"` + REF12 string `json:"ref12,omitempty" xml:"REF12"` + REF13 string `json:"ref13,omitempty" xml:"REF13"` + REF14 string `json:"ref14,omitempty" xml:"REF14"` + REF15 string `json:"ref15,omitempty" xml:"REF15"` + REF16 string `json:"ref16,omitempty" xml:"REF16"` +} + +type N3 struct { + N301 string `json:"n301,omitempty" xml:"N301"` + N302 string `json:"n302,omitempty" xml:"N302"` + N303 string `json:"n303,omitempty" xml:"N303"` + N304 string `json:"n304,omitempty" xml:"N304"` + N305 string `json:"n305,omitempty" xml:"N305"` + N306 string `json:"n306,omitempty" xml:"N306"` + N307 string `json:"n307,omitempty" xml:"N307"` + N308 string `json:"n308,omitempty" xml:"N308"` + N309 string `json:"n309,omitempty" xml:"N309"` + N310 string `json:"n310,omitempty" xml:"N310"` + N311 string `json:"n311,omitempty" xml:"N311"` + N312 string `json:"n312,omitempty" xml:"N312"` + N313 string `json:"n313,omitempty" xml:"N313"` + N314 string `json:"n314,omitempty" xml:"N314"` + N315 string `json:"n315,omitempty" xml:"N315"` + N316 string `json:"n316,omitempty" xml:"N316"` +} + +type N4 struct { + N401 string `json:"n401,omitempty" xml:"N401"` + N402 string `json:"n402,omitempty" xml:"N402"` + N403 string `json:"n403,omitempty" xml:"N403"` + N404 string `json:"n404,omitempty" xml:"N404"` + N405 string `json:"n405,omitempty" xml:"N405"` + N406 string `json:"n406,omitempty" xml:"N406"` + N407 string `json:"n407,omitempty" xml:"N407"` + N408 string `json:"n408,omitempty" xml:"N408"` + N409 string `json:"n409,omitempty" xml:"N409"` + N410 string `json:"n410,omitempty" xml:"N410"` + N411 string `json:"n411,omitempty" xml:"N411"` + N412 string `json:"n412,omitempty" xml:"N412"` + N413 string `json:"n413,omitempty" xml:"N413"` + N414 string `json:"n414,omitempty" xml:"N414"` + N415 string `json:"n415,omitempty" xml:"N415"` + N416 string `json:"n416,omitempty" xml:"N416"` +} + +type LoopNM10920 struct { + NM1_0920 NM1 `json:"nm1_0920,omitempty" xml:"NM1_0920"` + REF_0930 []REF `json:"ref_0930,omitempty" xml:"REF_0930"` + N3_0950 N3 `json:"n3_0950,omitempty" xml:"N3_0950"` + N4_0960 N4 `json:"n4_0960,omitempty" xml:"N4_0960"` + DMG_1000 DMG `json:"dmg_1000,omitempty" xml:"DMG_1000"` + INS_1010 INS `json:"ins_1010,omitempty" xml:"INS_1010"` +} + +type DMG struct { + DMG01 string `json:"dmg01,omitempty" xml:"DMG01"` + DMG02 string `json:"dmg02,omitempty" xml:"DMG02"` + DMG03 string `json:"dmg03,omitempty" xml:"DMG03"` + DMG04 string `json:"dmg04,omitempty" xml:"DMG04"` + DMG05 string `json:"dmg05,omitempty" xml:"DMG05"` + DMG06 string `json:"dmg06,omitempty" xml:"DMG06"` + DMG07 string `json:"dmg07,omitempty" xml:"DMG07"` + DMG08 string `json:"dmg08,omitempty" xml:"DMG08"` + DMG09 string `json:"dmg09,omitempty" xml:"DMG09"` + DMG10 string `json:"dmg10,omitempty" xml:"DMG10"` + DMG11 string `json:"dmg11,omitempty" xml:"DMG11"` + DMG12 string `json:"dmg12,omitempty" xml:"DMG12"` + DMG13 string `json:"dmg13,omitempty" xml:"DMG13"` + DMG14 string `json:"dmg14,omitempty" xml:"DMG14"` + DMG15 string `json:"dmg15,omitempty" xml:"DMG15"` + DMG16 string `json:"dmg16,omitempty" xml:"DMG16"` +} + +type INS struct { + INS01 string `json:"ins01,omitempty" xml:"INS01"` + INS02 string `json:"ins02,omitempty" xml:"INS02"` + INS03 string `json:"ins03,omitempty" xml:"INS03"` + INS04 string `json:"ins04,omitempty" xml:"INS04"` + INS05 string `json:"ins05,omitempty" xml:"INS05"` + INS06 string `json:"ins06,omitempty" xml:"INS06"` + INS07 string `json:"ins07,omitempty" xml:"INS07"` + INS08 string `json:"ins08,omitempty" xml:"INS08"` + INS09 string `json:"ins09,omitempty" xml:"INS09"` + INS10 string `json:"ins10,omitempty" xml:"INS10"` + INS11 string `json:"ins11,omitempty" xml:"INS11"` + INS12 string `json:"ins12,omitempty" xml:"INS12"` + INS13 string `json:"ins13,omitempty" xml:"INS13"` + INS14 string `json:"ins14,omitempty" xml:"INS14"` + INS15 string `json:"ins15,omitempty" xml:"INS15"` + INS16 string `json:"ins16,omitempty" xml:"INS16"` +} + +type TRN struct { + TRN01 string `json:"trn01,omitempty" xml:"TRN01"` + TRN02 string `json:"trn02,omitempty" xml:"TRN02"` + TRN03 string `json:"trn03,omitempty" xml:"TRN03"` + TRN04 string `json:"trn04,omitempty" xml:"TRN04"` + TRN05 string `json:"trn05,omitempty" xml:"TRN05"` + TRN06 string `json:"trn06,omitempty" xml:"TRN06"` + TRN07 string `json:"trn07,omitempty" xml:"TRN07"` + TRN08 string `json:"trn08,omitempty" xml:"TRN08"` + TRN09 string `json:"trn09,omitempty" xml:"TRN09"` + TRN10 string `json:"trn10,omitempty" xml:"TRN10"` + TRN11 string `json:"trn11,omitempty" xml:"TRN11"` + TRN12 string `json:"trn12,omitempty" xml:"TRN12"` + TRN13 string `json:"trn13,omitempty" xml:"TRN13"` + TRN14 string `json:"trn14,omitempty" xml:"TRN14"` + TRN15 string `json:"trn15,omitempty" xml:"TRN15"` + TRN16 string `json:"trn16,omitempty" xml:"TRN16"` +} + +type HL struct { + HL01 string `json:"hl01,omitempty" xml:"HL01"` + HL02 string `json:"hl02,omitempty" xml:"HL02"` + HL03 string `json:"hl03,omitempty" xml:"HL03"` + HL04 string `json:"hl04,omitempty" xml:"HL04"` + HL05 string `json:"hl05,omitempty" xml:"HL05"` + HL06 string `json:"hl06,omitempty" xml:"HL06"` + HL07 string `json:"hl07,omitempty" xml:"HL07"` + HL08 string `json:"hl08,omitempty" xml:"HL08"` + HL09 string `json:"hl09,omitempty" xml:"HL09"` + HL10 string `json:"hl10,omitempty" xml:"HL10"` + HL11 string `json:"hl11,omitempty" xml:"HL11"` + HL12 string `json:"hl12,omitempty" xml:"HL12"` + HL13 string `json:"hl13,omitempty" xml:"HL13"` + HL14 string `json:"hl14,omitempty" xml:"HL14"` + HL15 string `json:"hl15,omitempty" xml:"HL15"` + HL16 string `json:"hl16,omitempty" xml:"HL16"` +} + +type LoopNM10060 struct { + NM10060 NM1 `json:"nm1_0060,omitempty" xml:"NM1_0060"` +} + +type NM1 struct { + NM101 string `json:"nm101,omitempty" xml:"NM101"` + NM102 string `json:"nm102,omitempty" xml:"NM102"` + NM103 string `json:"nm103,omitempty" xml:"NM103"` + NM104 string `json:"nm104,omitempty" xml:"NM104"` + NM105 string `json:"nm105,omitempty" xml:"NM105"` + NM106 string `json:"nm106,omitempty" xml:"NM106"` + NM107 string `json:"nm107,omitempty" xml:"NM107"` + NM108 string `json:"nm108,omitempty" xml:"NM108"` + NM109 string `json:"nm109,omitempty" xml:"NM109"` + NM110 string `json:"nm110,omitempty" xml:"NM110"` + NM111 string `json:"nm111,omitempty" xml:"NM111"` + NM112 string `json:"nm112,omitempty" xml:"NM112"` + NM113 string `json:"nm113,omitempty" xml:"NM113"` + NM114 string `json:"nm114,omitempty" xml:"NM114"` + NM115 string `json:"nm115,omitempty" xml:"NM115"` + NM116 string `json:"nm116,omitempty" xml:"NM116"` +} diff --git a/config.dev.toml b/config.dev.toml index 522d299..c431538 100644 --- a/config.dev.toml +++ b/config.dev.toml @@ -74,8 +74,8 @@ user-uuid = "11a49fa4-fbc7-4fe9-87fe-52a5bc3b71f8" [bxe] url = "https://api-pve.bcbs.com/BXDirectConnect/V30" -key = "dacg7jtsmb6ajr3z553jbczg" -secret = "vFhNeWE8JdJpbDZQtcm6AHjX" +key = "c63z7gv9a5qz2zgx7zcm3253" +secret = "hK4Yc9jtBrxaZTr4UU2VsfX9" [blue365] url = "https://api-cloud.bcbs.com/blue365deals-stg/v1/validatePrefix/" diff --git a/config.stg.toml b/config.stg.toml index 6375f45..4ca8fb6 100644 --- a/config.stg.toml +++ b/config.stg.toml @@ -74,8 +74,8 @@ user-uuid = "11a49fa4-fbc7-4fe9-87fe-52a5bc3b71f8" [bxe] url = "https://api-pve.bcbs.com/BXDirectConnect/V30" -key = "dacg7jtsmb6ajr3z553jbczg" -secret = "vFhNeWE8JdJpbDZQtcm6AHjX" +key = "c63z7gv9a5qz2zgx7zcm3253" +secret = "hK4Yc9jtBrxaZTr4UU2VsfX9" [blue365] url = "https://api-cloud.bcbs.com/blue365deals-stg/v1/validatePrefix/" diff --git a/returnExample.xml b/returnExample.xml new file mode 100644 index 0000000..038863d --- /dev/null +++ b/returnExample.xml @@ -0,0 +1,1602 @@ + + + + 00 + + 00 + + ZZ + 993 + ZZ + 994 + 180514 + 1943 + ^ + 00501 + 003042910 + 0 + T + { + + + + HB + RITSA + RBXMO + 20180514 + 1943441 + 3042910 + X + 005010X279A1 + + + + 271 + 0001 + 005010X279A1 + + + 0022 + 11 + 123456701 + 20180514 + 1943438 + + + + 1 + 20 + 1 + + + + PR + 2 + blue_cross_blue_shield_il + PI + 621 + + + + + 2 + 1 + 21 + 1 + + + + 2B + 2 + BCBS MOP + SV + 1699849786XXXXXXXXX994X + + + + + 3 + 2 + 22 + 0 + + + 2 + 123456701 + 994BXMO + + + + IL + 1 + WULKOWICZ + JASON + R + MI + QMF921053892 + + + Q4 + BCB921053892 + + + 6P + IB1804 + + + 704 S EAST AVE + + + OAK PARK + IL + 60304 + + + D8 + 19640927 + M + + + Y + 18 + 001 + 25 + + + 291 + RD8 + 20180101-99991231 + + + 343 + D8 + 20180131 + + + + 1 + 30 + Blue Choice Preferred + + + + + D + 33 + + + THE FOLLOWING MUSCLE MANIPULATION MAXIMUM MAY BE COMBINED WITH OTHER THERAPY SERVICES. + + + + + 1 + 1 + AL + 88 + MH + W + + + + + U + 47 + 48 + U + W + + + INPATIENT FACILITY STAYS REQUIRE PREAUTHORIZATION + + + + ZZ + 21 + + + + + + U + 47 + 48 + U + W + + + 2120 + + + + X3 + 2 + CUSTOMER SERVICE + + + IC + TE + 8009728088 + + + + 2120 + + + + + A + IND + 47 + 48 + 23 + .4 + U + Y + + + DAILY ROOM AND BOARD + + + + + B + IND + 47 + 48 + 36 + 850 + U + Y + + + DAILY ROOM AND BOARD + + + EXCLUDED PROVIDER TYPES - 0Q,SF,0T,0D,0W,0O + + + + + C + IND + 30 + 23 + 2850 + U + Y + + + DAILY ROOM AND BOARD;EMERGENCY ACCIDENT CARE - PROFESSIONAL;EMERGENCY ACCIDENT OFFICE VISIT - PROFESSIONAL;EMERGENCY MEDICAL CARE - PROFESSIONAL;EMERGENCY MEDICAL OFFICE VISIT - PROFESSIONAL;EMERGENCY ROOM INSTITUTIONAL;EMERGENCY ROOM SERVICES + + + (NON-EMERGENCY) - INSTITUTIONAL;URGENT CARE INSTITUTIONAL;MUSCLE MANIPULATION - PROFESSIONAL;OFFICE VISIT - PROFESSIONAL;SPECIAL MEDICAL VISITS - INSTITUTIONAL + + + + + C + FAM + 30 + 23 + 8550 + U + Y + + + DAILY ROOM AND BOARD;EMERGENCY ACCIDENT CARE - PROFESSIONAL;EMERGENCY ACCIDENT OFFICE VISIT - PROFESSIONAL;EMERGENCY MEDICAL CARE - PROFESSIONAL;EMERGENCY MEDICAL OFFICE VISIT - PROFESSIONAL;EMERGENCY ROOM INSTITUTIONAL;EMERGENCY ROOM SERVICES + + + (NON-EMERGENCY) - INSTITUTIONAL;URGENT CARE INSTITUTIONAL;MUSCLE MANIPULATION - PROFESSIONAL;OFFICE VISIT - PROFESSIONAL;SPECIAL MEDICAL VISITS - INSTITUTIONAL + + + + + G + FAM + 30 + 23 + 13100 + U + Y + + + DAILY ROOM AND BOARD;EMERGENCY ACCIDENT CARE - PROFESSIONAL;EMERGENCY ACCIDENT OFFICE VISIT - PROFESSIONAL;EMERGENCY MEDICAL CARE - PROFESSIONAL;EMERGENCY MEDICAL OFFICE VISIT - PROFESSIONAL;EMERGENCY ROOM INSTITUTIONAL;EMERGENCY ROOM SERVICES + + + (NON-EMERGENCY) - INSTITUTIONAL;URGENT CARE INSTITUTIONAL;MUSCLE MANIPULATION - PROFESSIONAL;OFFICE VISIT - PROFESSIONAL;SPECIAL MEDICAL VISITS - INSTITUTIONAL + + + + + G + IND + 30 + 23 + 6550 + U + Y + + + DAILY ROOM AND BOARD;EMERGENCY ACCIDENT CARE - PROFESSIONAL;EMERGENCY ACCIDENT OFFICE VISIT - PROFESSIONAL;EMERGENCY MEDICAL CARE - PROFESSIONAL;EMERGENCY MEDICAL OFFICE VISIT - PROFESSIONAL;EMERGENCY ROOM INSTITUTIONAL;EMERGENCY ROOM SERVICES + + + (NON-EMERGENCY) - INSTITUTIONAL;URGENT CARE INSTITUTIONAL;MUSCLE MANIPULATION - PROFESSIONAL;OFFICE VISIT - PROFESSIONAL;SPECIAL MEDICAL VISITS - INSTITUTIONAL + + + + + J + IND + 47 + 48 + 36 + 0 + U + Y + + + DAILY ROOM AND BOARD + + + PENALTY WILL BE THE LESSER OF 50% OF ALLOWED AMOUNT OR $1000 + + + + + A + IND + 51 + 23 + .4 + U + W + + + EMERGENCY ACCIDENT CARE - PROFESSIONAL;EMERGENCY ROOM INSTITUTIONAL;URGENT CARE INSTITUTIONAL + + + + + A + IND + UC + 23 + .4 + U + W + + + EMERGENCY ACCIDENT OFFICE VISIT - PROFESSIONAL;EMERGENCY MEDICAL OFFICE VISIT - PROFESSIONAL + + + + + A + IND + 52 + 23 + .4 + U + W + + + EMERGENCY MEDICAL CARE - PROFESSIONAL + + + + + A + IND + 86 + 23 + .4 + U + Y + + + EMERGENCY ROOM SERVICES (NON-EMERGENCY) - INSTITUTIONAL + + + + + B + IND + 86 + 27 + 1000 + U + Y + + + EMERGENCY ROOM SERVICES (NON-EMERGENCY) - INSTITUTIONAL + + + + + A + IND + 33 + 23 + .4 + U + Y + + + MUSCLE MANIPULATION - PROFESSIONAL + + + + + F + IND + 33 + 23 + P6 + 15 + U + W + + + MUSCLE MANIPULATION - PROFESSIONAL + + + 15 VISITS PER 1 YEAR CALENDAR BEGIN FOR ALL PLACES OF TRTMNT. THIS IS AN INDIVIDUAL BENEFIT MAXIMUM. + + + INCLUDED PROVIDER TYPES - BY,B0 + + + + + F + IND + 33 + 23 + P6 + 25 + U + W + + + MUSCLE MANIPULATION - PROFESSIONAL + + + 25 VISITS PER 1 YEAR CALENDAR BEGIN FOR ALL PLACES OF TRTMNT. THIS IS AN INDIVIDUAL BENEFIT MAXIMUM. + + + EXCLUDED PROVIDER TYPES - BY,B0 + + + + + A + IND + 98 + 23 + .4 + U + Y + + + OFFICE VISIT - PROFESSIONAL + + + + + F + IND + 98 + 23 + P6 + 15 + U + W + + + OFFICE VISIT - PROFESSIONAL + + + 15 VISITS PER 1 YEAR CALENDAR BEGIN FOR ALL PLACES OF TRTMNT. THIS IS AN INDIVIDUAL BENEFIT MAXIMUM. + + + INCLUDED PROVIDER TYPES - BY,B0 + + + + + A + IND + BZ + 27 + 0 + U + Y + + + PHYSICAL HISTORY - PROFESSIONAL + + + + + F + IND + BZ + 23 + P6 + 15 + U + W + + + PHYSICAL HISTORY - PROFESSIONAL + + + 15 VISITS PER 1 YEAR CALENDAR BEGIN FOR ALL PLACES OF TRTMNT. THIS IS AN INDIVIDUAL BENEFIT MAXIMUM. + + + INCLUDED PROVIDER TYPES - BY,B0 + + + + + A + IND + 47 + 50 + 23 + .4 + U + Y + + + SPECIAL MEDICAL VISITS - INSTITUTIONAL + + + + + A + IND + 47 + 48 + 23 + .5 + U + N + + + DAILY ROOM AND BOARD + + + 50% COVERAGE PAYMENT LEVEL OF ALLOWED AMOUNT FOR ALL PLACES OF TRTMNT. APPLIES TO ALL CONDITIONS. PATIENT MAY BE RESP FOR AMT OVER THE ALLOWED AMT. + + + EXCLUDED PROVIDER TYPES - 0Q,0T,0U,0V,0N + + + + + A + IND + 47 + 48 + 23 + .5 + U + N + + + DAILY ROOM AND BOARD + + + SPECIALIST - 50% COVERAGE PAYMENT LEVEL OF ALLOWED AMOUNT FOR ALL PLACES OF TRTMNT. EXCLUDED CONDITION(S) ALCOHOLISM DIAGNOSIS/DRUG ADDICTION DIAGNOSIS/MENTAL DIAGNOSIS/NON-SERIOUS MENTAL ILLNESS. /PERVASIVE DEVELOPMENTAL DISORDERS/SERIOUS MENTAL ILLNESS + + + INCLUDED PROVIDER TYPES - 0Q,0T,0U,0V,0N + + + + + B + IND + 47 + 48 + 36 + 1500 + U + N + + + DAILY ROOM AND BOARD + + + + + C + IND + 47 + 48 + 23 + 15000 + U + N + + + DAILY ROOM AND BOARD + + + + + C + FAM + 47 + 48 + 23 + 45000 + U + N + + + DAILY ROOM AND BOARD + + + + + J + IND + 47 + 48 + 36 + 500 + U + N + + + DAILY ROOM AND BOARD + + + PER ADMISSION PENALTY WILL BE $500. + + + + + C + IND + 51 + 23 + 2850 + U + N + + + EMERGENCY ACCIDENT CARE - PROFESSIONAL;EMERGENCY ROOM INSTITUTIONAL;URGENT CARE INSTITUTIONAL + + + + + C + FAM + 51 + 23 + 8550 + U + N + + + EMERGENCY ACCIDENT CARE - PROFESSIONAL;EMERGENCY ROOM INSTITUTIONAL;URGENT CARE INSTITUTIONAL + + + + + G + FAM + 51 + 23 + 13100 + U + N + + + EMERGENCY ACCIDENT CARE - PROFESSIONAL;EMERGENCY ROOM INSTITUTIONAL;URGENT CARE INSTITUTIONAL + + + + + G + IND + 51 + 23 + 6550 + U + N + + + EMERGENCY ACCIDENT CARE - PROFESSIONAL;EMERGENCY ROOM INSTITUTIONAL;URGENT CARE INSTITUTIONAL + + + + + C + IND + UC + 23 + 2850 + U + N + + + EMERGENCY ACCIDENT OFFICE VISIT - PROFESSIONAL;EMERGENCY MEDICAL OFFICE VISIT - PROFESSIONAL + + + + + C + FAM + UC + 23 + 8550 + U + N + + + EMERGENCY ACCIDENT OFFICE VISIT - PROFESSIONAL;EMERGENCY MEDICAL OFFICE VISIT - PROFESSIONAL + + + + + G + FAM + UC + 23 + 13100 + U + N + + + EMERGENCY ACCIDENT OFFICE VISIT - PROFESSIONAL;EMERGENCY MEDICAL OFFICE VISIT - PROFESSIONAL + + + + + G + IND + UC + 23 + 6550 + U + N + + + EMERGENCY ACCIDENT OFFICE VISIT - PROFESSIONAL;EMERGENCY MEDICAL OFFICE VISIT - PROFESSIONAL + + + + + C + IND + 52 + 23 + 2850 + U + N + + + EMERGENCY MEDICAL CARE - PROFESSIONAL + + + + + C + FAM + 52 + 23 + 8550 + U + N + + + EMERGENCY MEDICAL CARE - PROFESSIONAL + + + + + G + FAM + 52 + 23 + 13100 + U + N + + + EMERGENCY MEDICAL CARE - PROFESSIONAL + + + + + G + IND + 52 + 23 + 6550 + U + N + + + EMERGENCY MEDICAL CARE - PROFESSIONAL + + + + + A + IND + 86 + 23 + .5 + U + N + + + EMERGENCY ROOM SERVICES (NON-EMERGENCY) - INSTITUTIONAL + + + 50% COVERAGE PAYMENT LEVEL OF ALLOWED AMOUNT FOR ALL PLACES OF TRTMNT. APPLIES TO ALL CONDITIONS. PATIENT MAY BE RESP FOR AMT OVER THE ALLOWED AMT. + + + EXCLUDED PROVIDER TYPES - 0Q,0T,0U,0V,0N + + + + + C + IND + 86 + 23 + 15000 + U + N + + + EMERGENCY ROOM SERVICES (NON-EMERGENCY) - INSTITUTIONAL + + + + + C + FAM + 86 + 23 + 45000 + U + N + + + EMERGENCY ROOM SERVICES (NON-EMERGENCY) - INSTITUTIONAL + + + + + A + IND + 33 + 23 + .5 + U + N + + + MUSCLE MANIPULATION - PROFESSIONAL + + + 50% COVERAGE PAYMENT LEVEL OF ALLOWED AMOUNT FOR ALL PLACES OF TRTMNT. APPLIES TO ALL CONDITIONS. PATIENT MAY BE RESP FOR AMT OVER THE ALLOWED AMT. + + + EXCLUDED PROVIDER TYPES - 0Q,0T,0U,0V,0N + + + + + C + IND + 33 + 23 + 15000 + U + N + + + MUSCLE MANIPULATION - PROFESSIONAL + + + + + C + FAM + 33 + 23 + 45000 + U + N + + + MUSCLE MANIPULATION - PROFESSIONAL + + + + + A + IND + 98 + 23 + .5 + U + N + + + OFFICE VISIT - PROFESSIONAL + + + 50% COVERAGE PAYMENT LEVEL OF ALLOWED AMOUNT FOR ALL PLACES OF TRTMNT. APPLIES TO ALL CONDITIONS. PATIENT MAY BE RESP FOR AMT OVER THE ALLOWED AMT. + + + EXCLUDED PROVIDER TYPES - 0Q,0T,0U,0V,0N + + + + + C + IND + 98 + 23 + 15000 + U + N + + + OFFICE VISIT - PROFESSIONAL + + + + + C + FAM + 98 + 23 + 45000 + U + N + + + OFFICE VISIT - PROFESSIONAL + + + + + A + IND + BZ + 23 + .5 + U + N + + + PHYSICAL HISTORY - PROFESSIONAL + + + 50% COVERAGE PAYMENT LEVEL OF ALLOWED AMOUNT FOR ALL PLACES OF TRTMNT. APPLIES TO ALL CONDITIONS. PATIENT MAY BE RESP FOR AMT OVER THE ALLOWED AMT. + + + EXCLUDED PROVIDER TYPES - 0Q,0T,0U,0V,0N + + + + + C + IND + BZ + 23 + 15000 + U + N + + + PHYSICAL HISTORY - PROFESSIONAL + + + + + C + FAM + BZ + 23 + 45000 + U + N + + + PHYSICAL HISTORY - PROFESSIONAL + + + + + A + IND + 47 + 50 + 23 + .5 + U + N + + + SPECIAL MEDICAL VISITS - INSTITUTIONAL + + + 50% COVERAGE PAYMENT LEVEL OF ALLOWED AMOUNT FOR ALL PLACES OF TRTMNT. APPLIES TO ALL CONDITIONS. PATIENT MAY BE RESP FOR AMT OVER THE ALLOWED AMT. + + + EXCLUDED PROVIDER TYPES - 0Q,0T,0U,0V,0N + + + + + A + IND + 47 + 50 + 23 + .5 + U + N + + + SPECIAL MEDICAL VISITS - INSTITUTIONAL + + + SPECIALIST - 50% COVERAGE PAYMENT LEVEL OF ALLOWED AMOUNT FOR ALL PLACES OF TRTMNT. EXCLUDED CONDITION(S) ALCOHOLISM DIAGNOSIS/DRUG ADDICTION DIAGNOSIS/MENTAL DIAGNOSIS/NON-SERIOUS MENTAL ILLNESS. /PERVASIVE DEVELOPMENTAL DISORDERS/SERIOUS MENTAL ILLNESS + + + INCLUDED PROVIDER TYPES - 0Q,0T,0U,0V,0N + + + + + C + IND + 47 + 50 + 23 + 15000 + U + N + + + SPECIAL MEDICAL VISITS - INSTITUTIONAL + + + + + C + FAM + 47 + 50 + 23 + 45000 + U + N + + + SPECIAL MEDICAL VISITS - INSTITUTIONAL + + + + + D + + + BENEFIT ABBREVIATIONS - 0Q=MEDICARE APPROVED ECF,SF=SKILLED NURSING,0T=MEDICARE APPROVED HOME HEALTH SERVICE (COORDINATED HOME CARE),0D=COORDINATED HOME CARE,0W=JOINT COMMISSION ON ACCREDITATION OF HOSPITALS (JCAH) APPROVED EXTENDED CARE FACILITY (ECF), + + + 0O=EXTENDED CARE/SKILLED NURSING FACILITY,BY=NAPRAPATH UNSOLICITEABLE,B0=NAPRAPATH UNSOLICITEABLE,0U=MEDICARE APPROVED FREESTANDING DIALYSIS CENTER,0V=ST LIC AMBUL SURGICTR,0N=NON-PLAN PROVIDER + + + + + C + IND + 30 + 29 + 2850 + U + Y + + + DAILY ROOM AND BOARD;EMERGENCY ACCIDENT CARE - PROFESSIONAL;EMERGENCY ACCIDENT OFFICE VISIT - PROFESSIONAL;EMERGENCY MEDICAL CARE - PROFESSIONAL;EMERGENCY MEDICAL OFFICE VISIT - PROFESSIONAL;EMERGENCY ROOM INSTITUTIONAL;EMERGENCY ROOM SERVICES + + + (NON-EMERGENCY) - INSTITUTIONAL;URGENT CARE INSTITUTIONAL;MUSCLE MANIPULATION - PROFESSIONAL;OFFICE VISIT - PROFESSIONAL;SPECIAL MEDICAL VISITS - INSTITUTIONAL + + + + + C + FAM + 30 + 29 + 8550 + U + Y + + + DAILY ROOM AND BOARD;EMERGENCY ACCIDENT CARE - PROFESSIONAL;EMERGENCY ACCIDENT OFFICE VISIT - PROFESSIONAL;EMERGENCY MEDICAL CARE - PROFESSIONAL;EMERGENCY MEDICAL OFFICE VISIT - PROFESSIONAL;EMERGENCY ROOM INSTITUTIONAL;EMERGENCY ROOM SERVICES + + + (NON-EMERGENCY) - INSTITUTIONAL;URGENT CARE INSTITUTIONAL;MUSCLE MANIPULATION - PROFESSIONAL;OFFICE VISIT - PROFESSIONAL;SPECIAL MEDICAL VISITS - INSTITUTIONAL + + + + + G + FAM + 30 + 29 + 13100 + U + Y + + + DAILY ROOM AND BOARD;EMERGENCY ACCIDENT CARE - PROFESSIONAL;EMERGENCY ACCIDENT OFFICE VISIT - PROFESSIONAL;EMERGENCY MEDICAL CARE - PROFESSIONAL;EMERGENCY MEDICAL OFFICE VISIT - PROFESSIONAL;EMERGENCY ROOM INSTITUTIONAL;EMERGENCY ROOM SERVICES + + + (NON-EMERGENCY) - INSTITUTIONAL;URGENT CARE INSTITUTIONAL;MUSCLE MANIPULATION - PROFESSIONAL;OFFICE VISIT - PROFESSIONAL;SPECIAL MEDICAL VISITS - INSTITUTIONAL + + + + + G + IND + 30 + 29 + 6550 + U + Y + + + DAILY ROOM AND BOARD;EMERGENCY ACCIDENT CARE - PROFESSIONAL;EMERGENCY ACCIDENT OFFICE VISIT - PROFESSIONAL;EMERGENCY MEDICAL CARE - PROFESSIONAL;EMERGENCY MEDICAL OFFICE VISIT - PROFESSIONAL;EMERGENCY ROOM INSTITUTIONAL;EMERGENCY ROOM SERVICES + + + (NON-EMERGENCY) - INSTITUTIONAL;URGENT CARE INSTITUTIONAL;MUSCLE MANIPULATION - PROFESSIONAL;OFFICE VISIT - PROFESSIONAL;SPECIAL MEDICAL VISITS - INSTITUTIONAL + + + + + F + IND + 33 + 29 + P6 + 15 + U + W + + + MUSCLE MANIPULATION - PROFESSIONAL + + + 15 VISITS PER 1 YEAR CALENDAR BEGIN FOR ALL PLACES OF TRTMNT. THIS IS AN INDIVIDUAL BENEFIT MAXIMUM. + + + INCLUDED PROVIDER TYPES - BY,B0 + + + + + F + IND + 33 + 29 + P6 + 25 + U + W + + + MUSCLE MANIPULATION - PROFESSIONAL + + + 25 VISITS PER 1 YEAR CALENDAR BEGIN FOR ALL PLACES OF TRTMNT. THIS IS AN INDIVIDUAL BENEFIT MAXIMUM. + + + EXCLUDED PROVIDER TYPES - BY,B0 + + + + + F + IND + 98 + 29 + P6 + 15 + U + W + + + OFFICE VISIT - PROFESSIONAL + + + 15 VISITS PER 1 YEAR CALENDAR BEGIN FOR ALL PLACES OF TRTMNT. THIS IS AN INDIVIDUAL BENEFIT MAXIMUM. + + + INCLUDED PROVIDER TYPES - BY,B0 + + + + + F + IND + BZ + 29 + P6 + 15 + U + W + + + PHYSICAL HISTORY - PROFESSIONAL + + + 15 VISITS PER 1 YEAR CALENDAR BEGIN FOR ALL PLACES OF TRTMNT. THIS IS AN INDIVIDUAL BENEFIT MAXIMUM. + + + INCLUDED PROVIDER TYPES - BY,B0 + + + + + C + IND + 47 + 48 + 29 + 15000 + U + N + + + DAILY ROOM AND BOARD + + + + + C + FAM + 47 + 48 + 29 + 45000 + U + N + + + DAILY ROOM AND BOARD + + + + + C + IND + 51 + 29 + 2850 + U + N + + + EMERGENCY ACCIDENT CARE - PROFESSIONAL;EMERGENCY ROOM INSTITUTIONAL;URGENT CARE INSTITUTIONAL + + + + + C + FAM + 51 + 29 + 8550 + U + N + + + EMERGENCY ACCIDENT CARE - PROFESSIONAL;EMERGENCY ROOM INSTITUTIONAL;URGENT CARE INSTITUTIONAL + + + + + G + FAM + 51 + 29 + 13100 + U + N + + + EMERGENCY ACCIDENT CARE - PROFESSIONAL;EMERGENCY ROOM INSTITUTIONAL;URGENT CARE INSTITUTIONAL + + + + + G + IND + 51 + 29 + 6550 + U + N + + + EMERGENCY ACCIDENT CARE - PROFESSIONAL;EMERGENCY ROOM INSTITUTIONAL;URGENT CARE INSTITUTIONAL + + + + + C + IND + UC + 29 + 2850 + U + N + + + EMERGENCY ACCIDENT OFFICE VISIT - PROFESSIONAL;EMERGENCY MEDICAL OFFICE VISIT - PROFESSIONAL + + + + + C + FAM + UC + 29 + 8550 + U + N + + + EMERGENCY ACCIDENT OFFICE VISIT - PROFESSIONAL;EMERGENCY MEDICAL OFFICE VISIT - PROFESSIONAL + + + + + G + FAM + UC + 29 + 13100 + U + N + + + EMERGENCY ACCIDENT OFFICE VISIT - PROFESSIONAL;EMERGENCY MEDICAL OFFICE VISIT - PROFESSIONAL + + + + + G + IND + UC + 29 + 6550 + U + N + + + EMERGENCY ACCIDENT OFFICE VISIT - PROFESSIONAL;EMERGENCY MEDICAL OFFICE VISIT - PROFESSIONAL + + + + + C + IND + 52 + 29 + 2850 + U + N + + + EMERGENCY MEDICAL CARE - PROFESSIONAL + + + + + C + FAM + 52 + 29 + 8550 + U + N + + + EMERGENCY MEDICAL CARE - PROFESSIONAL + + + + + G + FAM + 52 + 29 + 13100 + U + N + + + EMERGENCY MEDICAL CARE - PROFESSIONAL + + + + + G + IND + 52 + 29 + 6550 + U + N + + + EMERGENCY MEDICAL CARE - PROFESSIONAL + + + + + C + IND + 86 + 29 + 15000 + U + N + + + EMERGENCY ROOM SERVICES (NON-EMERGENCY) - INSTITUTIONAL + + + + + C + FAM + 86 + 29 + 45000 + U + N + + + EMERGENCY ROOM SERVICES (NON-EMERGENCY) - INSTITUTIONAL + + + + + C + IND + 33 + 29 + 15000 + U + N + + + MUSCLE MANIPULATION - PROFESSIONAL + + + + + C + FAM + 33 + 29 + 45000 + U + N + + + MUSCLE MANIPULATION - PROFESSIONAL + + + + + C + IND + 98 + 29 + 15000 + U + N + + + OFFICE VISIT - PROFESSIONAL + + + + + C + FAM + 98 + 29 + 45000 + U + N + + + OFFICE VISIT - PROFESSIONAL + + + + + C + IND + BZ + 29 + 15000 + U + N + + + PHYSICAL HISTORY - PROFESSIONAL + + + + + C + FAM + BZ + 29 + 45000 + U + N + + + PHYSICAL HISTORY - PROFESSIONAL + + + + + C + IND + 47 + 50 + 29 + 15000 + U + N + + + SPECIAL MEDICAL VISITS - INSTITUTIONAL + + + + + C + FAM + 47 + 50 + 29 + 45000 + U + N + + + SPECIAL MEDICAL VISITS - INSTITUTIONAL + + + + + P + + + UNLESS OTHERWISE REQUIRED BY STATE LAW, THIS NOTICE IS NOT A GUARANTEE OF PAYMENT. BENEFITS ARE SUBJECT TO ALL CONTRACT LIMITS AND THE MEMBER'S STATUS ON THE DATE OF SERVICE. ACCUMULATED AMOUNTS SUCH AS DEDUCTIBLE MAY CHANGE AS ADDITIONAL CLAIMS ARE PROCESSED. + + + + + + + + 250 + 0001 + + + + 1 + 3042910 + + + + 1 + 003042910 + + \ No newline at end of file diff --git a/server/authorization/organization.go b/server/authorization/organization.go index 07b0936..2923b89 100644 --- a/server/authorization/organization.go +++ b/server/authorization/organization.go @@ -20,6 +20,14 @@ func isSameOrganization(organizationA viewmodel.Organization, organizationB view } func grabOrgFromUser(user viewmodel.User) (viewmodel.Organization, error) { + if len(user.Profiles) < 1 { + return viewmodel.Organization{}, fmt.Errorf("User has no organizations %v", user) + } + + return user.Profiles[0].Organization, nil +} + +func grabOrgFromUserDirectly(user viewmodel.User) (viewmodel.Organization, error) { if len(user.Organizations) < 1 { return viewmodel.Organization{}, fmt.Errorf("User has no organizations %v", user) } diff --git a/server/authorization/user.go b/server/authorization/user.go index 6e23a4c..fac116f 100644 --- a/server/authorization/user.go +++ b/server/authorization/user.go @@ -21,7 +21,7 @@ func CanCreateUser(currentUser viewmodel.User, updatingUser viewmodel.User) bool return false } - updatingUserOrganization, err := grabOrgFromUser(updatingUser) + updatingUserOrganization, err := grabOrgFromUserDirectly(updatingUser) if err != nil { return false } diff --git a/server/router/eligibilityroute/controller.go b/server/router/eligibilityroute/controller.go index 0bf4c3a..4c439d8 100644 --- a/server/router/eligibilityroute/controller.go +++ b/server/router/eligibilityroute/controller.go @@ -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) + } } diff --git a/server/router/usersroute/controller.go b/server/router/usersroute/controller.go index 35543a9..06e8bb2 100644 --- a/server/router/usersroute/controller.go +++ b/server/router/usersroute/controller.go @@ -8,14 +8,18 @@ import ( "time" "bitbucket.org/nemt/nemt-portal-api/application/applicationservice" + "bitbucket.org/nemt/nemt-portal-api/application/third/eligibility/bcbsi" "bitbucket.org/nemt/nemt-portal-api/application/viewmodel" "bitbucket.org/nemt/nemt-portal-api/domain" "bitbucket.org/nemt/nemt-portal-api/infra/auth" "bitbucket.org/nemt/nemt-portal-api/infra/cache" "bitbucket.org/nemt/nemt-portal-api/infra/config" "bitbucket.org/nemt/nemt-portal-api/server/authorization" + "bitbucket.org/nemt/nemt-portal-api/server/validation" "bitbucket.org/nemt/nemt-portal-api/server/router/routeutils" "github.com/labstack/echo" + "golang.org/x/net/context" + "googlemaps.github.io/maps" ) var ( @@ -24,15 +28,17 @@ var ( ) type controller struct { - svc *applicationservice.Service - cfg *config.Config + svc *applicationservice.Service + cfg *config.Config + bcbsi *bcbsi.Service } func controllerInstance(svc *applicationservice.Service, cfg *config.Config) *controller { once.Do(func() { instance = &controller{ - svc: svc, - cfg: cfg, + svc: svc, + cfg: cfg, + bcbsi: bcbsi.New(cfg), } }) return instance @@ -381,6 +387,59 @@ func (c *controller) handleMember(ctx echo.Context) error { return routeutils.HandleAPIError(ctx, err) } + eligibility := viewmodel.Eligibility{} + eligibility.Provider.ProviderNPI = "1699849786" + eligibility.Provider.ProviderName = "LITHOLINK CORPORATION" + eligibility.TrackingID = user.ID + eligibility.Subscriber.SubscriberID = *user.Member + eligibility.Subscriber.PatientType = "S" + eligibility.Subscriber.Name.First = user.First + eligibility.Subscriber.Name.Last = user.Last + eligibility.Subscriber.DemographicInfo.DateOfBirth = *user.BirthDate + eligibility.Subscriber.DemographicInfo.Gender = *user.Gender + eligibility.ServiceInfo.DateOfService = time.Now() + eligibility.ServiceInfo.ServiceTypeCodes = []string{"30"} + + resp, err := c.bcbsi.BXE.Get271(eligibility) + if err != nil { + fmt.Println("Eligibility Not Found or Error: ", err.Error()) + } else { + address := viewmodel.Address{} + 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 + + address.AddressTypeName = "Home" + address.AddressType = "home" + address.Name = fmt.Sprintf("%s, %s", header.N301, body.N401) + address.Address = fmt.Sprintf("%s, %s", header.N301, body.N401) + address.CreatedUserUUID = authUser.ID + address.User = user + + googleMapsAPI, err := maps.NewClient(maps.WithClientIDAndSignature("gme-bluecrossandblue1", "msqgD-jdqCyR0M_1u5C1HION5iI=")) + if err != nil { + fmt.Println("Error to instantiate googles api: ", err.Error()) + } + + r := &maps.GeocodingRequest{ + Address: address.Address + " " + body.N402 + ", " + body.N403, + } + + result, err := googleMapsAPI.Geocode(context.Background(), r) + if err != nil { + fmt.Println("Error to instantiate googles api: ", err.Error()) + } + + if len(result) > 0 { + address.Latitude = result[0].Geometry.Location.Lat + address.Longitude = result[0].Geometry.Location.Lng + + _, err := c.svc.Users.SaveAddress(address) + if err != nil { + fmt.Println("Error to save address: ", err.Error()) + } + } + } + return routeutils.ResponseAPIOK(ctx, user) } @@ -472,6 +531,10 @@ func (c *controller) handlePortal(ctx echo.Context) error { } user.Pass = string(pass) + if passwordValidationErrors := validation.ValidatePassword(&user) ; len(passwordValidationErrors) > 0 { + return routeutils.ResponseAPICustomValidationError(ctx, "Password not strong enough", passwordValidationErrors) + } + if len(user.Name) == 0 && len(user.First) == 0 && len(user.Last) == 0 { return routeutils.ResponseAPIAuthError(ctx, "name is required", false) } diff --git a/server/validation/user.go b/server/validation/user.go new file mode 100644 index 0000000..1576e23 --- /dev/null +++ b/server/validation/user.go @@ -0,0 +1,67 @@ +package validation + +import ( + + "strings" + + "bitbucket.org/nemt/nemt-portal-api/application/viewmodel" + "bitbucket.org/nemt/nemt-portal-api/infra/errors" + +) + +func characterIsUpperCase(character rune) bool { + return (character >= 65) && (character <= 90) +} + +func characterIsLowerCase(character rune) bool { + return (character >= 97) && (character <= 122) +} + +func characterIsNumber(character rune) bool { + return (character >= 48) && (character <= 57) +} + +func ValidatePassword(user *viewmodel.User) []errors.ValidationError { + var result []errors.ValidationError + + userOrganizationName := "" + if len(user.Organizations) > 0{ + userOrganizationName = user.Organizations[0].Name + } + + if (len(user.Pass) < 8) { + result = append(result, errors.ValidationError{Field : "password", Message : "Password must be at least 8 characters."}) + } + + if (strings.Contains(user.Pass, user.First)){ + result = append(result, errors.ValidationError{Field : "password", Message : "Password cannot include your First Name."}) + } + + if (strings.Contains(user.Pass, user.Last)){ + result = append(result, errors.ValidationError{Field : "password", Message : "Password cannot include your Last Name."}) + } + + if (strings.Contains(user.Pass, userOrganizationName)){ + result = append(result, errors.ValidationError{Field : "password", Message : "Password cannot include your Organization Name."}) + } + + containsUpperCaseLetter := false; + containsLowerCaseLetter := false; + containsNumber := false; + + for _, character := range user.Pass { + containsUpperCaseLetter = containsUpperCaseLetter || characterIsUpperCase(character) + containsLowerCaseLetter = containsLowerCaseLetter || characterIsLowerCase(character) + containsNumber = containsNumber || characterIsNumber(character) + } + + if !containsUpperCaseLetter || !containsLowerCaseLetter || !containsNumber { + result = append(result, errors.ValidationError{Field : "password", Message : "Password must contain one of EACH :"}) + result = append(result, errors.ValidationError{Field : "password-tab", Message : "an uppercase letter"}) + result = append(result, errors.ValidationError{Field : "password-tab", Message : "a lowercase letter"}) + result = append(result, errors.ValidationError{Field : "password-tab", Message : "a number"}) + } + + + return result +} \ No newline at end of file