Merge branch 'update_flutter_3.24_vida_plus_episode' of http://34.17.52.180/Haroon6138/doctor_app_flutter into update_flutter_3.24_vida_plus_episode
# Conflicts: # lib/config/config.dart # lib/config/localized_values.dart # lib/core/service/patient_medical_file/soap/SOAP_service.dart # lib/core/viewModel/SOAP_view_model.dart # lib/utils/translations_delegate_base_utils.dartupdate_flutter_3.24_vida_plus_episode_MDS
commit
0526896745
@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,40 @@
|
|||||||
|
class GetSearchCurrentMedication {
|
||||||
|
String? formularyName;
|
||||||
|
String? genericFormularyCode;
|
||||||
|
String? genericFormularyId;
|
||||||
|
int? hospitalGroupId;
|
||||||
|
int? hospitalId;
|
||||||
|
String? itemType;
|
||||||
|
bool? outOfStock;
|
||||||
|
|
||||||
|
GetSearchCurrentMedication(
|
||||||
|
{this.formularyName,
|
||||||
|
this.genericFormularyCode,
|
||||||
|
this.genericFormularyId,
|
||||||
|
this.hospitalGroupId,
|
||||||
|
this.hospitalId,
|
||||||
|
this.itemType,
|
||||||
|
this.outOfStock});
|
||||||
|
|
||||||
|
GetSearchCurrentMedication.fromJson(Map<String, dynamic> json) {
|
||||||
|
formularyName = json['formularyName'];
|
||||||
|
genericFormularyCode = json['genericFormularyCode'];
|
||||||
|
genericFormularyId = json['genericFormularyId'];
|
||||||
|
hospitalGroupId = json['hospitalGroupId'];
|
||||||
|
hospitalId = json['hospitalId'];
|
||||||
|
itemType = json['itemType'];
|
||||||
|
outOfStock = json['outOfStock'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['formularyName'] = this.formularyName;
|
||||||
|
data['genericFormularyCode'] = this.genericFormularyCode;
|
||||||
|
data['genericFormularyId'] = this.genericFormularyId;
|
||||||
|
data['hospitalGroupId'] = this.hospitalGroupId;
|
||||||
|
data['hospitalId'] = this.hospitalId;
|
||||||
|
data['itemType'] = this.itemType;
|
||||||
|
data['outOfStock'] = this.outOfStock;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,108 @@
|
|||||||
|
class GetSearchCurrentMedicationDetails {
|
||||||
|
List<GenericItemFrequencyDetailsEntity>? genericItemFrequencyDetailsEntity;
|
||||||
|
List<GenericItemRouteDetailsEntity>? genericItemRouteDetailsEntity;
|
||||||
|
List<ItemStrengthDetailsDto>? itemStrengthDetailsDto;
|
||||||
|
int? patientTypeId;
|
||||||
|
|
||||||
|
GetSearchCurrentMedicationDetails({this.genericItemFrequencyDetailsEntity, this.genericItemRouteDetailsEntity, this.itemStrengthDetailsDto, this.patientTypeId});
|
||||||
|
|
||||||
|
GetSearchCurrentMedicationDetails.fromJson(Map<String, dynamic> json) {
|
||||||
|
if (json['genericItemFrequencyDetailsEntity'] != null) {
|
||||||
|
genericItemFrequencyDetailsEntity = <GenericItemFrequencyDetailsEntity>[];
|
||||||
|
json['genericItemFrequencyDetailsEntity'].forEach((v) { genericItemFrequencyDetailsEntity!.add(new GenericItemFrequencyDetailsEntity.fromJson(v)); });
|
||||||
|
}
|
||||||
|
if (json['genericItemRouteDetailsEntity'] != null) {
|
||||||
|
genericItemRouteDetailsEntity = <GenericItemRouteDetailsEntity>[];
|
||||||
|
json['genericItemRouteDetailsEntity'].forEach((v) { genericItemRouteDetailsEntity!.add(new GenericItemRouteDetailsEntity.fromJson(v)); });
|
||||||
|
}
|
||||||
|
if (json['itemStrengthDetailsDto'] != null) {
|
||||||
|
itemStrengthDetailsDto = <ItemStrengthDetailsDto>[];
|
||||||
|
json['itemStrengthDetailsDto'].forEach((v) { itemStrengthDetailsDto!.add(new ItemStrengthDetailsDto.fromJson(v)); });
|
||||||
|
}
|
||||||
|
patientTypeId = json['patientTypeId'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
if (this.genericItemFrequencyDetailsEntity != null) {
|
||||||
|
data['genericItemFrequencyDetailsEntity'] = this.genericItemFrequencyDetailsEntity!.map((v) => v.toJson()).toList();
|
||||||
|
}
|
||||||
|
if (this.genericItemRouteDetailsEntity != null) {
|
||||||
|
data['genericItemRouteDetailsEntity'] = this.genericItemRouteDetailsEntity!.map((v) => v.toJson()).toList();
|
||||||
|
}
|
||||||
|
if (this.itemStrengthDetailsDto != null) {
|
||||||
|
data['itemStrengthDetailsDto'] = this.itemStrengthDetailsDto!.map((v) => v.toJson()).toList();
|
||||||
|
}
|
||||||
|
data['patientTypeId'] = this.patientTypeId;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class GenericItemFrequencyDetailsEntity {
|
||||||
|
bool? Default;
|
||||||
|
String? frequency;
|
||||||
|
int? frequencyId;
|
||||||
|
int? interval;
|
||||||
|
|
||||||
|
GenericItemFrequencyDetailsEntity({this.Default, this.frequency, this.frequencyId, this.interval});
|
||||||
|
|
||||||
|
GenericItemFrequencyDetailsEntity.fromJson(Map<String, dynamic> json) {
|
||||||
|
Default = json['Default'];
|
||||||
|
frequency = json['Frequency'];
|
||||||
|
frequencyId = json['FrequencyId'];
|
||||||
|
interval = json['Interval'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['Default'] = this.Default;
|
||||||
|
data['Frequency'] = this.frequency;
|
||||||
|
data['FrequencyId'] = this.frequencyId;
|
||||||
|
data['Interval'] = this.interval;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class GenericItemRouteDetailsEntity {
|
||||||
|
bool? Default;
|
||||||
|
String? route;
|
||||||
|
int? routeId;
|
||||||
|
|
||||||
|
GenericItemRouteDetailsEntity({this.Default, this.route, this.routeId});
|
||||||
|
|
||||||
|
GenericItemRouteDetailsEntity.fromJson(Map<String, dynamic> json) {
|
||||||
|
Default = json['default'];
|
||||||
|
route = json['route'];
|
||||||
|
routeId = json['routeId'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['default'] = this.Default;
|
||||||
|
data['route'] = this.route;
|
||||||
|
data['routeId'] = this.routeId;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class ItemStrengthDetailsDto {
|
||||||
|
bool? Default;
|
||||||
|
String? strength;
|
||||||
|
int? strengthId;
|
||||||
|
|
||||||
|
ItemStrengthDetailsDto({this.Default, this.strength, this.strengthId});
|
||||||
|
|
||||||
|
ItemStrengthDetailsDto.fromJson(Map<String, dynamic> json) {
|
||||||
|
Default = json['default'];
|
||||||
|
strength = json['strength'];
|
||||||
|
strengthId = json['strengthId'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['default'] = this.Default;
|
||||||
|
data['strength'] = this.strength;
|
||||||
|
data['strengthId'] = this.strengthId;
|
||||||
|
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,454 @@
|
|||||||
|
// 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/home_medication_vp/GetSearchCurrentMedication.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/patient/patiant_info_model.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/medicine/medicine_search_screen.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/screens/patients/profile/soap_update_vida_plus/objective/widget/EmptyExamination.dart';
|
||||||
|
import 'package:doctor_app_flutter/screens/patients/profile/soap_update_vida_plus/subjective/medication/dropdown_popup.dart';
|
||||||
|
import 'package:doctor_app_flutter/utils/dr_app_toast_msg.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/loader/gif_loader_dialog_utils.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.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:flutter/services.dart';
|
||||||
|
import 'package:flutter_svg/flutter_svg.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
|
// ignore: must_be_immutable
|
||||||
|
class AddMedication extends StatefulWidget {
|
||||||
|
final Function() addMedicationFun;
|
||||||
|
final PatiantInformtion? patientInfo;
|
||||||
|
AddMedication({Key? key, required this.addMedicationFun, this.patientInfo}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
_AddMedicationState createState() => _AddMedicationState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _AddMedicationState extends State<AddMedication> {
|
||||||
|
int? _selectedMedicationStrength;
|
||||||
|
int? _selectedMedicationRoute;
|
||||||
|
int? _selectedMedicationFrequency;
|
||||||
|
TextEditingController medicationController = TextEditingController();
|
||||||
|
|
||||||
|
TextEditingController doseController = TextEditingController();
|
||||||
|
TextEditingController strengthController = TextEditingController();
|
||||||
|
TextEditingController routeController = TextEditingController();
|
||||||
|
TextEditingController frequencyController = TextEditingController();
|
||||||
|
GetSearchCurrentMedication? _selectedMedication;
|
||||||
|
TextEditingController remark = TextEditingController();
|
||||||
|
bool isVisible = false;
|
||||||
|
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: [
|
||||||
|
|
||||||
|
AppTextFieldCustom(
|
||||||
|
height: Utils.getTextFieldHeight(),
|
||||||
|
controller: medicationController,
|
||||||
|
hintText:
|
||||||
|
TranslationBase.of(context).searchMedicineNameHere,
|
||||||
|
minLines: 1,
|
||||||
|
maxLines: 1,
|
||||||
|
isTextFieldHasSuffix: true,
|
||||||
|
validationError: isFormSubmitted && medicationController.text.isEmpty ? TranslationBase.of(context).emptyMessage : null,
|
||||||
|
suffixIcon: IconButton(
|
||||||
|
icon: model.state == ViewState.BusyLocal
|
||||||
|
? SizedBox(
|
||||||
|
child: CircularProgressIndicator(
|
||||||
|
strokeWidth: 2,
|
||||||
|
),
|
||||||
|
height: 10,
|
||||||
|
width: 10,
|
||||||
|
)
|
||||||
|
: Icon(
|
||||||
|
Icons.search,
|
||||||
|
color: Colors.grey.shade600,
|
||||||
|
),
|
||||||
|
onPressed: () {
|
||||||
|
searchMedication(model);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
onChanged: (value) {},
|
||||||
|
onFieldSubmitted: () {},
|
||||||
|
),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
model.getMedicationListVP!.isNotEmpty & isVisible
|
||||||
|
? RoundedContainer(
|
||||||
|
width: MediaQuery.of(context).size.width,
|
||||||
|
height: MediaQuery.of(context).size.height * 0.60,
|
||||||
|
child: model.state == ViewState.Idle
|
||||||
|
? ListView.builder(
|
||||||
|
itemCount: model.getMedicationListVP!.length,
|
||||||
|
itemBuilder: (context, index) {
|
||||||
|
return ListTile(
|
||||||
|
onTap: () {
|
||||||
|
selectMedication(model, index);
|
||||||
|
},
|
||||||
|
title: AppText(
|
||||||
|
model.getMedicationListVP![index]
|
||||||
|
.formularyName!,
|
||||||
|
));
|
||||||
|
},
|
||||||
|
)
|
||||||
|
: SizedBox())
|
||||||
|
: SizedBox(),
|
||||||
|
|
||||||
|
if (_selectedMedication != null)
|
||||||
|
Column(
|
||||||
|
children: [
|
||||||
|
SizedBox(
|
||||||
|
height: 3,
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
width: MediaQuery.of(context).size.width * 0.9,
|
||||||
|
child: AppText(
|
||||||
|
_selectedMedication!.formularyName!,
|
||||||
|
color: Color(0xFF575757),
|
||||||
|
fontSize: 10,
|
||||||
|
fontWeight: FontWeight.w700,
|
||||||
|
letterSpacing: -0.4,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 5,
|
||||||
|
),
|
||||||
|
|
||||||
|
SizedBox(
|
||||||
|
height: 5,
|
||||||
|
),
|
||||||
|
AppTextFieldCustom(
|
||||||
|
height: Utils.getTextFieldHeight(),
|
||||||
|
enabled: true,
|
||||||
|
inputFormatters: <TextInputFormatter>[
|
||||||
|
FilteringTextInputFormatter.digitsOnly
|
||||||
|
],
|
||||||
|
// 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).doseDetails,
|
||||||
|
maxLines: 1,
|
||||||
|
minLines: 1,
|
||||||
|
|
||||||
|
isTextFieldHasSuffix: false,
|
||||||
|
controller: doseController,
|
||||||
|
validationError: isFormSubmitted && doseController.text.isEmpty ? TranslationBase.of(context).emptyMessage : null,
|
||||||
|
onChanged: (value) {},
|
||||||
|
onFieldSubmitted: () {},
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 10,
|
||||||
|
),
|
||||||
|
AppTextFieldCustom(
|
||||||
|
height: Utils.getTextFieldHeight(),
|
||||||
|
enabled: false,
|
||||||
|
isTextFieldHasSuffix: true,
|
||||||
|
onClick: model.getSearchCurrentMedicationDetails!
|
||||||
|
.isNotEmpty &&
|
||||||
|
model.getSearchCurrentMedicationDetails![0]
|
||||||
|
.itemStrengthDetailsDto !=
|
||||||
|
null
|
||||||
|
? () {
|
||||||
|
|
||||||
|
DropdownPopup dialog = DropdownPopup(
|
||||||
|
medicationDetails:
|
||||||
|
model.getSearchCurrentMedicationDetails![0],
|
||||||
|
isStrength: true,
|
||||||
|
okText: TranslationBase.of(context).ok,
|
||||||
|
selectedID:model.getSearchCurrentMedicationDetails![0]
|
||||||
|
.itemStrengthDetailsDto![0]
|
||||||
|
.strengthId!,
|
||||||
|
okFunction: (int id, String value) {
|
||||||
|
_selectedMedicationStrength = id;
|
||||||
|
strengthController.text = value;
|
||||||
|
setState(() {});
|
||||||
|
},
|
||||||
|
);
|
||||||
|
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.getSearchCurrentMedicationDetails!
|
||||||
|
.isNotEmpty &&
|
||||||
|
model.getSearchCurrentMedicationDetails![0]
|
||||||
|
.genericItemRouteDetailsEntity !=
|
||||||
|
null
|
||||||
|
? () {
|
||||||
|
|
||||||
|
DropdownPopup dialog = DropdownPopup(
|
||||||
|
medicationDetails:
|
||||||
|
model.getSearchCurrentMedicationDetails![0],
|
||||||
|
okText: TranslationBase.of(context).ok,
|
||||||
|
isRoute: true,
|
||||||
|
selectedID: model
|
||||||
|
.getSearchCurrentMedicationDetails![0]
|
||||||
|
.genericItemRouteDetailsEntity![0]
|
||||||
|
.routeId!,
|
||||||
|
// selectedText: ,
|
||||||
|
okFunction: (int id, String value) {
|
||||||
|
setState(() {
|
||||||
|
_selectedMedicationRoute = id;
|
||||||
|
routeController.text = value;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
);
|
||||||
|
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: 10,
|
||||||
|
),
|
||||||
|
|
||||||
|
AppTextFieldCustom(
|
||||||
|
height: Utils.getTextFieldHeight(),
|
||||||
|
|
||||||
|
onClick: model.getSearchCurrentMedicationDetails!
|
||||||
|
.isNotEmpty &&
|
||||||
|
model.getSearchCurrentMedicationDetails![0]
|
||||||
|
.genericItemFrequencyDetailsEntity !=
|
||||||
|
null
|
||||||
|
? () {
|
||||||
|
|
||||||
|
DropdownPopup dialog = DropdownPopup(
|
||||||
|
medicationDetails:
|
||||||
|
model.getSearchCurrentMedicationDetails![0],
|
||||||
|
okText: TranslationBase.of(context).ok,
|
||||||
|
selectedID: model
|
||||||
|
.getSearchCurrentMedicationDetails![0]
|
||||||
|
.genericItemFrequencyDetailsEntity![0]
|
||||||
|
.frequencyId! ,
|
||||||
|
okFunction: (int id, String value) {
|
||||||
|
_selectedMedicationFrequency = id;
|
||||||
|
frequencyController.text = value;
|
||||||
|
setState(() {});
|
||||||
|
},
|
||||||
|
);
|
||||||
|
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: 10,
|
||||||
|
),
|
||||||
|
AppTextFieldCustom(
|
||||||
|
hintText: TranslationBase.of(context).remarks,
|
||||||
|
controller: remark,
|
||||||
|
maxLines: 4,
|
||||||
|
minLines: 4,
|
||||||
|
hasBorder: true,
|
||||||
|
inputType: TextInputType.multiline,
|
||||||
|
onClick: () {},
|
||||||
|
onChanged: (value) {},
|
||||||
|
onFieldSubmitted: () {},
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
bottomSheet:
|
||||||
|
CustomBottomSheetContainer(
|
||||||
|
label: TranslationBase.of(context).addMedication,
|
||||||
|
onTap: () {
|
||||||
|
if(medicationController.text.isNotEmpty && doseController.text.isNotEmpty){
|
||||||
|
addMedication(model);
|
||||||
|
}else {
|
||||||
|
isFormSubmitted = true;
|
||||||
|
setState(() {
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
)),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
searchMedication(model) async {
|
||||||
|
await model.searchCurrentMedication(medicationController.text);
|
||||||
|
isVisible = true;
|
||||||
|
setState(() {});
|
||||||
|
}
|
||||||
|
|
||||||
|
selectMedication(SOAPViewModel model, int index) {
|
||||||
|
_selectedMedication = model.getMedicationListVP![index];
|
||||||
|
medicationController.text =
|
||||||
|
model.getMedicationListVP![index].formularyName!;
|
||||||
|
isVisible = false;
|
||||||
|
getOtherDetails(model, model.getMedicationListVP![index]);
|
||||||
|
setState(() {});
|
||||||
|
}
|
||||||
|
|
||||||
|
getOtherDetails(
|
||||||
|
SOAPViewModel model, GetSearchCurrentMedication selectMedicine) async {
|
||||||
|
GifLoaderDialogUtils.showMyDialog(context);
|
||||||
|
await model.getCurrentMedicationDetails(selectMedicine.genericFormularyId!);
|
||||||
|
|
||||||
|
GifLoaderDialogUtils.hideDialog(context);
|
||||||
|
setDefaultValues(model);
|
||||||
|
}
|
||||||
|
setDefaultValues(SOAPViewModel model){
|
||||||
|
_selectedMedicationStrength = model.getSearchCurrentMedicationDetails![0]
|
||||||
|
.itemStrengthDetailsDto![0]
|
||||||
|
.strengthId!;
|
||||||
|
strengthController.text = model
|
||||||
|
.getSearchCurrentMedicationDetails![0]
|
||||||
|
.itemStrengthDetailsDto![0]
|
||||||
|
.strength!;
|
||||||
|
|
||||||
|
_selectedMedicationRoute = model
|
||||||
|
.getSearchCurrentMedicationDetails![0]
|
||||||
|
.genericItemRouteDetailsEntity![0]
|
||||||
|
.routeId!;
|
||||||
|
routeController.text= model
|
||||||
|
.getSearchCurrentMedicationDetails![0]
|
||||||
|
.genericItemRouteDetailsEntity![0]
|
||||||
|
.route!;
|
||||||
|
_selectedMedicationFrequency = model
|
||||||
|
.getSearchCurrentMedicationDetails![0]
|
||||||
|
.genericItemFrequencyDetailsEntity![0]
|
||||||
|
.frequencyId!;
|
||||||
|
frequencyController.text= model
|
||||||
|
.getSearchCurrentMedicationDetails![0]
|
||||||
|
.genericItemFrequencyDetailsEntity![0]
|
||||||
|
.frequency!;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
addMedication(SOAPViewModel model) async{
|
||||||
|
Map<String, dynamic> request ={
|
||||||
|
|
||||||
|
"doseQuantity": doseController.text,
|
||||||
|
"frequencyId": _selectedMedicationFrequency,
|
||||||
|
"frequencyString":frequencyController.text,
|
||||||
|
"strengthId": _selectedMedicationStrength,
|
||||||
|
"strengthString": strengthController.text,
|
||||||
|
"routeId": _selectedMedicationRoute,
|
||||||
|
"routeString": routeController.text,
|
||||||
|
"remarks": remark.text,
|
||||||
|
"sentence": medicationController.text,
|
||||||
|
"formularyName": _selectedMedication!.formularyName!,
|
||||||
|
"genericFormularyId": _selectedMedication!.genericFormularyId!,
|
||||||
|
|
||||||
|
};
|
||||||
|
GifLoaderDialogUtils.showMyDialog(context);
|
||||||
|
|
||||||
|
await model.addCurrentMedication(request, widget.patientInfo!);
|
||||||
|
await model.getHomeMedication(widget.patientInfo!);
|
||||||
|
GifLoaderDialogUtils.hideDialog(context);
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,150 @@
|
|||||||
|
import 'package:doctor_app_flutter/config/size_config.dart';
|
||||||
|
import 'package:doctor_app_flutter/core/model/SOAP/home_medication_vp/GetSearchCurrentMedicationDetails.dart';
|
||||||
|
import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart';
|
||||||
|
import 'package:doctor_app_flutter/core/viewModel/project_view_model.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:flutter/material.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
|
|
||||||
|
class DropdownPopup extends StatefulWidget {
|
||||||
|
final GetSearchCurrentMedicationDetails? medicationDetails;
|
||||||
|
bool isStrength;
|
||||||
|
bool isRoute;
|
||||||
|
bool isFrequency;
|
||||||
|
int? selectedID;
|
||||||
|
String? selectedText;
|
||||||
|
final okText;
|
||||||
|
final Function(int selectedID, String selectedText)? okFunction;
|
||||||
|
DropdownPopup({this.medicationDetails, this.isStrength = false, this.okFunction, this.okText, this.selectedID, this.isRoute =false, this.isFrequency =false, this.selectedText });
|
||||||
|
|
||||||
|
@override
|
||||||
|
_DropdownPopupState createState() => _DropdownPopupState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _DropdownPopupState extends State<DropdownPopup> {
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
ProjectViewModel projectViewModel = Provider.of(context);
|
||||||
|
return showAlertDialog(context, projectViewModel);
|
||||||
|
}
|
||||||
|
|
||||||
|
showAlertDialog(BuildContext context, ProjectViewModel projectViewModel) {
|
||||||
|
// set up the buttons
|
||||||
|
Widget cancelButton = ElevatedButton(
|
||||||
|
child: AppText(
|
||||||
|
TranslationBase.of(context).cancel,
|
||||||
|
color: Colors.white,
|
||||||
|
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * (SizeConfig.isWidthLarge ? 3.5 : 5),
|
||||||
|
),
|
||||||
|
onPressed: () {
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
});
|
||||||
|
Widget continueButton = ElevatedButton(
|
||||||
|
child: AppText(
|
||||||
|
this.widget.okText,
|
||||||
|
color: Colors.white,
|
||||||
|
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * (SizeConfig.isWidthLarge ? 3.5 : 5),
|
||||||
|
),
|
||||||
|
onPressed: () {
|
||||||
|
|
||||||
|
// this.widget.okFunction(selectedValue);
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
});
|
||||||
|
// set up the AlertDialog
|
||||||
|
AlertDialog alert = AlertDialog(
|
||||||
|
// title: Text(widget.title),
|
||||||
|
content: createDialogList(projectViewModel),
|
||||||
|
actions: [
|
||||||
|
cancelButton,
|
||||||
|
continueButton,
|
||||||
|
],
|
||||||
|
);
|
||||||
|
return alert;
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget createDialogList(ProjectViewModel projectViewModel) {
|
||||||
|
return Container(
|
||||||
|
height: MediaQuery.of(context).size.height * 0.5,
|
||||||
|
child: SingleChildScrollView(
|
||||||
|
child: widget.isStrength ? Column(
|
||||||
|
children: [
|
||||||
|
|
||||||
|
...widget.medicationDetails!.itemStrengthDetailsDto!
|
||||||
|
.map((item) => RadioListTile(
|
||||||
|
title: AppText(
|
||||||
|
'${item.strength}',
|
||||||
|
),
|
||||||
|
groupValue: widget.selectedID!.toString(),
|
||||||
|
value: item.strengthId.toString(),
|
||||||
|
activeColor: Colors.blue.shade700,
|
||||||
|
selected: item.strengthId.toString() == widget.selectedID!.toString(),
|
||||||
|
onChanged: (val) {
|
||||||
|
widget.selectedID = item.strengthId;
|
||||||
|
widget.selectedText = item.strength;
|
||||||
|
widget.okFunction!( item.strengthId!, item.strength!);
|
||||||
|
|
||||||
|
},
|
||||||
|
))
|
||||||
|
.toList()
|
||||||
|
],
|
||||||
|
) :
|
||||||
|
|
||||||
|
widget.isRoute ? Column( children: [
|
||||||
|
|
||||||
|
...widget.medicationDetails!.genericItemRouteDetailsEntity!
|
||||||
|
.map((item) => RadioListTile(
|
||||||
|
title: AppText(
|
||||||
|
'${item.route}',
|
||||||
|
),
|
||||||
|
groupValue: widget.selectedID!.toString(),
|
||||||
|
value: item.routeId.toString(),
|
||||||
|
activeColor: Colors.blue.shade700,
|
||||||
|
selected: item.routeId.toString() == widget.selectedID!.toString(),
|
||||||
|
onChanged: (val) {
|
||||||
|
widget.selectedID = item.routeId;
|
||||||
|
widget.selectedText = item.route;
|
||||||
|
widget.okFunction!( item.routeId!, item.route!);
|
||||||
|
|
||||||
|
},
|
||||||
|
))
|
||||||
|
.toList()
|
||||||
|
],
|
||||||
|
) : Column( children: [
|
||||||
|
|
||||||
|
...widget.medicationDetails!.genericItemFrequencyDetailsEntity!
|
||||||
|
.map((item) => RadioListTile(
|
||||||
|
title: AppText(
|
||||||
|
'${item.frequency}',
|
||||||
|
),
|
||||||
|
groupValue: widget.selectedID!.toString(),
|
||||||
|
value: item.frequencyId.toString(),
|
||||||
|
activeColor: Colors.blue.shade700,
|
||||||
|
selected: item.frequencyId.toString() == widget.selectedID!.toString() ,
|
||||||
|
onChanged: (val) {
|
||||||
|
widget.selectedID = item.frequencyId;
|
||||||
|
widget.selectedText = item.frequency;
|
||||||
|
widget.okFunction!( item.frequencyId!, item.frequency!);
|
||||||
|
setState(() {
|
||||||
|
|
||||||
|
});
|
||||||
|
},
|
||||||
|
))
|
||||||
|
.toList()
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
static closeAlertDialog(BuildContext context) {
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,109 @@
|
|||||||
|
import 'package:doctor_app_flutter/core/model/SOAP/home_medication_vp/GetHomeMedication.dart';
|
||||||
|
import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_allergy.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/screens/base/base_view.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/shared/app_texts_widget.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_svg/flutter_svg.dart';
|
||||||
|
|
||||||
|
import 'add_medication.dart';
|
||||||
|
|
||||||
|
class UpdateMedicationWidget extends StatefulWidget {
|
||||||
|
final PatiantInformtion patientInfo;
|
||||||
|
UpdateMedicationWidget({
|
||||||
|
Key? key,
|
||||||
|
required this.patientInfo,
|
||||||
|
});
|
||||||
|
|
||||||
|
@override
|
||||||
|
_UpdateMedicationWidgetState createState() => _UpdateMedicationWidgetState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _UpdateMedicationWidgetState extends State<UpdateMedicationWidget> {
|
||||||
|
TextEditingController medicationController = TextEditingController();
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return BaseView<SOAPViewModel>(
|
||||||
|
onModelReady: (model) async {
|
||||||
|
model.getHomeMedication(widget.patientInfo);
|
||||||
|
},
|
||||||
|
builder: (_, model, w) =>
|
||||||
|
Column(
|
||||||
|
children: [
|
||||||
|
AddSoapItem(
|
||||||
|
title: "${TranslationBase
|
||||||
|
.of(context)
|
||||||
|
.addMedication}",
|
||||||
|
onAddSoapItemClicked: () {
|
||||||
|
Navigator.push(
|
||||||
|
context,
|
||||||
|
FadePage(
|
||||||
|
page: AddMedication(
|
||||||
|
patientInfo: widget.patientInfo,
|
||||||
|
addMedicationFun:(){
|
||||||
|
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
));
|
||||||
|
// openMedicationList(context);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 20,
|
||||||
|
),
|
||||||
|
ListView(
|
||||||
|
padding: EdgeInsets.all(10),
|
||||||
|
shrinkWrap: true,
|
||||||
|
physics: NeverScrollableScrollPhysics(),
|
||||||
|
children: model.getHomeMedicationList!.map((medication) {
|
||||||
|
return ListTile(
|
||||||
|
trailing: TextButton.icon(
|
||||||
|
onPressed: () {
|
||||||
|
removeMedication(medication, model);
|
||||||
|
},
|
||||||
|
icon: SvgPicture.asset(
|
||||||
|
"assets/images/svgs/delete.svg",
|
||||||
|
height: 18,
|
||||||
|
color: Color(0xffD02127),
|
||||||
|
),
|
||||||
|
label: AppText(
|
||||||
|
TranslationBase.of(context)
|
||||||
|
.remove,
|
||||||
|
fontSize: 12,
|
||||||
|
color: Color(0xffD02127))),
|
||||||
|
title:
|
||||||
|
|
||||||
|
AppText(
|
||||||
|
medication.prescribedItemName!,
|
||||||
|
fontSize: 12,
|
||||||
|
fontWeight: FontWeight.w800,
|
||||||
|
letterSpacing: -0.48,
|
||||||
|
),
|
||||||
|
subtitle: AppText(
|
||||||
|
'${medication.doseQuantity!} - ${ medication.frequencyString!}',
|
||||||
|
fontSize: 10,
|
||||||
|
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}).toList()),
|
||||||
|
|
||||||
|
|
||||||
|
]
|
||||||
|
));
|
||||||
|
}
|
||||||
|
removeMedication(GetHomeMedicationList medication, SOAPViewModel model) async{
|
||||||
|
GifLoaderDialogUtils.showMyDialog(context);
|
||||||
|
await model.removeCurrentMedication(medication.id!);
|
||||||
|
await model.getHomeMedication(widget.patientInfo);
|
||||||
|
GifLoaderDialogUtils.hideDialog(context);
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue