Fix frontend test errors and remove logs (#462)

* add karma verbose reporter

* Move fontawesome imports to separate module for easier testing imports

* add some missing imports/declarations

* remove console.logs

* add .catch where i got rid of empty .then
This commit is contained in:
Jean Fernandez 2024-05-01 10:04:32 -04:00 committed by GitHub
parent d280e932f9
commit 3b6d262c8d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
67 changed files with 116 additions and 224 deletions

View File

@ -8,7 +8,8 @@ module.exports = function(config) {
require('karma-chrome-launcher'), require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'), require('karma-jasmine-html-reporter'),
require('karma-coverage'), require('karma-coverage'),
require('@angular-devkit/build-angular/plugins/karma') require('karma-verbose-reporter'),
require('@angular-devkit/build-angular/plugins/karma'),
], ],
client: { client: {
jasmine: { jasmine: {
@ -41,7 +42,11 @@ module.exports = function(config) {
}, },
// coverage reporter generates the coverage // coverage reporter generates the coverage
reporters: ['progress', 'coverage'], reporters: [
'progress',
'coverage',
// 'verbose'
],
port: 9876, port: 9876,
colors: true, colors: true,
logLevel: config.LOG_INFO, logLevel: config.LOG_INFO,

View File

@ -86,6 +86,7 @@
"karma-coverage-istanbul-reporter": "~3.0.2", "karma-coverage-istanbul-reporter": "~3.0.2",
"karma-jasmine": "~5.1.0", "karma-jasmine": "~5.1.0",
"karma-jasmine-html-reporter": "^2.1.0", "karma-jasmine-html-reporter": "^2.1.0",
"karma-verbose-reporter": "^0.0.8",
"protractor": "~7.0.0", "protractor": "~7.0.0",
"react": "^18.2.0", "react": "^18.2.0",
"react-dom": "^18.2.0", "react-dom": "^18.2.0",

View File

@ -2,6 +2,7 @@ import { TestBed, async } from '@angular/core/testing';
import { RouterTestingModule } from '@angular/router/testing'; import { RouterTestingModule } from '@angular/router/testing';
import { AppComponent } from './app.component'; import { AppComponent } from './app.component';
import {HttpClientTestingModule} from '@angular/common/http/testing'; import {HttpClientTestingModule} from '@angular/common/http/testing';
import { ToastComponent } from './components/toast/toast.component';
describe('AppComponent', () => { describe('AppComponent', () => {
beforeEach(async(() => { beforeEach(async(() => {
@ -11,7 +12,7 @@ describe('AppComponent', () => {
HttpClientTestingModule HttpClientTestingModule
], ],
declarations: [ declarations: [
AppComponent AppComponent, ToastComponent
], ],
}).compileComponents(); }).compileComponents();
})); }));

View File

@ -39,7 +39,6 @@ export class AppComponent implements OnInit {
if (event.url?.startsWith('/auth') || event.url?.startsWith('/desktop')) { if (event.url?.startsWith('/auth') || event.url?.startsWith('/desktop')) {
this.showHeader = false; this.showHeader = false;
} else { } else {
// console.log("NU")
this.showHeader = true; this.showHeader = true;
} }
@ -48,5 +47,3 @@ export class AppComponent implements OnInit {
} }
} }
} }

View File

@ -10,9 +10,6 @@ import { DashboardComponent } from './pages/dashboard/dashboard.component';
import { MedicalSourcesComponent } from './pages/medical-sources/medical-sources.component'; import { MedicalSourcesComponent } from './pages/medical-sources/medical-sources.component';
import { NgChartsModule } from 'ng2-charts'; import { NgChartsModule } from 'ng2-charts';
import {SharedModule} from './components/shared.module'; import {SharedModule} from './components/shared.module';
import { FontAwesomeModule, FaIconLibrary } from '@fortawesome/angular-fontawesome'
import { fas } from '@fortawesome/free-solid-svg-icons';
import { far } from '@fortawesome/free-regular-svg-icons';
import { ResourceDetailComponent } from './pages/resource-detail/resource-detail.component'; import { ResourceDetailComponent } from './pages/resource-detail/resource-detail.component';
import { AuthSignupComponent } from './pages/auth-signup/auth-signup.component'; import { AuthSignupComponent } from './pages/auth-signup/auth-signup.component';
import { AuthSigninComponent } from './pages/auth-signin/auth-signin.component'; import { AuthSigninComponent } from './pages/auth-signin/auth-signin.component';
@ -42,6 +39,7 @@ import {FhirCardModule} from './components/fhir-card/fhir-card.module';
import {FhirDatatableModule} from './components/fhir-datatable/fhir-datatable.module'; import {FhirDatatableModule} from './components/fhir-datatable/fhir-datatable.module';
import { AuthSignupWizardComponent } from './pages/auth-signup-wizard/auth-signup-wizard.component'; import { AuthSignupWizardComponent } from './pages/auth-signup-wizard/auth-signup-wizard.component';
import {ShowFirstRunWizardGuard} from './auth-guards/show-first-run-wizard-guard'; import {ShowFirstRunWizardGuard} from './auth-guards/show-first-run-wizard-guard';
import { IconsModule } from './icon-module';
@NgModule({ @NgModule({
declarations: [ declarations: [
@ -67,7 +65,6 @@ import {ShowFirstRunWizardGuard} from './auth-guards/show-first-run-wizard-guard
FormsModule, FormsModule,
ReactiveFormsModule, ReactiveFormsModule,
BrowserModule, BrowserModule,
FontAwesomeModule,
SharedModule, SharedModule,
FhirCardModule, FhirCardModule,
FhirDatatableModule, FhirDatatableModule,
@ -82,7 +79,8 @@ import {ShowFirstRunWizardGuard} from './auth-guards/show-first-run-wizard-guard
InfiniteScrollModule, InfiniteScrollModule,
NgSelectModule, NgSelectModule,
WidgetsModule, WidgetsModule,
DirectivesModule DirectivesModule,
IconsModule,
], ],
providers: [ providers: [
{ {
@ -112,8 +110,4 @@ import {ShowFirstRunWizardGuard} from './auth-guards/show-first-run-wizard-guard
bootstrap: [AppComponent], bootstrap: [AppComponent],
schemas: [CUSTOM_ELEMENTS_SCHEMA] //required for lhncbc/lforms (webcomponent) schemas: [CUSTOM_ELEMENTS_SCHEMA] //required for lhncbc/lforms (webcomponent)
}) })
export class AppModule { export class AppModule {}
constructor(library: FaIconLibrary) {
library.addIconPacks(fas, far);
}
}

View File

@ -41,7 +41,7 @@ describe('TableComponent', () => {
it('encodes urls properly', () => { it('encodes urls properly', () => {
spyOn(console, 'log').and.callThrough(); spyOn(console, 'log').and.callThrough();
const link = fixture.debugElement.nativeElement.querySelector('a'); const link = fixture.debugElement.nativeElement.querySelector('a');
console.log(link);
expect(link.href).toContain( expect(link.href).toContain(
'/explore/123-456-789%3D/resource/aHR0cHM6Ly93d3cubWVyY3kubmV0L3NpdGVzL2RlZmF1bHQvZmlsZXMvZG9jdG9yX2ltYWdlcy9kZXNrdG9wLzE2NTk4ODYwNTktbS5qcGc%3D' '/explore/123-456-789%3D/resource/aHR0cHM6Ly93d3cubWVyY3kubmV0L3NpdGVzL2RlZmF1bHQvZmlsZXMvZG9jdG9yX2ltYWdlcy9kZXNrdG9wLzE2NTk4ODYwNTktbS5qcGc%3D'
); );

View File

@ -2,6 +2,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
import { RtfComponent } from './rtf.component'; import { RtfComponent } from './rtf.component';
import { BinaryModel } from 'src/lib/models/resources/binary-model'; import { BinaryModel } from 'src/lib/models/resources/binary-model';
import { RTFJS } from 'rtf.js';
describe('RtfComponent', () => { describe('RtfComponent', () => {
let component: RtfComponent; let component: RtfComponent;
@ -15,6 +16,8 @@ describe('RtfComponent', () => {
}) })
.compileComponents(); .compileComponents();
RTFJS.loggingEnabled(false);
fixture = TestBed.createComponent(RtfComponent); fixture = TestBed.createComponent(RtfComponent);
component = fixture.componentInstance; component = fixture.componentInstance;
component.displayModel = new BinaryModel({}); component.displayModel = new BinaryModel({});

View File

@ -62,7 +62,6 @@ export class FhirCardComponent implements OnInit, OnChanges {
let componentType = this.typeLookup(this.displayModel?.source_resource_type) let componentType = this.typeLookup(this.displayModel?.source_resource_type)
if(componentType != null){ if(componentType != null){
console.log("Attempting to create fhir display component", this.displayModel, componentType)
const componentRef = viewContainerRef.createComponent<FhirCardComponentInterface>(componentType); const componentRef = viewContainerRef.createComponent<FhirCardComponentInterface>(componentType);
componentRef.instance.displayModel = this.displayModel; componentRef.instance.displayModel = this.displayModel;
componentRef.instance.showDetails = this.showDetails; componentRef.instance.showDetails = this.showDetails;

View File

@ -1,6 +1,7 @@
import { ComponentFixture, TestBed } from '@angular/core/testing'; import { ComponentFixture, TestBed } from '@angular/core/testing';
import { FallbackComponent } from './fallback.component'; import { FallbackComponent } from './fallback.component';
import { HIGHLIGHT_OPTIONS } from 'ngx-highlightjs';
describe('FallbackComponent', () => { describe('FallbackComponent', () => {
let component: FallbackComponent; let component: FallbackComponent;
@ -8,7 +9,19 @@ describe('FallbackComponent', () => {
beforeEach(async () => { beforeEach(async () => {
await TestBed.configureTestingModule({ await TestBed.configureTestingModule({
imports: [ FallbackComponent ] imports: [ FallbackComponent ],
providers: [
{
provide: HIGHLIGHT_OPTIONS,
useValue: {
coreLibraryLoader: () => import('highlight.js/lib/core'),
lineNumbersLoader: () => import('highlightjs-line-numbers.js'), // Optional, only if you want the line numbers
languages: {
json: () => import('highlight.js/lib/languages/json')
},
}
},
]
}) })
.compileComponents(); .compileComponents();

View File

@ -4,6 +4,7 @@ import { DatatableGenericResourceComponent } from './datatable-generic-resource.
import {HTTP_CLIENT_TOKEN} from '../../../dependency-injection'; import {HTTP_CLIENT_TOKEN} from '../../../dependency-injection';
import {HttpClient} from '@angular/common/http'; import {HttpClient} from '@angular/common/http';
import {HttpClientTestingModule} from '@angular/common/http/testing'; import {HttpClientTestingModule} from '@angular/common/http/testing';
import { NgxDatatableModule } from '@swimlane/ngx-datatable';
describe('ListGenericResourceComponent', () => { describe('ListGenericResourceComponent', () => {
let component: DatatableGenericResourceComponent; let component: DatatableGenericResourceComponent;
@ -12,7 +13,7 @@ describe('ListGenericResourceComponent', () => {
beforeEach(async () => { beforeEach(async () => {
await TestBed.configureTestingModule({ await TestBed.configureTestingModule({
declarations: [ DatatableGenericResourceComponent ], declarations: [ DatatableGenericResourceComponent ],
imports: [HttpClientTestingModule], imports: [HttpClientTestingModule, NgxDatatableModule],
providers: [ providers: [
{ {
provide: HTTP_CLIENT_TOKEN, provide: HTTP_CLIENT_TOKEN,

View File

@ -65,7 +65,6 @@ export class DatatableGenericResourceComponent implements OnInit, ResourceListCo
} }
ngOnInit(): void { ngOnInit(): void {
console.log("INIT GENERIC RESOURCE")
this.currentPage = {offset: 0} this.currentPage = {offset: 0}
this.changePage(this.currentPage) this.changePage(this.currentPage)
@ -75,7 +74,6 @@ export class DatatableGenericResourceComponent implements OnInit, ResourceListCo
} }
changePage(page: PageInfo){ changePage(page: PageInfo){
console.log("Requesting page:" + JSON.stringify(page))
this.currentPage = page; this.currentPage = page;
this.fastenApi.getResources(this.resourceListType, this.sourceId, null, this.currentPage.offset) this.fastenApi.getResources(this.resourceListType, this.sourceId, null, this.currentPage.offset)
.subscribe((resourceList: ResourceFhir[]) => { .subscribe((resourceList: ResourceFhir[]) => {
@ -100,7 +98,6 @@ export class DatatableGenericResourceComponent implements OnInit, ResourceListCo
renderList(resourceList: ResourceFhir[]){ renderList(resourceList: ResourceFhir[]){
console.log("GENERIC RESOURCE RENDERLSIT")
this.columns = this.columnDefinitions.map((defn) => { this.columns = this.columnDefinitions.map((defn) => {
let column = {name: defn.title, prop: defn.title.replace(/[^A-Z0-9]/ig, "_"), sortable: false} let column = {name: defn.title, prop: defn.title.replace(/[^A-Z0-9]/ig, "_"), sortable: false}
return column return column
@ -152,15 +149,3 @@ export class DatatableGenericResourceComponent implements OnInit, ResourceListCo
/////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////
// START OVERRIDES // START OVERRIDES
/////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////

View File

@ -68,7 +68,6 @@ export class FhirDatatableComponent implements OnInit, OnChanges {
let componentType = this.typeLookup(this.resourceListType) let componentType = this.typeLookup(this.resourceListType)
if(componentType != null){ if(componentType != null){
console.log("Attempting to create component", this.resourceListType, componentType)
const componentRef = viewContainerRef.createComponent<ResourceListComponentInterface>(componentType); const componentRef = viewContainerRef.createComponent<ResourceListComponentInterface>(componentType);
componentRef.instance.totalElements = this.selectedTotalElements; componentRef.instance.totalElements = this.selectedTotalElements;
componentRef.instance.resourceListType = this.resourceListType; componentRef.instance.resourceListType = this.resourceListType;

View File

@ -30,7 +30,6 @@ export class GlossaryLookupComponent implements OnInit {
ngOnInit(): void { ngOnInit(): void {
this.fastenApi.getGlossarySearchByCode(this.code, this.codeSystem).subscribe(result => { this.fastenApi.getGlossarySearchByCode(this.code, this.codeSystem).subscribe(result => {
this.loading = false this.loading = false
console.log(result)
this.url = result?.url this.url = result?.url
this.source = result?.publisher this.source = result?.publisher
this.description = this.sanitized.bypassSecurityTrustHtml(result?.description) this.description = this.sanitized.bypassSecurityTrustHtml(result?.description)

View File

@ -32,12 +32,10 @@ const withHttpClientProvider: DecoratorFunction<any> = (storyFunc, context) => {
class MockHttpClient extends HttpClient { class MockHttpClient extends HttpClient {
get(): Observable<any> { get(): Observable<any> {
// console.log("CALLED getGlossarySearchByCode in MockFastenApiService")
return of(httpClientResp) return of(httpClientResp)
} }
} }
// console.log("Inside withHttpClientProvider DecoratorFunction", code, codeSystem)
return moduleMetadata({ providers: [{ provide: HTTP_CLIENT_TOKEN, useClass: MockHttpClient }] })( return moduleMetadata({ providers: [{ provide: HTTP_CLIENT_TOKEN, useClass: MockHttpClient }] })(
storyFunc, storyFunc,
context context

View File

@ -6,6 +6,7 @@ import {RouterModule} from '@angular/router';
import {RouterTestingModule} from '@angular/router/testing'; import {RouterTestingModule} from '@angular/router/testing';
import {HTTP_CLIENT_TOKEN} from '../../dependency-injection'; import {HTTP_CLIENT_TOKEN} from '../../dependency-injection';
import {HttpClient} from '@angular/common/http'; import {HttpClient} from '@angular/common/http';
import { IconsModule } from 'src/app/icon-module';
describe('HeaderComponent', () => { describe('HeaderComponent', () => {
let component: HeaderComponent; let component: HeaderComponent;
@ -13,7 +14,7 @@ describe('HeaderComponent', () => {
beforeEach(async(() => { beforeEach(async(() => {
TestBed.configureTestingModule({ TestBed.configureTestingModule({
imports: [ HttpClientTestingModule, RouterTestingModule, RouterModule ], imports: [ HttpClientTestingModule, RouterTestingModule, RouterModule, IconsModule ],
declarations: [ HeaderComponent ], declarations: [ HeaderComponent ],
providers: [ providers: [
{ {

View File

@ -95,12 +95,10 @@ export class HeaderComponent implements OnInit, OnDestroy {
this.newSupportRequest = newSupportRequest this.newSupportRequest = newSupportRequest
} }
submitSupportForm() { submitSupportForm() {
console.log("submitting support form", this.newSupportRequest)
this.loading = false this.loading = false
this.fastenApi.supportRequest(this.newSupportRequest).subscribe((resp: any) => { this.fastenApi.supportRequest(this.newSupportRequest).subscribe((resp: any) => {
this.loading = false this.loading = false
console.log(resp);
this.submitSuccess = true this.submitSuccess = true
//show success toast? close modal? //show success toast? close modal?
}, },

View File

@ -38,7 +38,6 @@ export class MedicalRecordWizardAddAttachmentComponent implements OnInit {
} }
onAttachmentFileChange($event){ onAttachmentFileChange($event){
console.log("onAttachmentFileChange")
let fileInput = $event.target as HTMLInputElement; let fileInput = $event.target as HTMLInputElement;
if (fileInput.files && fileInput.files[0]) { if (fileInput.files && fileInput.files[0]) {
let processingFile = fileInput.files[0] let processingFile = fileInput.files[0]

View File

@ -72,7 +72,6 @@ export class MedicalRecordWizardAddEncounterComponent implements OnInit {
} }
} }
selectionChanged(event) { selectionChanged(event) {
console.log("SELECTION CHANGED", event)
this.selectedEncounter = event this.selectedEncounter = event
} }
get submitEnabled() { get submitEnabled() {
@ -108,7 +107,6 @@ export class MedicalRecordWizardAddEncounterComponent implements OnInit {
let parsed = RecResourceRelatedDisplayModel(graphResponse.results["Encounter"]?.[0]) let parsed = RecResourceRelatedDisplayModel(graphResponse.results["Encounter"]?.[0])
let encounterDisplayModelWithRelated = parsed.displayModel as EncounterModel let encounterDisplayModelWithRelated = parsed.displayModel as EncounterModel
console.log("Found encounter (and related resources)", encounterDisplayModelWithRelated)
this.activeModal.close({ this.activeModal.close({
action: this.activeId, action: this.activeId,
data: encounterDisplayModelWithRelated data: encounterDisplayModelWithRelated

View File

@ -43,7 +43,6 @@ export class MedicalRecordWizardAddLabResultsComponent implements OnInit {
ngOnInit(): void { ngOnInit(): void {
// const parent: HTMLElement = document.getElementById('lhcFormContainer'); // const parent: HTMLElement = document.getElementById('lhcFormContainer');
// console.log("Adding Form to page", this.questionnaire)
// LForms.Util.addFormToPage(this.questionnaire, parent); // LForms.Util.addFormToPage(this.questionnaire, parent);
this.resetLabPanelForm() this.resetLabPanelForm()
} }
@ -60,26 +59,18 @@ export class MedicalRecordWizardAddLabResultsComponent implements OnInit {
null, null,
{bundleType: "transaction"} {bundleType: "transaction"}
) )
console.log(formData)
this.activeModal.close({ this.activeModal.close({
action: 'create', action: 'create',
data: formData data: formData
}); });
} }
onFormReady(e){
console.log("onFormReady", e)
}
onError(e){
console.log("onError", e)
}
private resetLabPanelForm() { private resetLabPanelForm() {
this.newLabPanelTypeaheadForm = new FormGroup({ this.newLabPanelTypeaheadForm = new FormGroup({
data: new FormControl(null, Validators.required), data: new FormControl(null, Validators.required),
}) })
this.newLabPanelTypeaheadForm.valueChanges.subscribe(form => { this.newLabPanelTypeaheadForm.valueChanges.subscribe(form => {
console.log("CHANGE LabPanel IN MODAL", form)
let val = form.data let val = form.data
if(val && val.id){ if(val && val.id){
this.loading = true this.loading = true

View File

@ -74,7 +74,6 @@ export class MedicalRecordWizardAddOrganizationComponent implements OnInit {
} }
} }
selectionChanged(event) { selectionChanged(event) {
console.log("SELECTION CHANGED", event)
this.selectedOrganization = event this.selectedOrganization = event
} }
get submitEnabled() { get submitEnabled() {
@ -160,7 +159,6 @@ export class MedicalRecordWizardAddOrganizationComponent implements OnInit {
data: new FormControl(null, Validators.required), data: new FormControl(null, Validators.required),
}) })
this.newOrganizationTypeaheadForm.valueChanges.subscribe(form => { this.newOrganizationTypeaheadForm.valueChanges.subscribe(form => {
console.log("CHANGE Organization IN MODAL", form)
let val = form.data let val = form.data
if(val == null){ if(val == null){

View File

@ -74,7 +74,6 @@ export class MedicalRecordWizardAddPractitionerComponent implements OnInit {
} }
} }
selectionChanged(event) { selectionChanged(event) {
console.log("SELECTION CHANGED", event)
this.selectedPractitioner = event this.selectedPractitioner = event
} }
get submitEnabled() { get submitEnabled() {
@ -168,7 +167,6 @@ export class MedicalRecordWizardAddPractitionerComponent implements OnInit {
data: new FormControl(null, Validators.required), data: new FormControl(null, Validators.required),
}) })
this.newPractitionerTypeaheadForm.valueChanges.subscribe(form => { this.newPractitionerTypeaheadForm.valueChanges.subscribe(form => {
console.log("CHANGE INDIVIDUAL IN MODAL", form)
let val = form.data let val = form.data
if(val == null){ if(val == null){
//reset the dependant fields (user cleared the text box) //reset the dependant fields (user cleared the text box)

View File

@ -242,13 +242,11 @@ export class MedicalRecordWizardComponent implements OnInit {
modalRef.componentInstance.debugMode = this.debugMode; modalRef.componentInstance.debugMode = this.debugMode;
modalRef.result.then( modalRef.result.then(
(result) => { (result) => {
console.log('Closing, saving form', result);
// add this to the list of organization // add this to the list of organization
//TODO //TODO
this.addEncounter(result); this.addEncounter(result);
}, },
(err) => { (err) => {
console.log('Closed without saving', err);
}, },
); );
@ -268,7 +266,6 @@ export class MedicalRecordWizardComponent implements OnInit {
modalRef.componentInstance.disabledResourceIds = disabledResourceIds; modalRef.componentInstance.disabledResourceIds = disabledResourceIds;
modalRef.result.then( modalRef.result.then(
(result) => { (result) => {
console.log('Closing, saving form', result);
// add this to the list of organization // add this to the list of organization
this.addPractitioner(result); this.addPractitioner(result);
if(formGroup && controlName){ if(formGroup && controlName){
@ -277,7 +274,6 @@ export class MedicalRecordWizardComponent implements OnInit {
} }
}, },
(err) => { (err) => {
console.log('Closed without saving', err);
}, },
); );
@ -296,7 +292,6 @@ export class MedicalRecordWizardComponent implements OnInit {
modalRef.componentInstance.disabledResourceIds = disabledResourceIds; modalRef.componentInstance.disabledResourceIds = disabledResourceIds;
modalRef.result.then( modalRef.result.then(
(result) => { (result) => {
console.log('Closing, saving form', result);
//add this to the list of organization //add this to the list of organization
this.addOrganization(result); this.addOrganization(result);
if(formGroup && controlName){ if(formGroup && controlName){
@ -305,7 +300,6 @@ export class MedicalRecordWizardComponent implements OnInit {
} }
}, },
(err) => { (err) => {
console.log('Closed without saving', err);
}, },
); );
} }
@ -317,12 +311,10 @@ export class MedicalRecordWizardComponent implements OnInit {
modalRef.componentInstance.debugMode = this.debugMode; modalRef.componentInstance.debugMode = this.debugMode;
modalRef.result.then( modalRef.result.then(
(result) => { (result) => {
console.log('Closing, saving form', result);
//add this to the list of organization //add this to the list of organization
this.addLabResultsBundle(result); this.addLabResultsBundle(result);
}, },
(err) => { (err) => {
console.log('Closed without saving', err);
}, },
); );
} }
@ -335,7 +327,6 @@ export class MedicalRecordWizardComponent implements OnInit {
modalRef.componentInstance.debugMode = this.debugMode; modalRef.componentInstance.debugMode = this.debugMode;
modalRef.result.then( modalRef.result.then(
(result) => { (result) => {
console.log('Closing, saving form', result);
//add this to the list of organization //add this to the list of organization
result.id = uuidV4(); result.id = uuidV4();
this.addAttachment(result); this.addAttachment(result);
@ -349,7 +340,6 @@ export class MedicalRecordWizardComponent implements OnInit {
} }
}, },
(err) => { (err) => {
console.log('Closed without saving', err);
}, },
); );
} }
@ -358,10 +348,8 @@ export class MedicalRecordWizardComponent implements OnInit {
onSubmit() { onSubmit() {
console.log(this.form.getRawValue())
this.form.markAllAsTouched() this.form.markAllAsTouched()
if (this.form.valid) { if (this.form.valid) {
console.log('form submitted');
this.submitWizardLoading = true; this.submitWizardLoading = true;
let resourceStorage = GenerateR4ResourceLookup(this.form.getRawValue()); let resourceStorage = GenerateR4ResourceLookup(this.form.getRawValue());
@ -413,12 +401,10 @@ export class MedicalRecordWizardComponent implements OnInit {
this.fastenApi.createRelatedResourcesFastenSource(fhirListResource).subscribe( this.fastenApi.createRelatedResourcesFastenSource(fhirListResource).subscribe(
(resp) => { (resp) => {
console.log(resp)
this.submitWizardLoading = false; this.submitWizardLoading = false;
this.activeModal.close() this.activeModal.close()
}, },
(err) => { (err) => {
console.log(err)
this.submitWizardLoading = false; this.submitWizardLoading = false;
} }
) )

View File

@ -5,6 +5,7 @@ import {HTTP_CLIENT_TOKEN} from '../../dependency-injection';
import {HttpClient} from '@angular/common/http'; import {HttpClient} from '@angular/common/http';
import {HttpClientTestingModule} from '@angular/common/http/testing'; import {HttpClientTestingModule} from '@angular/common/http/testing';
import {RouterTestingModule} from '@angular/router/testing'; import {RouterTestingModule} from '@angular/router/testing';
import { LoadingSpinnerComponent } from '../loading-spinner/loading-spinner.component';
describe('MedicalSourcesConnectedComponent', () => { describe('MedicalSourcesConnectedComponent', () => {
let component: MedicalSourcesConnectedComponent; let component: MedicalSourcesConnectedComponent;
@ -13,7 +14,7 @@ describe('MedicalSourcesConnectedComponent', () => {
beforeEach(async () => { beforeEach(async () => {
await TestBed.configureTestingModule({ await TestBed.configureTestingModule({
declarations: [ MedicalSourcesConnectedComponent ], declarations: [ MedicalSourcesConnectedComponent ],
imports: [HttpClientTestingModule, RouterTestingModule], imports: [HttpClientTestingModule, RouterTestingModule, LoadingSpinnerComponent],
providers: [ providers: [
{ {
provide: HTTP_CLIENT_TOKEN, provide: HTTP_CLIENT_TOKEN,

View File

@ -11,7 +11,6 @@ export class MedicalSourcesCategoryLookupPipe implements PipeTransform {
} }
let lookupDescription = SOURCE_CATEGORY_CODE_LOOKUP[categoryCode]; let lookupDescription = SOURCE_CATEGORY_CODE_LOOKUP[categoryCode];
if (!lookupDescription){ if (!lookupDescription){
console.log("COULD NOT FIND CATEGORY CODE", categoryCode, "IN LOOKUP")
return categoryCode; return categoryCode;
} else { } else {
return lookupDescription; return lookupDescription;

View File

@ -23,11 +23,9 @@ export class MedicalSourcesFilterComponent implements OnInit {
} }
categorySelected(category: string){ categorySelected(category: string){
console.log("SELECTED CATEGORY", category)
this.filterService.filterForm.patchValue({'categories': {[category]: true}}) this.filterService.filterForm.patchValue({'categories': {[category]: true}})
} }
platformTypeSelected(platformType: string){ platformTypeSelected(platformType: string){
console.log("SELECTED PLATFORMTYPE", platformType)
this.filterService.filterForm.patchValue({'platformTypes': {[platformType]: true}}) this.filterService.filterForm.patchValue({'platformTypes': {[platformType]: true}})
} }

View File

@ -180,8 +180,6 @@ export class NlmTypeaheadComponent implements ControlValueAccessor {
tap(() => { this.searching = true }), tap(() => { this.searching = true }),
switchMap((term): ObservableInput<any> => { switchMap((term): ObservableInput<any> => {
console.log("searching for", term)
//must use bind //must use bind
return searchOpFn(term).pipe( return searchOpFn(term).pipe(
tap(() => {this.searchFailed = false}), tap(() => {this.searchFailed = false}),
@ -197,7 +195,7 @@ export class NlmTypeaheadComponent implements ControlValueAccessor {
typeAheadChangeEvent(event){ typeAheadChangeEvent(event){
this.markAsTouched() this.markAsTouched()
console.log("bubbling modelChange event", event)
if(typeof event === 'string'){ if(typeof event === 'string'){
if(this.idResult){ if(this.idResult){
this.onChange(null); this.onChange(null);

View File

@ -2,8 +2,8 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
import { ReportHeaderComponent } from './report-header.component'; import { ReportHeaderComponent } from './report-header.component';
import {FastenApiService} from '../../services/fasten-api.service'; import {FastenApiService} from '../../services/fasten-api.service';
import {NgbModalModule} from '@ng-bootstrap/ng-bootstrap';
import {of} from 'rxjs'; import {of} from 'rxjs';
import { RouterTestingModule } from '@angular/router/testing';
describe('ReportHeaderComponent', () => { describe('ReportHeaderComponent', () => {
let component: ReportHeaderComponent; let component: ReportHeaderComponent;
@ -14,6 +14,7 @@ describe('ReportHeaderComponent', () => {
mockedFastenApiService = jasmine.createSpyObj('FastenApiService', ['getResources']) mockedFastenApiService = jasmine.createSpyObj('FastenApiService', ['getResources'])
await TestBed.configureTestingModule({ await TestBed.configureTestingModule({
imports: [ RouterTestingModule ],
declarations: [ ReportHeaderComponent ], declarations: [ ReportHeaderComponent ],
providers: [{ providers: [{
provide: FastenApiService, provide: FastenApiService,

View File

@ -21,17 +21,14 @@ export class ReportHeaderComponent implements OnInit {
ngOnInit(): void { ngOnInit(): void {
this.fastenApi.getResources("Patient").subscribe(results => { this.fastenApi.getResources("Patient").subscribe(results => {
console.log(results)
this.patient = results[0] this.patient = results[0]
if(!this.patient) return if(!this.patient) return
let primaryCareId = fhirpath.evaluate(this.patient?.resource_raw, "Patient.generalPractitioner.reference.first()") let primaryCareId = fhirpath.evaluate(this.patient?.resource_raw, "Patient.generalPractitioner.reference.first()")
console.log("GP:", primaryCareId)
if(primaryCareId){ if(primaryCareId){
let primaryCareIdStr = primaryCareId.join("") let primaryCareIdStr = primaryCareId.join("")
let primaryCareIdParts = primaryCareIdStr.split("/") let primaryCareIdParts = primaryCareIdStr.split("/")
if(primaryCareIdParts.length == 2) { if(primaryCareIdParts.length == 2) {
console.log(primaryCareIdParts)
this.fastenApi.getResources(primaryCareIdParts[0], this.patient?.source_id, primaryCareIdParts[1]).subscribe(primaryResults => { this.fastenApi.getResources(primaryCareIdParts[0], this.patient?.source_id, primaryCareIdParts[1]).subscribe(primaryResults => {
if (primaryResults.length > 0){ if (primaryResults.length > 0){
this.primaryCare = new PractitionerModel(primaryResults[0].resource_raw) this.primaryCare = new PractitionerModel(primaryResults[0].resource_raw)

View File

@ -2,6 +2,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
import { ReportMedicalHistoryConditionComponent } from './report-medical-history-condition.component'; import { ReportMedicalHistoryConditionComponent } from './report-medical-history-condition.component';
import {PipesModule} from '../../pipes/pipes.module'; import {PipesModule} from '../../pipes/pipes.module';
import { RouterTestingModule } from '@angular/router/testing';
describe('ReportMedicalHistoryConditionComponent', () => { describe('ReportMedicalHistoryConditionComponent', () => {
let component: ReportMedicalHistoryConditionComponent; let component: ReportMedicalHistoryConditionComponent;
@ -10,7 +11,7 @@ describe('ReportMedicalHistoryConditionComponent', () => {
beforeEach(async () => { beforeEach(async () => {
await TestBed.configureTestingModule({ await TestBed.configureTestingModule({
declarations: [ ReportMedicalHistoryConditionComponent ], declarations: [ ReportMedicalHistoryConditionComponent ],
imports: [PipesModule] imports: [PipesModule, RouterTestingModule]
}) })
.compileComponents(); .compileComponents();

View File

@ -139,7 +139,6 @@ export class ReportMedicalHistoryConditionComponent implements OnInit {
} }
console.log("GENERATED INVOLVED IN CARE MAP", involvedInCareMap)
for(let resourceId in involvedInCareMap){ for(let resourceId in involvedInCareMap){
this.involvedInCare.push(involvedInCareMap[resourceId]) this.involvedInCare.push(involvedInCareMap[resourceId])
} }

View File

@ -4,6 +4,8 @@ import { ReportMedicalHistoryEditorComponent } from './report-medical-history-ed
import {NgbActiveModal, NgbModalModule} from '@ng-bootstrap/ng-bootstrap'; import {NgbActiveModal, NgbModalModule} from '@ng-bootstrap/ng-bootstrap';
import {FastenApiService} from '../../services/fasten-api.service'; import {FastenApiService} from '../../services/fasten-api.service';
import {HttpClient} from '@angular/common/http'; import {HttpClient} from '@angular/common/http';
import { TreeModule } from '@circlon/angular-tree-component';
import { FormsModule } from '@angular/forms';
describe('ReportMedicalHistoryEditorComponent', () => { describe('ReportMedicalHistoryEditorComponent', () => {
let component: ReportMedicalHistoryEditorComponent; let component: ReportMedicalHistoryEditorComponent;
@ -12,7 +14,7 @@ describe('ReportMedicalHistoryEditorComponent', () => {
beforeEach(async () => { beforeEach(async () => {
await TestBed.configureTestingModule({ await TestBed.configureTestingModule({
declarations: [ ReportMedicalHistoryEditorComponent ], declarations: [ ReportMedicalHistoryEditorComponent ],
imports: [], imports: [ TreeModule, FormsModule ],
providers: [NgbActiveModal, { providers: [NgbActiveModal, {
provide: FastenApiService, provide: FastenApiService,
useValue: jasmine.createSpyObj('FastenApiService', ['createResourceComposition']) useValue: jasmine.createSpyObj('FastenApiService', ['createResourceComposition'])

View File

@ -65,7 +65,6 @@ export class ReportMedicalHistoryEditorComponent implements OnInit {
) { } ) { }
ngOnInit(): void { ngOnInit(): void {
console.log("ngOnInit STATUS", this.conditions)
this.nodes = this.generateNodes(this.conditions) this.nodes = this.generateNodes(this.conditions)
} }
@ -81,7 +80,6 @@ export class ReportMedicalHistoryEditorComponent implements OnInit {
//delete this key (unselected) //delete this key (unselected)
delete this.selectedResources[key] delete this.selectedResources[key]
} }
console.log("selected resources", this.selectedResources)
} }
onMergeResourcesClick() { onMergeResourcesClick() {
@ -91,8 +89,7 @@ export class ReportMedicalHistoryEditorComponent implements OnInit {
resources.push(this.selectedResources[key]) resources.push(this.selectedResources[key])
} }
this.fastenApi.createResourceComposition(this.compositionTitle, resources).subscribe(results => { this.fastenApi.createResourceComposition(this.compositionTitle, resources).subscribe((results) => {
console.log(results)
this.activeModal.close() this.activeModal.close()
},(err) => {}) },(err) => {})
} }
@ -112,7 +109,6 @@ export class ReportMedicalHistoryEditorComponent implements OnInit {
} }
} }
console.log("NODES:", relatedNodes)
return relatedNodes return relatedNodes
} }

View File

@ -1,6 +1,7 @@
import { ComponentFixture, TestBed } from '@angular/core/testing'; import { ComponentFixture, TestBed } from '@angular/core/testing';
import { ReportMedicalHistoryExplanationOfBenefitComponent } from './report-medical-history-explanation-of-benefit.component'; import { ReportMedicalHistoryExplanationOfBenefitComponent } from './report-medical-history-explanation-of-benefit.component';
import { RouterTestingModule } from '@angular/router/testing';
describe('ReportMedicalHistoryExplanationOfBenefitComponent', () => { describe('ReportMedicalHistoryExplanationOfBenefitComponent', () => {
let component: ReportMedicalHistoryExplanationOfBenefitComponent; let component: ReportMedicalHistoryExplanationOfBenefitComponent;
@ -8,7 +9,8 @@ describe('ReportMedicalHistoryExplanationOfBenefitComponent', () => {
beforeEach(async () => { beforeEach(async () => {
await TestBed.configureTestingModule({ await TestBed.configureTestingModule({
declarations: [ ReportMedicalHistoryExplanationOfBenefitComponent ] declarations: [ ReportMedicalHistoryExplanationOfBenefitComponent ],
imports: [ RouterTestingModule ]
}) })
.compileComponents(); .compileComponents();

View File

@ -57,7 +57,6 @@ export class ReportMedicalHistoryExplanationOfBenefitComponent implements OnInit
this.eobDisplayModel = result.displayModel this.eobDisplayModel = result.displayModel
console.log("Resources Lookup", this.resourcesLookup)
let involvedInCareMap: {[resource_id: string]: {displayName: string, role?: string, email?: string}} = {} let involvedInCareMap: {[resource_id: string]: {displayName: string, role?: string, email?: string}} = {}
@ -86,7 +85,6 @@ export class ReportMedicalHistoryExplanationOfBenefitComponent implements OnInit
this.procedures.push(procedureModel) this.procedures.push(procedureModel)
}) })
console.log("CONDITION", this.condition)
// this.medications = this.eobDisplayModel.prescription // this.medications = this.eobDisplayModel.prescription
@ -157,7 +155,6 @@ export class ReportMedicalHistoryExplanationOfBenefitComponent implements OnInit
} }
console.log("GENERATED INVOLVED IN CARE MAP", involvedInCareMap)
for(let resourceId in involvedInCareMap){ for(let resourceId in involvedInCareMap){
this.involvedInCare.push(involvedInCareMap[resourceId]) this.involvedInCare.push(involvedInCareMap[resourceId])
} }

View File

@ -2,6 +2,8 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
import { ReportMedicalHistoryTimelinePanelComponent } from './report-medical-history-timeline-panel.component'; import { ReportMedicalHistoryTimelinePanelComponent } from './report-medical-history-timeline-panel.component';
import {MomentModule} from 'ngx-moment'; import {MomentModule} from 'ngx-moment';
import { RouterTestingModule } from '@angular/router/testing';
import { NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap';
describe('ReportMedicalHistoryTimelinePanelComponent', () => { describe('ReportMedicalHistoryTimelinePanelComponent', () => {
let component: ReportMedicalHistoryTimelinePanelComponent; let component: ReportMedicalHistoryTimelinePanelComponent;
@ -9,8 +11,8 @@ describe('ReportMedicalHistoryTimelinePanelComponent', () => {
beforeEach(async () => { beforeEach(async () => {
await TestBed.configureTestingModule({ await TestBed.configureTestingModule({
imports: [ MomentModule ], imports: [ MomentModule, RouterTestingModule, NgbDropdownModule ],
declarations: [ ReportMedicalHistoryTimelinePanelComponent ] declarations: [ ReportMedicalHistoryTimelinePanelComponent ],
}) })
.compileComponents(); .compileComponents();

View File

@ -20,6 +20,9 @@ export class ReportMedicalHistoryTimelinePanelComponent implements OnInit {
constructor(private modalService: NgbModal) { } constructor(private modalService: NgbModal) { }
ngOnInit(): void { ngOnInit(): void {
if (!this.resourceFhir) {
return;
}
let parsed = RecResourceRelatedDisplayModel(this.resourceFhir) let parsed = RecResourceRelatedDisplayModel(this.resourceFhir)
this.displayModel = parsed.displayModel as EncounterModel this.displayModel = parsed.displayModel as EncounterModel

View File

@ -0,0 +1,15 @@
import { NgModule } from '@angular/core';
import { FontAwesomeModule, FaIconLibrary } from '@fortawesome/angular-fontawesome';
import { fas } from '@fortawesome/free-solid-svg-icons';
import { far } from '@fortawesome/free-regular-svg-icons';
// Taken from https://stackoverflow.com/questions/55328832/testing-components-with-font-awesome-icons-module
@NgModule({
imports: [ FontAwesomeModule ],
exports: [ FontAwesomeModule ]
})
export class IconsModule {
constructor(library: FaIconLibrary) {
library.addIconPacks(fas, far);
}
}

View File

@ -90,8 +90,6 @@ export class AuthSigninComponent implements OnInit {
} }
idpConnectHello($event){ idpConnectHello($event){
this.authService.IdpConnect('hello').catch(console.error)
this.authService.IdpConnect('hello')
.then(console.log)
} }
} }

View File

@ -126,10 +126,8 @@ export class AuthSignupWizardComponent implements OnInit {
this.loading = true this.loading = true
this.submitted = true; this.submitted = true;
console.log("starting signup process...",this.newUser)
this.authService.Signup(this.newUser).then((tokenResp: any) => { this.authService.Signup(this.newUser).then((tokenResp: any) => {
this.loading = false this.loading = false
console.log(tokenResp);
this.router.navigateByUrl('/dashboard'); this.router.navigateByUrl('/dashboard');
}, },
(err)=>{ (err)=>{

View File

@ -32,7 +32,6 @@ export class AuthSignupComponent implements OnInit {
this.authService.Signup(this.newUser).then((tokenResp: any) => { this.authService.Signup(this.newUser).then((tokenResp: any) => {
this.loading = false this.loading = false
console.log(tokenResp);
this.router.navigateByUrl('/dashboard'); this.router.navigateByUrl('/dashboard');
}, },
(err)=>{ (err)=>{

View File

@ -25,7 +25,6 @@ export class BackgroundJobsComponent implements OnInit, OnDestroy {
mergeMap(() => this.fastenApi.getBackgroundJobs()) mergeMap(() => this.fastenApi.getBackgroundJobs())
) )
.subscribe((jobs) => { .subscribe((jobs) => {
console.log("Background jobs updated")
this.backgroundJobs = jobs this.backgroundJobs = jobs
}) })
} }

View File

@ -6,6 +6,7 @@ import {RouterTestingModule} from '@angular/router/testing';
import {RouterModule} from '@angular/router'; import {RouterModule} from '@angular/router';
import {HTTP_CLIENT_TOKEN} from '../../dependency-injection'; import {HTTP_CLIENT_TOKEN} from '../../dependency-injection';
import {HttpClient} from '@angular/common/http'; import {HttpClient} from '@angular/common/http';
import { GridstackComponent } from 'src/app/components/gridstack/gridstack.component';
describe('DashboardComponent', () => { describe('DashboardComponent', () => {
let component: DashboardComponent; let component: DashboardComponent;
@ -13,7 +14,7 @@ describe('DashboardComponent', () => {
beforeEach(async(() => { beforeEach(async(() => {
TestBed.configureTestingModule({ TestBed.configureTestingModule({
imports: [HttpClientTestingModule, RouterTestingModule, RouterModule], imports: [HttpClientTestingModule, RouterTestingModule, RouterModule, GridstackComponent],
declarations: [ DashboardComponent ], declarations: [ DashboardComponent ],
providers: [ providers: [
{ {

View File

@ -59,7 +59,6 @@ export class DashboardComponent implements OnInit {
//setup dashboard configs //setup dashboard configs
console.log("DASHBOARDS!", this.dashboardConfigs)
this.changeSelectedDashboard(0) this.changeSelectedDashboard(0)
}, error => { }, error => {
@ -115,7 +114,6 @@ export class DashboardComponent implements OnInit {
this.gridComp?.grid?.removeAll() //clear the grid this.gridComp?.grid?.removeAll() //clear the grid
this.dashboardConfigs?.[this.selectedDashboardConfigNdx]?.widgets?.forEach((widgetConfig) => { this.dashboardConfigs?.[this.selectedDashboardConfigNdx]?.widgets?.forEach((widgetConfig) => {
console.log("Adding Widgets to Dashboard Grid")
this.gridComp?.grid?.addWidget({ this.gridComp?.grid?.addWidget({
x: widgetConfig.x, x: widgetConfig.x,
@ -131,7 +129,6 @@ export class DashboardComponent implements OnInit {
public toggleEditableGrid() { public toggleEditableGrid() {
this.gridEditDisabled = !this.gridEditDisabled; this.gridEditDisabled = !this.gridEditDisabled;
console.log('toggle - is disabled', this.gridEditDisabled)
this.gridEditDisabled ? this.gridComp.grid?.disable(true) : this.gridComp.grid?.enable(true); this.gridEditDisabled ? this.gridComp.grid?.disable(true) : this.gridComp.grid?.enable(true);
@ -141,7 +138,6 @@ export class DashboardComponent implements OnInit {
this.addDashboardLoading = true this.addDashboardLoading = true
this.dashboardLocationError = '' this.dashboardLocationError = ''
this.fastenApi.addDashboardLocation(this.dashboardLocation).subscribe((result) => { this.fastenApi.addDashboardLocation(this.dashboardLocation).subscribe((result) => {
console.log("Added Remote Dashboard", result)
this.addDashboardLoading = false this.addDashboardLoading = false
this.modalService.dismissAll() this.modalService.dismissAll()
@ -149,37 +145,21 @@ export class DashboardComponent implements OnInit {
//reload the page //reload the page
window.location.reload() window.location.reload()
}, (error) => { }, (error) => {
console.log("Error Adding Remote Dashboard", error)
this.addDashboardLoading = false this.addDashboardLoading = false
this.dashboardLocationError = error this.dashboardLocationError = error
}, },
() => { () => {
console.log("Completed Adding Remote Dashboard")
this.addDashboardLoading = false this.addDashboardLoading = false
}) })
} }
public showAddDashboardLocationModal(content) { public showAddDashboardLocationModal(content) {
this.dashboardLocation = '' this.dashboardLocation = ''
this.modalService.open(content, { ariaLabelledBy: 'modal-basic-title' }).result.then( this.modalService.open(content, { ariaLabelledBy: 'modal-basic-title' }).result.catch(console.error);
(result) => {
console.log(`Closed with: ${result}`)
},
(reason) => {
console.log(`Dismissed ${reason}`)
},
);
} }
public showDashboardSettingsModal(content) { public showDashboardSettingsModal(content) {
this.modalService.open(content, { ariaLabelledBy: 'modal-basic-title' }).result.then( this.modalService.open(content, { ariaLabelledBy: 'modal-basic-title' }).result.catch(console.error);
(result) => {
console.log(`Closed with: ${result}`)
},
(reason) => {
console.log(`Dismissed ${reason}`)
},
);
} }
} }

View File

@ -3,7 +3,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
import { DesktopCallbackComponent } from './desktop-callback.component'; import { DesktopCallbackComponent } from './desktop-callback.component';
import {HttpClientTestingModule} from '@angular/common/http/testing'; import {HttpClientTestingModule} from '@angular/common/http/testing';
import {RouterTestingModule} from '@angular/router/testing'; import {RouterTestingModule} from '@angular/router/testing';
import {FormsModule, ReactiveFormsModule} from '@angular/forms'; import { LoadingSpinnerComponent } from 'src/app/components/loading-spinner/loading-spinner.component';
describe('DesktopCallbackComponent', () => { describe('DesktopCallbackComponent', () => {
let component: DesktopCallbackComponent; let component: DesktopCallbackComponent;
@ -11,7 +11,7 @@ describe('DesktopCallbackComponent', () => {
beforeEach(async () => { beforeEach(async () => {
await TestBed.configureTestingModule({ await TestBed.configureTestingModule({
imports: [HttpClientTestingModule, RouterTestingModule], imports: [HttpClientTestingModule, RouterTestingModule, LoadingSpinnerComponent],
declarations: [ DesktopCallbackComponent ] declarations: [ DesktopCallbackComponent ]
}) })
.compileComponents(); .compileComponents();

View File

@ -4,6 +4,9 @@ import { ExploreComponent } from './explore.component';
import {HTTP_CLIENT_TOKEN} from '../../dependency-injection'; import {HTTP_CLIENT_TOKEN} from '../../dependency-injection';
import {HttpClient} from '@angular/common/http'; import {HttpClient} from '@angular/common/http';
import {HttpClientTestingModule} from '@angular/common/http/testing'; import {HttpClientTestingModule} from '@angular/common/http/testing';
import { ReportHeaderComponent } from 'src/app/components/report-header/report-header.component';
import { LoadingSpinnerComponent } from 'src/app/components/loading-spinner/loading-spinner.component';
import { RouterTestingModule } from '@angular/router/testing';
describe('ExploreComponent', () => { describe('ExploreComponent', () => {
let component: ExploreComponent; let component: ExploreComponent;
@ -11,8 +14,8 @@ describe('ExploreComponent', () => {
beforeEach(async () => { beforeEach(async () => {
await TestBed.configureTestingModule({ await TestBed.configureTestingModule({
declarations: [ ExploreComponent ], declarations: [ ExploreComponent, ReportHeaderComponent ],
imports: [HttpClientTestingModule], imports: [HttpClientTestingModule, LoadingSpinnerComponent, RouterTestingModule],
providers: [ providers: [
{ {
provide: HTTP_CLIENT_TOKEN, provide: HTTP_CLIENT_TOKEN,

View File

@ -2,9 +2,10 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
import { MedicalHistoryComponent } from './medical-history.component'; import { MedicalHistoryComponent } from './medical-history.component';
import {FastenApiService} from '../../services/fasten-api.service'; import {FastenApiService} from '../../services/fasten-api.service';
import {HttpClient} from '@angular/common/http'; import {NgbModalModule} from '@ng-bootstrap/ng-bootstrap';
import {NgbModal, NgbModalModule} from '@ng-bootstrap/ng-bootstrap';
import {of} from 'rxjs'; import {of} from 'rxjs';
import { ReportHeaderComponent } from 'src/app/components/report-header/report-header.component';
import { RouterTestingModule } from '@angular/router/testing';
describe('MedicalHistoryComponent', () => { describe('MedicalHistoryComponent', () => {
let component: MedicalHistoryComponent; let component: MedicalHistoryComponent;
@ -15,7 +16,8 @@ describe('MedicalHistoryComponent', () => {
mockedFastenApiService = jasmine.createSpyObj('FastenApiService', ['getResources', 'getResourceGraph']) mockedFastenApiService = jasmine.createSpyObj('FastenApiService', ['getResources', 'getResourceGraph'])
await TestBed.configureTestingModule({ await TestBed.configureTestingModule({
declarations: [ MedicalHistoryComponent ], declarations: [ MedicalHistoryComponent, ReportHeaderComponent ],
imports: [ RouterTestingModule ],
providers: [{ providers: [{
provide: FastenApiService, provide: FastenApiService,
useValue: mockedFastenApiService useValue: mockedFastenApiService

View File

@ -67,7 +67,6 @@ export class MedicalHistoryComponent implements OnInit {
this.fastenApi.getResourceGraph(null, encounterIds).subscribe((graphResponse: ResourceGraphResponse) => { this.fastenApi.getResourceGraph(null, encounterIds).subscribe((graphResponse: ResourceGraphResponse) => {
this.loading = false this.loading = false
console.log("FLATTENED RESOURCES RESPONSE", graphResponse)
this.encounters = graphResponse.results["Encounter"] || [] this.encounters = graphResponse.results["Encounter"] || []
}, },

View File

@ -5,7 +5,11 @@ import {HttpClientTestingModule} from '@angular/common/http/testing';
import {RouterTestingModule} from '@angular/router/testing'; import {RouterTestingModule} from '@angular/router/testing';
import {HTTP_CLIENT_TOKEN} from '../../dependency-injection'; import {HTTP_CLIENT_TOKEN} from '../../dependency-injection';
import {HttpClient} from '@angular/common/http'; import {HttpClient} from '@angular/common/http';
import {FormBuilder, FormsModule, ReactiveFormsModule} from '@angular/forms'; import {FormsModule, ReactiveFormsModule} from '@angular/forms';
import { LoadingSpinnerComponent } from 'src/app/components/loading-spinner/loading-spinner.component';
import { MedicalSourcesFilterComponent } from 'src/app/components/medical-sources-filter/medical-sources-filter.component';
import { MedicalSourcesConnectedComponent } from 'src/app/components/medical-sources-connected/medical-sources-connected.component';
import { NgxDropzoneModule } from 'ngx-dropzone';
describe('MedicalSourcesComponent', () => { describe('MedicalSourcesComponent', () => {
let component: MedicalSourcesComponent; let component: MedicalSourcesComponent;
@ -13,8 +17,8 @@ describe('MedicalSourcesComponent', () => {
beforeEach(async () => { beforeEach(async () => {
await TestBed.configureTestingModule({ await TestBed.configureTestingModule({
declarations: [ MedicalSourcesComponent ], declarations: [ MedicalSourcesComponent, MedicalSourcesFilterComponent, MedicalSourcesConnectedComponent ],
imports: [HttpClientTestingModule, RouterTestingModule, FormsModule, ReactiveFormsModule], imports: [HttpClientTestingModule, RouterTestingModule, FormsModule, ReactiveFormsModule, LoadingSpinnerComponent, NgxDropzoneModule],
providers: [ providers: [
{ {
provide: HTTP_CLIENT_TOKEN, provide: HTTP_CLIENT_TOKEN,

View File

@ -89,17 +89,13 @@ export class MedicalSourcesComponent implements OnInit {
) { ) {
this.filterService.filterChanges.subscribe((filterInfo) => { this.filterService.filterChanges.subscribe((filterInfo) => {
console.log("medical-sources - filterChanges", filterInfo)
//this function should only trigger when there's a change to the filter values -- which requires a new query //this function should only trigger when there's a change to the filter values -- which requires a new query
this.availableLighthouseBrandList = [] this.availableLighthouseBrandList = []
this.resultLimits.totalItems = 0 this.resultLimits.totalItems = 0
this.resultLimits.scrollComplete = false this.resultLimits.scrollComplete = false
//update the form with data from route (don't emit a new patch event), then submit query //update the form with data from route (don't emit a new patch event), then submit query
this.querySources(filterInfo?.filter).subscribe(null, null, () => { this.querySources(filterInfo?.filter).subscribe(null, null, () => {})
console.log("querySources() complete")
})
}) })
} }
@ -133,7 +129,6 @@ export class MedicalSourcesComponent implements OnInit {
distinctUntilChanged(), distinctUntilChanged(),
) )
.subscribe(value => { .subscribe(value => {
console.log("search term changed:", value)
let currentQuery = this.filterService.filterForm.value.query || "" let currentQuery = this.filterService.filterForm.value.query || ""
if(value != null && currentQuery != value){ if(value != null && currentQuery != value){
this.filterService.filterForm.patchValue({query: value}) this.filterService.filterForm.patchValue({query: value})
@ -143,9 +138,7 @@ export class MedicalSourcesComponent implements OnInit {
} }
private querySources(filter?: MedicalSourcesFilter): Observable<LighthouseSourceSearch> { private querySources(filter?: MedicalSourcesFilter): Observable<LighthouseSourceSearch> {
console.log("querySources()", filter)
if(this.loading){ if(this.loading){
console.log("already loading, ignoring querySources()")
return of(null) return of(null)
} }
//TODO: pass filter to function. //TODO: pass filter to function.
@ -153,7 +146,6 @@ export class MedicalSourcesComponent implements OnInit {
if(!filter){ if(!filter){
filter = this.filterService.toMedicalSourcesFilter(this.filterForm.value) filter = this.filterService.toMedicalSourcesFilter(this.filterForm.value)
console.log("querySources() - no filter provided, using current form value", filter)
} }
@ -161,7 +153,6 @@ export class MedicalSourcesComponent implements OnInit {
this.loading = true this.loading = true
var searchObservable = this.lighthouseApi.searchLighthouseSources(filter); var searchObservable = this.lighthouseApi.searchLighthouseSources(filter);
searchObservable.subscribe(wrapper => { searchObservable.subscribe(wrapper => {
console.log("search sources", wrapper);
// this.searchResults = wrapper.hits.hits; // this.searchResults = wrapper.hits.hits;
this.resultLimits.totalItems = wrapper.hits.total.value; this.resultLimits.totalItems = wrapper.hits.total.value;
@ -174,11 +165,9 @@ export class MedicalSourcesComponent implements OnInit {
//check if scroll is complete. //check if scroll is complete.
if(!wrapper?.hits || !wrapper?.hits?.hits || wrapper?.hits?.hits?.length == 0 || wrapper?.hits?.total?.value == wrapper?.hits?.hits?.length){ if(!wrapper?.hits || !wrapper?.hits?.hits || wrapper?.hits?.hits?.length == 0 || wrapper?.hits?.total?.value == wrapper?.hits?.hits?.length){
console.log("SCROLL_COMPLETE!@@@@@@@@")
this.resultLimits.scrollComplete = true; this.resultLimits.scrollComplete = true;
} else { } else {
//change the current Page (but don't cause a new query) //change the current Page (but don't cause a new query)
console.log("SETTING NEXT SORT KEY:", wrapper.hits.hits[wrapper.hits.hits.length - 1].sort.join(','))
this.filterService.filterForm.patchValue({searchAfter: wrapper.hits.hits[wrapper.hits.hits.length - 1].sort.join(",")}, {emitEvent: false}) this.filterService.filterForm.patchValue({searchAfter: wrapper.hits.hits[wrapper.hits.hits.length - 1].sort.join(",")}, {emitEvent: false})
} }
@ -229,7 +218,6 @@ export class MedicalSourcesComponent implements OnInit {
}, },
() => { () => {
this.loading = false this.loading = false
console.log("sources finished")
} }
); );
return searchObservable; return searchObservable;
@ -297,10 +285,8 @@ export class MedicalSourcesComponent implements OnInit {
sourceMetadata.brand_id = brandId sourceMetadata.brand_id = brandId
sourceMetadata.portal_id = portalId sourceMetadata.portal_id = portalId
console.log(sourceMetadata);
let authorizationUrl = await this.lighthouseApi.generateSourceAuthorizeUrl(sourceMetadata) let authorizationUrl = await this.lighthouseApi.generateSourceAuthorizeUrl(sourceMetadata)
console.log('authorize url:', authorizationUrl.toString());
// redirect to lighthouse with uri's (or open a new window in desktop mode) // redirect to lighthouse with uri's (or open a new window in desktop mode)
this.lighthouseApi.redirectWithOriginAndDestination(authorizationUrl.toString(), sourceMetadata).subscribe((desktopRedirectData) => { this.lighthouseApi.redirectWithOriginAndDestination(authorizationUrl.toString(), sourceMetadata).subscribe((desktopRedirectData) => {
if(!desktopRedirectData){ if(!desktopRedirectData){
@ -335,10 +321,8 @@ export class MedicalSourcesComponent implements OnInit {
let shouldConvert = await this.showCcdaWarningModal() let shouldConvert = await this.showCcdaWarningModal()
if(shouldConvert){ if(shouldConvert){
let convertedFile = await this.platformApi.convertCcdaToFhir(processingFile).toPromise() let convertedFile = await this.platformApi.convertCcdaToFhir(processingFile).toPromise()
console.log("converted file: ", convertedFile.name)
processingFile = convertedFile processingFile = convertedFile
} else { } else {
console.log("removing file from list")
this.uploadedFile = [] this.uploadedFile = []
return return
} }
@ -348,7 +332,6 @@ export class MedicalSourcesComponent implements OnInit {
//TODO: handle manual bundles. //TODO: handle manual bundles.
this.fastenApi.createManualSource(processingFile).subscribe( this.fastenApi.createManualSource(processingFile).subscribe(
(respData) => { (respData) => {
console.log("source manual source create response:", respData)
}, },
(err) => {console.log(err)}, (err) => {console.log(err)},
() => { () => {
@ -359,7 +342,6 @@ export class MedicalSourcesComponent implements OnInit {
showCcdaWarningModal(): Promise<boolean> { showCcdaWarningModal(): Promise<boolean> {
console.log("SHOWING CCDA Warning MODAL")
return this.modalService.open(this.ccdaWarningModalRef).result.then<boolean>( return this.modalService.open(this.ccdaWarningModalRef).result.then<boolean>(
(result) => { (result) => {

View File

@ -2,9 +2,10 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
import { PatientProfileComponent } from './patient-profile.component'; import { PatientProfileComponent } from './patient-profile.component';
import {FastenApiService} from '../../services/fasten-api.service'; import {FastenApiService} from '../../services/fasten-api.service';
import {NgbModalModule} from '@ng-bootstrap/ng-bootstrap';
import {of} from 'rxjs'; import {of} from 'rxjs';
import {PipesModule} from '../../pipes/pipes.module'; import {PipesModule} from '../../pipes/pipes.module';
import { ReportHeaderComponent } from 'src/app/components/report-header/report-header.component';
import { RouterTestingModule } from '@angular/router/testing';
describe('PatientProfileComponent', () => { describe('PatientProfileComponent', () => {
let component: PatientProfileComponent; let component: PatientProfileComponent;
@ -14,8 +15,8 @@ describe('PatientProfileComponent', () => {
beforeEach(async () => { beforeEach(async () => {
mockedFastenApiService = jasmine.createSpyObj('FastenApiService', ['getResources']) mockedFastenApiService = jasmine.createSpyObj('FastenApiService', ['getResources'])
await TestBed.configureTestingModule({ await TestBed.configureTestingModule({
declarations: [ PatientProfileComponent ], declarations: [ PatientProfileComponent, ReportHeaderComponent ],
imports: [PipesModule], imports: [PipesModule, RouterTestingModule],
providers: [{ providers: [{
provide: FastenApiService, provide: FastenApiService,
useValue: mockedFastenApiService useValue: mockedFastenApiService

View File

@ -35,7 +35,6 @@ export class PatientProfileComponent implements OnInit {
this.fastenApi.getResources("AllergyIntolerance") this.fastenApi.getResources("AllergyIntolerance")
]).subscribe(results => { ]).subscribe(results => {
this.loading['page'] = false this.loading['page'] = false
console.log(results)
this.patient = results[0][0] this.patient = results[0][0]
this.immunizations = results[1].map((immunization) => { this.immunizations = results[1].map((immunization) => {
return fhirModelFactory(immunization.source_resource_type as ResourceType, immunization) as ImmunizationModel return fhirModelFactory(immunization.source_resource_type as ResourceType, immunization) as ImmunizationModel
@ -52,7 +51,6 @@ export class PatientProfileComponent implements OnInit {
this.loading['delete'] = true this.loading['delete'] = true
this.fastenApi.deleteAccount().subscribe(result => { this.fastenApi.deleteAccount().subscribe(result => {
this.loading['delete'] = false this.loading['delete'] = false
console.log(result)
}, error => { }, error => {
this.loading['delete'] = false this.loading['delete'] = false
console.log(error) console.log(error)

View File

@ -2,9 +2,10 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
import { ReportLabsComponent } from './report-labs.component'; import { ReportLabsComponent } from './report-labs.component';
import {FastenApiService} from '../../services/fasten-api.service'; import {FastenApiService} from '../../services/fasten-api.service';
import {NgbModalModule} from '@ng-bootstrap/ng-bootstrap';
import {of} from 'rxjs'; import {of} from 'rxjs';
import {RouterTestingModule} from '@angular/router/testing'; import {RouterTestingModule} from '@angular/router/testing';
import { ReportHeaderComponent } from 'src/app/components/report-header/report-header.component';
import { LoadingSpinnerComponent } from 'src/app/components/loading-spinner/loading-spinner.component';
describe('ReportLabsComponent', () => { describe('ReportLabsComponent', () => {
let component: ReportLabsComponent; let component: ReportLabsComponent;
@ -15,8 +16,8 @@ describe('ReportLabsComponent', () => {
mockedFastenApiService = jasmine.createSpyObj('FastenApiService', ['getResources', 'queryResources']) mockedFastenApiService = jasmine.createSpyObj('FastenApiService', ['getResources', 'queryResources'])
await TestBed.configureTestingModule({ await TestBed.configureTestingModule({
declarations: [ ReportLabsComponent ], declarations: [ ReportLabsComponent, ReportHeaderComponent ],
imports: [RouterTestingModule], imports: [RouterTestingModule, LoadingSpinnerComponent, RouterTestingModule],
providers: [{ providers: [{
provide: FastenApiService, provide: FastenApiService,
useValue: mockedFastenApiService useValue: mockedFastenApiService

View File

@ -67,13 +67,10 @@ export class ReportLabsComponent implements OnInit {
this.reportSourceId = routeParams['source_id'] this.reportSourceId = routeParams['source_id']
this.reportResourceType = routeParams['resource_type'] this.reportResourceType = routeParams['resource_type']
this.reportResourceId = routeParams['resource_id'] this.reportResourceId = routeParams['resource_id']
console.log("Selected Report changed!", this.reportSourceId,this.reportResourceType, this.reportResourceId)
if(this.reportSourceId && this.reportResourceType && this.reportResourceId){ if(this.reportSourceId && this.reportResourceType && this.reportResourceId){
//we're requesting a single report //we're requesting a single report
console.log("REQUSTING REPORT", this.reportSourceId, this.reportResourceType, this.reportResourceId)
this.findLabResultCodesFilteredToReport(this.reportSourceId, this.reportResourceType, this.reportResourceId).subscribe((data) => { this.findLabResultCodesFilteredToReport(this.reportSourceId, this.reportResourceType, this.reportResourceId).subscribe((data) => {
console.log("REPORT result codes", data)
this.allObservationGroups = data this.allObservationGroups = data
this.currentPage = 1 //reset to first page when changing report this.currentPage = 1 //reset to first page when changing report
return this.populateObservationsForCurrentPage() return this.populateObservationsForCurrentPage()
@ -81,7 +78,6 @@ export class ReportLabsComponent implements OnInit {
} else { } else {
this.findLabResultCodesSortedByLatest().subscribe((data) => { this.findLabResultCodesSortedByLatest().subscribe((data) => {
// this.loading = false // this.loading = false
console.log("ALL lab result codes", data)
this.allObservationGroups = data.map((item) => item.label) this.allObservationGroups = data.map((item) => item.label)
return this.populateObservationsForCurrentPage() return this.populateObservationsForCurrentPage()
}) })
@ -95,7 +91,6 @@ export class ReportLabsComponent implements OnInit {
let observationGroups = this.allObservationGroups.slice((this.currentPage-1) * this.pageSize, this.currentPage * this.pageSize) let observationGroups = this.allObservationGroups.slice((this.currentPage-1) * this.pageSize, this.currentPage * this.pageSize)
console.log("FILTERED OBSERVATION GROUPS", observationGroups, (this.currentPage -1) * this.pageSize, this.currentPage * this.pageSize)
this.loading = true this.loading = true
this.getObservationsByCodes(observationGroups).subscribe((data) => { this.getObservationsByCodes(observationGroups).subscribe((data) => {
this.loading = false this.loading = false
@ -116,7 +111,6 @@ export class ReportLabsComponent implements OnInit {
.pipe( .pipe(
mergeMap((diagnosticReports) => { mergeMap((diagnosticReports) => {
let diagnosticReport = diagnosticReports?.[0] let diagnosticReport = diagnosticReports?.[0]
console.log("diagnosticReport", diagnosticReport)
this.reportDisplayModel = fhirModelFactory(diagnosticReport.source_resource_type as ResourceType, diagnosticReport) this.reportDisplayModel = fhirModelFactory(diagnosticReport.source_resource_type as ResourceType, diagnosticReport)
@ -142,7 +136,6 @@ export class ReportLabsComponent implements OnInit {
allObservationGroups.push('http://loinc.org|' + observationGroup) allObservationGroups.push('http://loinc.org|' + observationGroup)
} }
} }
console.log("FOUND REPORT LAB CODES", allObservationGroups)
return allObservationGroups return allObservationGroups
}) })
) )

View File

@ -6,6 +6,7 @@ import {RouterTestingModule} from '@angular/router/testing';
import {ActivatedRoute, convertToParamMap} from '@angular/router'; import {ActivatedRoute, convertToParamMap} from '@angular/router';
import {HTTP_CLIENT_TOKEN} from '../../dependency-injection'; import {HTTP_CLIENT_TOKEN} from '../../dependency-injection';
import {HttpClient} from '@angular/common/http'; import {HttpClient} from '@angular/common/http';
import { LoadingSpinnerComponent } from 'src/app/components/loading-spinner/loading-spinner.component';
describe('ResourceDetailComponent', () => { describe('ResourceDetailComponent', () => {
let component: ResourceDetailComponent; let component: ResourceDetailComponent;
@ -14,7 +15,7 @@ describe('ResourceDetailComponent', () => {
beforeEach(async () => { beforeEach(async () => {
await TestBed.configureTestingModule({ await TestBed.configureTestingModule({
declarations: [ ResourceDetailComponent ], declarations: [ ResourceDetailComponent ],
imports: [HttpClientTestingModule, RouterTestingModule], imports: [HttpClientTestingModule, RouterTestingModule, LoadingSpinnerComponent],
providers: [ providers: [
{ {
provide: ActivatedRoute, provide: ActivatedRoute,

View File

@ -28,7 +28,6 @@ export class ResourceDetailComponent implements OnInit {
this.loading = true this.loading = true
this.fastenApi.getResourceBySourceId(this.route.snapshot.paramMap.get('source_id'), this.route.snapshot.paramMap.get('resource_id')).subscribe((resourceFhir) => { this.fastenApi.getResourceBySourceId(this.route.snapshot.paramMap.get('source_id'), this.route.snapshot.paramMap.get('resource_id')).subscribe((resourceFhir) => {
this.loading = false this.loading = false
console.log("RESOURECE FHIR", resourceFhir)
this.resource = resourceFhir; this.resource = resourceFhir;
this.sourceId = this.route.snapshot.paramMap.get('source_id') this.sourceId = this.route.snapshot.paramMap.get('source_id')
this.sourceName = "unknown" //TODO popualte this this.sourceName = "unknown" //TODO popualte this
@ -36,9 +35,7 @@ export class ResourceDetailComponent implements OnInit {
try{ try{
let parsed = fhirModelFactory(resourceFhir.source_resource_type as ResourceType, resourceFhir) let parsed = fhirModelFactory(resourceFhir.source_resource_type as ResourceType, resourceFhir)
this.displayModel = parsed this.displayModel = parsed
console.log("Successfully parsed model", parsed)
} catch (e) { } catch (e) {
console.log("FAILED TO PARSE", resourceFhir)
console.error(e) console.error(e)
} }
}, error => { }, error => {

View File

@ -6,6 +6,7 @@ import {RouterTestingModule} from '@angular/router/testing';
import {ActivatedRoute, convertToParamMap, RouterModule} from '@angular/router'; import {ActivatedRoute, convertToParamMap, RouterModule} from '@angular/router';
import {HTTP_CLIENT_TOKEN} from '../../dependency-injection'; import {HTTP_CLIENT_TOKEN} from '../../dependency-injection';
import {HttpClient} from '@angular/common/http'; import {HttpClient} from '@angular/common/http';
import { FhirDatatableModule } from 'src/app/components/fhir-datatable/fhir-datatable.module';
describe('SourceDetailComponent', () => { describe('SourceDetailComponent', () => {
let component: SourceDetailComponent; let component: SourceDetailComponent;
@ -13,7 +14,7 @@ describe('SourceDetailComponent', () => {
beforeEach(async () => { beforeEach(async () => {
await TestBed.configureTestingModule({ await TestBed.configureTestingModule({
imports: [HttpClientTestingModule, RouterTestingModule, RouterModule], imports: [HttpClientTestingModule, RouterTestingModule, RouterModule, FhirDatatableModule],
declarations: [ SourceDetailComponent ], declarations: [ SourceDetailComponent ],
providers: [ providers: [
{ {

View File

@ -18,7 +18,6 @@ export class DatasetLatestEntryPipe implements PipeTransform {
} }
let lastItem = dataset?.data?.[dataset?.data?.length - 1] || '' let lastItem = dataset?.data?.[dataset?.data?.length - 1] || ''
// let valueKey = this.chartOptions?.parsing?.['yAxisKey'] || dataset?.parsing?.['key'] // let valueKey = this.chartOptions?.parsing?.['yAxisKey'] || dataset?.parsing?.['key']
console.log('latestEntryConfig', lastItem, valLookupKey, unitLookupKey, round)
let lastItemUnit = "" let lastItemUnit = ""
let lastItemValue let lastItemValue
@ -26,7 +25,6 @@ export class DatasetLatestEntryPipe implements PipeTransform {
lastItemValue = _.flatten(lastItem?.[0]?.[valLookupKey])?.[0] as string lastItemValue = _.flatten(lastItem?.[0]?.[valLookupKey])?.[0] as string
lastItemUnit = _.flatten(lastItem?.[0]?.[unitLookupKey])?.[0] as string lastItemUnit = _.flatten(lastItem?.[0]?.[unitLookupKey])?.[0] as string
} else if (typeof lastItem === 'object') { } else if (typeof lastItem === 'object') {
console.log('lastItem-object', lastItem?.[valLookupKey])
lastItemValue = lastItem?.[valLookupKey] lastItemValue = lastItem?.[valLookupKey]
lastItemUnit = lastItem?.[unitLookupKey] lastItemUnit = lastItem?.[unitLookupKey]
} else { } else {

View File

@ -35,11 +35,8 @@ export class EventBusService {
// Ideally we want consistently listen to events, but only when the user is authenticated. // Ideally we want consistently listen to events, but only when the user is authenticated.
//TODO: find a way to abort the event bus connection. //TODO: find a way to abort the event bus connection.
this.authService.IsAuthenticatedSubject.subscribe((isAuthenticated) => { this.authService.IsAuthenticatedSubject.subscribe((isAuthenticated) => {
console.log("isAuthenticated changed:", isAuthenticated)
if(isAuthenticated){ if(isAuthenticated){
console.log("Started listening to event bus")
this.eventBusSubscription = this.listenEventBus().subscribe((event: Event | EventSourceSync | EventSourceComplete)=>{ this.eventBusSubscription = this.listenEventBus().subscribe((event: Event | EventSourceSync | EventSourceComplete)=>{
console.log("eventbus event:", event)
//TODO: start toasts. //TODO: start toasts.
if(event.event_type == "source_sync"){ if(event.event_type == "source_sync"){
this.SourceSyncMessages.next(event as EventSourceSync) this.SourceSyncMessages.next(event as EventSourceSync)
@ -49,7 +46,6 @@ export class EventBusService {
}) })
} else { } else {
//no longer authenticated, unsubscribe from eventbus and abort/terminate connection //no longer authenticated, unsubscribe from eventbus and abort/terminate connection
console.log("Stopped listening to event bus")
this.abortEventBus() this.abortEventBus()
} }
}); });

View File

@ -50,7 +50,6 @@ export class FastenApiService {
return this._httpClient.get<any>(endpointUrl.toString()) return this._httpClient.get<any>(endpointUrl.toString())
.pipe( .pipe(
map((response: ValueSet) => { map((response: ValueSet) => {
console.log("Glossary RESPONSE", response)
return response return response
}) })
); );
@ -60,7 +59,6 @@ export class FastenApiService {
return this._httpClient.get<any>(`${GetEndpointAbsolutePath(globalThis.location, environment.fasten_api_endpoint_base)}/health`) return this._httpClient.get<any>(`${GetEndpointAbsolutePath(globalThis.location, environment.fasten_api_endpoint_base)}/health`)
.pipe( .pipe(
map((response: ResponseWrapper) => { map((response: ResponseWrapper) => {
console.log("Health RESPONSE", response)
return response.data return response.data
}) })
); );
@ -75,7 +73,6 @@ export class FastenApiService {
return this._httpClient.delete<any>(`${GetEndpointAbsolutePath(globalThis.location, environment.fasten_api_endpoint_base)}/secure/account/me`) return this._httpClient.delete<any>(`${GetEndpointAbsolutePath(globalThis.location, environment.fasten_api_endpoint_base)}/secure/account/me`)
.pipe( .pipe(
map((response: ResponseWrapper) => { map((response: ResponseWrapper) => {
console.log("DELETE ACCOUNT RESPONSE", response)
if(response.success) { if(response.success) {
this.authService.Logout().then(() => { this.authService.Logout().then(() => {
this.router.navigateByUrl('/auth/signup') this.router.navigateByUrl('/auth/signup')
@ -101,7 +98,6 @@ export class FastenApiService {
return this._httpClient.get<any>(`${GetEndpointAbsolutePath(globalThis.location, environment.fasten_api_endpoint_base)}/secure/summary`, ) return this._httpClient.get<any>(`${GetEndpointAbsolutePath(globalThis.location, environment.fasten_api_endpoint_base)}/secure/summary`, )
.pipe( .pipe(
map((response: ResponseWrapper) => { map((response: ResponseWrapper) => {
console.log("Summary RESPONSE", response)
return response.data as Summary return response.data as Summary
}) })
); );
@ -111,7 +107,6 @@ export class FastenApiService {
return this._httpClient.post<any>(`${GetEndpointAbsolutePath(globalThis.location, environment.fasten_api_endpoint_base)}/secure/source`, source) return this._httpClient.post<any>(`${GetEndpointAbsolutePath(globalThis.location, environment.fasten_api_endpoint_base)}/secure/source`, source)
.pipe( .pipe(
map((response: ResponseWrapper) => { map((response: ResponseWrapper) => {
console.log("SOURCE RESPONSE", response)
// @ts-ignore // @ts-ignore
return {summary: response.data, source: response.source} return {summary: response.data, source: response.source}
}) })
@ -126,7 +121,6 @@ export class FastenApiService {
return this._httpClient.post<any>(`${GetEndpointAbsolutePath(globalThis.location, environment.fasten_api_endpoint_base)}/secure/source/manual`, formData) return this._httpClient.post<any>(`${GetEndpointAbsolutePath(globalThis.location, environment.fasten_api_endpoint_base)}/secure/source/manual`, formData)
.pipe( .pipe(
map((response: ResponseWrapper) => { map((response: ResponseWrapper) => {
console.log("MANUAL SOURCE RESPONSE", response)
return response.data as Source return response.data as Source
}) })
); );
@ -134,7 +128,6 @@ export class FastenApiService {
createRelatedResourcesFastenSource(resourceList: List): Observable<Source> { createRelatedResourcesFastenSource(resourceList: List): Observable<Source> {
console.log(resourceList)
let bundleBlob = new Blob([JSON.stringify(resourceList)], { type: 'application/json' }); let bundleBlob = new Blob([JSON.stringify(resourceList)], { type: 'application/json' });
let bundleFile = new File([ bundleBlob ], 'related.json', { type: 'application/json' }); let bundleFile = new File([ bundleBlob ], 'related.json', { type: 'application/json' });
@ -144,7 +137,6 @@ export class FastenApiService {
return this._httpClient.post<any>(`${GetEndpointAbsolutePath(globalThis.location, environment.fasten_api_endpoint_base)}/secure/resource/related`, formData) return this._httpClient.post<any>(`${GetEndpointAbsolutePath(globalThis.location, environment.fasten_api_endpoint_base)}/secure/resource/related`, formData)
.pipe( .pipe(
map((response: ResponseWrapper) => { map((response: ResponseWrapper) => {
console.log("RELATED RESOURCES RESPONSE", response)
return response.data as Source return response.data as Source
}) })
); );
@ -155,7 +147,6 @@ export class FastenApiService {
return this._httpClient.get<any>(`${GetEndpointAbsolutePath(globalThis.location, environment.fasten_api_endpoint_base)}/secure/source`) return this._httpClient.get<any>(`${GetEndpointAbsolutePath(globalThis.location, environment.fasten_api_endpoint_base)}/secure/source`)
.pipe( .pipe(
map((response: ResponseWrapper) => { map((response: ResponseWrapper) => {
console.log("SOURCE RESPONSE", response)
return response.data as Source[] return response.data as Source[]
}) })
); );
@ -165,7 +156,6 @@ export class FastenApiService {
return this._httpClient.get<any>(`${GetEndpointAbsolutePath(globalThis.location, environment.fasten_api_endpoint_base)}/secure/source/${sourceId}`) return this._httpClient.get<any>(`${GetEndpointAbsolutePath(globalThis.location, environment.fasten_api_endpoint_base)}/secure/source/${sourceId}`)
.pipe( .pipe(
map((response: ResponseWrapper) => { map((response: ResponseWrapper) => {
console.log("SOURCE RESPONSE", response)
return response.data as Source return response.data as Source
}) })
); );
@ -175,7 +165,6 @@ export class FastenApiService {
return this._httpClient.get<any>(`${GetEndpointAbsolutePath(globalThis.location, environment.fasten_api_endpoint_base)}/secure/source/${sourceId}/summary`) return this._httpClient.get<any>(`${GetEndpointAbsolutePath(globalThis.location, environment.fasten_api_endpoint_base)}/secure/source/${sourceId}/summary`)
.pipe( .pipe(
map((response: ResponseWrapper) => { map((response: ResponseWrapper) => {
console.log("SOURCE RESPONSE", response)
return response.data as SourceSummary return response.data as SourceSummary
}) })
); );
@ -194,7 +183,6 @@ export class FastenApiService {
return this._httpClient.post<any>(`${GetEndpointAbsolutePath(globalThis.location, environment.fasten_api_endpoint_base)}/secure/source/${sourceId}/sync`, {}) return this._httpClient.post<any>(`${GetEndpointAbsolutePath(globalThis.location, environment.fasten_api_endpoint_base)}/secure/source/${sourceId}/sync`, {})
.pipe( .pipe(
map((response: ResponseWrapper) => { map((response: ResponseWrapper) => {
console.log("SOURCE RESPONSE", response)
return response.data return response.data
}) })
); );
@ -219,7 +207,6 @@ export class FastenApiService {
return this._httpClient.get<any>(`${GetEndpointAbsolutePath(globalThis.location, environment.fasten_api_endpoint_base)}/secure/resource/fhir`, {params: queryParams}) return this._httpClient.get<any>(`${GetEndpointAbsolutePath(globalThis.location, environment.fasten_api_endpoint_base)}/secure/resource/fhir`, {params: queryParams})
.pipe( .pipe(
map((response: ResponseWrapper) => { map((response: ResponseWrapper) => {
console.log("RESPONSE", response)
return response.data as ResourceFhir[] return response.data as ResourceFhir[]
}) })
); );
@ -246,7 +233,6 @@ export class FastenApiService {
return this._httpClient.post<any>(`${GetEndpointAbsolutePath(globalThis.location, environment.fasten_api_endpoint_base)}/secure/resource/graph/${graphType}`, {resource_ids: selectedResourceIds}) return this._httpClient.post<any>(`${GetEndpointAbsolutePath(globalThis.location, environment.fasten_api_endpoint_base)}/secure/resource/graph/${graphType}`, {resource_ids: selectedResourceIds})
.pipe( .pipe(
map((response: ResponseWrapper) => { map((response: ResponseWrapper) => {
console.log("RESPONSE", response)
return response.data as ResourceGraphResponse return response.data as ResourceGraphResponse
}) })
); );
@ -257,7 +243,6 @@ export class FastenApiService {
return this._httpClient.get<any>(`${GetEndpointAbsolutePath(globalThis.location, environment.fasten_api_endpoint_base)}/secure/resource/fhir/${sourceId}/${resourceId}`) return this._httpClient.get<any>(`${GetEndpointAbsolutePath(globalThis.location, environment.fasten_api_endpoint_base)}/secure/resource/fhir/${sourceId}/${resourceId}`)
.pipe( .pipe(
map((response: ResponseWrapper) => { map((response: ResponseWrapper) => {
console.log("RESPONSE", response)
return response.data as ResourceFhir return response.data as ResourceFhir
}) })
); );
@ -269,7 +254,6 @@ export class FastenApiService {
}) })
.pipe( .pipe(
map((response: ResponseWrapper) => { map((response: ResponseWrapper) => {
console.log("RESPONSE", response)
return response return response
}) })
); );
@ -284,7 +268,6 @@ export class FastenApiService {
}) })
.pipe( .pipe(
map((response: ResponseWrapper) => { map((response: ResponseWrapper) => {
console.log("RESPONSE", response)
return response.data return response.data
}) })
); );
@ -339,7 +322,6 @@ export class FastenApiService {
return this._httpClient.get<any>(`${GetEndpointAbsolutePath(globalThis.location, environment.fasten_api_endpoint_base)}/secure/jobs`, {params: queryParams}) return this._httpClient.get<any>(`${GetEndpointAbsolutePath(globalThis.location, environment.fasten_api_endpoint_base)}/secure/jobs`, {params: queryParams})
.pipe( .pipe(
map((response: ResponseWrapper) => { map((response: ResponseWrapper) => {
console.log("RESPONSE", response)
return response.data as BackgroundJob[] return response.data as BackgroundJob[]
}) })
); );
@ -350,7 +332,6 @@ export class FastenApiService {
return this._httpClient.post<any>(`${GetEndpointAbsolutePath(globalThis.location, environment.fasten_api_endpoint_base)}/secure/jobs/error`, errorData) return this._httpClient.post<any>(`${GetEndpointAbsolutePath(globalThis.location, environment.fasten_api_endpoint_base)}/secure/jobs/error`, errorData)
.pipe( .pipe(
map((response: ResponseWrapper) => { map((response: ResponseWrapper) => {
console.log("RESPONSE", response)
return response.data return response.data
}) })
); );
@ -361,7 +342,6 @@ export class FastenApiService {
return this._httpClient.post<any>(`${GetEndpointAbsolutePath(globalThis.location, environment.fasten_api_endpoint_base)}/support/request`, request) return this._httpClient.post<any>(`${GetEndpointAbsolutePath(globalThis.location, environment.fasten_api_endpoint_base)}/support/request`, request)
.pipe( .pipe(
map((response: ResponseWrapper) => { map((response: ResponseWrapper) => {
console.log("Support request response", response)
// @ts-ignore // @ts-ignore
return {} return {}
}) })

View File

@ -58,7 +58,6 @@ export class NlmClinicalTableSearchService {
`${this.nlm_clinical_table_search_endpoint}/conditions/v3/search`, {params: queryParams} `${this.nlm_clinical_table_search_endpoint}/conditions/v3/search`, {params: queryParams}
).pipe( ).pipe(
map((response) => { map((response) => {
console.log("RESPONSE", response)
let results = response[3].map((item: any):NlmSearchResults => { let results = response[3].map((item: any):NlmSearchResults => {
return { return {
id: item[0], id: item[0],

View File

@ -26,7 +26,6 @@ export class PlatformService {
return this._httpClient.post<string>(endpointUrl.toString(), ccdaFile, { headers: {'Content-Type': 'application/cda+xml'} }) return this._httpClient.post<string>(endpointUrl.toString(), ccdaFile, { headers: {'Content-Type': 'application/cda+xml'} })
.pipe( .pipe(
map((responseJson: string) => { map((responseJson: string) => {
console.log("Converter RESPONSE", responseJson)
return new File([JSON.stringify(responseJson)], ccdaFile.name + ".converted.json", {type: "application/json", lastModified: ccdaFile.lastModified || Date.now()}) return new File([JSON.stringify(responseJson)], ccdaFile.name + ".converted.json", {type: "application/json", lastModified: ccdaFile.lastModified || Date.now()})
}) })
); );

View File

@ -70,9 +70,6 @@ export class DashboardWidgetComponent implements OnInit, DashboardWidgetComponen
this.chartProcessQueryResults.bind(currentThis), this.chartProcessQueryResults.bind(currentThis),
(error) => { (error) => {
this.loading = false this.loading = false
},
() => {
console.log("complete")
}) })
} }
@ -84,7 +81,6 @@ export class DashboardWidgetComponent implements OnInit, DashboardWidgetComponen
for (let queryNdx in queryResults) { for (let queryNdx in queryResults) {
let queryResult = queryResults[queryNdx] let queryResult = queryResults[queryNdx]
console.log(`QUERY RESULTS FOR ${this.widgetConfig.title_text}`, queryResult)
this.chartLabels = [] this.chartLabels = []
// console.log(`CHART LABELS BEFORE ${this.widgetConfig.title_text}`, this.chartLabels) // console.log(`CHART LABELS BEFORE ${this.widgetConfig.title_text}`, this.chartLabels)
for(let result of queryResult){ for(let result of queryResult){
@ -97,8 +93,6 @@ export class DashboardWidgetComponent implements OnInit, DashboardWidgetComponen
// } // }
} }
console.log(`CHART LABELS FOR ${this.widgetConfig.title_text}`, this.chartLabels)
this.chartDatasets.push(_.extend( this.chartDatasets.push(_.extend(
this.chartDatasetsDefaults?.[queryNdx] || {}, this.chartDatasetsDefaults?.[queryNdx] || {},
this.widgetConfig.queries?.[queryNdx]?.dataset_options || {}, this.widgetConfig.queries?.[queryNdx]?.dataset_options || {},
@ -115,10 +109,6 @@ export class DashboardWidgetComponent implements OnInit, DashboardWidgetComponen
console.error("ERROR DURING PROCESSING") console.error("ERROR DURING PROCESSING")
console.error(e) console.error(e)
} }
console.log(`Loading COmpleted for ${this.widgetConfig.title_text}, ${this.loading}`)
} }
@ -127,9 +117,7 @@ export class DashboardWidgetComponent implements OnInit, DashboardWidgetComponen
// fhirPathMapQueryFn will also assign aliases where appropriate. // fhirPathMapQueryFn will also assign aliases where appropriate.
// `where` clause filtering is processed in the backend. // `where` clause filtering is processed in the backend.
processQueryResourcesSelectClause(query: DashboardWidgetQuery, response: ResponseWrapper): any[]{ processQueryResourcesSelectClause(query: DashboardWidgetQuery, response: ResponseWrapper): any[]{
console.log("RESPONSE", response)
if(!response.data || !response.data.length){ if(!response.data || !response.data.length){
console.log("NO QUERY DATA FOUND")
return [] return []
} }
let results = response.data let results = response.data

View File

@ -193,8 +193,6 @@ export class PatientVitalsWidgetComponent extends DashboardWidgetComponent imple
for(let key in vitalSignCodeLookup){ for(let key in vitalSignCodeLookup){
this.vitalSigns.push(vitalSignCodeLookup[key]) this.vitalSigns.push(vitalSignCodeLookup[key])
} }
console.log("PRINTING DETECTED PATIENT DATA", this.name, this.age, this.gender, vitalSignCodeLookup, this.vitalSigns)
} }

View File

@ -206,9 +206,6 @@ export class RecordsSummaryWidgetComponent extends DashboardWidgetComponent impl
}, },
(error) => { (error) => {
this.loading = false this.loading = false
},
() => {
console.log('completed getting summary')
}) })
} }
} }

View File

@ -95,4 +95,3 @@ export const Example: Story = {
} }
} }
}; };

View File

@ -81,7 +81,6 @@ export class DocumentReferenceModel extends FastenDisplayModel {
}; };
contentDTO(fhirResource: any, fhirVersion: fhirVersions){ contentDTO(fhirResource: any, fhirVersion: fhirVersions){
console.log('INSIDE CONTENTDTO', fhirResource)
this.category = new CodableConceptModel(_.get(fhirResource, 'category[0]') || {}); this.category = new CodableConceptModel(_.get(fhirResource, 'category[0]') || {});
this.content = _.get(fhirResource, 'content', []).map((content: any) => { this.content = _.get(fhirResource, 'content', []).map((content: any) => {
const attachment: Attachment = _.get(content, 'attachment'); const attachment: Attachment = _.get(content, 'attachment');

View File

@ -8461,6 +8461,13 @@ karma-source-map-support@1.4.0:
dependencies: dependencies:
source-map-support "^0.5.5" source-map-support "^0.5.5"
karma-verbose-reporter@^0.0.8:
version "0.0.8"
resolved "https://registry.yarnpkg.com/karma-verbose-reporter/-/karma-verbose-reporter-0.0.8.tgz#472d1062af5402d8f2d38d534a8614a5b77b84e8"
integrity sha512-wHgevIcEpfgKwR3CnWd8t1ErzWeVlctO7ZtXkKFR1inb006ogz+7ZKg95eIVOnHCYWL3Gdy1dRMOGjVP0n4MlA==
dependencies:
colors "1.4.0"
karma@~6.4.3: karma@~6.4.3:
version "6.4.3" version "6.4.3"
resolved "https://registry.yarnpkg.com/karma/-/karma-6.4.3.tgz#763e500f99597218bbb536de1a14acc4ceea7ce8" resolved "https://registry.yarnpkg.com/karma/-/karma-6.4.3.tgz#763e500f99597218bbb536de1a14acc4ceea7ce8"