You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
72 lines
2.7 KiB
Dart
72 lines
2.7 KiB
Dart
import 'package:doctor_app_flutter/config/config.dart';
|
|
import 'package:doctor_app_flutter/core/service/base/base_service.dart';
|
|
import 'package:doctor_app_flutter/models/patient/PatientArrivalEntity.dart';
|
|
import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-data.dart';
|
|
import 'package:doctor_app_flutter/models/patient/vital_sign/vital_sign_res_model.dart';
|
|
|
|
class VitalSignsService extends BaseService{
|
|
|
|
List<VitalSignResModel> patientVitalSignList = [];
|
|
List<VitalSignResModel> patientVitalSignOrderdSubList = [];
|
|
VitalSignData patientVitalSigns;
|
|
|
|
/*Future getPatientVitalSign(patient) async {
|
|
hasError = false;
|
|
await baseAppClient.post(
|
|
GET_PATIENT_VITAL_SIGN,
|
|
onSuccess: (dynamic response, int statusCode) {
|
|
patientVitalSignList = [];
|
|
response['List_DoctorPatientVitalSign'].forEach((v) {
|
|
patientVitalSignList.add(new VitalSignResModel.fromJson(v));
|
|
});
|
|
|
|
if (patientVitalSignList.length > 0) {
|
|
List<VitalSignResModel> patientVitalSignOrderdSubListTemp = [];
|
|
patientVitalSignOrderdSubListTemp = patientVitalSignList;
|
|
patientVitalSignOrderdSubListTemp
|
|
.sort((VitalSignResModel a, VitalSignResModel b) {
|
|
return b.vitalSignDate.microsecondsSinceEpoch -
|
|
a.vitalSignDate.microsecondsSinceEpoch;
|
|
});
|
|
patientVitalSignOrderdSubList.clear();
|
|
int length = patientVitalSignOrderdSubListTemp.length >= 20
|
|
? 20
|
|
: patientVitalSignOrderdSubListTemp.length;
|
|
for (int x = 0; x < length; x++) {
|
|
patientVitalSignOrderdSubList
|
|
.add(patientVitalSignOrderdSubListTemp[x]);
|
|
}
|
|
}
|
|
},
|
|
onFailure: (String error, int statusCode) {
|
|
hasError = true;
|
|
super.error = error;
|
|
},
|
|
body: patient,
|
|
);
|
|
} // Vit*/
|
|
|
|
Future getPatientVitalSign(PatientArrivalEntity patientArrivalEntity) async {
|
|
hasError = false;
|
|
Map<String, dynamic> body = Map();
|
|
body['PatientMRN'] = patientArrivalEntity.patientMRN;
|
|
body['AppointmentNo'] = patientArrivalEntity.appointmentNo;
|
|
body['EpisodeID'] = patientArrivalEntity.episodeNo;
|
|
|
|
await baseAppClient.post(
|
|
GET_PATIENT_VITAL_SIGN_DATA,
|
|
onSuccess: (dynamic response, int statusCode) {
|
|
if(response['VitalSignsList'] != null){
|
|
if(response['VitalSignsList']['entityList'] = null && (response['VitalSignsList']['entityList'] as List).length > 0){
|
|
patientVitalSigns = VitalSignData.fromJson(response['VitalSignsList']['entityList']['0']);
|
|
}
|
|
}
|
|
},
|
|
onFailure: (String error, int statusCode) {
|
|
hasError = true;
|
|
super.error = error.toString();
|
|
},
|
|
body: body,
|
|
);
|
|
}
|
|
} |