Skip to content

Commit

Permalink
fixing medicare patient access url.
Browse files Browse the repository at this point in the history
Adding UnitedHealthCare sandbox.
  • Loading branch information
AnalogJ committed Nov 13, 2023
1 parent aeab375 commit 25885b9
Show file tree
Hide file tree
Showing 6 changed files with 116 additions and 25 deletions.
18 changes: 10 additions & 8 deletions clients/factory/factory.go

Large diffs are not rendered by default.

40 changes: 40 additions & 0 deletions clients/internal/platform/unitedhealthcare.go
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)
}
4 changes: 3 additions & 1 deletion definitions/factory/factory.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion definitions/internal/platform/medicare.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func GetSourceMedicare(env pkg.FastenLighthouseEnvType, clientIdLookup map[pkg.S
sourceDef.SourceType = pkg.SourceTypeMedicare
sourceDef.Category = []string{"Insurance"}
sourceDef.Aliases = []string{}
sourceDef.PatientAccessUrl = "https://sandbox.bluebutton.cms.gov/"
sourceDef.PatientAccessUrl = "https://www.medicare.gov"

return sourceDef, nil
}
46 changes: 46 additions & 0 deletions definitions/internal/platform/unitedhealthcare.go
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
}
31 changes: 16 additions & 15 deletions pkg/source_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +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"
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"
SourceTypeUnitedhealthcare SourceType = "unitedhealthcare"
SourceTypeVahealth SourceType = "vahealth"
// source
SourceType1CpPlacePllc SourceType = "1-cp-place-pllc"
SourceType1SandraKHutchisonMd SourceType = "1-sandra-k-hutchison-md"
Expand Down

0 comments on commit 25885b9

Please sign in to comment.