diff --git a/lib/core/response_models/patient_ticket_model.dart b/lib/core/response_models/patient_ticket_model.dart index a80f0e7..5f2c30c 100644 --- a/lib/core/response_models/patient_ticket_model.dart +++ b/lib/core/response_models/patient_ticket_model.dart @@ -97,7 +97,7 @@ class PatientTicketModel { createdOn = json['createdOn']; editedOn = json['editedOn']; queueNo = json['queueNoM']; - callNoStr = json['callNoStr']; + callNoStr = json['callNoStr'] != null ? (json['callNoStr'] as String).replaceAll('_', '-') : ""; isQueue = json['isQueue']; isToneReq = json['isToneReq']; isVoiceReq = json['isVoiceReq']; @@ -151,98 +151,98 @@ class PatientTicketModel { if (callType == 5) return CallType.nebulization; return CallType.vitalSign; } - // - // static List testCallPatients = [ - // PatientTicketModel( - // id: 1, - // patientID: 112, - // mobileNo: "112", - // doctorName: "name", - // doctorNameN: "nameN", - // patientGender: 1, - // callType: 1, - // roomNo: "617", - // createdOn: DateTime.now().millisecondsSinceEpoch.toString(), - // editedOn: DateTime.now().millisecondsSinceEpoch.toString(), - // editedOnTimeStamp: DateTime.now().millisecondsSinceEpoch, - // queueNo: "B-89", - // callNoStr: "B-89", - // isQueue: true, - // isToneReq: true, - // isVoiceReq: true, - // concurrentCallDelaySec: 8, - // ), - // PatientTicketModel( - // id: 1, - // patientID: 112, - // mobileNo: "112", - // doctorName: "name", - // doctorNameN: "nameN", - // patientGender: 1, - // callType: 1, - // roomNo: "617", - // createdOn: DateTime.now().millisecondsSinceEpoch.toString(), - // editedOn: DateTime.now().millisecondsSinceEpoch.toString(), - // queueNo: "B-89", - // callNoStr: "B-89", - // isQueue: true, - // isToneReq: true, - // isVoiceReq: true, - // concurrentCallDelaySec: 8, - // ), - // PatientTicketModel( - // id: 1, - // patientID: 112, - // mobileNo: "112", - // doctorName: "name", - // doctorNameN: "nameN", - // patientGender: 1, - // callType: 1, - // roomNo: "617", - // createdOn: DateTime.now().millisecondsSinceEpoch.toString(), - // editedOn: DateTime.now().millisecondsSinceEpoch.toString(), - // queueNo: "B-89", - // callNoStr: "B-89", - // isQueue: true, - // isToneReq: true, - // isVoiceReq: true, - // concurrentCallDelaySec: 8, - // ), - // PatientTicketModel( - // id: 1, - // patientID: 112, - // mobileNo: "112", - // doctorName: "name", - // doctorNameN: "nameN", - // patientGender: 1, - // callType: 1, - // roomNo: "617", - // createdOn: DateTime.now().millisecondsSinceEpoch.toString(), - // editedOn: DateTime.now().millisecondsSinceEpoch.toString(), - // queueNo: "B-89", - // callNoStr: "B-89", - // isQueue: true, - // isToneReq: true, - // isVoiceReq: true, - // concurrentCallDelaySec: 8, - // ), - // PatientTicketModel( - // id: 1, - // patientID: 112, - // mobileNo: "112", - // doctorName: "name", - // doctorNameN: "nameN", - // patientGender: 1, - // callType: 1, - // roomNo: "617", - // createdOn: DateTime.now().millisecondsSinceEpoch.toString(), - // editedOn: DateTime.now().millisecondsSinceEpoch.toString(), - // queueNo: "B-89", - // callNoStr: "B-89", - // isQueue: true, - // isToneReq: true, - // isVoiceReq: true, - // concurrentCallDelaySec: 8, - // ), - // ]; +// +// static List testCallPatients = [ +// PatientTicketModel( +// id: 1, +// patientID: 112, +// mobileNo: "112", +// doctorName: "name", +// doctorNameN: "nameN", +// patientGender: 1, +// callType: 1, +// roomNo: "617", +// createdOn: DateTime.now().millisecondsSinceEpoch.toString(), +// editedOn: DateTime.now().millisecondsSinceEpoch.toString(), +// editedOnTimeStamp: DateTime.now().millisecondsSinceEpoch, +// queueNo: "B-89", +// callNoStr: "B-89", +// isQueue: true, +// isToneReq: true, +// isVoiceReq: true, +// concurrentCallDelaySec: 8, +// ), +// PatientTicketModel( +// id: 1, +// patientID: 112, +// mobileNo: "112", +// doctorName: "name", +// doctorNameN: "nameN", +// patientGender: 1, +// callType: 1, +// roomNo: "617", +// createdOn: DateTime.now().millisecondsSinceEpoch.toString(), +// editedOn: DateTime.now().millisecondsSinceEpoch.toString(), +// queueNo: "B-89", +// callNoStr: "B-89", +// isQueue: true, +// isToneReq: true, +// isVoiceReq: true, +// concurrentCallDelaySec: 8, +// ), +// PatientTicketModel( +// id: 1, +// patientID: 112, +// mobileNo: "112", +// doctorName: "name", +// doctorNameN: "nameN", +// patientGender: 1, +// callType: 1, +// roomNo: "617", +// createdOn: DateTime.now().millisecondsSinceEpoch.toString(), +// editedOn: DateTime.now().millisecondsSinceEpoch.toString(), +// queueNo: "B-89", +// callNoStr: "B-89", +// isQueue: true, +// isToneReq: true, +// isVoiceReq: true, +// concurrentCallDelaySec: 8, +// ), +// PatientTicketModel( +// id: 1, +// patientID: 112, +// mobileNo: "112", +// doctorName: "name", +// doctorNameN: "nameN", +// patientGender: 1, +// callType: 1, +// roomNo: "617", +// createdOn: DateTime.now().millisecondsSinceEpoch.toString(), +// editedOn: DateTime.now().millisecondsSinceEpoch.toString(), +// queueNo: "B-89", +// callNoStr: "B-89", +// isQueue: true, +// isToneReq: true, +// isVoiceReq: true, +// concurrentCallDelaySec: 8, +// ), +// PatientTicketModel( +// id: 1, +// patientID: 112, +// mobileNo: "112", +// doctorName: "name", +// doctorNameN: "nameN", +// patientGender: 1, +// callType: 1, +// roomNo: "617", +// createdOn: DateTime.now().millisecondsSinceEpoch.toString(), +// editedOn: DateTime.now().millisecondsSinceEpoch.toString(), +// queueNo: "B-89", +// callNoStr: "B-89", +// isQueue: true, +// isToneReq: true, +// isVoiceReq: true, +// concurrentCallDelaySec: 8, +// ), +// ]; } diff --git a/lib/home/priority_calls_components.dart b/lib/home/priority_calls_components.dart index fcc0337..baa260c 100644 --- a/lib/home/priority_calls_components.dart +++ b/lib/home/priority_calls_components.dart @@ -39,19 +39,21 @@ class PriorityTickets extends StatelessWidget { SizedBox(height: SizeConfig.getHeightMultiplier() * 1.8), Column( mainAxisAlignment: MainAxisAlignment.spaceAround, - children: otherTickets - .map((ticket) => Padding( - padding: EdgeInsets.only(top: SizeConfig.getHeightMultiplier() * 2), - child: TicketItem( - ticketNo: ticket.queueNo, - callType: ticket.getCallType(), - scale: 0.8, - roomNo: ticket.roomNo, - isClinicAdded: ticket.callNoStr != ticket.queueNo, - callConfig: callConfig, - ), - )) - .toList(), + children: otherTickets.map((ticket) { + log("queueNoFaiz: ${ticket.callNoStr} != ${ticket.queueNo} "); + + return Padding( + padding: EdgeInsets.only(top: SizeConfig.getHeightMultiplier() * 2), + child: TicketItem( + ticketNo: ticket.queueNo, + callType: ticket.getCallType(), + scale: 0.8, + roomNo: ticket.roomNo, + isClinicAdded: ticket.callNoStr != ticket.queueNo, + callConfig: callConfig, + ), + ); + }).toList(), ) ] ], @@ -80,9 +82,14 @@ class TicketItem extends StatelessWidget { }) : super(key: key); String getFormattedTicket(String ticketNo, bool isClinicAdded) { + log("ticketNo: $ticketNo"); if (isClinicAdded) { var formattedString = ticketNo.split(" "); - return "${formattedString[0]} ${formattedString[1]}"; + if (formattedString.length > 1) { + return "${formattedString[0]} ${formattedString[1]}"; + } else { + return ticketNo; + } } return ticketNo; } diff --git a/lib/utils/call_by_voice.dart b/lib/utils/call_by_voice.dart index 4a8bfae..51bd841 100644 --- a/lib/utils/call_by_voice.dart +++ b/lib/utils/call_by_voice.dart @@ -23,6 +23,11 @@ class CallByVoice { log("ticketNo: $ticketNo"); log("isClinicNameAdded: $isClinicNameAdded"); + // log("getEngines: ${await flutterTts.getEngines}"); + // log("getDefaultEngine: ${await flutterTts.getDefaultEngine}"); + // log("getVoices: ${await flutterTts.getVoices}"); + // log("getDefaultVoice: ${await flutterTts.getDefaultVoice}"); + String clinicName = ""; String patientAlpha = ""; String patientNumeric = ""; diff --git a/lib/utils/utils.dart b/lib/utils/utils.dart index f431d71..a1bc199 100644 --- a/lib/utils/utils.dart +++ b/lib/utils/utils.dart @@ -11,7 +11,7 @@ class Utils { //TODO: Add translation String localMsg = 'Something wrong happened, please contact the admin'; if (err != null) { - localMsg = localMsg + '\n \n' + err.toString(); + localMsg = '$localMsg\n \n$err'; } return localMsg; }