From c79dc02a1de7f542a3ced2b5b24ef6cace2ba369 Mon Sep 17 00:00:00 2001 From: Jason Kulatunga Date: Tue, 8 Nov 2022 19:45:05 -0800 Subject: [PATCH] cleanup unnecessary constants. adding anthem sourcetypes. --- backend/pkg/constants.go | 33 -------- backend/pkg/models/metadata_source.go | 14 ---- frontend/angular.json | 10 +-- frontend/src/environments/environment.ts | 1 + frontend/src/lib/conduit/factory.ts | 76 ++++++++++++++----- .../src/lib/conduit/fhir/logica_client.ts | 11 --- .../{ => platforms}/careevolution_client.ts | 8 +- .../fhir/{ => platforms}/cerner_client.ts | 12 +-- .../fhir/{ => platforms}/epic_client.ts | 12 +-- .../fhir/{ => sandbox}/athena_client.ts | 12 +-- .../fhir/{ => sandbox}/healthit_client.ts | 12 +-- .../lib/conduit/fhir/sandbox/logica_client.ts | 11 +++ .../src/lib/models/database/source_types.ts | 68 +++++++++++------ 13 files changed, 146 insertions(+), 134 deletions(-) delete mode 100644 backend/pkg/models/metadata_source.go delete mode 100644 frontend/src/lib/conduit/fhir/logica_client.ts rename frontend/src/lib/conduit/fhir/{ => platforms}/careevolution_client.ts (58%) rename frontend/src/lib/conduit/fhir/{ => platforms}/cerner_client.ts (73%) rename frontend/src/lib/conduit/fhir/{ => platforms}/epic_client.ts (72%) rename frontend/src/lib/conduit/fhir/{ => sandbox}/athena_client.ts (58%) rename frontend/src/lib/conduit/fhir/{ => sandbox}/healthit_client.ts (72%) create mode 100644 frontend/src/lib/conduit/fhir/sandbox/logica_client.ts diff --git a/backend/pkg/constants.go b/backend/pkg/constants.go index 3d6d172b..c1caffeb 100644 --- a/backend/pkg/constants.go +++ b/backend/pkg/constants.go @@ -1,34 +1 @@ package pkg - -// SourceType contains all the various medical, insurance, health care providers which Fasten can communicate with -type SourceType string - -const ( - SourceTypeManual SourceType = "manual" - - SourceTypeAetna SourceType = "aetna" - SourceTypeAthena SourceType = "athena" - SourceTypeAnthem SourceType = "anthem" - SourceTypeCareEvolution SourceType = "careevolution" - SourceTypeCedarSinai SourceType = "cedarssinai" - SourceTypeCerner SourceType = "cerner" - SourceTypeCigna SourceType = "cigna" - SourceTypeCommonSpirit SourceType = "commonspirit" - SourceTypeDeltaDental SourceType = "deltadental" - SourceTypeDignityHealth SourceType = "dignityhealth" - SourceTypeEpic SourceType = "epic" - SourceTypeHealthIT SourceType = "healthit" - SourceTypeHCAHealthcare SourceType = "hcahealthcare" - SourceTypeHumana SourceType = "humana" - SourceTypeKaiser SourceType = "kaiser" - SourceTypeLogica SourceType = "logica" - SourceTypeMetlife SourceType = "metlife" - SourceTypeProvidence SourceType = "providence" - SourceTypeStanford SourceType = "stanford" - SourceTypeSutter SourceType = "sutter" - SourceTypeTrinity SourceType = "trinity" - SourceTypeUCSF SourceType = "ucsf" - SourceTypeUnitedHealthcare SourceType = "unitedhealthcare" - SourceTypeBlueButtonMedicare SourceType = "bluebutton" - SourceTypeVerity SourceType = "verity" -) diff --git a/backend/pkg/models/metadata_source.go b/backend/pkg/models/metadata_source.go deleted file mode 100644 index a49d6abc..00000000 --- a/backend/pkg/models/metadata_source.go +++ /dev/null @@ -1,14 +0,0 @@ -package models - -import ( - "github.com/fastenhealth/fastenhealth-onprem/backend/pkg" -) - -type MetadataSource struct { - SourceType pkg.SourceType `json:"source_type"` - Display string `json:"display"` - Category []string `json:"category"` - - Supported bool `json:"enabled"` - Confidential bool `json:"confidential"` -} diff --git a/frontend/angular.json b/frontend/angular.json index 50619afe..f81e5350 100644 --- a/frontend/angular.json +++ b/frontend/angular.json @@ -38,7 +38,7 @@ "webWorkerTsConfig": "tsconfig.worker.json" }, "configurations": { - "production": { + "prod": { "fileReplacements": [ { "replace": "src/environments/environment.ts", @@ -129,8 +129,8 @@ "browserTarget": "fastenhealth:build" }, "configurations": { - "production": { - "browserTarget": "fastenhealth:build:production" + "prod": { + "browserTarget": "fastenhealth:build:prod" }, "sandbox": { "browserTarget": "fastenhealth:build:sandbox" @@ -185,8 +185,8 @@ "devServerTarget": "fastenhealth:serve" }, "configurations": { - "production": { - "devServerTarget": "fastenhealth:serve:production" + "prod": { + "devServerTarget": "fastenhealth:serve:prod" } } } diff --git a/frontend/src/environments/environment.ts b/frontend/src/environments/environment.ts index 97bf0d7c..d328660c 100644 --- a/frontend/src/environments/environment.ts +++ b/frontend/src/environments/environment.ts @@ -3,6 +3,7 @@ // The list of file replacements can be found in `angular.json`. export const environment = { + //javascript environment, not Fasten env. production: false, // is the application running in the cloud? (enables 3rd party IdP's and token based couchdb authentication) diff --git a/frontend/src/lib/conduit/factory.ts b/frontend/src/lib/conduit/factory.ts index cd3a5dbb..714b375f 100644 --- a/frontend/src/lib/conduit/factory.ts +++ b/frontend/src/lib/conduit/factory.ts @@ -1,38 +1,78 @@ import {SourceType} from '../models/database/source_types'; import {Source} from '../models/database/source'; import {IClient} from './interface'; + +import {HealthITClient} from './fhir/sandbox/healthit_client'; +import {LogicaClient} from './fhir/sandbox/logica_client'; +import {AthenaClient} from './fhir/sandbox/athena_client'; + +import {CareEvolutionClient} from './fhir/platforms/careevolution_client'; +import {CernerClient} from './fhir/platforms/cerner_client'; +import {EpicClient} from './fhir/platforms/epic_client'; + import {AetnaClient} from './fhir/aetna_client'; import {BlueButtonClient} from './fhir/bluebutton_client'; -import {CareEvolutionClient} from './fhir/careevolution_client'; -import {CernerClient} from './fhir/cerner_client'; -import {AthenaClient} from './fhir/athena_client'; import {CignaClient} from './fhir/cigna_client'; -import {EpicClient} from './fhir/epic_client'; -import {HealthITClient} from './fhir/healthit_client'; -import {LogicaClient} from './fhir/logica_client'; import {ClientConfig} from '../models/client/client-config'; export function NewClient(sourceType: SourceType, source: Source, clientConfig: ClientConfig): IClient { switch(sourceType) { - case SourceType.Aetna: - return new AetnaClient(source, clientConfig) + + //sandbox case SourceType.Athena: return new AthenaClient(source, clientConfig) - case SourceType.BlueButtonMedicare: - return new BlueButtonClient(source, clientConfig) - case SourceType.CareEvolution: - return new CareEvolutionClient(source, clientConfig) - case SourceType.Cerner: - return new CernerClient(source, clientConfig) - case SourceType.Cigna: - return new CignaClient(source, clientConfig) - case SourceType.Epic: - return new EpicClient(source, clientConfig) case SourceType.HealthIT: return new HealthITClient(source, clientConfig) case SourceType.Logica: return new LogicaClient(source, clientConfig ) + + //platforms + case SourceType.CareEvolution: + return new CareEvolutionClient(source, clientConfig) + case SourceType.Cerner: + return new CernerClient(source, clientConfig) + case SourceType.Epic: + return new EpicClient(source, clientConfig) + + //providers + case SourceType.Aetna: + return new AetnaClient(source, clientConfig) + + case SourceType.Amerigroup: + case SourceType.AmerigroupMedicaid: + case SourceType.Anthem: + case SourceType.AnthemBluecrossCA: + case SourceType.BluecrossBlueshieldKansasMedicare: + case SourceType.BluecrossBlueshieldKansas: + case SourceType.BluecrossBlueshieldNY: + case SourceType.BlueMedicareAdvantage: + case SourceType.ClearHealthAlliance: + case SourceType.DellChildrens: + case SourceType.EmpireBlue: + case SourceType.EmpireBlueMedicaid: + case SourceType.HealthyBlueLA: + case SourceType.HealthyBlueLAMedicaid: + case SourceType.HealthyBlueMO: + case SourceType.HealthyBlueMOMedicaid: + case SourceType.HealthyBlueNC: + case SourceType.HealthyBlueNCMedicaid: + case SourceType.HealthyBlueNE: + case SourceType.HealthyBlueSC: + case SourceType.HighmarkWesternNY: + case SourceType.SimplyHealthcareMedicaid: + case SourceType.SimplyHealthcareMedicare: + case SourceType.SummitCommunityCare: + case SourceType.Unicare: + case SourceType.UnicareMA: + case SourceType.UnicareMedicaid: + return new CareEvolutionClient(source, clientConfig) + + case SourceType.Cigna: + return new CignaClient(source, clientConfig) + case SourceType.BlueButton: + return new BlueButtonClient(source, clientConfig) + // case SourceType.Manual: // return new ManualClient(source) default: diff --git a/frontend/src/lib/conduit/fhir/logica_client.ts b/frontend/src/lib/conduit/fhir/logica_client.ts deleted file mode 100644 index f0b290d1..00000000 --- a/frontend/src/lib/conduit/fhir/logica_client.ts +++ /dev/null @@ -1,11 +0,0 @@ -import {IClient} from '../interface'; -import {FHIR401Client} from './base/fhir401_r4_client'; -import {Source} from '../../models/database/source'; -import {IDatabaseRepository} from '../../database/interface'; -import {ClientConfig} from '../../models/client/client-config'; - -export class LogicaClient extends FHIR401Client implements IClient { - constructor(source: Source, clientConfig: ClientConfig) { - super(source, clientConfig); - } -} diff --git a/frontend/src/lib/conduit/fhir/careevolution_client.ts b/frontend/src/lib/conduit/fhir/platforms/careevolution_client.ts similarity index 58% rename from frontend/src/lib/conduit/fhir/careevolution_client.ts rename to frontend/src/lib/conduit/fhir/platforms/careevolution_client.ts index 3adbf9df..87321adb 100644 --- a/frontend/src/lib/conduit/fhir/careevolution_client.ts +++ b/frontend/src/lib/conduit/fhir/platforms/careevolution_client.ts @@ -1,7 +1,7 @@ -import {IClient} from '../interface'; -import {FHIR401Client} from './base/fhir401_r4_client'; -import {Source} from '../../models/database/source'; -import {ClientConfig} from '../../models/client/client-config'; +import {IClient} from '../../interface'; +import {FHIR401Client} from '../base/fhir401_r4_client'; +import {Source} from '../../../models/database/source'; +import {ClientConfig} from '../../../models/client/client-config'; export class CareEvolutionClient extends FHIR401Client implements IClient { constructor(source: Source, clientConfig: ClientConfig) { diff --git a/frontend/src/lib/conduit/fhir/cerner_client.ts b/frontend/src/lib/conduit/fhir/platforms/cerner_client.ts similarity index 73% rename from frontend/src/lib/conduit/fhir/cerner_client.ts rename to frontend/src/lib/conduit/fhir/platforms/cerner_client.ts index 39b50089..a690d131 100644 --- a/frontend/src/lib/conduit/fhir/cerner_client.ts +++ b/frontend/src/lib/conduit/fhir/platforms/cerner_client.ts @@ -1,9 +1,9 @@ -import {IClient} from '../interface'; -import {FHIR401Client} from './base/fhir401_r4_client'; -import {Source} from '../../models/database/source'; -import {IDatabaseRepository} from '../../database/interface'; -import {UpsertSummary} from '../../models/fasten/upsert-summary'; -import {ClientConfig} from '../../models/client/client-config'; +import {IClient} from '../../interface'; +import {FHIR401Client} from '../base/fhir401_r4_client'; +import {Source} from '../../../models/database/source'; +import {IDatabaseRepository} from '../../../database/interface'; +import {UpsertSummary} from '../../../models/fasten/upsert-summary'; +import {ClientConfig} from '../../../models/client/client-config'; export class CernerClient extends FHIR401Client implements IClient { constructor(source: Source, clientConfig: ClientConfig) { diff --git a/frontend/src/lib/conduit/fhir/epic_client.ts b/frontend/src/lib/conduit/fhir/platforms/epic_client.ts similarity index 72% rename from frontend/src/lib/conduit/fhir/epic_client.ts rename to frontend/src/lib/conduit/fhir/platforms/epic_client.ts index ea91126b..c02124a9 100644 --- a/frontend/src/lib/conduit/fhir/epic_client.ts +++ b/frontend/src/lib/conduit/fhir/platforms/epic_client.ts @@ -1,9 +1,9 @@ -import {IClient} from '../interface'; -import {FHIR401Client} from './base/fhir401_r4_client'; -import {Source} from '../../models/database/source'; -import {IDatabaseRepository} from '../../database/interface'; -import {UpsertSummary} from '../../models/fasten/upsert-summary'; -import {ClientConfig} from '../../models/client/client-config'; +import {IClient} from '../../interface'; +import {FHIR401Client} from '../base/fhir401_r4_client'; +import {Source} from '../../../models/database/source'; +import {IDatabaseRepository} from '../../../database/interface'; +import {UpsertSummary} from '../../../models/fasten/upsert-summary'; +import {ClientConfig} from '../../../models/client/client-config'; export class EpicClient extends FHIR401Client implements IClient { constructor(source: Source, clientConfig: ClientConfig) { diff --git a/frontend/src/lib/conduit/fhir/athena_client.ts b/frontend/src/lib/conduit/fhir/sandbox/athena_client.ts similarity index 58% rename from frontend/src/lib/conduit/fhir/athena_client.ts rename to frontend/src/lib/conduit/fhir/sandbox/athena_client.ts index dcc3e304..7543311b 100644 --- a/frontend/src/lib/conduit/fhir/athena_client.ts +++ b/frontend/src/lib/conduit/fhir/sandbox/athena_client.ts @@ -1,9 +1,9 @@ -import {IClient} from '../interface'; -import {FHIR401Client} from './base/fhir401_r4_client'; -import {Source} from '../../models/database/source'; -import {IDatabaseRepository} from '../../database/interface'; -import {UpsertSummary} from '../../models/fasten/upsert-summary'; -import {ClientConfig} from '../../models/client/client-config'; +import {IClient} from '../../interface'; +import {FHIR401Client} from '../base/fhir401_r4_client'; +import {Source} from '../../../models/database/source'; +import {IDatabaseRepository} from '../../../database/interface'; +import {UpsertSummary} from '../../../models/fasten/upsert-summary'; +import {ClientConfig} from '../../../models/client/client-config'; export class AthenaClient extends FHIR401Client implements IClient { constructor(source: Source, clientConfig: ClientConfig) { diff --git a/frontend/src/lib/conduit/fhir/healthit_client.ts b/frontend/src/lib/conduit/fhir/sandbox/healthit_client.ts similarity index 72% rename from frontend/src/lib/conduit/fhir/healthit_client.ts rename to frontend/src/lib/conduit/fhir/sandbox/healthit_client.ts index 7b23d14a..03b077f8 100644 --- a/frontend/src/lib/conduit/fhir/healthit_client.ts +++ b/frontend/src/lib/conduit/fhir/sandbox/healthit_client.ts @@ -1,9 +1,9 @@ -import {IClient} from '../interface'; -import {FHIR401Client} from './base/fhir401_r4_client'; -import {Source} from '../../models/database/source'; -import {IDatabaseRepository} from '../../database/interface'; -import {UpsertSummary} from '../../models/fasten/upsert-summary'; -import {ClientConfig} from '../../models/client/client-config'; +import {IClient} from '../../interface'; +import {FHIR401Client} from '../base/fhir401_r4_client'; +import {Source} from '../../../models/database/source'; +import {IDatabaseRepository} from '../../../database/interface'; +import {UpsertSummary} from '../../../models/fasten/upsert-summary'; +import {ClientConfig} from '../../../models/client/client-config'; export class HealthITClient extends FHIR401Client implements IClient { constructor(source: Source, clientConfig: ClientConfig) { diff --git a/frontend/src/lib/conduit/fhir/sandbox/logica_client.ts b/frontend/src/lib/conduit/fhir/sandbox/logica_client.ts new file mode 100644 index 00000000..225cddb1 --- /dev/null +++ b/frontend/src/lib/conduit/fhir/sandbox/logica_client.ts @@ -0,0 +1,11 @@ +import {IClient} from '../../interface'; +import {FHIR401Client} from '../base/fhir401_r4_client'; +import {Source} from '../../../models/database/source'; +import {IDatabaseRepository} from '../../../database/interface'; +import {ClientConfig} from '../../../models/client/client-config'; + +export class LogicaClient extends FHIR401Client implements IClient { + constructor(source: Source, clientConfig: ClientConfig) { + super(source, clientConfig); + } +} diff --git a/frontend/src/lib/models/database/source_types.ts b/frontend/src/lib/models/database/source_types.ts index 09577eb0..945e65b2 100644 --- a/frontend/src/lib/models/database/source_types.ts +++ b/frontend/src/lib/models/database/source_types.ts @@ -3,29 +3,47 @@ export enum SourceType { Manual = "manual", - Aetna = "aetna", - Athena = "athena", - Anthem = "anthem", - CareEvolution = "careevolution", - CedarSinai = "cedarssinai", - Cerner = "cerner", - Cigna = "cigna", - CommonSpirit = "commonspirit", - DeltaDental = "deltadental", - DignityHealth = "dignityhealth", - Epic = "epic", - HealthIT = "healthit", - HCAHealthcare = "hcahealthcare", - Humana = "humana", - Kaiser = "kaiser", - Logica = "logica", - Metlife = "metlife", - Providence = "providence", - Stanford = "stanford", - Sutter = "sutter", - Trinity = "trinity", - UCSF = "ucsf", - UnitedHealthcare = "unitedhealthcare", - BlueButtonMedicare = "bluebutton", - Verity = "verity", + Athena = "athena", + HealthIT = "healthit", + Logica = "logica", + +//platforms + CareEvolution = "careevolution", + Cerner = "cerner", + Epic = "epic", + +//providers + Aetna = "aetna", + Amerigroup = "amerigroup", + AmerigroupMedicaid = "amerigroupmedicaid", + Anthem = "anthem", + AnthemBluecrossCA = "anthembluecrossca", + BlueButton = "bluebutton", + BluecrossBlueshieldKansasMedicare = "bcbskansasmedicare", + BluecrossBlueshieldKansas = "bcbskansas", + BluecrossBlueshieldNY = "bcbsny", + BlueMedicareAdvantage = "bluemedicareadvantage", + ClearHealthAlliance = "clearhealthalliance", + Cigna = "cigna", + DellChildrens = "dellchildrens", + EmpireBlue = "empireblue", + EmpireBlueMedicaid = "empirebluemedicaid", + HealthyBlueLA = "healthybluela", + HealthyBlueLAMedicaid = "healthybluelamedicaid", + HealthyBlueMO = "healthybluemo", + HealthyBlueMOMedicaid = "healthybluemomedicaid", + HealthyBlueNC = "healthybluenc", + HealthyBlueNCMedicaid = "healthybluencmedicaid", + HealthyBlueNE = "healthybluene", + HealthyBlueSC = "healthybluesc", + HighmarkWesternNY = "highmarkwesternny", + SimplyHealthcareMedicaid = "simplyhealthcaremedicaid", + SimplyHealthcareMedicare = "simplyhealthcaremedicare", + SummitCommunityCare = "summitcommunitycare", + Unicare = "unicare", + UnicareMA = "unicarema", + UnicareMedicaid = "unicaremedicaid", + Humana = "humana", + Kaiser = "kaiser", + UnitedHealthcare = "unitedhealthcare", }