SOAP vida plus in progress
parent
f3876e9ef1
commit
b727e66ac1
@ -0,0 +1,245 @@
|
|||||||
|
class EpisodeByChiefComplaintVidaPlus {
|
||||||
|
int? clinicId;
|
||||||
|
String? createdOn;
|
||||||
|
int? doctorId;
|
||||||
|
int? episodeStatus;
|
||||||
|
int? hospitalGroupId;
|
||||||
|
int? hospitalId;
|
||||||
|
String? modifiedOn;
|
||||||
|
int? patientEpisodeId;
|
||||||
|
int? patientId;
|
||||||
|
List<PatientPomrs>? patientPomrs;
|
||||||
|
|
||||||
|
EpisodeByChiefComplaintVidaPlus(
|
||||||
|
{this.clinicId,
|
||||||
|
this.createdOn,
|
||||||
|
this.doctorId,
|
||||||
|
this.episodeStatus,
|
||||||
|
this.hospitalGroupId,
|
||||||
|
this.hospitalId,
|
||||||
|
this.modifiedOn,
|
||||||
|
this.patientEpisodeId,
|
||||||
|
this.patientId,
|
||||||
|
this.patientPomrs});
|
||||||
|
|
||||||
|
EpisodeByChiefComplaintVidaPlus.fromJson(Map<String, dynamic> json) {
|
||||||
|
clinicId = json['clinicId'];
|
||||||
|
createdOn = json['createdOn'];
|
||||||
|
doctorId = json['doctorId'];
|
||||||
|
episodeStatus = json['episodeStatus'];
|
||||||
|
hospitalGroupId = json['hospitalGroupId'];
|
||||||
|
hospitalId = json['hospitalId'];
|
||||||
|
modifiedOn = json['modifiedOn'];
|
||||||
|
patientEpisodeId = json['patientEpisodeId'];
|
||||||
|
patientId = json['patientId'];
|
||||||
|
if (json['patientPomrs'] != null) {
|
||||||
|
patientPomrs = <PatientPomrs>[];
|
||||||
|
json['patientPomrs'].forEach((v) {
|
||||||
|
patientPomrs!.add(new PatientPomrs.fromJson(v));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['clinicId'] = this.clinicId;
|
||||||
|
data['createdOn'] = this.createdOn;
|
||||||
|
data['doctorId'] = this.doctorId;
|
||||||
|
data['episodeStatus'] = this.episodeStatus;
|
||||||
|
data['hospitalGroupId'] = this.hospitalGroupId;
|
||||||
|
data['hospitalId'] = this.hospitalId;
|
||||||
|
data['modifiedOn'] = this.modifiedOn;
|
||||||
|
data['patientEpisodeId'] = this.patientEpisodeId;
|
||||||
|
data['patientId'] = this.patientId;
|
||||||
|
if (this.patientPomrs != null) {
|
||||||
|
data['patientPomrs'] = this.patientPomrs!.map((v) => v.toJson()).toList();
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class PatientPomrs {
|
||||||
|
int? appointmentId;
|
||||||
|
int? chiefComplainTemplateId;
|
||||||
|
List<ChiefComplains>? chiefComplains;
|
||||||
|
int? clinicGroupId;
|
||||||
|
String? createdOn;
|
||||||
|
int? doctorId;
|
||||||
|
String? doctorName;
|
||||||
|
int? episodeId;
|
||||||
|
bool? fallowUp;
|
||||||
|
bool? fallowUpRequired;
|
||||||
|
bool? isReadOnly;
|
||||||
|
String? modifiedOn;
|
||||||
|
int? patientId;
|
||||||
|
int? patientPomrId;
|
||||||
|
String? pomrSingOn;
|
||||||
|
int? pomrStatus;
|
||||||
|
bool? readOnly;
|
||||||
|
String? seenAtStatus;
|
||||||
|
String? vprnSeenAtStatus;
|
||||||
|
|
||||||
|
PatientPomrs(
|
||||||
|
{this.appointmentId,
|
||||||
|
this.chiefComplainTemplateId,
|
||||||
|
this.chiefComplains,
|
||||||
|
this.clinicGroupId,
|
||||||
|
this.createdOn,
|
||||||
|
this.doctorId,
|
||||||
|
this.doctorName,
|
||||||
|
this.episodeId,
|
||||||
|
this.fallowUp,
|
||||||
|
this.fallowUpRequired,
|
||||||
|
this.isReadOnly,
|
||||||
|
this.modifiedOn,
|
||||||
|
this.patientId,
|
||||||
|
this.patientPomrId,
|
||||||
|
this.pomrSingOn,
|
||||||
|
this.pomrStatus,
|
||||||
|
this.readOnly,
|
||||||
|
this.seenAtStatus,
|
||||||
|
this.vprnSeenAtStatus});
|
||||||
|
|
||||||
|
PatientPomrs.fromJson(Map<String, dynamic> json) {
|
||||||
|
appointmentId = json['appointmentId'];
|
||||||
|
chiefComplainTemplateId = json['chiefComplainTemplateId'];
|
||||||
|
if (json['chiefComplains'] != null) {
|
||||||
|
chiefComplains = <ChiefComplains>[];
|
||||||
|
json['chiefComplains'].forEach((v) {
|
||||||
|
chiefComplains!.add(new ChiefComplains.fromJson(v));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
clinicGroupId = json['clinicGroupId'];
|
||||||
|
createdOn = json['createdOn'];
|
||||||
|
doctorId = json['doctorId'];
|
||||||
|
doctorName = json['doctorName'];
|
||||||
|
episodeId = json['episodeId'];
|
||||||
|
fallowUp = json['fallowUp'];
|
||||||
|
fallowUpRequired = json['fallowUpRequired'];
|
||||||
|
isReadOnly = json['isReadOnly'];
|
||||||
|
modifiedOn = json['modifiedOn'];
|
||||||
|
patientId = json['patientId'];
|
||||||
|
patientPomrId = json['patientPomrId'];
|
||||||
|
pomrSingOn = json['pomrSingOn'];
|
||||||
|
pomrStatus = json['pomrStatus'];
|
||||||
|
readOnly = json['readOnly'];
|
||||||
|
seenAtStatus = json['seenAtStatus'];
|
||||||
|
vprnSeenAtStatus = json['vprnSeenAtStatus'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['appointmentId'] = this.appointmentId;
|
||||||
|
data['chiefComplainTemplateId'] = this.chiefComplainTemplateId;
|
||||||
|
if (this.chiefComplains != null) {
|
||||||
|
data['chiefComplains'] =
|
||||||
|
this.chiefComplains!.map((v) => v.toJson()).toList();
|
||||||
|
}
|
||||||
|
data['clinicGroupId'] = this.clinicGroupId;
|
||||||
|
data['createdOn'] = this.createdOn;
|
||||||
|
data['doctorId'] = this.doctorId;
|
||||||
|
data['doctorName'] = this.doctorName;
|
||||||
|
data['episodeId'] = this.episodeId;
|
||||||
|
data['fallowUp'] = this.fallowUp;
|
||||||
|
data['fallowUpRequired'] = this.fallowUpRequired;
|
||||||
|
data['isReadOnly'] = this.isReadOnly;
|
||||||
|
data['modifiedOn'] = this.modifiedOn;
|
||||||
|
data['patientId'] = this.patientId;
|
||||||
|
data['patientPomrId'] = this.patientPomrId;
|
||||||
|
data['pomrSingOn'] = this.pomrSingOn;
|
||||||
|
data['pomrStatus'] = this.pomrStatus;
|
||||||
|
data['readOnly'] = this.readOnly;
|
||||||
|
data['seenAtStatus'] = this.seenAtStatus;
|
||||||
|
data['vprnSeenAtStatus'] = this.vprnSeenAtStatus;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class ChiefComplains {
|
||||||
|
int? appointmentId;
|
||||||
|
String? chiefComplain;
|
||||||
|
int? chiefComplainId;
|
||||||
|
int? clinicId;
|
||||||
|
String? createdBy;
|
||||||
|
int? createdId;
|
||||||
|
String? createdOn;
|
||||||
|
int? doctorId;
|
||||||
|
String? doctorName;
|
||||||
|
int? episodeId;
|
||||||
|
int? hospitalGroupId;
|
||||||
|
int? hospitalId;
|
||||||
|
String? loginUserId;
|
||||||
|
String? modifiedBy;
|
||||||
|
Null? modifiedId;
|
||||||
|
String? modifiedOn;
|
||||||
|
int? patientId;
|
||||||
|
String? patientName;
|
||||||
|
int? patientPomrId;
|
||||||
|
|
||||||
|
ChiefComplains(
|
||||||
|
{this.appointmentId,
|
||||||
|
this.chiefComplain,
|
||||||
|
this.chiefComplainId,
|
||||||
|
this.clinicId,
|
||||||
|
this.createdBy,
|
||||||
|
this.createdId,
|
||||||
|
this.createdOn,
|
||||||
|
this.doctorId,
|
||||||
|
this.doctorName,
|
||||||
|
this.episodeId,
|
||||||
|
this.hospitalGroupId,
|
||||||
|
this.hospitalId,
|
||||||
|
this.loginUserId,
|
||||||
|
this.modifiedBy,
|
||||||
|
this.modifiedId,
|
||||||
|
this.modifiedOn,
|
||||||
|
this.patientId,
|
||||||
|
this.patientName,
|
||||||
|
this.patientPomrId});
|
||||||
|
|
||||||
|
ChiefComplains.fromJson(Map<String, dynamic> json) {
|
||||||
|
appointmentId = json['appointmentId'];
|
||||||
|
chiefComplain = json['chiefComplain'];
|
||||||
|
chiefComplainId = json['chiefComplainId'];
|
||||||
|
clinicId = json['clinicId'];
|
||||||
|
createdBy = json['createdBy'];
|
||||||
|
createdId = json['createdId'];
|
||||||
|
createdOn = json['createdOn'];
|
||||||
|
doctorId = json['doctorId'];
|
||||||
|
doctorName = json['doctorName'];
|
||||||
|
episodeId = json['episodeId'];
|
||||||
|
hospitalGroupId = json['hospitalGroupId'];
|
||||||
|
hospitalId = json['hospitalId'];
|
||||||
|
loginUserId = json['loginUserId'];
|
||||||
|
modifiedBy = json['modifiedBy'];
|
||||||
|
modifiedId = json['modifiedId'];
|
||||||
|
modifiedOn = json['modifiedOn'];
|
||||||
|
patientId = json['patientId'];
|
||||||
|
patientName = json['patientName'];
|
||||||
|
patientPomrId = json['patientPomrId'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['appointmentId'] = this.appointmentId;
|
||||||
|
data['chiefComplain'] = this.chiefComplain;
|
||||||
|
data['chiefComplainId'] = this.chiefComplainId;
|
||||||
|
data['clinicId'] = this.clinicId;
|
||||||
|
data['createdBy'] = this.createdBy;
|
||||||
|
data['createdId'] = this.createdId;
|
||||||
|
data['createdOn'] = this.createdOn;
|
||||||
|
data['doctorId'] = this.doctorId;
|
||||||
|
data['doctorName'] = this.doctorName;
|
||||||
|
data['episodeId'] = this.episodeId;
|
||||||
|
data['hospitalGroupId'] = this.hospitalGroupId;
|
||||||
|
data['hospitalId'] = this.hospitalId;
|
||||||
|
data['loginUserId'] = this.loginUserId;
|
||||||
|
data['modifiedBy'] = this.modifiedBy;
|
||||||
|
data['modifiedId'] = this.modifiedId;
|
||||||
|
data['modifiedOn'] = this.modifiedOn;
|
||||||
|
data['patientId'] = this.patientId;
|
||||||
|
data['patientName'] = this.patientName;
|
||||||
|
data['patientPomrId'] = this.patientPomrId;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,156 @@
|
|||||||
|
class GetHomeMedicationList {
|
||||||
|
List? personalizationEntity;
|
||||||
|
int? appointmentId;
|
||||||
|
int? clinicGroupId;
|
||||||
|
int? clinicId;
|
||||||
|
String? createdTime;
|
||||||
|
String? doseQuantity;
|
||||||
|
String? formularyName;
|
||||||
|
String? frequencyId;
|
||||||
|
String? frequencyString;
|
||||||
|
String? genericFormularyId;
|
||||||
|
String? homeMedFrom;
|
||||||
|
int? hospitalGroupId;
|
||||||
|
int? hospitalId;
|
||||||
|
String? id;
|
||||||
|
bool? isActive;
|
||||||
|
bool? isEHRIPReconciled;
|
||||||
|
bool? isEHROPReconciled;
|
||||||
|
bool? isERIPReconciled;
|
||||||
|
bool? isFreeText;
|
||||||
|
bool? isReconciled;
|
||||||
|
bool? isUnknownDetail;
|
||||||
|
String? lastUpdatedTime;
|
||||||
|
int? patientId;
|
||||||
|
int? patientPomrId;
|
||||||
|
String? prescribeTypeAlias;
|
||||||
|
int? prescribedItemId;
|
||||||
|
String? prescribedItemName;
|
||||||
|
String? remarks;
|
||||||
|
String? routeId;
|
||||||
|
String? routeString;
|
||||||
|
String? rowVersion;
|
||||||
|
String? sentence;
|
||||||
|
String? strengthId;
|
||||||
|
String? strengthString;
|
||||||
|
|
||||||
|
GetHomeMedicationList(
|
||||||
|
{this.personalizationEntity,
|
||||||
|
this.appointmentId,
|
||||||
|
this.clinicGroupId,
|
||||||
|
this.clinicId,
|
||||||
|
this.createdTime,
|
||||||
|
this.doseQuantity,
|
||||||
|
this.formularyName,
|
||||||
|
this.frequencyId,
|
||||||
|
this.frequencyString,
|
||||||
|
this.genericFormularyId,
|
||||||
|
this.homeMedFrom,
|
||||||
|
this.hospitalGroupId,
|
||||||
|
this.hospitalId,
|
||||||
|
this.id,
|
||||||
|
this.isActive,
|
||||||
|
this.isEHRIPReconciled,
|
||||||
|
this.isEHROPReconciled,
|
||||||
|
this.isERIPReconciled,
|
||||||
|
this.isFreeText,
|
||||||
|
this.isReconciled,
|
||||||
|
this.isUnknownDetail,
|
||||||
|
this.lastUpdatedTime,
|
||||||
|
this.patientId,
|
||||||
|
this.patientPomrId,
|
||||||
|
this.prescribeTypeAlias,
|
||||||
|
this.prescribedItemId,
|
||||||
|
this.prescribedItemName,
|
||||||
|
this.remarks,
|
||||||
|
this.routeId,
|
||||||
|
this.routeString,
|
||||||
|
this.rowVersion,
|
||||||
|
this.sentence,
|
||||||
|
this.strengthId,
|
||||||
|
this.strengthString});
|
||||||
|
|
||||||
|
GetHomeMedicationList.fromJson(Map<String, dynamic> json) {
|
||||||
|
if (json['PersonalizationEntity'] != null) {
|
||||||
|
personalizationEntity = [];
|
||||||
|
json['PersonalizationEntity'].forEach((v) {
|
||||||
|
personalizationEntity!.add( v.fromJson(v));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
appointmentId = json['appointmentId'];
|
||||||
|
clinicGroupId = json['clinicGroupId'];
|
||||||
|
clinicId = json['clinicId'];
|
||||||
|
createdTime = json['createdTime'];
|
||||||
|
doseQuantity = json['doseQuantity'];
|
||||||
|
formularyName = json['formularyName'];
|
||||||
|
frequencyId = json['frequencyId'];
|
||||||
|
frequencyString = json['frequencyString'];
|
||||||
|
genericFormularyId = json['genericFormularyId'];
|
||||||
|
homeMedFrom = json['homeMedFrom'];
|
||||||
|
hospitalGroupId = json['hospitalGroupId'];
|
||||||
|
hospitalId = json['hospitalId'];
|
||||||
|
id = json['id'];
|
||||||
|
isActive = json['isActive'];
|
||||||
|
isEHRIPReconciled = json['isEHRIPReconciled'];
|
||||||
|
isEHROPReconciled = json['isEHROPReconciled'];
|
||||||
|
isERIPReconciled = json['isERIPReconciled'];
|
||||||
|
isFreeText = json['isFreeText'];
|
||||||
|
isReconciled = json['isReconciled'];
|
||||||
|
isUnknownDetail = json['isUnknownDetail'];
|
||||||
|
lastUpdatedTime = json['lastUpdatedTime'];
|
||||||
|
patientId = json['patientId'];
|
||||||
|
patientPomrId = json['patientPomrId'];
|
||||||
|
prescribeTypeAlias = json['prescribeTypeAlias'];
|
||||||
|
prescribedItemId = json['prescribedItemId'];
|
||||||
|
prescribedItemName = json['prescribedItemName'];
|
||||||
|
remarks = json['remarks'];
|
||||||
|
routeId = json['routeId'];
|
||||||
|
routeString = json['routeString'];
|
||||||
|
rowVersion = json['rowVersion'];
|
||||||
|
sentence = json['sentence'];
|
||||||
|
strengthId = json['strengthId'];
|
||||||
|
strengthString = json['strengthString'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
if (this.personalizationEntity != null) {
|
||||||
|
data['PersonalizationEntity'] =
|
||||||
|
this.personalizationEntity!.map((v) => v.toJson()).toList();
|
||||||
|
}
|
||||||
|
data['appointmentId'] = this.appointmentId;
|
||||||
|
data['clinicGroupId'] = this.clinicGroupId;
|
||||||
|
data['clinicId'] = this.clinicId;
|
||||||
|
data['createdTime'] = this.createdTime;
|
||||||
|
data['doseQuantity'] = this.doseQuantity;
|
||||||
|
data['formularyName'] = this.formularyName;
|
||||||
|
data['frequencyId'] = this.frequencyId;
|
||||||
|
data['frequencyString'] = this.frequencyString;
|
||||||
|
data['genericFormularyId'] = this.genericFormularyId;
|
||||||
|
data['homeMedFrom'] = this.homeMedFrom;
|
||||||
|
data['hospitalGroupId'] = this.hospitalGroupId;
|
||||||
|
data['hospitalId'] = this.hospitalId;
|
||||||
|
data['id'] = this.id;
|
||||||
|
data['isActive'] = this.isActive;
|
||||||
|
data['isEHRIPReconciled'] = this.isEHRIPReconciled;
|
||||||
|
data['isEHROPReconciled'] = this.isEHROPReconciled;
|
||||||
|
data['isERIPReconciled'] = this.isERIPReconciled;
|
||||||
|
data['isFreeText'] = this.isFreeText;
|
||||||
|
data['isReconciled'] = this.isReconciled;
|
||||||
|
data['isUnknownDetail'] = this.isUnknownDetail;
|
||||||
|
data['lastUpdatedTime'] = this.lastUpdatedTime;
|
||||||
|
data['patientId'] = this.patientId;
|
||||||
|
data['patientPomrId'] = this.patientPomrId;
|
||||||
|
data['prescribeTypeAlias'] = this.prescribeTypeAlias;
|
||||||
|
data['prescribedItemId'] = this.prescribedItemId;
|
||||||
|
data['prescribedItemName'] = this.prescribedItemName;
|
||||||
|
data['remarks'] = this.remarks;
|
||||||
|
data['routeId'] = this.routeId;
|
||||||
|
data['routeString'] = this.routeString;
|
||||||
|
data['rowVersion'] = this.rowVersion;
|
||||||
|
data['sentence'] = this.sentence;
|
||||||
|
data['strengthId'] = this.strengthId;
|
||||||
|
data['strengthString'] = this.strengthString;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,32 +1,63 @@
|
|||||||
|
import 'package:doctor_app_flutter/core/model/SOAP/chief_complaint/get_chief_complaint_vida_plus.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';
|
||||||
|
|
||||||
class ComplaintItems extends StatelessWidget {
|
class ComplaintItems extends StatefulWidget {
|
||||||
final String complaint;
|
final GetChiefComplaintVidaPlus complaint;
|
||||||
final Function(String) onCrossClicked;
|
final Function(GetChiefComplaintVidaPlus) onCrossClicked;
|
||||||
|
final bool isDeletable;
|
||||||
|
|
||||||
const ComplaintItems(
|
const ComplaintItems(
|
||||||
{super.key, required this.complaint, required this.onCrossClicked});
|
{super.key, required this.complaint, required this.onCrossClicked, this.isDeletable = false});
|
||||||
|
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<ComplaintItems> createState() => _ComplaintItemsState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _ComplaintItemsState extends State<ComplaintItems> {
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Container(
|
return Stack(children: [ Container(
|
||||||
padding: const EdgeInsets.all(5.0),
|
padding: const EdgeInsets.all(5.0),
|
||||||
width: 120,
|
width: 120,
|
||||||
height: 40,
|
height: 40,
|
||||||
|
margin:const EdgeInsets.all(5.0) ,
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Color(0xffEAEAEA),
|
color: Color(0xffEAEAEA),
|
||||||
borderRadius: BorderRadius.circular(
|
borderRadius: BorderRadius.circular(
|
||||||
5,
|
5,
|
||||||
)),
|
)),
|
||||||
child: AppText(
|
child:Text(
|
||||||
textOverflow: TextOverflow.ellipsis,
|
widget.complaint.chiefComplain!,
|
||||||
complaint,
|
style: TextStyle(
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
fontWeight: FontWeight.w400,
|
fontWeight: FontWeight.w400,
|
||||||
|
height: 1.2,
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
color: Color(0xFF575757),
|
color: Color(0xFF575757),
|
||||||
),
|
),
|
||||||
);
|
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),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
) :SizedBox()
|
||||||
|
],);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,342 @@
|
|||||||
|
// ignore: must_be_immutable
|
||||||
|
import 'package:autocomplete_textfield/autocomplete_textfield.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/master_key_model.dart';
|
||||||
|
import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_allergy.dart';
|
||||||
|
import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart';
|
||||||
|
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
|
||||||
|
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
|
||||||
|
import 'package:doctor_app_flutter/screens/base/base_view.dart';
|
||||||
|
import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_header.dart';
|
||||||
|
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart';
|
||||||
|
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
|
||||||
|
import 'package:doctor_app_flutter/utils/utils.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/bottom_sheet/custom_bottom_sheet_container.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/shared/dialogs/master_key_dailog.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/shared/text_fields/auto_complete_text_field.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/shared/text_fields/text_fields_utils.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
|
|
||||||
|
// ignore: must_be_immutable
|
||||||
|
class AddMedication extends StatefulWidget {
|
||||||
|
final Function(MySelectedAllergy mySelectedAllergy) addMedicationFun;
|
||||||
|
TextEditingController medicationController;
|
||||||
|
|
||||||
|
AddMedication({Key? key, required this.addMedicationFun, required this.medicationController}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
_AddMedicationState createState() => _AddMedicationState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _AddMedicationState extends State<AddMedication> {
|
||||||
|
MasterKeyModel? _selectedMedicationDose;
|
||||||
|
MasterKeyModel? _selectedMedicationStrength;
|
||||||
|
MasterKeyModel? _selectedMedicationRoute;
|
||||||
|
MasterKeyModel? _selectedMedicationFrequency;
|
||||||
|
|
||||||
|
TextEditingController doseController = TextEditingController();
|
||||||
|
TextEditingController strengthController = TextEditingController();
|
||||||
|
TextEditingController routeController = TextEditingController();
|
||||||
|
TextEditingController frequencyController = TextEditingController();
|
||||||
|
GetMedicationResponseModel? _selectedMedication;
|
||||||
|
|
||||||
|
GlobalKey<AutoCompleteTextFieldState<GetMedicationResponseModel>> key = GlobalKey<AutoCompleteTextFieldState<GetMedicationResponseModel>>();
|
||||||
|
bool isFormSubmitted = false;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
ProjectViewModel projectViewModel = Provider.of(context);
|
||||||
|
return BaseView<SOAPViewModel>(
|
||||||
|
onModelReady: (model) async {
|
||||||
|
// model.onAddMedicationStart();
|
||||||
|
},
|
||||||
|
builder: (_, model, w) => AppScaffold(
|
||||||
|
backgroundColor: Colors.white,
|
||||||
|
baseViewModel: model,
|
||||||
|
isShowAppBar: true,
|
||||||
|
appBar: PatientSearchHeader(
|
||||||
|
|
||||||
|
title:TranslationBase.of(context).addMedication,
|
||||||
|
),
|
||||||
|
body: Container(
|
||||||
|
padding: EdgeInsets.all(15),
|
||||||
|
child:
|
||||||
|
SingleChildScrollView(
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
// SizedBox(
|
||||||
|
// height: SizeConfig.heightMultiplier! *
|
||||||
|
// (SizeConfig.isHeightVeryShort
|
||||||
|
// ? 2
|
||||||
|
// : SizeConfig.isHeightShort
|
||||||
|
// ? 2
|
||||||
|
// : 2),
|
||||||
|
// ),
|
||||||
|
// Container(
|
||||||
|
// // height: screenSize.height * 0.070,
|
||||||
|
// child: InkWell(
|
||||||
|
// onTap: model.allMedicationList != null
|
||||||
|
// ? () {
|
||||||
|
// setState(() {
|
||||||
|
// _selectedMedication = GetMedicationResponseModel();
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
// : null,
|
||||||
|
// child: _selectedMedication == null
|
||||||
|
// // ?
|
||||||
|
// CustomAutoCompleteTextField(
|
||||||
|
// isShowError: isFormSubmitted && _selectedMedication == null,
|
||||||
|
// child: AutoCompleteTextField<GetMedicationResponseModel>(
|
||||||
|
// decoration: TextFieldsUtils.textFieldSelectorDecoration(TranslationBase.of(context).searchMedicineNameHere, "", true, suffixIcon: Icons.search),
|
||||||
|
// itemSubmitted: (item) => setState(() => _selectedMedication = item),
|
||||||
|
// key: key,
|
||||||
|
// suggestions: model.allMedicationList!,
|
||||||
|
// itemBuilder: (context, suggestion) => new Padding(child: AppText(suggestion.description! + '/' + suggestion.genericName!), padding: EdgeInsets.all(8.0)),
|
||||||
|
// itemSorter: (a, b) => 1,
|
||||||
|
// itemFilter: (suggestion, input) =>
|
||||||
|
// suggestion.genericName!.toLowerCase().startsWith(input.toLowerCase()) ||
|
||||||
|
// suggestion.description!.toLowerCase().startsWith(input.toLowerCase()) ||
|
||||||
|
// suggestion.keywords!.toLowerCase().startsWith(input.toLowerCase()),
|
||||||
|
// ),
|
||||||
|
// )
|
||||||
|
// :
|
||||||
|
AppTextFieldCustom(
|
||||||
|
height: Utils.getTextFieldHeight(),
|
||||||
|
hintText: _selectedMedication != null
|
||||||
|
? _selectedMedication!.description! + (' (${_selectedMedication!.genericName} )')
|
||||||
|
: TranslationBase.of(context).searchMedicineNameHere,
|
||||||
|
minLines: 1,
|
||||||
|
maxLines: 1,
|
||||||
|
isTextFieldHasSuffix: true,
|
||||||
|
suffixIcon: IconButton(
|
||||||
|
icon: Icon(
|
||||||
|
Icons.search,
|
||||||
|
color: Colors.grey.shade600,
|
||||||
|
),
|
||||||
|
onPressed: () {},
|
||||||
|
),
|
||||||
|
|
||||||
|
onChanged: (value) {},
|
||||||
|
onFieldSubmitted: () {},
|
||||||
|
),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
if (_selectedMedication != null)
|
||||||
|
Column(
|
||||||
|
children: [
|
||||||
|
SizedBox(
|
||||||
|
height: 3,
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
width: MediaQuery.of(context).size.width * 0.7,
|
||||||
|
child: AppText(
|
||||||
|
_selectedMedication!.description! + (' (${_selectedMedication!.genericName} )'),
|
||||||
|
color: Color(0xFF575757),
|
||||||
|
fontSize: 10,
|
||||||
|
fontWeight: FontWeight.w700,
|
||||||
|
letterSpacing: -0.4,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 5,
|
||||||
|
),
|
||||||
|
AppTextFieldCustom(
|
||||||
|
height: Utils.getTextFieldHeight(),
|
||||||
|
|
||||||
|
onClick: model.medicationDoseTimeList != null
|
||||||
|
? () {
|
||||||
|
MasterKeyDailog dialog = MasterKeyDailog(
|
||||||
|
list: model.medicationDoseTimeList,
|
||||||
|
okText: TranslationBase.of(context).ok,
|
||||||
|
selectedValue: _selectedMedicationDose,
|
||||||
|
okFunction: (selectedValue) {
|
||||||
|
setState(() {
|
||||||
|
_selectedMedicationDose = selectedValue;
|
||||||
|
|
||||||
|
doseController.text = projectViewModel.isArabic ? _selectedMedicationDose!.nameAr! : _selectedMedicationDose!.nameEn!;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
);
|
||||||
|
showDialog(
|
||||||
|
barrierDismissible: false,
|
||||||
|
context: context,
|
||||||
|
builder: (BuildContext context) {
|
||||||
|
return dialog;
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
: null,
|
||||||
|
hintText: TranslationBase.of(context).doseTime,
|
||||||
|
maxLines: 1,
|
||||||
|
minLines: 1,
|
||||||
|
isTextFieldHasSuffix: true,
|
||||||
|
controller: doseController,
|
||||||
|
validationError: isFormSubmitted && _selectedMedicationDose == null ? TranslationBase.of(context).emptyMessage : null,
|
||||||
|
onChanged: (value) {},
|
||||||
|
onFieldSubmitted: () {},
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 5,
|
||||||
|
),
|
||||||
|
AppTextFieldCustom(
|
||||||
|
height: Utils.getTextFieldHeight(),
|
||||||
|
|
||||||
|
isTextFieldHasSuffix: true,
|
||||||
|
onClick: model.medicationStrengthList != null
|
||||||
|
? () {
|
||||||
|
MasterKeyDailog dialog = MasterKeyDailog(
|
||||||
|
list: model.medicationStrengthList,
|
||||||
|
okText: TranslationBase.of(context).ok,
|
||||||
|
selectedValue: _selectedMedicationStrength,
|
||||||
|
okFunction: (selectedValue) {
|
||||||
|
setState(() {
|
||||||
|
_selectedMedicationStrength = selectedValue;
|
||||||
|
|
||||||
|
strengthController.text = projectViewModel.isArabic ? _selectedMedicationStrength!.nameAr! : _selectedMedicationStrength!.nameEn!;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
);
|
||||||
|
showDialog(
|
||||||
|
barrierDismissible: false,
|
||||||
|
context: context,
|
||||||
|
builder: (BuildContext context) {
|
||||||
|
return dialog;
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
: null,
|
||||||
|
hintText: TranslationBase.of(context).strength,
|
||||||
|
maxLines: 1,
|
||||||
|
minLines: 1,
|
||||||
|
controller: strengthController,
|
||||||
|
validationError: isFormSubmitted && _selectedMedicationStrength == null ? TranslationBase.of(context).emptyMessage : null,
|
||||||
|
onChanged: (value) {},
|
||||||
|
onFieldSubmitted: () {},
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 5,
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 5,
|
||||||
|
),
|
||||||
|
AppTextFieldCustom(
|
||||||
|
height: Utils.getTextFieldHeight(),
|
||||||
|
enabled: false,
|
||||||
|
isTextFieldHasSuffix: true,
|
||||||
|
onClick: model.medicationRouteList != null
|
||||||
|
? () {
|
||||||
|
MasterKeyDailog dialog = MasterKeyDailog(
|
||||||
|
list: model.medicationRouteList,
|
||||||
|
selectedValue: _selectedMedicationRoute,
|
||||||
|
okText: TranslationBase.of(context).ok,
|
||||||
|
okFunction: (selectedValue) {
|
||||||
|
setState(() {
|
||||||
|
_selectedMedicationRoute = selectedValue;
|
||||||
|
|
||||||
|
routeController.text = projectViewModel.isArabic ? _selectedMedicationRoute!.nameAr! : _selectedMedicationRoute!.nameEn!;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
);
|
||||||
|
showDialog(
|
||||||
|
barrierDismissible: false,
|
||||||
|
context: context,
|
||||||
|
builder: (BuildContext context) {
|
||||||
|
return dialog;
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
: null,
|
||||||
|
hintText: TranslationBase.of(context).route,
|
||||||
|
maxLines: 1,
|
||||||
|
minLines: 1,
|
||||||
|
controller: routeController,
|
||||||
|
validationError: isFormSubmitted && _selectedMedicationRoute == null ? TranslationBase.of(context).emptyMessage : null,
|
||||||
|
onChanged: (value) {},
|
||||||
|
onFieldSubmitted: () {},
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 5,
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 5,
|
||||||
|
),
|
||||||
|
AppTextFieldCustom(
|
||||||
|
height: Utils.getTextFieldHeight(),
|
||||||
|
onClick: model.medicationFrequencyList != null
|
||||||
|
? () {
|
||||||
|
MasterKeyDailog dialog = MasterKeyDailog(
|
||||||
|
list: model.medicationFrequencyList,
|
||||||
|
okText: TranslationBase.of(context).ok,
|
||||||
|
selectedValue: _selectedMedicationFrequency,
|
||||||
|
okFunction: (selectedValue) {
|
||||||
|
setState(() {
|
||||||
|
_selectedMedicationFrequency = selectedValue;
|
||||||
|
|
||||||
|
frequencyController.text = projectViewModel.isArabic ? _selectedMedicationFrequency!.nameAr! : _selectedMedicationFrequency!.nameEn!;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
);
|
||||||
|
showDialog(
|
||||||
|
barrierDismissible: false,
|
||||||
|
context: context,
|
||||||
|
builder: (BuildContext context) {
|
||||||
|
return dialog;
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
: null,
|
||||||
|
hintText: TranslationBase.of(context).frequency,
|
||||||
|
enabled: false,
|
||||||
|
maxLines: 1,
|
||||||
|
minLines: 1,
|
||||||
|
isTextFieldHasSuffix: true,
|
||||||
|
controller: frequencyController,
|
||||||
|
validationError: isFormSubmitted && _selectedMedicationFrequency == null ? TranslationBase.of(context).emptyMessage : null,
|
||||||
|
onChanged: (value) {},
|
||||||
|
onFieldSubmitted: () {},
|
||||||
|
),
|
||||||
|
// SizedBox(
|
||||||
|
// height: SizeConfig.heightMultiplier! *
|
||||||
|
// (SizeConfig.isHeightVeryShort
|
||||||
|
// ? 20
|
||||||
|
// : SizeConfig.isHeightShort
|
||||||
|
// ? 15
|
||||||
|
// : 10),
|
||||||
|
// ),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),),
|
||||||
|
|
||||||
|
|
||||||
|
bottomSheet: model.state != ViewState.Idle
|
||||||
|
? Container(
|
||||||
|
height: 0,
|
||||||
|
)
|
||||||
|
: CustomBottomSheetContainer(
|
||||||
|
label: TranslationBase.of(context).addMedication,
|
||||||
|
onTap: () {
|
||||||
|
setState(() {
|
||||||
|
isFormSubmitted = true;
|
||||||
|
});
|
||||||
|
if (_selectedMedication != null &&
|
||||||
|
_selectedMedicationDose != null &&
|
||||||
|
_selectedMedicationStrength != null &&
|
||||||
|
_selectedMedicationRoute != null &&
|
||||||
|
_selectedMedicationFrequency != null) {
|
||||||
|
widget.medicationController.text = widget.medicationController.text +
|
||||||
|
'${_selectedMedication!.description} (${TranslationBase.of(context).doseTime} ) ${doseController.text} (${TranslationBase.of(context).strength}) ${strengthController.text} (${TranslationBase.of(context).route}) ${routeController.text} (${TranslationBase.of(context).frequency}) ${frequencyController.text} \n \n';
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
)),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,64 @@
|
|||||||
|
import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_allergy.dart';
|
||||||
|
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/SOAP_open_items.dart';
|
||||||
|
import 'package:doctor_app_flutter/screens/patients/profile/soap_update_vida_plus/subjective/chief_complaint/widgets/add_soap_item.dart';
|
||||||
|
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
import 'add_medication.dart';
|
||||||
|
|
||||||
|
class UpdateMedicationWidget extends StatefulWidget {
|
||||||
|
final TextEditingController? medicationController;
|
||||||
|
|
||||||
|
UpdateMedicationWidget({
|
||||||
|
Key? key,
|
||||||
|
this.medicationController,
|
||||||
|
});
|
||||||
|
|
||||||
|
@override
|
||||||
|
_UpdateMedicationWidgetState createState() => _UpdateMedicationWidgetState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _UpdateMedicationWidgetState extends State<UpdateMedicationWidget> {
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Column(
|
||||||
|
children: [
|
||||||
|
AddSoapItem(
|
||||||
|
title: "${TranslationBase.of(context).addMedication}",
|
||||||
|
onAddSoapItemClicked: () {
|
||||||
|
Navigator.push(
|
||||||
|
context,
|
||||||
|
FadePage(
|
||||||
|
page:AddMedication(
|
||||||
|
addMedicationFun: (MySelectedAllergy mySelectedAllergy) {},
|
||||||
|
medicationController: widget.medicationController!,
|
||||||
|
)
|
||||||
|
|
||||||
|
));
|
||||||
|
// openMedicationList(context);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 20,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
//
|
||||||
|
// openMedicationList(BuildContext context) {
|
||||||
|
// showModalBottomSheet(
|
||||||
|
// backgroundColor: Colors.white,
|
||||||
|
// isScrollControlled: true,
|
||||||
|
// isDismissible: false,
|
||||||
|
// context: context,
|
||||||
|
// builder: (context) {
|
||||||
|
// return AddMedication(
|
||||||
|
// addMedicationFun: (MySelectedAllergy mySelectedAllergy) {},
|
||||||
|
// medicationController: widget.medicationController!,
|
||||||
|
// );
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue