Skip to content

Commit

Permalink
adding unitedhealthcare prod configuration.
Browse files Browse the repository at this point in the history
  • Loading branch information
AnalogJ committed Nov 14, 2023
1 parent cef7c11 commit e5dbe60
Show file tree
Hide file tree
Showing 10 changed files with 206 additions and 32 deletions.
4 changes: 4 additions & 0 deletions SOURCE_LIST.md
Original file line number Diff line number Diff line change
Expand Up @@ -27723,3 +27723,7 @@ and may change frequently.
| ZZZ DO NOT USE HILO HI | `zzz-do-not-use-hilo-hi` | eclinicalworks | <img height="50" src="https://raw.githubusercontent.com/fastenhealth/fasten-onprem/main/frontend/src/assets/sources/zzz-do-not-use-hilo-hi.png" /> |
| zzzDeleteSeattle DispatchHealth | `zzzdeleteseattle-dispatchhealth` | athena | <img height="50" src="https://raw.githubusercontent.com/fastenhealth/fasten-onprem/main/frontend/src/assets/sources/zzzdeleteseattle-dispatchhealth.png" /> |
| Blue Cross Blue Shield Alabama | `bcbsal` | | <img height="50" src="https://raw.githubusercontent.com/fastenhealth/fasten-onprem/main/frontend/src/assets/sources/bcbsal.png" /> |
| Peoples Health | `peopleshealth` | unitedhealthcare | <img height="50" src="https://raw.githubusercontent.com/fastenhealth/fasten-onprem/main/frontend/src/assets/sources/peopleshealth.png" /> |
| Rocky Mountain Health Plans | `rockymountainhealthplans` | unitedhealthcare | <img height="50" src="https://raw.githubusercontent.com/fastenhealth/fasten-onprem/main/frontend/src/assets/sources/rockymountainhealthplans.png" /> |
| Sierra Health and Life | `sierrahealthandlife` | unitedhealthcare | <img height="50" src="https://raw.githubusercontent.com/fastenhealth/fasten-onprem/main/frontend/src/assets/sources/sierrahealthandlife.png" /> |
| United Healthcare | `unitedhealthcare` | unitedhealthcare-sandbox | <img height="50" src="https://raw.githubusercontent.com/fastenhealth/fasten-onprem/main/frontend/src/assets/sources/unitedhealthcare.png" /> |
6 changes: 4 additions & 2 deletions clients/factory/factory.go

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,25 @@ import (
"net/http"
)

type sourceClientUnitedhealthcare struct {
type sourceClientUnitedhealthcareSandbox struct {
models.SourceClient
}

// https://sandbox.fhir.flex.optum.com/R4/.well-known/smart-configuration
// https://sandbox.fhir.flex.optum.com/R4/metadata
// https://www.uhc.com/legal/interoperability-apis
func GetSourceClientUnitedhealthcare(env pkg.FastenLighthouseEnvType, ctx context.Context, globalLogger logrus.FieldLogger, sourceCreds models.SourceCredential, testHttpClient ...*http.Client) (models.SourceClient, error) {
func GetSourceClientUnitedhealthcareSandbox(env pkg.FastenLighthouseEnvType, ctx context.Context, globalLogger logrus.FieldLogger, sourceCreds models.SourceCredential, testHttpClient ...*http.Client) (models.SourceClient, error) {
baseClient, err := base.GetSourceClientFHIR401(env, ctx, globalLogger, sourceCreds, testHttpClient...)
if err != nil {
return nil, err
}

return sourceClientUnitedhealthcare{baseClient}, err
return sourceClientUnitedhealthcareSandbox{baseClient}, err
}

// Operation-PatientEverything is not supported - https://build.fhir.org/operation-patient-everything.html
// Manually processing individual resources
func (c sourceClientUnitedhealthcare) SyncAll(db models.DatabaseRepository) (models.UpsertSummary, error) {
func (c sourceClientUnitedhealthcareSandbox) SyncAll(db models.DatabaseRepository) (models.UpsertSummary, error) {
supportedResources := append(c.GetUsCoreResources(), []string{"MedicationDispense"}...)
return c.SyncAllByResourceName(db, supportedResources)
}
16 changes: 12 additions & 4 deletions definitions/factory/factory.go

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
// https://sandbox.fhir.flex.optum.com/R4/.well-known/smart-configuration
// https://sandbox.fhir.flex.optum.com/R4/metadata
// https://www.uhc.com/legal/interoperability-apis
func GetSourceUnitedhealthcare(env pkg.FastenLighthouseEnvType, clientIdLookup map[pkg.SourceType]string) (models.LighthouseSourceDefinition, error) {
func GetSourceUnitedhealthcareSandbox(env pkg.FastenLighthouseEnvType, clientIdLookup map[pkg.SourceType]string) (models.LighthouseSourceDefinition, error) {
sourceDef := models.LighthouseSourceDefinition{}
sourceDef.AuthorizationEndpoint = "https://sandbox.authz.flex.optum.com/oauth/authorize"
sourceDef.TokenEndpoint = "https://sandbox.authz.flex.optum.com/oauth/token"
Expand All @@ -30,14 +30,14 @@ func GetSourceUnitedhealthcare(env pkg.FastenLighthouseEnvType, clientIdLookup m

sourceDef.ApiEndpointBaseUrl = "https://sandbox.fhir.flex.optum.com/R4"
// retrieve client-id, if available
if clientId, clientIdOk := clientIdLookup[pkg.SourceTypeUnitedhealthcare]; clientIdOk {
if clientId, clientIdOk := clientIdLookup[pkg.SourceTypeUnitedhealthcareSandbox]; clientIdOk {
sourceDef.ClientId = clientId
}
sourceDef.RedirectUri = pkg.GetCallbackEndpoint(string(pkg.SourceTypeUnitedhealthcare))
sourceDef.RedirectUri = pkg.GetCallbackEndpoint(string(pkg.SourceTypeUnitedhealthcareSandbox))

sourceDef.Display = "United Healthcare"
sourceDef.PlatformType = pkg.SourceTypeUnitedhealthcare
sourceDef.SourceType = pkg.SourceTypeUnitedhealthcare
sourceDef.Display = "United Healthcare (Sandbox)"
sourceDef.PlatformType = pkg.SourceTypeUnitedhealthcareSandbox
sourceDef.SourceType = pkg.SourceTypeUnitedhealthcareSandbox
sourceDef.Category = []string{"Insurance"}
sourceDef.Aliases = []string{}
sourceDef.PatientAccessUrl = "https://www.uhc.com"
Expand Down
39 changes: 39 additions & 0 deletions definitions/internal/source/peopleshealth.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
// Copyright (C) Fasten Health, Inc. - All Rights Reserved.
//
// THIS FILE IS GENERATED BY https://github.com/fastenhealth/fasten-sources-gen
// PLEASE DO NOT EDIT BY HAND

package source

import (
models "github.com/fastenhealth/fasten-sources/definitions/models"
pkg "github.com/fastenhealth/fasten-sources/pkg"
)

// https://healthx.fhir.flex.optum.com/R4/.well-known/smart-configuration
// https://healthx.fhir.flex.optum.com/R4/metadata
func GetSourcePeopleshealth(env pkg.FastenLighthouseEnvType, clientIdLookup map[pkg.SourceType]string) (models.LighthouseSourceDefinition, error) {
sourceDef, err := GetSourceUnitedhealthcare(env, clientIdLookup)
sourceDef.AuthorizationEndpoint = "https://healthx.authz.flex.optum.com/oauth/authorize"
sourceDef.TokenEndpoint = "https://healthx.authz.flex.optum.com/oauth/token"
sourceDef.IntrospectionEndpoint = "https://healthx.authz.flex.optum.com/.well-known/jwks.json"
sourceDef.UserInfoEndpoint = "https://healthx.authz.flex.optum.com/userinfo"

sourceDef.Issuer = "https://healthx.fhir.flex.optum.com/R4"
sourceDef.Audience = "https://healthx.fhir.flex.optum.com/R4"

sourceDef.ApiEndpointBaseUrl = "https://healthx.fhir.flex.optum.com/R4"
// retrieve client-id, if available
if clientId, clientIdOk := clientIdLookup[pkg.SourceTypePeopleshealth]; clientIdOk {
sourceDef.ClientId = clientId
}
sourceDef.RedirectUri = pkg.GetCallbackEndpoint(string(pkg.SourceTypeUnitedhealthcare))

sourceDef.Display = "Peoples Health"
sourceDef.SourceType = pkg.SourceTypePeopleshealth
sourceDef.Category = []string{"Insurance"}
sourceDef.Aliases = []string{}
sourceDef.PatientAccessUrl = "https://www.peopleshealth.com/"

return sourceDef, err
}
39 changes: 39 additions & 0 deletions definitions/internal/source/rockymountainhealthplans.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
// Copyright (C) Fasten Health, Inc. - All Rights Reserved.
//
// THIS FILE IS GENERATED BY https://github.com/fastenhealth/fasten-sources-gen
// PLEASE DO NOT EDIT BY HAND

package source

import (
models "github.com/fastenhealth/fasten-sources/definitions/models"
pkg "github.com/fastenhealth/fasten-sources/pkg"
)

// https://rmhp.fhir.flex.optum.com/R4/.well-known/smart-configuration
// https://rmhp.fhir.flex.optum.com/R4/metadata
func GetSourceRockymountainhealthplans(env pkg.FastenLighthouseEnvType, clientIdLookup map[pkg.SourceType]string) (models.LighthouseSourceDefinition, error) {
sourceDef, err := GetSourceUnitedhealthcare(env, clientIdLookup)
sourceDef.AuthorizationEndpoint = "https://rmhp.authz.flex.optum.com/oauth/authorize"
sourceDef.TokenEndpoint = "https://rmhp.authz.flex.optum.com/oauth/token"
sourceDef.IntrospectionEndpoint = "https://rmhp.authz.flex.optum.com/.well-known/jwks.json"
sourceDef.UserInfoEndpoint = "https://rmhp.authz.flex.optum.com/userinfo"

sourceDef.Issuer = "https://rmhp.fhir.flex.optum.com/R4"
sourceDef.Audience = "https://rmhp.fhir.flex.optum.com/R4"

sourceDef.ApiEndpointBaseUrl = "https://rmhp.fhir.flex.optum.com/R4"
// retrieve client-id, if available
if clientId, clientIdOk := clientIdLookup[pkg.SourceTypeRockymountainhealthplans]; clientIdOk {
sourceDef.ClientId = clientId
}
sourceDef.RedirectUri = pkg.GetCallbackEndpoint(string(pkg.SourceTypeUnitedhealthcare))

sourceDef.Display = "Rocky Mountain Health Plans"
sourceDef.SourceType = pkg.SourceTypeRockymountainhealthplans
sourceDef.Category = []string{"Insurance"}
sourceDef.Aliases = []string{}
sourceDef.PatientAccessUrl = "https://www.rmhp.org/"

return sourceDef, err
}
39 changes: 39 additions & 0 deletions definitions/internal/source/sierrahealthandlife.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
// Copyright (C) Fasten Health, Inc. - All Rights Reserved.
//
// THIS FILE IS GENERATED BY https://github.com/fastenhealth/fasten-sources-gen
// PLEASE DO NOT EDIT BY HAND

package source

import (
models "github.com/fastenhealth/fasten-sources/definitions/models"
pkg "github.com/fastenhealth/fasten-sources/pkg"
)

// https://sierra.fhir.flex.optum.com/R4/.well-known/smart-configuration
// https://sierra.fhir.flex.optum.com/R4/metadata
func GetSourceSierrahealthandlife(env pkg.FastenLighthouseEnvType, clientIdLookup map[pkg.SourceType]string) (models.LighthouseSourceDefinition, error) {
sourceDef, err := GetSourceUnitedhealthcare(env, clientIdLookup)
sourceDef.AuthorizationEndpoint = "https://sierra.authz.flex.optum.com/oauth/authorize"
sourceDef.TokenEndpoint = "https://sierra.authz.flex.optum.com/oauth/token"
sourceDef.IntrospectionEndpoint = "https://sierra.authz.flex.optum.com/.well-known/jwks.json"
sourceDef.UserInfoEndpoint = "https://sierra.authz.flex.optum.com/userinfo"

sourceDef.Issuer = "https://sierra.fhir.flex.optum.com/R4"
sourceDef.Audience = "https://sierra.fhir.flex.optum.com/R4"

sourceDef.ApiEndpointBaseUrl = "https://sierra.fhir.flex.optum.com/R4"
// retrieve client-id, if available
if clientId, clientIdOk := clientIdLookup[pkg.SourceTypeSierrahealthandlife]; clientIdOk {
sourceDef.ClientId = clientId
}
sourceDef.RedirectUri = pkg.GetCallbackEndpoint(string(pkg.SourceTypeUnitedhealthcare))

sourceDef.Display = "Sierra Health and Life"
sourceDef.SourceType = pkg.SourceTypeSierrahealthandlife
sourceDef.Category = []string{"Insurance"}
sourceDef.Aliases = []string{}
sourceDef.PatientAccessUrl = "https://www.sierrahealthandlife.com/"

return sourceDef, err
}
39 changes: 39 additions & 0 deletions definitions/internal/source/unitedhealthcare.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
// Copyright (C) Fasten Health, Inc. - All Rights Reserved.
//
// THIS FILE IS GENERATED BY https://github.com/fastenhealth/fasten-sources-gen
// PLEASE DO NOT EDIT BY HAND

package source

import (
platform "github.com/fastenhealth/fasten-sources/definitions/internal/platform"
models "github.com/fastenhealth/fasten-sources/definitions/models"
pkg "github.com/fastenhealth/fasten-sources/pkg"
)

// https://hsid.fhir.flex.optum.com/R4/.well-known/smart-configuration
// https://hsid.fhir.flex.optum.com/R4/metadata
func GetSourceUnitedhealthcare(env pkg.FastenLighthouseEnvType, clientIdLookup map[pkg.SourceType]string) (models.LighthouseSourceDefinition, error) {
sourceDef, err := platform.GetSourceUnitedhealthcareSandbox(env, clientIdLookup)
sourceDef.AuthorizationEndpoint = "https://hsid.authz.flex.optum.com/oauth/authorize"
sourceDef.TokenEndpoint = "https://hsid.authz.flex.optum.com/oauth/token"
sourceDef.IntrospectionEndpoint = "https://hsid.authz.flex.optum.com/.well-known/jwks.json"
sourceDef.UserInfoEndpoint = "https://hsid.authz.flex.optum.com/userinfo"

sourceDef.Issuer = "https://hsid.fhir.flex.optum.com/R4"
sourceDef.Audience = "https://hsid.fhir.flex.optum.com/R4"

sourceDef.ApiEndpointBaseUrl = "https://hsid.fhir.flex.optum.com/R4"
// retrieve client-id, if available
if clientId, clientIdOk := clientIdLookup[pkg.SourceTypeUnitedhealthcare]; clientIdOk {
sourceDef.ClientId = clientId
}

sourceDef.Display = "United Healthcare"
sourceDef.SourceType = pkg.SourceTypeUnitedhealthcare
sourceDef.Category = []string{"Insurance"}
sourceDef.Aliases = []string{}
sourceDef.PatientAccessUrl = "https://www.uhc.com"

return sourceDef, err
}
36 changes: 20 additions & 16 deletions pkg/source_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,22 @@ type SourceType string
const (
SourceTypeManual SourceType = "manual"
// platform
SourceTypeAetna SourceType = "aetna"
SourceTypeAllscripts SourceType = "allscripts"
SourceTypeAthena SourceType = "athena"
SourceTypeCareevolution SourceType = "careevolution"
SourceTypeCerner SourceType = "cerner"
SourceTypeCigna SourceType = "cigna"
SourceTypeEclinicalworks SourceType = "eclinicalworks"
SourceTypeEdifecs SourceType = "edifecs"
SourceTypeEpicLegacy SourceType = "epic-legacy"
SourceTypeEpic SourceType = "epic"
SourceTypeHumana SourceType = "humana"
SourceTypeMedicare SourceType = "medicare"
SourceTypeMeditech SourceType = "meditech"
SourceTypeNextgen SourceType = "nextgen"
SourceTypeUnitedhealthcare SourceType = "unitedhealthcare"
SourceTypeVahealth SourceType = "vahealth"
SourceTypeAetna SourceType = "aetna"
SourceTypeAllscripts SourceType = "allscripts"
SourceTypeAthena SourceType = "athena"
SourceTypeCareevolution SourceType = "careevolution"
SourceTypeCerner SourceType = "cerner"
SourceTypeCigna SourceType = "cigna"
SourceTypeEclinicalworks SourceType = "eclinicalworks"
SourceTypeEdifecs SourceType = "edifecs"
SourceTypeEpicLegacy SourceType = "epic-legacy"
SourceTypeEpic SourceType = "epic"
SourceTypeHumana SourceType = "humana"
SourceTypeMedicare SourceType = "medicare"
SourceTypeMeditech SourceType = "meditech"
SourceTypeNextgen SourceType = "nextgen"
SourceTypeUnitedhealthcareSandbox SourceType = "unitedhealthcare-sandbox"
SourceTypeVahealth SourceType = "vahealth"
// source
SourceType1CpPlacePllc SourceType = "1-cp-place-pllc"
SourceType1SandraKHutchisonMd SourceType = "1-sandra-k-hutchison-md"
Expand Down Expand Up @@ -27744,6 +27744,10 @@ const (
SourceTypeZzzDoNotUseHiloHi SourceType = "zzz-do-not-use-hilo-hi"
SourceTypeZzzdeleteseattleDispatchhealth SourceType = "zzzdeleteseattle-dispatchhealth"
SourceTypeBcbsal SourceType = "bcbsal"
SourceTypePeopleshealth SourceType = "peopleshealth"
SourceTypeRockymountainhealthplans SourceType = "rockymountainhealthplans"
SourceTypeSierrahealthandlife SourceType = "sierrahealthandlife"
SourceTypeUnitedhealthcare SourceType = "unitedhealthcare"
// sandbox
SourceTypeHealthit SourceType = "healthit"
SourceTypeKaiser SourceType = "kaiser"
Expand Down

0 comments on commit e5dbe60

Please sign in to comment.