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.
94 lines
2.2 KiB
Dart
94 lines
2.2 KiB
Dart
import 'dart:math';
|
|
|
|
import 'package:queuing_system/utils/call_type.dart';
|
|
|
|
class Tickets {
|
|
Tickets({
|
|
this.callNo,
|
|
this.roomNo,
|
|
this.callType,
|
|
this.createdON,
|
|
this.doctorName,
|
|
this.doctorNameN,
|
|
this.editedON,
|
|
this.mobileNo,
|
|
this.patientGender,
|
|
this.patientID,
|
|
this.callNoStr,
|
|
this.queueNo,
|
|
this.queueDuration,
|
|
});
|
|
|
|
int getRandomNum() {
|
|
return Random().nextInt(2);
|
|
}
|
|
|
|
Tickets.fromJson(dynamic json) {
|
|
id = json['ID'];
|
|
callNo = json['CallNo'];
|
|
roomNo = json['RoomNo'];
|
|
callType = json['callType'];
|
|
createdON = json['CreatedON'];
|
|
doctorName = json['DoctorName'];
|
|
doctorNameN = json['DoctorNameN'];
|
|
editedON = json['EditedON'];
|
|
mobileNo = json['MobileNo'];
|
|
patientGender = json['PatientGender'];
|
|
patientID = json['PatientID'];
|
|
queueNo = json['QueueNo'];
|
|
queueDuration = json['QueueDuration'];
|
|
callNoStr = json['CallNoStr'] ?? json['CallNo'].toString();
|
|
isQueue = json["ISQueue"] ?? false;
|
|
// isQueue = getRandomNum();
|
|
}
|
|
|
|
int id;
|
|
int callNo;
|
|
String roomNo;
|
|
int callType;
|
|
String createdON;
|
|
String doctorName;
|
|
String doctorNameN;
|
|
String editedON;
|
|
String mobileNo;
|
|
int patientGender;
|
|
int patientID;
|
|
String queueNo;
|
|
String queueDuration;
|
|
String callNoStr;
|
|
bool callUpdated = false;
|
|
bool isQueue;
|
|
|
|
Map<String, dynamic> toJson() {
|
|
final map = <String, dynamic>{};
|
|
map['ID'] = id;
|
|
map['CallNo'] = callNo;
|
|
map['RoomNo'] = roomNo;
|
|
map['callType'] = callType;
|
|
map['CreatedON'] = createdON;
|
|
map['DoctorName'] = doctorName;
|
|
map['DoctorNameN'] = doctorNameN;
|
|
map['EditedON'] = editedON;
|
|
map['MobileNo'] = mobileNo;
|
|
map['PatientGender'] = patientGender;
|
|
map['PatientID'] = patientID;
|
|
map['CallNoStr'] = callNoStr;
|
|
map['QueueNo'] = queueNo;
|
|
map['QueueDuration'] = queueDuration;
|
|
map['ISQueue'] = isQueue;
|
|
return map;
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return (callNoStr).toString();
|
|
}
|
|
|
|
CallType getCallType() {
|
|
if (callType == 0) return CallType.RECEPTION;
|
|
if (callType == 1) return CallType.NURSE;
|
|
if (callType == 2) return CallType.DOCTOR;
|
|
return CallType.NONE;
|
|
}
|
|
}
|