diff --git a/frontend/src/app/workers/source-sync.worker.ts b/frontend/src/app/workers/source-sync.worker.ts index cbf604b1..2635f5cf 100644 --- a/frontend/src/app/workers/source-sync.worker.ts +++ b/frontend/src/app/workers/source-sync.worker.ts @@ -33,7 +33,7 @@ export class SourceSyncWorker implements DoWork { //lets refresh the source information if required. console.log("!!!!!!!!!!!!!!STARTING WORKER SYNC!!!!!!!!!", sourceSyncMessage) return client.RefreshSourceToken() - .then((wasSourceRefreshed)=>{ + .then((wasSourceRefreshed) => { if(wasSourceRefreshed){ //the source was updated, we need to save the updated source information return db.UpsertSource(client.source) @@ -43,7 +43,7 @@ export class SourceSyncWorker implements DoWork { } return client }) - .then((client)=> { + .then((client) => { return client.SyncAll(db) }) .then((resp) => { diff --git a/frontend/src/assets/sources/amerigroup.webp b/frontend/src/assets/sources/amerigroup.webp new file mode 100644 index 00000000..8888b1dd Binary files /dev/null and b/frontend/src/assets/sources/amerigroup.webp differ diff --git a/frontend/src/assets/sources/amerigroupmedicaid.webp b/frontend/src/assets/sources/amerigroupmedicaid.webp new file mode 100644 index 00000000..8888b1dd Binary files /dev/null and b/frontend/src/assets/sources/amerigroupmedicaid.webp differ diff --git a/frontend/src/assets/sources/anthembluecrossca.png b/frontend/src/assets/sources/anthembluecrossca.png new file mode 100644 index 00000000..ddfafb7f Binary files /dev/null and b/frontend/src/assets/sources/anthembluecrossca.png differ diff --git a/frontend/src/assets/sources/bcbskansas.png b/frontend/src/assets/sources/bcbskansas.png new file mode 100644 index 00000000..c9e49d22 Binary files /dev/null and b/frontend/src/assets/sources/bcbskansas.png differ diff --git a/frontend/src/assets/sources/bcbskansasmedicare.png b/frontend/src/assets/sources/bcbskansasmedicare.png new file mode 100644 index 00000000..c9e49d22 Binary files /dev/null and b/frontend/src/assets/sources/bcbskansasmedicare.png differ diff --git a/frontend/src/assets/sources/bcbsny.png b/frontend/src/assets/sources/bcbsny.png new file mode 100644 index 00000000..2700831a Binary files /dev/null and b/frontend/src/assets/sources/bcbsny.png differ diff --git a/frontend/src/assets/sources/bluemedicareadvantage.png b/frontend/src/assets/sources/bluemedicareadvantage.png new file mode 100644 index 00000000..319b28c5 Binary files /dev/null and b/frontend/src/assets/sources/bluemedicareadvantage.png differ diff --git a/frontend/src/assets/sources/clearhealthalliance.svg b/frontend/src/assets/sources/clearhealthalliance.svg new file mode 100644 index 00000000..89a2de4c --- /dev/null +++ b/frontend/src/assets/sources/clearhealthalliance.svg @@ -0,0 +1,274 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/frontend/src/assets/sources/dellchildrens.png b/frontend/src/assets/sources/dellchildrens.png new file mode 100644 index 00000000..583a6f2a Binary files /dev/null and b/frontend/src/assets/sources/dellchildrens.png differ diff --git a/frontend/src/assets/sources/empireblue.png b/frontend/src/assets/sources/empireblue.png new file mode 100644 index 00000000..d669d7c7 Binary files /dev/null and b/frontend/src/assets/sources/empireblue.png differ diff --git a/frontend/src/assets/sources/empirebluemedicaid.png b/frontend/src/assets/sources/empirebluemedicaid.png new file mode 100644 index 00000000..d669d7c7 Binary files /dev/null and b/frontend/src/assets/sources/empirebluemedicaid.png differ diff --git a/frontend/src/assets/sources/healthybluela.png b/frontend/src/assets/sources/healthybluela.png new file mode 100644 index 00000000..302a0f90 Binary files /dev/null and b/frontend/src/assets/sources/healthybluela.png differ diff --git a/frontend/src/assets/sources/healthybluelamedicaid.png b/frontend/src/assets/sources/healthybluelamedicaid.png new file mode 100644 index 00000000..302a0f90 Binary files /dev/null and b/frontend/src/assets/sources/healthybluelamedicaid.png differ diff --git a/frontend/src/assets/sources/healthybluemo.png b/frontend/src/assets/sources/healthybluemo.png new file mode 100644 index 00000000..302a0f90 Binary files /dev/null and b/frontend/src/assets/sources/healthybluemo.png differ diff --git a/frontend/src/assets/sources/healthybluemomedicaid.png b/frontend/src/assets/sources/healthybluemomedicaid.png new file mode 100644 index 00000000..302a0f90 Binary files /dev/null and b/frontend/src/assets/sources/healthybluemomedicaid.png differ diff --git a/frontend/src/assets/sources/healthybluenc.png b/frontend/src/assets/sources/healthybluenc.png new file mode 100644 index 00000000..302a0f90 Binary files /dev/null and b/frontend/src/assets/sources/healthybluenc.png differ diff --git a/frontend/src/assets/sources/healthybluencmedicaid.png b/frontend/src/assets/sources/healthybluencmedicaid.png new file mode 100644 index 00000000..302a0f90 Binary files /dev/null and b/frontend/src/assets/sources/healthybluencmedicaid.png differ diff --git a/frontend/src/assets/sources/healthybluene.png b/frontend/src/assets/sources/healthybluene.png new file mode 100644 index 00000000..302a0f90 Binary files /dev/null and b/frontend/src/assets/sources/healthybluene.png differ diff --git a/frontend/src/assets/sources/healthybluesc.png b/frontend/src/assets/sources/healthybluesc.png new file mode 100644 index 00000000..302a0f90 Binary files /dev/null and b/frontend/src/assets/sources/healthybluesc.png differ diff --git a/frontend/src/assets/sources/highmarkwesternny.png b/frontend/src/assets/sources/highmarkwesternny.png new file mode 100644 index 00000000..2cb2cd75 Binary files /dev/null and b/frontend/src/assets/sources/highmarkwesternny.png differ diff --git a/frontend/src/assets/sources/simplyhealthcaremedicaid.png b/frontend/src/assets/sources/simplyhealthcaremedicaid.png new file mode 100644 index 00000000..0989fa15 Binary files /dev/null and b/frontend/src/assets/sources/simplyhealthcaremedicaid.png differ diff --git a/frontend/src/assets/sources/simplyhealthcaremedicare.png b/frontend/src/assets/sources/simplyhealthcaremedicare.png new file mode 100644 index 00000000..0989fa15 Binary files /dev/null and b/frontend/src/assets/sources/simplyhealthcaremedicare.png differ diff --git a/frontend/src/assets/sources/summitcommunitycare.png b/frontend/src/assets/sources/summitcommunitycare.png new file mode 100644 index 00000000..18199244 Binary files /dev/null and b/frontend/src/assets/sources/summitcommunitycare.png differ diff --git a/frontend/src/assets/sources/unicare.png b/frontend/src/assets/sources/unicare.png new file mode 100644 index 00000000..adbbd420 Binary files /dev/null and b/frontend/src/assets/sources/unicare.png differ diff --git a/frontend/src/assets/sources/unicarema.png b/frontend/src/assets/sources/unicarema.png new file mode 100644 index 00000000..adbbd420 Binary files /dev/null and b/frontend/src/assets/sources/unicarema.png differ diff --git a/frontend/src/assets/sources/unicaremedicaid.png b/frontend/src/assets/sources/unicaremedicaid.png new file mode 100644 index 00000000..adbbd420 Binary files /dev/null and b/frontend/src/assets/sources/unicaremedicaid.png differ diff --git a/frontend/src/lib/database/pouchdb_repository.ts b/frontend/src/lib/database/pouchdb_repository.ts index fc5644cd..6e575659 100644 --- a/frontend/src/lib/database/pouchdb_repository.ts +++ b/frontend/src/lib/database/pouchdb_repository.ts @@ -317,6 +317,7 @@ export class PouchdbRepository implements IDatabaseRepository { newDoc.updated_at = newDoc.updated_at || (newDoc as any).meta?.updated_at } newDoc.updated_at = newDoc.updated_at || (new Date().toISOString()) + // console.log("merge, empty") return newDoc } @@ -347,10 +348,11 @@ export class PouchdbRepository implements IDatabaseRepository { } else { - throw new Error("unknown doc_type, cannot diff for upsert: " + newDoc.doc_type) + let errMsg = "unknown doc_type, cannot diff for upsert: " + newDoc.doc_type + console.error(errMsg) + throw new Error(errMsg) } }) - }) .then(( result ): UpsertSummary => { // // success, res is {rev: '1-xxx', updated: true, id: 'myDocId'} @@ -364,17 +366,18 @@ export class PouchdbRepository implements IDatabaseRepository { }); } - protected upsertBulk(docs: IDatabaseDocument[]): Promise { - return Promise.all(docs.map((doc) => { + protected async upsertBulk(docs: IDatabaseDocument[]): Promise { + //insert sequentially (not in parallel) + let finalUpsertSummary = new UpsertSummary() + + for (let doc of docs){ doc.populateId(); - return this.upsertDocument(doc) - })).then((results) => { - return results.reduce((prev, current ) => { - prev.totalResources += current.totalResources - prev.updatedResources = prev.updatedResources.concat(current.updatedResources) - return prev - }, new UpsertSummary()) - }) + let upsertSummary = await this.upsertDocument(doc) + finalUpsertSummary.totalResources += upsertSummary.totalResources + finalUpsertSummary.updatedResources = finalUpsertSummary.updatedResources.concat(upsertSummary.updatedResources) + } + + return finalUpsertSummary } protected getDocument(id: string): Promise {