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

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

@ -103,37 +103,6 @@ class PatientViewModel extends BaseViewModel {
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 {
setState(ViewState.Busy);
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:flutter/cupertino.dart';
import '../../widgets/shared/loader/gif_loader_dialog_utils.dart';
import '../service/patient/patient_service.dart';
class PrescriptionViewModel extends BaseViewModel {
FilterType filterType = FilterType.Clinic;
bool hasError = false;
PatientService _patientService = locator<PatientService>();
PrescriptionService _prescriptionService = locator<PrescriptionService>();
List<GetMedicationResponseModel> get allMedicationList =>
@ -65,6 +70,26 @@ class PrescriptionViewModel extends BaseViewModel {
List<PrescriotionInPatient> get inPatientPrescription =>
_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 {
setState(ViewState.Busy);
error = "";

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

Loading…
Cancel
Save