diff --git a/lib/core/model/SOAP/get_hopi_details.dart b/lib/core/model/SOAP/get_hopi_details.dart index 4783587e..eadf19ba 100644 --- a/lib/core/model/SOAP/get_hopi_details.dart +++ b/lib/core/model/SOAP/get_hopi_details.dart @@ -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 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; } } diff --git a/lib/core/service/patient_medical_file/soap/SOAP_service.dart b/lib/core/service/patient_medical_file/soap/SOAP_service.dart index 1c45580c..f20df2b0 100644 --- a/lib/core/service/patient_medical_file/soap/SOAP_service.dart +++ b/lib/core/service/patient_medical_file/soap/SOAP_service.dart @@ -1398,6 +1398,29 @@ class SOAPService extends LookupService { }, body: request); } + continueEpisodeVidaPlusFromPrevious( + PatiantInformtion patient, ChiefComplains chiefComplaint, String chiefComplainTemplateId) async { + List> chiefComplaintList = []; + var listofComplain = { + chiefComplaint.chiefComplain :chiefComplainTemplateId + }; + + Map 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 request = { diff --git a/lib/core/viewModel/SOAP_view_model.dart b/lib/core/viewModel/SOAP_view_model.dart index 4b149e7c..7a6baa46 100644 --- a/lib/core/viewModel/SOAP_view_model.dart +++ b/lib/core/viewModel/SOAP_view_model.dart @@ -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); diff --git a/lib/screens/patients/profile/soap_update_vida_plus/subjective/chief_complaint/AddChiefComplaints.dart b/lib/screens/patients/profile/soap_update_vida_plus/subjective/chief_complaint/AddChiefComplaints.dart index 480882e6..8e61432a 100644 --- a/lib/screens/patients/profile/soap_update_vida_plus/subjective/chief_complaint/AddChiefComplaints.dart +++ b/lib/screens/patients/profile/soap_update_vida_plus/subjective/chief_complaint/AddChiefComplaints.dart @@ -73,8 +73,8 @@ class _AddChiefComplaintState extends State { SizedBox(height: 16,), PreviousChiefComplaints( model.episodeByChiefComplaintListVidaPlus, - (List chiefComplaint){ - createCCByEpisode(model, chiefComplaint); + (ChiefComplains , String){ + addChiefComplaint(model, ChiefComplains.chiefComplain??'', context); }, ) ], diff --git a/lib/screens/patients/profile/soap_update_vida_plus/subjective/chief_complaint/widgets/complaint_items.dart b/lib/screens/patients/profile/soap_update_vida_plus/subjective/chief_complaint/widgets/complaint_items.dart index 2bda8432..a91707aa 100644 --- a/lib/screens/patients/profile/soap_update_vida_plus/subjective/chief_complaint/widgets/complaint_items.dart +++ b/lib/screens/patients/profile/soap_update_vida_plus/subjective/chief_complaint/widgets/complaint_items.dart @@ -18,18 +18,19 @@ class ComplaintItems extends StatefulWidget { class _ComplaintItemsState extends State { @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 { 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() + ],), + ); } } diff --git a/lib/screens/patients/profile/soap_update_vida_plus/subjective/chief_complaint/widgets/listOfComplaints.dart b/lib/screens/patients/profile/soap_update_vida_plus/subjective/chief_complaint/widgets/listOfComplaints.dart index ba83eff7..5ca2912d 100644 --- a/lib/screens/patients/profile/soap_update_vida_plus/subjective/chief_complaint/widgets/listOfComplaints.dart +++ b/lib/screens/patients/profile/soap_update_vida_plus/subjective/chief_complaint/widgets/listOfComplaints.dart @@ -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(); + }, + ), ), ], ); diff --git a/lib/screens/patients/profile/soap_update_vida_plus/subjective/chief_complaint/widgets/previous_cheif_complaints.dart b/lib/screens/patients/profile/soap_update_vida_plus/subjective/chief_complaint/widgets/previous_cheif_complaints.dart index 4662dd90..ba51f1d0 100644 --- a/lib/screens/patients/profile/soap_update_vida_plus/subjective/chief_complaint/widgets/previous_cheif_complaints.dart +++ b/lib/screens/patients/profile/soap_update_vida_plus/subjective/chief_complaint/widgets/previous_cheif_complaints.dart @@ -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 complaints; - final Function(List)? onSendClicked; - PreviousChiefComplaints(this.complaints,this.onSendClicked, {super.key,}); + final List 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, int key) { - List 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, int key) { + List 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(" "); + } } diff --git a/lib/screens/patients/profile/soap_update_vida_plus/subjective/present_illness/update_present_illness.dart b/lib/screens/patients/profile/soap_update_vida_plus/subjective/present_illness/update_present_illness.dart index e9f00bdd..70fb1250 100644 --- a/lib/screens/patients/profile/soap_update_vida_plus/subjective/present_illness/update_present_illness.dart +++ b/lib/screens/patients/profile/soap_update_vida_plus/subjective/present_illness/update_present_illness.dart @@ -267,6 +267,8 @@ class UpdatePresentIllnessState extends State { 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!;