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

@ -1413,6 +1413,11 @@ class SOAPViewModel extends BaseViewModel {
_SOAPService.showAuditBottomSheet = status; _SOAPService.showAuditBottomSheet = status;
} }
getProgressNoteAndCondition(PatiantInformtion information) async{
getPatientConditionList();
getProgressNote(information);
}
getProgressNote(PatiantInformtion patientInformation) async { getProgressNote(PatiantInformtion patientInformation) async {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
await _SOAPService.getProgressNoteNew(patientInformation); await _SOAPService.getProgressNoteNew(patientInformation);
@ -1590,4 +1595,9 @@ class SOAPViewModel extends BaseViewModel {
print('the value is ${_SOAPService.conditionTypeMapWithIdAsKey[key.trim()]}'); print('the value is ${_SOAPService.conditionTypeMapWithIdAsKey[key.trim()]}');
return _SOAPService.conditionTypeList[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/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/SOAP/progress_note/progress_note.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_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); widget.sOAPViewModel.setPlanCallBack(this);
WidgetsBinding.instance.addPostFrameCallback((_) async { WidgetsBinding.instance.addPostFrameCallback((_) async {
widget.changeLoadingState(true); widget.changeLoadingState(true);
model.getProgressNoteAndCondition(widget.patientInfo);
model.getProgressNote(widget.patientInfo);
widget.changeLoadingState(false); widget.changeLoadingState(false);
}); });
}, },
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
backgroundColor: Theme.of(context).scaffoldBackgroundColor, backgroundColor: Theme.of(context).scaffoldBackgroundColor,
isShowAppBar: false, isShowAppBar: false,
isLoading: model.state == ViewState.BusyLocal,
body: SingleChildScrollView( body: SingleChildScrollView(
physics: ScrollPhysics(), physics: ScrollPhysics(),
child: Center( child: Center(
@ -160,7 +160,7 @@ class _UpdatePlanPageVidaPlusState extends State<UpdatePlanPageVidaPlus>
), ),
} else ...{ } else ...{
Divider(), Divider(),
ListOfNotes(notes: model.progressNote) ListOfNotes(notes: model.progressNote, model: model,)
} }
// if (mySelectedExamination.isEmpty) ...{ // if (mySelectedExamination.isEmpty) ...{

@ -2,75 +2,128 @@ 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/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
class ProgressNoteItem extends StatelessWidget { class ProgressNoteItem extends StatelessWidget {
final String type; final String type;
final String speciality; final String speciality;
final String Notes; final String Notes;
// final String status; final String patientCondition;
final String doctorName;
final String modifiedOn;
const ProgressNoteItem( const ProgressNoteItem(
{super.key, {super.key,
required this.type, required this.type,
required this.speciality, required this.speciality,
required this.Notes, required this.Notes,
// required this.status required this.patientCondition,
required this.doctorName,
required this.modifiedOn,
}); });
@override @override
Widget build(BuildContext context) => Column( Widget build(BuildContext context) => Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Stack( Row(
children: [ children: [
Column( Expanded(
crossAxisAlignment: CrossAxisAlignment.start, child: Column(
children: [ crossAxisAlignment: CrossAxisAlignment.start,
Row( children: [
children: [ Row(
AppText( children: [
"${TranslationBase.of(context).type}:", AppText(
color: Color(0XFF2B353E), "${TranslationBase.of(context).type}:",
fontSize: 10, color: Color(0XFF2B353E),
fontWeight: FontWeight.w500, fontSize: 10,
), fontWeight: FontWeight.w500,
SizedBox( ),
width: 4, SizedBox(
), width: 4,
AppText( ),
type, AppText(
color: Color(0XFF2B353E), type,
fontSize: 10, color: Color(0XFF2B353E),
fontWeight: FontWeight.w500, fontSize: 10,
), fontWeight: FontWeight.w500,
], ),
), ],
SizedBox( ),
height: 8, SizedBox(
), height: 4,
Row( ),
children: [ Row(
AppText( children: [
"${TranslationBase.of(context).speciality}:", AppText(
color: Color(0XFF2B353E), "${TranslationBase.of(context).speciality}:",
fontSize: 10, color: Color(0XFF2B353E),
fontWeight: FontWeight.w500, fontSize: 10,
), fontWeight: FontWeight.w500,
SizedBox( ),
width: 4, SizedBox(
), width: 4,
AppText( ),
speciality, AppText(
color: Color(0XFF2B353E), speciality,
fontSize: 10, color: Color(0XFF2B353E),
fontWeight: FontWeight.w500, fontSize: 10,
), fontWeight: FontWeight.w500,
], ),
), ],
], ),
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( Visibility(
// alignment: Alignment.topRight, child: Status(status: status)) visible: patientCondition.isNotEmpty,
child: Status(status: patientCondition))
], ],
), ),
SizedBox( 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/GetGetProgressNoteResModel.dart';
import 'package:doctor_app_flutter/core/model/SOAP/progress_note/progress_note.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:doctor_app_flutter/screens/patients/profile/soap_update_vida_plus/plan/widget/ProgressNoteItem.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class ListOfNotes extends StatelessWidget{ class ListOfNotes extends StatelessWidget {
final List<ProgressNote> notes; 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 @override
Widget build(BuildContext context) => Flexible( Widget build(BuildContext context) => Flexible(
child: ListView.separated( child: ListView.separated(
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
shrinkWrap: true, shrinkWrap: true,
itemBuilder: (_, index) =>ProgressNoteItem(type: notes[index].progressNotesTypesName ?? '', speciality: notes[index].specialityName ?? '', Notes: notes[index].progressNote?? ''), itemBuilder: (_, index) => ProgressNoteItem(
separatorBuilder: (_, __) => Divider(), type: notes[index].progressNotesTypesName ?? '',
itemCount: notes.length), 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