fix the DOCTYPE html error in getPrescription service

merge-requests/967/head
RoaaGhali98 4 years ago
parent e10c07f6a4
commit 5f3f509b8c

@ -2,16 +2,15 @@ class PrescriptionReqModel {
String vidaAuthTokenID; String vidaAuthTokenID;
dynamic patientMRN; dynamic patientMRN;
dynamic appNo; dynamic appNo;
dynamic admissionNo;
PrescriptionReqModel( PrescriptionReqModel(
{this.vidaAuthTokenID, this.patientMRN, this.appNo, this.admissionNo}); {this.vidaAuthTokenID, this.patientMRN, this.appNo});
PrescriptionReqModel.fromJson(Map<String, dynamic> json) { PrescriptionReqModel.fromJson(Map<String, dynamic> json) {
vidaAuthTokenID = json['VidaAuthTokenID']; vidaAuthTokenID = json['VidaAuthTokenID'];
patientMRN = json['PatientMRN']; patientMRN = json['PatientMRN'];
appNo = json['AppointmentNo']; appNo = json['AppointmentNo'];
admissionNo = json['AdmissionNo'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -19,7 +18,6 @@ class PrescriptionReqModel {
data['VidaAuthTokenID'] = this.vidaAuthTokenID; data['VidaAuthTokenID'] = this.vidaAuthTokenID;
data['PatientMRN'] = this.patientMRN; data['PatientMRN'] = this.patientMRN;
data['AppointmentNo'] = this.appNo; data['AppointmentNo'] = this.appNo;
data['AdmissionNo'] = this.admissionNo;
return data; return data;
} }

@ -16,7 +16,6 @@ class PrescriptionResModel {
String name; String name;
int episodeID; int episodeID;
int actualDoctorRate; int actualDoctorRate;
int admission;
int clinicID; int clinicID;
String companyName; String companyName;
String despensedStatus; String despensedStatus;
@ -51,7 +50,6 @@ class PrescriptionResModel {
this.name, this.name,
this.episodeID, this.episodeID,
this.actualDoctorRate, this.actualDoctorRate,
this.admission,
this.clinicID, this.clinicID,
this.companyName, this.companyName,
this.despensedStatus, this.despensedStatus,
@ -86,7 +84,6 @@ class PrescriptionResModel {
name = json['Name']; name = json['Name'];
episodeID = json['EpisodeID']; episodeID = json['EpisodeID'];
actualDoctorRate = json['ActualDoctorRate']; actualDoctorRate = json['ActualDoctorRate'];
admission = json['Admission'];
clinicID = json['ClinicID']; clinicID = json['ClinicID'];
companyName = json['CompanyName']; companyName = json['CompanyName'];
despensedStatus = json['Despensed_Status']; despensedStatus = json['Despensed_Status'];
@ -123,7 +120,6 @@ class PrescriptionResModel {
data['Name'] = this.name; data['Name'] = this.name;
data['EpisodeID'] = this.episodeID; data['EpisodeID'] = this.episodeID;
data['ActualDoctorRate'] = this.actualDoctorRate; data['ActualDoctorRate'] = this.actualDoctorRate;
data['Admission'] = this.admission;
data['ClinicID'] = this.clinicID; data['ClinicID'] = this.clinicID;
data['CompanyName'] = this.companyName; data['CompanyName'] = this.companyName;
data['Despensed_Status'] = this.despensedStatus; data['Despensed_Status'] = this.despensedStatus;

@ -103,37 +103,6 @@ class PatientViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future getOutPatientPrescriptions(patient, {bool isLocalBusy = false, BuildContext context, PatiantInformtion patientInformation}) async {
if (isLocalBusy) {
setState(ViewState.BusyLocal);
} else {
setState(ViewState.Busy);
}
GifLoaderDialogUtils.showMyDialog(context);
await _patientService.getOutPatientPrescriptions(patient);
GifLoaderDialogUtils.hideDialog(context);
if (_patientService.hasError) {
error = _patientService.error;
if (isLocalBusy) {
setState(ViewState.ErrorLocal);
} else {
setState(ViewState.Error);
}
} else
setState(ViewState.Idle);
}
// async {
// setState(ViewState.Busy);
// await _patientService.getOutPatientPrescriptions(patient);
// if (_patientService.hasError) {
// error = _patientService.error;
// setState(ViewState.Error);
// } else
// setState(ViewState.Idle);
// }
Future getInPatientPrescriptions(patient) async { Future getInPatientPrescriptions(patient) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _patientService.getInPatientPrescriptions(patient); await _patientService.getInPatientPrescriptions(patient);

@ -20,9 +20,14 @@ import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/model/patient/vital_sign/patient-vital-sign-data.dart'; import 'package:doctor_app_flutter/core/model/patient/vital_sign/patient-vital-sign-data.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import '../../widgets/shared/loader/gif_loader_dialog_utils.dart';
import '../service/patient/patient_service.dart';
class PrescriptionViewModel extends BaseViewModel { class PrescriptionViewModel extends BaseViewModel {
FilterType filterType = FilterType.Clinic; FilterType filterType = FilterType.Clinic;
bool hasError = false; bool hasError = false;
PatientService _patientService = locator<PatientService>();
PrescriptionService _prescriptionService = locator<PrescriptionService>(); PrescriptionService _prescriptionService = locator<PrescriptionService>();
List<GetMedicationResponseModel> get allMedicationList => List<GetMedicationResponseModel> get allMedicationList =>
@ -65,6 +70,26 @@ class PrescriptionViewModel extends BaseViewModel {
List<PrescriotionInPatient> get inPatientPrescription => List<PrescriotionInPatient> get inPatientPrescription =>
_prescriptionsService.prescriptionInPatientList; _prescriptionsService.prescriptionInPatientList;
Future getOutPatientPrescriptions(patient, {bool isLocalBusy = false, BuildContext context, PatiantInformtion patientInformation}) async {
if (isLocalBusy) {
setState(ViewState.BusyLocal);
} else {
setState(ViewState.Busy);
}
await _patientService.getOutPatientPrescriptions(patient);
if (_patientService.hasError) {
error = _patientService.error;
if (isLocalBusy) {
setState(ViewState.ErrorLocal);
} else {
setState(ViewState.Error);
}
} else
setState(ViewState.Idle);
}
getPrescriptionsInPatient(PatiantInformtion patient) async { getPrescriptionsInPatient(PatiantInformtion patient) async {
setState(ViewState.Busy); setState(ViewState.Busy);
error = ""; error = "";

@ -40,7 +40,7 @@ class PrescriptionsPage extends StatelessWidget {
patient.admissionNo == null patient.admissionNo == null
? model.getPrescriptions(patient, patientType: patientType) ? model.getPrescriptions(patient, patientType: patientType)
: model.getMedicationForInPatient(patient), : model.getMedicationForInPatient(patient),
isLocalBusy: false, isLocalBusy: true,
context: context, context: context,
patientInformation: patient patientInformation: patient
); );

Loading…
Cancel
Save