WD: date time doctor name and patient condition displayed on ProgressNoteItem.dart

update_flutter_3.24_vida_plus_episode
taha.alam 11 months ago
parent 707a98cb18
commit 1353f48f7e

@ -84,7 +84,9 @@ class SOAPService extends LookupService {
List<SOAPClinic> clinicsList = [];
List<PatientCondition> patientConditionList = [];
Map<String, List<Category>> specialityDetails = {};
Map<String, dynamic> patientConditionMap = {};
Map<String, dynamic> diagnosisTypeList = {};
Map<String, dynamic> diagnosisTypeTypeMapWithIdAsKey = {};
Map<String, dynamic> conditionTypeList = {};
Map<String, dynamic> conditionTypeMapWithIdAsKey = {};
List<String> icdVersionList = [];
@ -783,7 +785,10 @@ class SOAPService extends LookupService {
await baseAppClient.post(DIAGNOSIS_TYPE,
onSuccess: (dynamic response, int statusCode) {
response['ListDiagnosisTypeModel']['resultData']
.forEach((v) => diagnosisTypeList[v['name']] = v['diagnosisType']);
.forEach((v) {
diagnosisTypeList[v['name']] = v['diagnosisType'];
diagnosisTypeTypeMapWithIdAsKey[v['diagnosisType']] = v['name'];
});
}, onFailure: (String error, int statusCode) {
searchChiefComplaintListVidaPlus.clear();
hasError = true;
@ -1379,11 +1384,14 @@ class SOAPService extends LookupService {
Map<String, dynamic> request = {};
var success = false;
patientConditionList.clear();
patientConditionMap.clear();
await baseAppClient.post(GET_PATIENT_CLINIC,
onSuccess: (dynamic response, int statusCode) {
response['ListPatientConditionProgress']['resultData'].forEach((v) =>
v['PATIENT_CONDITION'].forEach((item) =>
patientConditionList.add(PatientCondition.fromJson(item))));
v['PATIENT_CONDITION'].forEach((item) {
patientConditionList.add(PatientCondition.fromJson(item));
patientConditionMap[item['code']]= item['name'];
}));
success = false;
}, onFailure: (String error, int statusCode) {
success = false;

@ -1413,6 +1413,11 @@ class SOAPViewModel extends BaseViewModel {
_SOAPService.showAuditBottomSheet = status;
}
getProgressNoteAndCondition(PatiantInformtion information) async{
getPatientConditionList();
getProgressNote(information);
}
getProgressNote(PatiantInformtion patientInformation) async {
setState(ViewState.BusyLocal);
await _SOAPService.getProgressNoteNew(patientInformation);
@ -1590,4 +1595,9 @@ class SOAPViewModel extends BaseViewModel {
print('the value is ${_SOAPService.conditionTypeMapWithIdAsKey[key.trim()]}');
return _SOAPService.conditionTypeList[key.trim()];
}
String? getPatientConditionValue(String key){
return _SOAPService.patientConditionMap[key.trim()];
}
}

@ -1,4 +1,5 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/view_state.dart';
import 'package:doctor_app_flutter/core/model/SOAP/progress_note/progress_note.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
@ -103,15 +104,14 @@ class _UpdatePlanPageVidaPlusState extends State<UpdatePlanPageVidaPlus>
widget.sOAPViewModel.setPlanCallBack(this);
WidgetsBinding.instance.addPostFrameCallback((_) async {
widget.changeLoadingState(true);
model.getProgressNote(widget.patientInfo);
model.getProgressNoteAndCondition(widget.patientInfo);
widget.changeLoadingState(false);
});
},
builder: (_, model, w) => AppScaffold(
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
isShowAppBar: false,
isLoading: model.state == ViewState.BusyLocal,
body: SingleChildScrollView(
physics: ScrollPhysics(),
child: Center(
@ -160,7 +160,7 @@ class _UpdatePlanPageVidaPlusState extends State<UpdatePlanPageVidaPlus>
),
} else ...{
Divider(),
ListOfNotes(notes: model.progressNote)
ListOfNotes(notes: model.progressNote, model: model,)
}
// if (mySelectedExamination.isEmpty) ...{

@ -2,28 +2,35 @@ import 'package:doctor_app_flutter/screens/patients/profile/soap_update_vida_plu
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
class ProgressNoteItem extends StatelessWidget {
final String type;
final String speciality;
final String Notes;
// final String status;
final String patientCondition;
final String doctorName;
final String modifiedOn;
const ProgressNoteItem(
{super.key,
required this.type,
required this.speciality,
required this.Notes,
// required this.status
required this.patientCondition,
required this.doctorName,
required this.modifiedOn,
});
@override
Widget build(BuildContext context) => Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Stack(
Row(
children: [
Column(
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
@ -46,7 +53,7 @@ class ProgressNoteItem extends StatelessWidget {
],
),
SizedBox(
height: 8,
height: 4,
),
Row(
children: [
@ -67,10 +74,56 @@ class ProgressNoteItem extends StatelessWidget {
),
],
),
SizedBox(
height: 4,
),
Row(
children: [
AppText(
"${TranslationBase.of(context).doctorName}:",
color: Color(0XFF2B353E),
fontSize: 10,
fontWeight: FontWeight.w500,
),
SizedBox(
width: 4,
),
AppText(
doctorName,
color: Color(0XFF2B353E),
fontSize: 10,
fontWeight: FontWeight.w500,
),
],
),
SizedBox(
height: 4,
),
Row(
children: [
AppText(
"${TranslationBase.of(context).dateTime}",
color: Color(0XFF2B353E),
fontSize: 10,
fontWeight: FontWeight.w500,
),
SizedBox(
width: 4,
),
AppText(
getDateAndTime(modifiedOn),
color: Color(0XFF2B353E),
fontSize: 10,
fontWeight: FontWeight.w500,
),
],
),
// Align(
// alignment: Alignment.topRight, child: Status(status: status))
],
),
),
Visibility(
visible: patientCondition.isNotEmpty,
child: Status(status: patientCondition))
],
),
SizedBox(
@ -84,4 +137,10 @@ class ProgressNoteItem extends StatelessWidget {
),
],
);
String getDateAndTime(String dateTime) {
if (dateTime.isEmpty) return '';
DateTime now = DateTime.now();
return DateFormat('dd/MM/yyyy hh:mm a').format(now);
}
}

@ -1,20 +1,31 @@
import 'package:doctor_app_flutter/core/model/SOAP/progress_note/GetGetProgressNoteResModel.dart';
import 'package:doctor_app_flutter/core/model/SOAP/progress_note/progress_note.dart';
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update_vida_plus/plan/widget/ProgressNoteItem.dart';
import 'package:flutter/material.dart';
class ListOfNotes extends StatelessWidget {
final List<ProgressNote> notes;
final SOAPViewModel model;
const ListOfNotes({super.key, required this.notes, required this.model});
const ListOfNotes({super.key, required this.notes});
@override
Widget build(BuildContext context) => Flexible(
child: ListView.separated(
physics: NeverScrollableScrollPhysics(),
shrinkWrap: true,
itemBuilder: (_, index) =>ProgressNoteItem(type: notes[index].progressNotesTypesName ?? '', speciality: notes[index].specialityName ?? '', Notes: notes[index].progressNote?? ''),
itemBuilder: (_, index) => ProgressNoteItem(
type: notes[index].progressNotesTypesName ?? '',
speciality: notes[index].specialityName ?? '',
Notes: notes[index].progressNote ?? '',
patientCondition: model.getPatientConditionValue(
notes[index].patientCondition ?? '') ??
'',
doctorName: notes[index].userFullName ?? '',
modifiedOn: notes[index].modifiedOn ?? '',
),
separatorBuilder: (_, __) => Divider(),
itemCount: notes.length),
);
}
Loading…
Cancel
Save