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

@ -1398,6 +1398,29 @@ class SOAPService extends LookupService {
}, body: request); }, 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, updateChiefComplaintVidaPlus(PatiantInformtion patient,
GetChiefComplaintVidaPlus chiefComplaint) async { GetChiefComplaintVidaPlus chiefComplaint) async {
Map<String, dynamic> request = { Map<String, dynamic> request = {

@ -1134,6 +1134,17 @@ class SOAPViewModel extends BaseViewModel {
setState(ViewState.Idle); 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 { getHomeMedication(PatiantInformtion patientInfo) async {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
await _SOAPService.getHomeMedication(patientInfo); await _SOAPService.getHomeMedication(patientInfo);

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

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

@ -19,102 +19,116 @@ class ListOfComplaintsItem extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Column( return Row(
mainAxisSize: MainAxisSize.min, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Row( Expanded(
mainAxisAlignment: MainAxisAlignment.spaceBetween, child: Column(
children: [ crossAxisAlignment: CrossAxisAlignment.start,
Column( mainAxisSize: MainAxisSize.max,
crossAxisAlignment: CrossAxisAlignment.start, children: [
children: [ Text(
name,
AppText( textAlign: TextAlign.start,
name, style: TextStyle(
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 16, fontSize: 16,
textAlign: TextAlign.start, color: Color(0xFF2E303A),
color: Color(0xFF2E303A), overflow: TextOverflow.clip),
textOverflow: TextOverflow.ellipsis, ),
SizedBox(
), height: 4,
),
SizedBox( Row(
height: 4, children: [
), Text(TranslationBase.of(context).createdBy,
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,
textAlign: TextAlign.start, textAlign: TextAlign.start,
fontSize: 12, style: TextStyle(
textOverflow: TextOverflow.ellipsis, fontWeight: FontWeight.w400,
color: Color(0xFF2E303A), fontSize: 15,
allowExpand: false, color: Color(0xFF2E303A),
maxLines: 1, )),
)), SizedBox(
], width: 4,
) ),
], Expanded(
), child: Text(createdBy,
textAlign: TextAlign.start,
SizedBox( style: TextStyle(
width: 77, fontWeight: FontWeight.w400,
height: 27, fontSize: 12,
child: AppButton( overflow: TextOverflow.ellipsis,
title: TranslationBase.of(context).select, color: Color(0xFF2E303A),
hPadding: 8, )),
color: Color(0xFFD02127), ),
fontColor: Colors.white, ],
onPressed: () {
onSendClick();
},
), ),
), // 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:flutter/material.dart';
import 'package:quiver/time.dart'; import 'package:quiver/time.dart';
class PreviousChiefComplaints extends StatelessWidget { class PreviousChiefComplaints extends StatelessWidget {
final List<EpisodeByChiefComplaintVidaPlus> complaints; final List<EpisodeByChiefComplaintVidaPlus> complaints;
final Function(List<PatientPomrs>)? onSendClicked; final Function(ChiefComplains , String)? onSendClicked;
PreviousChiefComplaints(this.complaints,this.onSendClicked, {super.key,});
PreviousChiefComplaints(
this.complaints,
this.onSendClicked, {
super.key,
});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -28,13 +32,13 @@ class PreviousChiefComplaints extends StatelessWidget {
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
AppText( Text(TranslationBase.of(context).previousChiefCompaints,
TranslationBase.of(context).previousChiefCompaints, textAlign: TextAlign.start,
textAlign: TextAlign.start, style: TextStyle(
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 16, fontSize: 16,
color: Color(0xFF2E303A), color: Color(0xFF2E303A),
), )),
SizedBox( SizedBox(
height: 16, height: 16,
), ),
@ -49,43 +53,102 @@ class PreviousChiefComplaints extends StatelessWidget {
height: 10, height: 10,
), ),
Flexible( Flexible(
child: ListView.separated( child: ListView.builder(
shrinkWrap: true, shrinkWrap: true,
separatorBuilder: (context, index2) => Divider(),
itemCount: complaints.length, itemCount: complaints.length,
physics: NeverScrollableScrollPhysics(),
itemBuilder: (context, index) { itemBuilder: (context, index) {
return complaints[index].patientPomrs!.isNotEmpty ? ListOfComplaintsItem( return ListView.builder(
name: getChildValue(complaints[index].patientPomrs!, 1), shrinkWrap: true,
createdBy: getChildValue(complaints[index].patientPomrs!,2), physics: NeverScrollableScrollPhysics(),
createdAt: getChildValue(complaints[index].patientPomrs!, 3), itemCount:
onSendClick: () { complaints[index].patientPomrs?.length ?? 0,
onSendClicked!(complaints[index].patientPomrs!); itemBuilder: (context, pomrID) {
}) :SizedBox(); 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){ setData(SOAPViewModel model){
if(model.getHopiDetails.isNotEmpty) { if(model.getHopiDetails.isNotEmpty) {
patientController.text = model.getHopiDetails[0].hpi!; patientController.text = model.getHopiDetails[0].hpi!;
familyController.text = model.getHopiDetails[0].hpiTakenFamilyText!;
otherController.text = model.getHopiDetails[0].hpiTakenOtherText!;
isOtherSelected = model.getHopiDetails[0].isHpiTakenOther!; isOtherSelected = model.getHopiDetails[0].isHpiTakenOther!;
isFamilySelected = model.getHopiDetails[0].isHpiTakenFamily!; isFamilySelected = model.getHopiDetails[0].isHpiTakenFamily!;
isPatientSelected = model.getHopiDetails[0].isHpiTakenPatient!; isPatientSelected = model.getHopiDetails[0].isHpiTakenPatient!;

Loading…
Cancel
Save