diff --git a/src/app/merms-patient/merms-patient.page.html b/src/app/merms-patient/merms-patient.page.html index c657808..20cd9fd 100644 --- a/src/app/merms-patient/merms-patient.page.html +++ b/src/app/merms-patient/merms-patient.page.html @@ -15,12 +15,12 @@ - Bill: $1000.23 Pending + Price: #1000.00 Pending - Reason:{{reason}} + Reason:{{reason}} {{appt}} - {{gender}} [{{age}}] diff --git a/src/app/merms-patient/merms-patient.page.ts b/src/app/merms-patient/merms-patient.page.ts index ebc2751..9aff646 100644 --- a/src/app/merms-patient/merms-patient.page.ts +++ b/src/app/merms-patient/merms-patient.page.ts @@ -70,7 +70,12 @@ export class MermsPatientPage implements OnInit { async goConsultBillProfine() { const modal = await this.modalController.create({ - component: ConsultBillingPage + component: ConsultBillingPage, + componentProps: { + 'patient_name': this.patient_name, + 'patient_id': this.patient_id, + 'patientData': this.patientData + } }); return await modal.present(); } diff --git a/src/app/modal/consult-billing/consult-billing.page.html b/src/app/modal/consult-billing/consult-billing.page.html index d591d6e..dbb1fd4 100644 --- a/src/app/modal/consult-billing/consult-billing.page.html +++ b/src/app/modal/consult-billing/consult-billing.page.html @@ -9,6 +9,12 @@ + + + {{patient_name}} + + + @@ -18,17 +24,17 @@ #0.00 - Free - + #1000.00 - Basic Review - + #5000.00 - Comprehensive Review - + diff --git a/src/app/modal/consult-billing/consult-billing.page.ts b/src/app/modal/consult-billing/consult-billing.page.ts index 5dd818d..e45ee32 100644 --- a/src/app/modal/consult-billing/consult-billing.page.ts +++ b/src/app/modal/consult-billing/consult-billing.page.ts @@ -1,5 +1,7 @@ -import { Component, OnInit } from '@angular/core'; +import { Component, OnInit, Input } from '@angular/core'; import { ModalController } from '@ionic/angular'; +import { MermsServiceProviderService } from './../../providers/merms-service-provider.service'; +import { MermsSessionService } from './../../merms-session.service'; @Component({ selector: 'app-consult-billing', @@ -8,10 +10,62 @@ import { ModalController } from '@ionic/angular'; }) export class ConsultBillingPage implements OnInit { - constructor(private modalCtrl:ModalController) { } + + @Input() patient_name: string; + @Input() patient_id: number; + @Input() patientData: any; + + constructor(private modalCtrl: ModalController, + private mermsServiceProviderService: MermsServiceProviderService, + private mermsSessionService: MermsSessionService + ) { + this.getPriceData(); + } ngOnInit() { } + + priceData: any; + pendingEncounterData: any; + + currentProviderData: { + sessionid: string, + member_id: number, + card_count: number + card_type: number + }; + + + getPriceData() { + console.log('MermsServiceProviderService::getPriceData() ######## @@@@ ########'); + this.currentProviderData = { + sessionid: this.mermsSessionService.session, + member_id: this.mermsSessionService.member_id, + card_count: 100, + card_type: 22000 + }; + + try { + this.mermsServiceProviderService.genericGetService('provider/recentencounter', this.currentProviderData).subscribe(priceData => { + console.log("card data result 22k: ", priceData[0]['payload']); + this.priceData = priceData[0]['payload']; + if (priceData.hasOwnProperty('payload') && Array.isArray(priceData['payload'])) { + this.priceData = priceData['payload']; + console.log("card data result 22k: ", this.priceData); + } + }); + } catch (e) { + console.log(e); + } + + + + // + + + } + + dismiss() { // using the injected ModalController this page // can "dismiss" itself and optionally pass back data