bug fixes

merge-requests/487/head
Sultan Khan 5 years ago
parent 148ea967fb
commit 5c4aee849e

@ -68,7 +68,7 @@ class BaseAppClient {
body['LanguageID'] = 2; body['LanguageID'] = 2;
body['stamp'] = STAMP; body['stamp'] = STAMP;
// if(!body.containsKey("IPAdress")) // if(!body.containsKey("IPAdress"))
body['IPAdress'] = IP_ADDRESS; body['IPAdress'] = IP_ADDRESS;
body['VersionID'] = VERSION_ID; body['VersionID'] = VERSION_ID;
body['Channel'] = CHANNEL; body['Channel'] = CHANNEL;
@ -86,9 +86,6 @@ class BaseAppClient {
print("URL : $url"); print("URL : $url");
print("Body : ${json.encode(body)}"); print("Body : ${json.encode(body)}");
String bodyData= json.encode(body);
var asd = "";
if (await Helpers.checkConnection()) { if (await Helpers.checkConnection()) {
final response = await http.post(url, final response = await http.post(url,

@ -130,7 +130,8 @@ class PatientService extends BaseService {
"IsLoginForDoctorApp": patient.IsLoginForDoctorApp, "IsLoginForDoctorApp": patient.IsLoginForDoctorApp,
"PatientOutSA": patient.PatientOutSA, "PatientOutSA": patient.PatientOutSA,
"SearchType": patient.Searchtype, "SearchType": patient.Searchtype,
"MobileNo": '' "MobileNo": patient.MobileNo,
"IdentificationNo": patient.IdentificationNo
}, },
); );

@ -29,7 +29,8 @@ class PatientModel {
bool IsLoginForDoctorApp; bool IsLoginForDoctorApp;
bool PatientOutSA; bool PatientOutSA;
int Searchtype; int Searchtype;
String IdentificationNo;
String MobileNo;
int get getProjectID => ProjectID; int get getProjectID => ProjectID;
set setProjectID(int ProjectID) => this.ProjectID = ProjectID; set setProjectID(int ProjectID) => this.ProjectID = ProjectID;
@ -132,7 +133,9 @@ class PatientModel {
this.SessionID, this.SessionID,
this.IsLoginForDoctorApp, this.IsLoginForDoctorApp,
this.PatientOutSA, this.PatientOutSA,
this.Searchtype}); this.Searchtype,
this.IdentificationNo,
this.MobileNo});
factory PatientModel.fromJson(Map<String, dynamic> json) => PatientModel( factory PatientModel.fromJson(Map<String, dynamic> json) => PatientModel(
FirstName: json["FirstName"], FirstName: json["FirstName"],
@ -162,6 +165,8 @@ class PatientModel {
data['IsLoginForDoctorApp'] = this.IsLoginForDoctorApp; data['IsLoginForDoctorApp'] = this.IsLoginForDoctorApp;
data['PatientOutSA'] = this.PatientOutSA; data['PatientOutSA'] = this.PatientOutSA;
data['Searchtype'] = this.Searchtype; data['Searchtype'] = this.Searchtype;
data['IdentificationNo'] = this.IdentificationNo;
data['MobileNo'] = this.MobileNo;
return data; return data;
} }
} }

@ -72,25 +72,27 @@ class _SearchMedicinePatientScreen extends State<SearchMedicinePatientScreen>
indicatorColor: Colors.red[800], indicatorColor: Colors.red[800],
labelColor: Theme.of(context).primaryColor, labelColor: Theme.of(context).primaryColor,
labelPadding: labelPadding:
EdgeInsets.only(top: 4.0, left: 35.0, right: 35.0), EdgeInsets.only(top: 4.0, left: 30.0, right: 30.0),
unselectedLabelColor: Colors.grey[800], unselectedLabelColor: Colors.grey[800],
tabs: [ tabs: [
Container( Container(
width: MediaQuery.of(context).size.width * 0.30, width: MediaQuery.of(context).size.width * 0.35,
child: Center( child: Center(
child: AppText( child: AppText(
TranslationBase.of(context).searchPatient, TranslationBase.of(context).searchPatient,
color: Colors.black, color: Colors.black,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 14,
), ),
), ),
), ),
Container( Container(
width: MediaQuery.of(context).size.width * 0.30, width: MediaQuery.of(context).size.width * 0.35,
child: Center( child: Center(
child: AppText( child: AppText(
TranslationBase.of(context).searchMedicine, TranslationBase.of(context).searchMedicine,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 14,
color: Colors.black), color: Colors.black),
), ),
), ),

@ -56,6 +56,7 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
LastName: "0", LastName: "0",
PatientMobileNumber: "0", PatientMobileNumber: "0",
PatientIdentificationID: "0", PatientIdentificationID: "0",
MobileNo: '0',
PatientID: 0, PatientID: 0,
From: "0", From: "0",
To: "0", To: "0",
@ -67,6 +68,7 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
TokenID: "2Fi7HoIHB0eDyekVa6tCJg==", TokenID: "2Fi7HoIHB0eDyekVa6tCJg==",
SessionID: "5G0yXn0Jnq", SessionID: "5G0yXn0Jnq",
IsLoginForDoctorApp: true, IsLoginForDoctorApp: true,
IdentificationNo: '0',
PatientOutSA: false); PatientOutSA: false);
void _validateInputs() async { void _validateInputs() async {
@ -192,14 +194,19 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
if (value.length == 10 && if (value.length == 10 &&
(value[0] == '2' || value[0] == '1')) { (value[0] == '2' || value[0] == '1')) {
_patientSearchFormValues _patientSearchFormValues
.PatientIdentificationID = value; .IdentificationNo = value;
} else if (value.length == 10 && _patientSearchFormValues.Searchtype = 2;
_patientSearchFormValues.setPatientID = 0;
} else if ((value.length == 10 ||
value.length == 9) &&
(value[0] == '05' || value[0] == '5')) { (value[0] == '05' || value[0] == '5')) {
_patientSearchFormValues _patientSearchFormValues.MobileNo = value;
.setPatientMobileNumber = value; _patientSearchFormValues.Searchtype = 0;
_patientSearchFormValues.setPatientID = 0;
} else { } else {
_patientSearchFormValues.setPatientID = _patientSearchFormValues.setPatientID =
int.parse(value); int.parse(value);
_patientSearchFormValues.Searchtype = 1;
} }
} }

@ -270,7 +270,7 @@ class _PatientsScreenState extends State<PatientsScreen> {
} }
if (routeArgs != null && routeArgs.containsKey("isSearch")) { if (routeArgs != null && routeArgs.containsKey("isSearch")) {
isView = routeArgs['isView']; isView = routeArgs['isView'];
patient.Searchtype = 1; //patient.Searchtype = 1;
} }
if (routeArgs != null && routeArgs.containsKey('activeFilter')) { if (routeArgs != null && routeArgs.containsKey('activeFilter')) {
_activeLocation = routeArgs['activeFilter']; _activeLocation = routeArgs['activeFilter'];
@ -333,34 +333,34 @@ class _PatientsScreenState extends State<PatientsScreen> {
} }
parsed = lItems; parsed = lItems;
responseModelList = new ModelResponse.fromJson(parsed).list; responseModelList = new ModelResponse.fromJson(parsed).list;
//if (val2 == 7) { if (val2 == 7) {
responseModelList.sort((a, b) { responseModelList.sort((a, b) {
if (b.startTime != null && b.startTime != null) { if (b.startTime != null && b.startTime != null) {
try { try {
DateTime now = DateTime.now(); DateTime now = DateTime.now();
DateFormat dateFormat = DateFormat("yyyy-MM-dd HH:mm"); DateFormat dateFormat = DateFormat("yyyy-MM-dd HH:mm");
String formattedDate = String formattedDate =
DateFormat('yyyy-MM-dd ' + a.startTime).format(now); DateFormat('yyyy-MM-dd ' + a.startTime).format(now);
DateTime dateTimeA = dateFormat.parse(formattedDate); DateTime dateTimeA = dateFormat.parse(formattedDate);
String formattedDateB = String formattedDateB =
DateFormat('yyyy-MM-dd ' + b.startTime).format(now); DateFormat('yyyy-MM-dd ' + b.startTime).format(now);
DateTime dateTimeB = dateFormat.parse(formattedDateB); DateTime dateTimeB = dateFormat.parse(formattedDateB);
var adate = dateTimeA; //a.startTime; var adate = dateTimeA; //a.startTime;
var bdate = dateTimeB; var bdate = dateTimeB;
return adate.compareTo(bdate); return adate.compareTo(bdate);
} on Exception catch (_) { } on Exception catch (_) {
print('never reached'); print('never reached');
var adate = a.startTime; //a.startTime; var adate = a.startTime; //a.startTime;
var bdate = b.startTime; var bdate = b.startTime;
return adate.compareTo(bdate); return adate.compareTo(bdate);
}
} else {
var adate = convertDateFormat(a.appointmentDate);
var bdate = convertDateFormat(b.appointmentDate);
return bdate.compareTo(adate);
} }
} else { });
var adate = convertDateFormat(a.appointmentDate); }
var bdate = convertDateFormat(b.appointmentDate);
return bdate.compareTo(adate);
}
});
//}
responseModelList2 = responseModelList; responseModelList2 = responseModelList;
_isError = false; _isError = false;
} else { } else {

@ -1264,75 +1264,68 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
if (formKey.currentState if (formKey.currentState
.validate()) { .validate()) {
Navigator.pop(context); Navigator.pop(context);
//openDrugToDrug(model); openDrugToDrug(model);
{ {
// var x = model // postProcedure(
// .patientAssessmentList // icdCode: model
// .map((value) => // .patientAssessmentList
// value.icdCode10ID) // .isNotEmpty
// .toList() // ? model
// .join(','); // .patientAssessmentList[
// 0]
postProcedure( // .icdCode10ID
icdCode: model // .isEmpty
.patientAssessmentList // ? "test"
.isNotEmpty // : model
? model // .patientAssessmentList[
.patientAssessmentList[ // 0]
0] // .icdCode10ID
.icdCode10ID // .toString()
.isEmpty // : "test",
? "test" // // icdCode: model
: model // // .patientAssessmentList
.patientAssessmentList[ // // .map((value) => value
0] // // .icdCode10ID
.icdCode10ID // // .trim())
.toString() // // .toList()
: "test", // // .join(' '),
// icdCode: model // dose:
// .patientAssessmentList // strengthController
// .map((value) => value // .text,
// .icdCode10ID // doseUnit: units[
// .trim()) // 'parameterCode']
// .toList() // .toString(),
// .join(' '), // patient:
dose: // widget.patient,
strengthController // doseTimeIn:
.text, // doseTime['id']
doseUnit: units[ // .toString(),
'parameterCode'] // model: widget.model,
.toString(), // duration:
patient: // duration['id']
widget.patient, // .toString(),
doseTimeIn: // frequency: frequency[
doseTime['id'] // 'parameterCode']
.toString(), // .toString(),
model: widget.model, // route: route[
duration: // 'parameterCode']
duration['id'] // .toString(),
.toString(), // drugId:
frequency: frequency[ // _selectedMedication
'parameterCode'] // .itemId
.toString(), // .toString(),
route: route[ // strength:
'parameterCode'] // strengthController
.toString(), // .text,
drugId: // indication:
_selectedMedication // indicationController
.itemId // .text,
.toString(), // instruction:
strength: // instructionController
strengthController // .text,
.text, // doseTime:
indication: // selectedDate,
indicationController // );
.text,
instruction:
instructionController
.text,
doseTime:
selectedDate,
);
} }
} }
@ -1432,7 +1425,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
context: context, context: context,
builder: (context) { builder: (context) {
return Container( return Container(
height: SizeConfig.realScreenHeight * .5, height: SizeConfig.realScreenHeight * .8,
width: SizeConfig.realScreenWidth, width: SizeConfig.realScreenWidth,
child: SingleChildScrollView( child: SingleChildScrollView(
child: Column( child: Column(
@ -1448,6 +1441,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
title: TranslationBase.of(context).addMedication, title: TranslationBase.of(context).addMedication,
onPressed: () { onPressed: () {
Navigator.pop(context); Navigator.pop(context);
postProcedure( postProcedure(
icdCode: model.patientAssessmentList.isNotEmpty icdCode: model.patientAssessmentList.isNotEmpty
? model.patientAssessmentList[0].icdCode10ID ? model.patientAssessmentList[0].icdCode10ID
@ -1477,6 +1471,36 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
instruction: instructionController.text, instruction: instructionController.text,
doseTime: selectedDate, doseTime: selectedDate,
); );
// postProcedure(
// icdCode: model.patientAssessmentList.isNotEmpty
// ? model.patientAssessmentList[0].icdCode10ID
// .isEmpty
// ? "test"
// : model.patientAssessmentList[0].icdCode10ID
// .toString()
// : "test",
// // icdCode: model
// // .patientAssessmentList
// // .map((value) => value
// // .icdCode10ID
// // .trim())
// // .toList()
// // .join(' '),
// dose: strengthController.text,
// doseUnit: units['parameterCode'].toString(),
// patient: widget.patient,
// doseTimeIn: doseTime['id'].toString(),
// model: widget.model,
// duration: duration['id'].toString(),
// frequency: frequency['parameterCode'].toString(),
// route: route['parameterCode'].toString(),
// drugId: _selectedMedication.itemId.toString(),
// strength: strengthController.text,
// indication: indicationController.text,
// instruction: instructionController.text,
// doseTime: selectedDate,
// );
}, },
)) ))
], ],

@ -423,6 +423,10 @@ class Helpers {
} }
static String capitalize(str) { static String capitalize(str) {
return "${str[0].toUpperCase()}${str.substring(1).toLowerCase()}"; if (str != "") {
return "${str[0].toUpperCase()}${str.substring(1).toLowerCase()}";
} else {
return str;
}
} }
} }

@ -132,11 +132,14 @@ class PatientCard extends StatelessWidget {
? patientInfo.nationalityName.trim() ? patientInfo.nationalityName.trim()
: patientInfo.nationality != null : patientInfo.nationality != null
? patientInfo.nationality.trim() ? patientInfo.nationality.trim()
: "", : patientInfo.nationalityId != null
? patientInfo.nationalityId
: "",
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 14, fontSize: 14,
), ),
patientInfo.nationality != null patientInfo.nationality != null ||
patientInfo.nationalityId != null
? ClipRRect( ? ClipRRect(
borderRadius: borderRadius:
BorderRadius.circular(20.0), BorderRadius.circular(20.0),

Loading…
Cancel
Save