fix CareEvolution (now configured as a Confidential client)

fixes fastenhealth/docs#10
This commit is contained in:
Jason Kulatunga 2022-09-25 16:13:06 -07:00
parent 2ba9f3493b
commit 581d008f09
5 changed files with 39 additions and 13 deletions

View File

@ -10,6 +10,7 @@ import (
"github.com/fastenhealth/fastenhealth-onprem/backend/pkg/hub/internal/fhir/athena"
"github.com/fastenhealth/fastenhealth-onprem/backend/pkg/hub/internal/fhir/base"
"github.com/fastenhealth/fastenhealth-onprem/backend/pkg/hub/internal/fhir/bluebutton"
"github.com/fastenhealth/fastenhealth-onprem/backend/pkg/hub/internal/fhir/careevolution"
"github.com/fastenhealth/fastenhealth-onprem/backend/pkg/hub/internal/fhir/cerner"
"github.com/fastenhealth/fastenhealth-onprem/backend/pkg/hub/internal/fhir/cigna"
"github.com/fastenhealth/fastenhealth-onprem/backend/pkg/hub/internal/fhir/epic"
@ -35,6 +36,8 @@ func NewClient(sourceType pkg.SourceType, ctx context.Context, appConfig config.
sourceClient, updatedSource, err = cigna.NewClient(ctx, appConfig, globalLogger, credentials, testHttpClient...)
case pkg.SourceTypeBlueButtonMedicare:
sourceClient, updatedSource, err = bluebutton.NewClient(ctx, appConfig, globalLogger, credentials, testHttpClient...)
case pkg.SourceTypeCareEvolution:
sourceClient, updatedSource, err = careevolution.NewClient(ctx, appConfig, globalLogger, credentials, testHttpClient...)
case pkg.SourceTypeCerner:
sourceClient, updatedSource, err = cerner.NewClient(ctx, appConfig, globalLogger, credentials, testHttpClient...)
case pkg.SourceTypeCigna:

View File

@ -0,0 +1,22 @@
package careevolution
import (
"context"
"github.com/fastenhealth/fastenhealth-onprem/backend/pkg/config"
"github.com/fastenhealth/fastenhealth-onprem/backend/pkg/hub/internal/fhir/base"
"github.com/fastenhealth/fastenhealth-onprem/backend/pkg/models"
"github.com/sirupsen/logrus"
"net/http"
)
type CareEvolutionClient struct {
*base.FHIR401Client
}
func NewClient(ctx context.Context, appConfig config.Interface, globalLogger logrus.FieldLogger, source models.Source, testHttpClient ...*http.Client) (base.Client, *models.Source, error) {
baseClient, updatedSource, err := base.NewFHIR401Client(ctx, appConfig, globalLogger, source, testHttpClient...)
baseClient.Headers["Accept"] = "application/json+fhir"
return CareEvolutionClient{
baseClient,
}, updatedSource, err
}

View File

@ -14,6 +14,8 @@ func GetMetadataSource(c *gin.Context) {
string(pkg.SourceTypeEpic): {Display: "Epic (Sandbox)", SourceType: pkg.SourceTypeEpic, Category: []string{"Sandbox"}, Supported: true},
string(pkg.SourceTypeLogica): {Display: "Logica (Sandbox)", SourceType: pkg.SourceTypeLogica, Category: []string{"Sandbox"}, Supported: true},
string(pkg.SourceTypeHealthIT): {Display: "HealthIT (Sandbox)", SourceType: pkg.SourceTypeHealthIT, Category: []string{"Sandbox"}, Supported: true},
//fails with CORS error when swapping token. Must be a confidential client.
string(pkg.SourceTypeCareEvolution): {Display: "CareEvolution (Sandbox)", SourceType: pkg.SourceTypeCareEvolution, Category: []string{"Sandbox"}, Supported: false},
// enabled
string(pkg.SourceTypeAetna): {Display: "Aetna", SourceType: pkg.SourceTypeAetna, Category: []string{"Insurance"}, Supported: true},
@ -23,9 +25,6 @@ func GetMetadataSource(c *gin.Context) {
//TODO: infinite pagination for Encounters??
string(pkg.SourceTypeCerner): {Display: "Cerner (Sandbox)", SourceType: pkg.SourceTypeCerner, Category: []string{"Sandbox"}, Supported: true},
//TODO: fails with CORS error when swapping token. Should be confidential client.
string(pkg.SourceTypeCareEvolution): {Display: "CareEvolution (Sandbox)", SourceType: pkg.SourceTypeCareEvolution, Category: []string{"Sandbox"}, Supported: false},
// pending
string(pkg.SourceTypeAnthem): {Display: "Anthem", SourceType: pkg.SourceTypeAnthem, Category: []string{"Insurance"}},
string(pkg.SourceTypeCedarSinai): {Display: "Cedar Sinai", SourceType: pkg.SourceTypeCedarSinai, Category: []string{"Hospital"}},

View File

@ -28,7 +28,7 @@ export class AppComponent implements OnInit {
}
modifyHeader(location) {
if(location.url.startsWith('/auth'))
if(location.url?.startsWith('/auth'))
{
this.showHeader = false;
} else {

View File

@ -1,5 +1,6 @@
<div class="az-content">
<div *ngIf="resourceTypeCounts" class="container">
<div class="container">
<div class="az-content-left">
<ul class="list-group">
<li *ngFor="let resourceGroup of resourceTypeCounts | keyvalue" (click)="selectResourceType(resourceGroup.key)" class="list-group-item d-flex justify-content-between align-items-center">
@ -19,14 +20,15 @@
</div><!-- az-content-body -->
</div><!-- container -->
<div class="container">
<div class="az-error-wrapper">
<h1>{{selectedSource.source_type}}</h1>
<h2>No resources found for this Healthcare provider</h2>
<h6>You may need to re-authenticate to this source, or wait for the resources to sync.</h6>
<a routerLink="/sources" class="btn btn-outline-indigo">Sources</a>
<ng-template #empty >
<div class="container">
<div class="az-error-wrapper">
<h1>{{selectedSource.source_type}}</h1>
<h2>No resources found for this Healthcare provider</h2>
<h6>You may need to re-authenticate to this source, or wait for the resources to sync.</h6>
<a routerLink="/sources" class="btn btn-outline-indigo">Sources</a>
</div>
</div>
</div>
</ng-template>
</div><!-- az-content -->