WD: Previous Chief complaint resolutions.

update_flutter_3.24_vida_plus_episode_MDS
taha.alam 1 year ago
parent 57a542c31e
commit ec7bd327c8

@ -8,6 +8,8 @@ class GetHopiDetails {
bool? isHpiTakenFamily;
bool? isHpiTakenOther;
bool? isHpiTakenPatient;
String? hpiTakenFamilyText;
String? hpiTakenOtherText;
String? loginUserId;
int? patientId;
int? patientPomrId;
@ -39,6 +41,8 @@ class GetHopiDetails {
loginUserId = json['loginUserId'];
patientId = json['patientId'];
patientPomrId = json['patientPomrId'];
hpiTakenFamilyText = json['hpiTakenFamilyText'];
hpiTakenOtherText = json['hpiTakenOtherText'];
}
Map<String, dynamic> toJson() {
@ -55,6 +59,8 @@ class GetHopiDetails {
data['loginUserId'] = this.loginUserId;
data['patientId'] = this.patientId;
data['patientPomrId'] = this.patientPomrId;
data['hpiTakenFamilyText'] = this.hpiTakenFamilyText;
data['hpiTakenOtherText'] = this.hpiTakenOtherText;
return data;
}
}

@ -1398,6 +1398,29 @@ class SOAPService extends LookupService {
}, body: request);
}
continueEpisodeVidaPlusFromPrevious(
PatiantInformtion patient, ChiefComplains chiefComplaint, String chiefComplainTemplateId) async {
List<Map<String, dynamic>> chiefComplaintList = [];
var listofComplain = {
chiefComplaint.chiefComplain :chiefComplainTemplateId
};
Map<String, dynamic> request = {
"appointmentId": patient.appointmentNo,
"projectId": patient.projectId,
"setupId": await sharedPref.getString(DOCTOR_SETUP_ID),
"chiefComplain":listofComplain
};
hasError = false;
await baseAppClient.post(CONTINUE_EPISODE_VP,
onSuccess: (dynamic response, int statusCode) {
print("Success");
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: request);
}
updateChiefComplaintVidaPlus(PatiantInformtion patient,
GetChiefComplaintVidaPlus chiefComplaint) async {
Map<String, dynamic> request = {

@ -1134,6 +1134,17 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
continueEpisodeVidaPlusFromPrevious(
PatiantInformtion patient, ChiefComplains chiefComplaint, String chiefComplainTemplateId) async {
setState(ViewState.BusyLocal);
await _SOAPService.continueEpisodeVidaPlusFromPrevious(patient, chiefComplaint,chiefComplainTemplateId );
if (_SOAPService.hasError) {
error = _SOAPService.error;
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);
}
getHomeMedication(PatiantInformtion patientInfo) async {
setState(ViewState.BusyLocal);
await _SOAPService.getHomeMedication(patientInfo);

@ -73,8 +73,8 @@ class _AddChiefComplaintState extends State<AddChiefComplaint> {
SizedBox(height: 16,),
PreviousChiefComplaints(
model.episodeByChiefComplaintListVidaPlus,
(List<PatientPomrs> chiefComplaint){
createCCByEpisode(model, chiefComplaint);
(ChiefComplains , String){
addChiefComplaint(model, ChiefComplains.chiefComplain??'', context);
},
)
],

@ -18,18 +18,19 @@ class ComplaintItems extends StatefulWidget {
class _ComplaintItemsState extends State<ComplaintItems> {
@override
Widget build(BuildContext context) {
return Stack(children: [ Container(
padding: const EdgeInsets.all(5.0),
return Container(
padding: const EdgeInsets.all(5.0),
margin:const EdgeInsets.all(5.0) ,
alignment: Alignment.center,
decoration: BoxDecoration(
color: Color(0xffEAEAEA),
borderRadius: BorderRadius.circular(
5,
)),
child: Row(children: [ SizedBox(
width: 120,
height: 40,
margin:const EdgeInsets.all(5.0) ,
alignment: Alignment.center,
decoration: BoxDecoration(
color: Color(0xffEAEAEA),
borderRadius: BorderRadius.circular(
5,
)),
child:Text(
child: Text(
widget.complaint.chiefComplain!,
style: TextStyle(
overflow: TextOverflow.ellipsis,
@ -41,23 +42,25 @@ class _ComplaintItemsState extends State<ComplaintItems> {
maxLines: 1,
softWrap: false,
textAlign: TextAlign.center,
)),
widget.isDeletable ? Positioned(
top:0,
bottom: 0,
right: 10,
child: InkWell(
onTap: () {
widget.onCrossClicked(widget.complaint);
},
child: Icon(
Icons.close,
size: 18,
color: Color(0xFFD02127),
),
),
widget.isDeletable ? Positioned(
top:0,
bottom: 0,
right: 10,
child: InkWell(
onTap: () {
widget.onCrossClicked(widget.complaint);
},
child: Icon(
Icons.close,
size: 18,
color: Color(0xFFD02127),
),
),
),
) :SizedBox()
],);
) :SizedBox()
],),
);
}
}

@ -19,102 +19,116 @@ class ListOfComplaintsItem extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Column(
mainAxisSize: MainAxisSize.min,
return Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
name,
fontWeight: FontWeight.w600,
fontSize: 16,
textAlign: TextAlign.start,
color: Color(0xFF2E303A),
textOverflow: TextOverflow.ellipsis,
),
SizedBox(
height: 4,
),
Row(
children: [
AppText(
TranslationBase.of(context).createdBy,
fontWeight: FontWeight.w400,
fontSize: 15,
color: Color(0xFF2E303A),
textAlign: TextAlign.start,
),
SizedBox(
width: 4,
),
Container(
width: MediaQuery.of(context).size.width * 0.32,
child: AppText(
createdBy,
fontWeight: FontWeight.w400,
fontSize: 12,
textAlign: TextAlign.start,
textOverflow: TextOverflow.ellipsis,
color: Color(0xFF2E303A),
),
)
],
),
SizedBox(
height: 5,
),
Row(
children: [
AppText(
TranslationBase.of(context).createdOn,
fontWeight: FontWeight.w400,
textAlign: TextAlign.start,
fontSize: 15,
color: Color(0xFF2E303A),
),
SizedBox(
width: 4,
),
Container(
width: MediaQuery.of(context).size.width * 0.32,
child:AppText(
createdAt,
fontWeight: FontWeight.w400,
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: [
Text(
name,
textAlign: TextAlign.start,
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 16,
color: Color(0xFF2E303A),
overflow: TextOverflow.clip),
),
SizedBox(
height: 4,
),
Row(
children: [
Text(TranslationBase.of(context).createdBy,
textAlign: TextAlign.start,
fontSize: 12,
textOverflow: TextOverflow.ellipsis,
color: Color(0xFF2E303A),
allowExpand: false,
maxLines: 1,
)),
],
)
],
),
SizedBox(
width: 77,
height: 27,
child: AppButton(
title: TranslationBase.of(context).select,
hPadding: 8,
color: Color(0xFFD02127),
fontColor: Colors.white,
onPressed: () {
onSendClick();
},
style: TextStyle(
fontWeight: FontWeight.w400,
fontSize: 15,
color: Color(0xFF2E303A),
)),
SizedBox(
width: 4,
),
Expanded(
child: Text(createdBy,
textAlign: TextAlign.start,
style: TextStyle(
fontWeight: FontWeight.w400,
fontSize: 12,
overflow: TextOverflow.ellipsis,
color: Color(0xFF2E303A),
)),
),
],
),
),
],
// Row(
// children: [
// Expanded(
// child: AppText(
// TranslationBase.of(context).createdBy,
// fontWeight: FontWeight.w400,
// fontSize: 15,
// color: Color(0xFF2E303A),
// textAlign: TextAlign.start,
// ),
// ),
// SizedBox(
// width: 4,
// ),
// AppText(
// createdBy,
// fontWeight: FontWeight.w400,
// fontSize: 12,
// textAlign: TextAlign.start,
// textOverflow: TextOverflow.ellipsis,
// color: Color(0xFF2E303A),
// )
// ],
// ),
SizedBox(
height: 5,
),
Row(
children: [
Text(TranslationBase.of(context).createdOn,
textAlign: TextAlign.start,
style: TextStyle(
fontWeight: FontWeight.w400,
fontSize: 15,
color: Color(0xFF2E303A),
)),
SizedBox(
width: 4,
),
Expanded(
child: Text(createdAt,
textAlign: TextAlign.start,
style: TextStyle(
fontWeight: FontWeight.w400,
fontSize: 12,
overflow: TextOverflow.ellipsis,
color: Color(0xFF2E303A),
)),
),
],
)
],
),
),
SizedBox(
width: 77,
height: 27,
child: AppButton(
title: TranslationBase.of(context).select,
hPadding: 8,
color: Color(0xFFD02127),
fontColor: Colors.white,
onPressed: () {
onSendClick();
},
),
),
],
);

@ -6,11 +6,15 @@ import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart';
import 'package:quiver/time.dart';
class PreviousChiefComplaints extends StatelessWidget {
final List<EpisodeByChiefComplaintVidaPlus> complaints;
final Function(List<PatientPomrs>)? onSendClicked;
PreviousChiefComplaints(this.complaints,this.onSendClicked, {super.key,});
final List<EpisodeByChiefComplaintVidaPlus> complaints;
final Function(ChiefComplains , String)? onSendClicked;
PreviousChiefComplaints(
this.complaints,
this.onSendClicked, {
super.key,
});
@override
Widget build(BuildContext context) {
@ -28,13 +32,13 @@ class PreviousChiefComplaints extends StatelessWidget {
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context).previousChiefCompaints,
textAlign: TextAlign.start,
fontWeight: FontWeight.w600,
fontSize: 16,
color: Color(0xFF2E303A),
),
Text(TranslationBase.of(context).previousChiefCompaints,
textAlign: TextAlign.start,
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 16,
color: Color(0xFF2E303A),
)),
SizedBox(
height: 16,
),
@ -49,43 +53,102 @@ class PreviousChiefComplaints extends StatelessWidget {
height: 10,
),
Flexible(
child: ListView.separated(
child: ListView.builder(
shrinkWrap: true,
separatorBuilder: (context, index2) => Divider(),
itemCount: complaints.length,
physics: NeverScrollableScrollPhysics(),
itemBuilder: (context, index) {
return complaints[index].patientPomrs!.isNotEmpty ? ListOfComplaintsItem(
name: getChildValue(complaints[index].patientPomrs!, 1),
createdBy: getChildValue(complaints[index].patientPomrs!,2),
createdAt: getChildValue(complaints[index].patientPomrs!, 3),
onSendClick: () {
onSendClicked!(complaints[index].patientPomrs!);
}) :SizedBox();
})
)
return ListView.builder(
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
itemCount:
complaints[index].patientPomrs?.length ?? 0,
itemBuilder: (context, pomrID) {
return ListView.separated(
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
itemCount: complaints[index]
.patientPomrs?[pomrID]
.chiefComplains
?.length ??
0,
separatorBuilder: (context, _) => Column(
children: [
SizedBox(height: 10,),
Divider(),
SizedBox(height: 10,),
],
),
itemBuilder: (context, cheifComplainIndex) {
return ListOfComplaintsItem(
name: complaints[index]
.patientPomrs![pomrID]
.chiefComplains?[
cheifComplainIndex]
.chiefComplain ??
'',
// createdBy: getChildValue(complaints[index].patientPomrs!,2),
createdBy: complaints[index]
.patientPomrs![pomrID]
.chiefComplains?[
cheifComplainIndex]
.createdBy ??
'',
createdAt: complaints[index]
.patientPomrs![pomrID]
.chiefComplains?[
cheifComplainIndex]
.createdOn ??
'',
onSendClick: () {
onSendClicked!(
complaints[index]
.patientPomrs![pomrID]
.chiefComplains![
cheifComplainIndex]
,complaints[index]
.patientPomrs?[pomrID].chiefComplainTemplateId?.toString() ??'');
});
});
// return Column(
// children: complaints[index].patientPomrs![pomrID].chiefComplains?.map((element)=>ListOfComplaintsItem(
// name: element.chiefComplain ?? '',
// // createdBy: getChildValue(complaints[index].patientPomrs!,2),
// createdBy: element.createdBy ?? '',
// createdAt: element.createdOn ?? '',
// onSendClick: () {
// onSendClicked!(complaints[index].patientPomrs!);
// })).toList()??[],
// );
},
);
// return complaints[index].patientPomrs!.isNotEmpty ? ListOfComplaintsItem(
// name: getChildValue(complaints[index].patientPomrs!, 1),
// createdBy: getChildValue(complaints[index].patientPomrs!,2),
// createdAt: getChildValue(complaints[index].patientPomrs!, 3),
// onSendClick: () {
// onSendClicked!(complaints[index].patientPomrs!);
// }) :SizedBox();
}))
],
),
));
}
String getChildValue(List<PatientPomrs>? patientPomrs, int key) {
List<String> value = [];
patientPomrs!.forEach((element) {
if(key ==1) {
element.chiefComplains!.forEach((element2) {
value.add(element2.chiefComplain!);
});
}else if(key ==2) {
value.add(element.doctorName!);
}else {
value.add(element.createdOn!);
}
});
return value.join(" ");
}
String getChildValue(List<PatientPomrs>? patientPomrs, int key) {
List<String> value = [];
patientPomrs!.forEach((element) {
if (key == 1) {
element.chiefComplains!.forEach((element2) {
value.add(element2.chiefComplain!);
});
} else if (key == 2) {
value.add(element.doctorName!);
} else {
value.add(element.createdOn!);
}
});
return value.join(" ");
}
}

@ -267,6 +267,8 @@ class UpdatePresentIllnessState extends State<UpdatePresentIllness> {
setData(SOAPViewModel model){
if(model.getHopiDetails.isNotEmpty) {
patientController.text = model.getHopiDetails[0].hpi!;
familyController.text = model.getHopiDetails[0].hpiTakenFamilyText!;
otherController.text = model.getHopiDetails[0].hpiTakenOtherText!;
isOtherSelected = model.getHopiDetails[0].isHpiTakenOther!;
isFamilySelected = model.getHopiDetails[0].isHpiTakenFamily!;
isPatientSelected = model.getHopiDetails[0].isHpiTakenPatient!;

Loading…
Cancel
Save