-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding UnitedHealthCare sandbox.
- Loading branch information
Showing
6 changed files
with
116 additions
and
25 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// 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 platform | ||
|
||
import ( | ||
"context" | ||
base "github.com/fastenhealth/fasten-sources/clients/internal/base" | ||
models "github.com/fastenhealth/fasten-sources/clients/models" | ||
pkg "github.com/fastenhealth/fasten-sources/pkg" | ||
logrus "github.com/sirupsen/logrus" | ||
"net/http" | ||
) | ||
|
||
type sourceClientUnitedhealthcare 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) { | ||
baseClient, err := base.GetSourceClientFHIR401(env, ctx, globalLogger, sourceCreds, testHttpClient...) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
return sourceClientUnitedhealthcare{baseClient}, err | ||
} | ||
|
||
// Operation-PatientEverything uses non-standard endpoint - https://build.fhir.org/operation-patient-everything.html | ||
func (c sourceClientUnitedhealthcare) SyncAll(db models.DatabaseRepository) (models.UpsertSummary, error) { | ||
bundle, err := c.GetResourceBundle("Patient") | ||
if err != nil { | ||
return models.UpsertSummary{UpdatedResources: []string{}}, err | ||
} | ||
return c.SyncAllByPatientEverythingBundle(db, bundle) | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// 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 platform | ||
|
||
import ( | ||
models "github.com/fastenhealth/fasten-sources/definitions/models" | ||
pkg "github.com/fastenhealth/fasten-sources/pkg" | ||
) | ||
|
||
// 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) { | ||
sourceDef := models.LighthouseSourceDefinition{} | ||
sourceDef.AuthorizationEndpoint = "https://sandbox.authz.flex.optum.com/oauth/authorize" | ||
sourceDef.TokenEndpoint = "https://sandbox.authz.flex.optum.com/oauth/token" | ||
sourceDef.IntrospectionEndpoint = "https://sandbox.authz.flex.optum.com/.well-known/jwks.json" | ||
sourceDef.UserInfoEndpoint = "https://sandbox.authz.flex.optum.com/userinfo" | ||
|
||
sourceDef.Issuer = "https://sandbox.fhir.flex.optum.com/R4" | ||
sourceDef.Scopes = []string{"fhirUser", "openid", "patient/Condition.read", "patient/Coverage.read", "patient/Encounter.read", "patient/ExplanationOfBenefit.read", "patient/Immunization.read", "patient/MedicationDispense.read", "patient/MedicationRequest.read", "patient/Observation.read", "patient/Patient.read", "patient/Procedure.read", "public/Endpoint.read", "public/HealthcareService.read", "public/InsurancePlan.read", "public/Location.read", "public/Network.read", "public/Organization.read", "public/OrganizationAffiliation.read", "public/Practitioner.read", "public/PractitionerRole.read"} | ||
sourceDef.GrantTypesSupported = []string{"authorization_code"} | ||
sourceDef.ResponseType = []string{"code"} | ||
sourceDef.ResponseModesSupported = []string{"query"} | ||
sourceDef.Audience = "https://sandbox.fhir.flex.optum.com/R4" | ||
sourceDef.CodeChallengeMethodsSupported = []string{"S256"} | ||
|
||
sourceDef.ApiEndpointBaseUrl = "https://sandbox.fhir.flex.optum.com/R4" | ||
// retrieve client-id, if available | ||
if clientId, clientIdOk := clientIdLookup[pkg.SourceTypeUnitedhealthcare]; clientIdOk { | ||
sourceDef.ClientId = clientId | ||
} | ||
sourceDef.RedirectUri = pkg.GetCallbackEndpoint(string(pkg.SourceTypeUnitedhealthcare)) | ||
|
||
sourceDef.Display = "United Healthcare" | ||
sourceDef.PlatformType = pkg.SourceTypeUnitedhealthcare | ||
sourceDef.SourceType = pkg.SourceTypeUnitedhealthcare | ||
sourceDef.Category = []string{"Insurance"} | ||
sourceDef.Aliases = []string{} | ||
sourceDef.PatientAccessUrl = "https://www.uhc.com" | ||
|
||
return sourceDef, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters