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.
184 lines
6.2 KiB
Dart
184 lines
6.2 KiB
Dart
import 'package:hmg_qline/utilities/date_utils.dart';
|
|
import 'package:hmg_qline/utilities/enums.dart';
|
|
import 'package:hmg_qline/utilities/extensions.dart';
|
|
|
|
class TicketDetailsModel {
|
|
QTypeEnum? qTypeEnum;
|
|
ScreenTypeEnum? screenTypeEnum;
|
|
String? connectionID;
|
|
TicketData? ticketModel;
|
|
|
|
TicketDetailsModel({this.qTypeEnum, this.screenTypeEnum, this.connectionID, this.ticketModel});
|
|
|
|
TicketDetailsModel.fromJson(Map<String, dynamic> json) {
|
|
qTypeEnum = json['qType'] != null ? (json['qType'] as int).toQTypeEnum() : null;
|
|
screenTypeEnum = json['screenType'] != null ? (json['screenType'] as int).toScreenTypeEnum() : null;
|
|
connectionID = json['connectionID'];
|
|
ticketModel = json['data'] != null
|
|
? TicketData.fromJson(
|
|
json['data'],
|
|
qTypeEnum: json['qType'] != null ? (json['qType'] as int).toQTypeEnum() : null,
|
|
)
|
|
: null;
|
|
}
|
|
}
|
|
|
|
class TicketData {
|
|
int? id;
|
|
int? patientID;
|
|
int? laBQGroupID;
|
|
String? queueNo;
|
|
int? counterBatchNo;
|
|
int? calledBy;
|
|
String? calledOn;
|
|
String? servedOn;
|
|
String? patientName;
|
|
String? mobileNo;
|
|
String? patientEmail;
|
|
int? preferredLang;
|
|
LanguageEnum voiceLanguageEnum = LanguageEnum.english;
|
|
String ticketNoText = "Ticket Number";
|
|
String postVoiceText = "Please Visit Counter";
|
|
int? patientGender;
|
|
String? roomNo;
|
|
bool? isActive;
|
|
int? createdBy;
|
|
int? editedBy;
|
|
DateTime? editedOn;
|
|
DateTime? createdOn;
|
|
|
|
// New fields
|
|
String? doctorNameN;
|
|
int? callType;
|
|
String? queueNoM;
|
|
String? callNoStr;
|
|
bool? isQueue;
|
|
bool? isToneReq;
|
|
bool? isVoiceReq;
|
|
int? orientationType;
|
|
bool? isTurnOn;
|
|
int? concurrentCallDelaySec;
|
|
String? crTypeAckIP;
|
|
int voiceLanguage = 1;
|
|
String voiceLanguageText = "English";
|
|
String vitalSignText = "Vital Sign";
|
|
String doctorText = "Doctor";
|
|
String procedureText = "Procedure";
|
|
String vaccinationText = "Vaccination";
|
|
String nebulizationText = "Nebulization";
|
|
String callForVitalSignText = "Call for Vital Sign";
|
|
String callForDoctorText = "Call for Doctor";
|
|
String callForProcedureText = "Call for Procedure";
|
|
String callForVaccinationText = "Call for Vaccination";
|
|
String callForNebulizationText = "Call for Nebulization";
|
|
String roomText = "Room";
|
|
String queueNoText = "Counter";
|
|
String callForText = "Call For";
|
|
|
|
TicketData({
|
|
this.id,
|
|
this.patientID,
|
|
this.laBQGroupID,
|
|
this.queueNo,
|
|
this.counterBatchNo,
|
|
this.calledBy,
|
|
this.calledOn,
|
|
this.servedOn,
|
|
this.patientName,
|
|
this.mobileNo,
|
|
this.patientEmail,
|
|
this.preferredLang,
|
|
this.voiceLanguageEnum = LanguageEnum.english,
|
|
this.ticketNoText = "Ticket Number",
|
|
this.postVoiceText = "Please Visit Counter",
|
|
this.patientGender,
|
|
this.roomNo,
|
|
this.isActive,
|
|
this.createdBy,
|
|
this.createdOn,
|
|
this.editedBy,
|
|
this.editedOn,
|
|
this.doctorNameN,
|
|
this.callType,
|
|
this.queueNoM,
|
|
this.callNoStr,
|
|
this.isQueue,
|
|
this.isToneReq,
|
|
this.isVoiceReq,
|
|
this.orientationType,
|
|
this.isTurnOn,
|
|
this.concurrentCallDelaySec,
|
|
this.crTypeAckIP,
|
|
this.voiceLanguageText = "English",
|
|
this.vitalSignText = "Vital Sign",
|
|
this.doctorText = "Doctor",
|
|
this.procedureText = "Procedure",
|
|
this.vaccinationText = "Vaccination",
|
|
this.nebulizationText = "Nebulization",
|
|
this.callForVitalSignText = "Call for Vital Sign",
|
|
this.callForDoctorText = "Call for Doctor",
|
|
this.callForProcedureText = "Call for Procedure",
|
|
this.callForVaccinationText = "Call for Vaccination",
|
|
this.callForNebulizationText = "Call for Nebulization",
|
|
this.roomText = "Room",
|
|
this.queueNoText = "Counter",
|
|
this.callForText = "Call For",
|
|
});
|
|
|
|
TicketData.fromJson(Map<String, dynamic> json, {QTypeEnum? qTypeEnum}) {
|
|
id = json['id'];
|
|
patientID = json['patientID'];
|
|
laBQGroupID = json['laB_QGroupID'];
|
|
queueNo = json['queueNo'];
|
|
counterBatchNo = json['counterBatchNo'];
|
|
calledBy = json['calledBy'];
|
|
calledOn = json['calledOn'];
|
|
servedOn = json['servedOn'];
|
|
patientName = json['patientName'];
|
|
mobileNo = json['mobileNo'];
|
|
patientEmail = json['patientEmail'];
|
|
preferredLang = (json['preferredLang'] != null && json['preferredLang'].toString().trim() != "") ? int.parse(json['preferredLang'].toString()) : 1;
|
|
voiceLanguageEnum = (json['preferredLang'] != null && json['preferredLang'].toString().trim() != "") ? (int.parse(json['preferredLang'].toString())).toLanguageEnum() : LanguageEnum.english;
|
|
ticketNoText = json['ticketNoText'] ?? "Ticket Number";
|
|
postVoiceText = json['pleaseVisitCounterText'] ?? "Please Visit Counter";
|
|
patientGender = json['patientGender'] ?? 1;
|
|
roomNo = json['roomNo']?.toString();
|
|
if (qTypeEnum != null && qTypeEnum == QTypeEnum.general) {
|
|
roomNo = json['counterNo']?.toString();
|
|
}
|
|
isActive = json['isActive'];
|
|
createdBy = json['createdBy'];
|
|
editedBy = json['editedBy'];
|
|
editedOn = json['editedOn'] != null ? (json['editedOn'] as String).toDateTime() : DateTime.now();
|
|
createdOn = json['createdOn'] != null ? (json['createdOn'] as String).toDateTime() : DateTime.now();
|
|
|
|
// New fields
|
|
doctorNameN = json['doctorNameN'];
|
|
callType = json['callType'];
|
|
queueNoM = json['queueNoM'];
|
|
callNoStr = json['callNoStr'];
|
|
isQueue = json['isQueue'];
|
|
isToneReq = json['isToneReq'];
|
|
isVoiceReq = json['isVoiceReq'];
|
|
orientationType = json['orientationType'];
|
|
isTurnOn = json['isTurnOn'];
|
|
concurrentCallDelaySec = json['concurrentCallDelaySec'];
|
|
crTypeAckIP = json['crTypeAckIP'];
|
|
voiceLanguage = json['voiceLanguage'];
|
|
voiceLanguageText = json['voiceLanguageText'];
|
|
vitalSignText = json['vitalSignText'];
|
|
doctorText = json['doctorText'];
|
|
procedureText = json['procedureText'];
|
|
vaccinationText = json['vaccinationText'];
|
|
nebulizationText = json['nebulizationText'];
|
|
callForVitalSignText = json['callForVitalSignText'];
|
|
callForDoctorText = json['callForDoctorText'];
|
|
callForProcedureText = json['callForProcedureText'];
|
|
callForVaccinationText = json['callForVaccinationText'];
|
|
callForNebulizationText = json['callForNebulizationText'];
|
|
roomText = json['roomText'];
|
|
queueNoText = json['queueNoText'];
|
|
callForText = json['callForText'];
|
|
}
|
|
}
|