add ECG service

merge-requests/353/head
Mohammad Aljammal 5 years ago
parent fc0d1b67a4
commit e7e4aad962

@ -292,4 +292,4 @@ SPEC CHECKSUMS:
PODFILE CHECKSUM: 649616dc336b3659ac6b2b25159d8e488e042b69
COCOAPODS: 1.10.0.rc.1
COCOAPODS: 1.10.1

@ -212,6 +212,9 @@ const GET_PROCEDURE_VALIDATION =
const GET_BOX_QUANTITY =
'Services/DoctorApplication.svc/REST/CalculateBoxQuantity';
///GET ECG
const GET_ECG = "Services/Patients.svc/REST/HIS_GetPatientMuseResults";
var selectedPatientType = 1;
//*********change value to decode json from Dropdown ************

@ -0,0 +1,64 @@
import 'package:doctor_app_flutter/util/date-utils.dart';
class PatientMuseResultsModel {
int rowID;
String setupID;
int projectID;
String orderNo;
int lineItemNo;
int patientType;
int patientID;
String procedureID;
dynamic reportData;
String imageURL;
String createdBy;
String createdOn;
DateTime createdOnDateTime;
PatientMuseResultsModel(
{this.rowID,
this.setupID,
this.projectID,
this.orderNo,
this.lineItemNo,
this.patientType,
this.patientID,
this.procedureID,
this.reportData,
this.imageURL,
this.createdBy,
this.createdOn});
PatientMuseResultsModel.fromJson(Map<String, dynamic> json) {
rowID = json['RowID'];
setupID = json['SetupID'];
projectID = json['ProjectID'];
orderNo = json['OrderNo'];
lineItemNo = json['LineItemNo'];
patientType = json['PatientType'];
patientID = json['PatientID'];
procedureID = json['ProcedureID'];
reportData = json['ReportData'];
imageURL = json['ImageURL'];
createdBy = json['CreatedBy'];
createdOn = json['CreatedOn'];
createdOnDateTime = DateUtils.getDateTimeFromServerFormat(json['CreatedOn']);
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['RowID'] = this.rowID;
data['SetupID'] = this.setupID;
data['ProjectID'] = this.projectID;
data['OrderNo'] = this.orderNo;
data['LineItemNo'] = this.lineItemNo;
data['PatientType'] = this.patientType;
data['PatientID'] = this.patientID;
data['ProcedureID'] = this.procedureID;
data['ReportData'] = this.reportData;
data['ImageURL'] = this.imageURL;
data['CreatedBy'] = this.createdBy;
data['CreatedOn'] = this.createdOn;
return data;
}
}

@ -0,0 +1,28 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/model/PatientMuseResultsModel.dart';
import 'package:doctor_app_flutter/core/service/base/base_service.dart';
class PatientMuseService extends BaseService {
List<PatientMuseResultsModel> patientMuseResultsModelList = List();
getECGPatient({int patientType, int patientOutSA,int patientID}) async {
Map<String,dynamic> body = Map();
body['PatientType'] = patientType;
body['PatientOutSA'] = patientOutSA;
body['PatientID'] = patientID;
await baseAppClient.post(
GET_ECG,
onSuccess: (dynamic response, int statusCode) {
patientMuseResultsModelList.clear();
response['HIS_GetPatientMuseResultsList'].forEach((v) {
patientMuseResultsModelList.add(PatientMuseResultsModel.fromJson(v));
});
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: body,
);
}
}

@ -0,0 +1,23 @@
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/service/PatientMuseService.dart';
import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart';
import '../../locator.dart';
class PatientMuseViewModel extends BaseViewModel {
PatientMuseService _patientMuseService = locator<PatientMuseService>();
getECGPatient({int patientType, int patientOutSA, int patientID}) async {
setState(ViewState.Busy);
await _patientMuseService.getECGPatient(
patientID: patientID,
patientOutSA: patientOutSA,
patientType: patientType);
if (_patientMuseService.hasError) {
error = _patientMuseService.error;
setState(ViewState.Error);
} else
setState(ViewState.Idle);
}
}

@ -15,6 +15,7 @@ import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart';
import 'package:doctor_app_flutter/core/viewModel/sick_leave_view_model.dart';
import 'package:get_it/get_it.dart';
import 'core/service/PatientMuseService.dart';
import 'core/service/SOAP_service.dart';
import 'core/service/patient-admission-request-service.dart';
import 'core/service/doctor_reply_service.dart';
@ -25,6 +26,7 @@ import 'core/service/patient-doctor-referral-service.dart';
import 'core/service/referral_patient_service.dart';
import 'core/service/referred_patient_service.dart';
import 'core/service/schedule_service.dart';
import 'core/viewModel/PatientMuseViewModel.dart';
import 'core/viewModel/SOAP_view_model.dart';
import 'core/viewModel/doctor_replay_view_model.dart';
import 'core/viewModel/medicine_view_model.dart';
@ -58,6 +60,7 @@ void setupLocator() {
locator.registerLazySingleton(() => AdmissionRequestService());
locator.registerLazySingleton(() => UcafService());
locator.registerLazySingleton(() => AuthService());
locator.registerLazySingleton(() => PatientMuseService());
/// View Model
locator.registerFactory(() => DoctorReplayViewModel());
@ -77,4 +80,5 @@ void setupLocator() {
locator.registerFactory(() => AdmissionRequestViewModel());
locator.registerFactory(() => UcafViewModel());
locator.registerFactory(() => MedicalFileViewModel());
locator.registerFactory(() => PatientMuseViewModel());
}

@ -27,7 +27,7 @@ class PatientProfileScreen extends StatelessWidget {
PatiantInformtion patient;
//TODO change it
@override
Widget build(BuildContext context) {
final routeArgs = ModalRoute.of(context).settings.arguments as Map;

@ -17,6 +17,7 @@ import 'package:hexcolor/hexcolor.dart';
class AddSickLeavScreen extends StatelessWidget {
PatiantInformtion patient;
//TODO jammal
@override
Widget build(BuildContext context) {
final routeArgs = ModalRoute.of(context).settings.arguments as Map;

@ -28,7 +28,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget {
String from;
String to;
//TODO change it
PatiantInformtion patient;
String patientType;
@override

@ -573,7 +573,7 @@ packages:
name: meta
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.0-nullsafety.4"
version: "1.3.0-nullsafety.3"
mime:
dependency: transitive
description:
@ -844,7 +844,7 @@ packages:
name: stack_trace
url: "https://pub.dartlang.org"
source: hosted
version: "1.10.0-nullsafety.2"
version: "1.10.0-nullsafety.1"
stream_channel:
dependency: transitive
description:
@ -986,5 +986,5 @@ packages:
source: hosted
version: "2.2.1"
sdks:
dart: ">=2.10.0 <=2.11.0-213.1.beta"
dart: ">=2.10.0 <2.11.0"
flutter: ">=1.22.0 <2.0.0"

Loading…
Cancel
Save