WD: admission request changes

update_flutter_3.24_vida_plus_episode_MDS
taha.alam 11 months ago
parent 2e93b1f92f
commit 90d4818604

@ -1336,4 +1336,5 @@ const Map<String, Map<String, String>> localizedValues = {
},
"morphologyCode": {"en": "Morphology Code", "ar": "كود الشكل"},
"intendedLengthOfStay": {"en": "Intended Length Of Stay", "ar": "مدة الإقامة المقصودة"},
"pleasFillMorphology": {"en": "Pleas Select Morphology", "ar": "مناشدات تحديد التشكل"},
};

@ -43,6 +43,9 @@ class AdmissionRequest {
int? admissionRequestNo;
dynamic? intendedLengthOfStayId;
String? expectedAdmissionDate;
String? morphologyCode;
String? morphologyDescription;
AdmissionRequest(
{this.patientMRN,
this.admitToClinic,
@ -87,7 +90,9 @@ class AdmissionRequest {
this.episodeID,
this.admissionRequestNo,
this.intendedLengthOfStayId,
this.expectedAdmissionDate
this.expectedAdmissionDate,
this.morphologyCode,
this.morphologyDescription
});
AdmissionRequest.fromJson(Map<String, dynamic> json) {
@ -148,6 +153,8 @@ class AdmissionRequest {
appointmentNo = json['appointmentNo'];
episodeID = json['episodeID'];
admissionRequestNo = json['admissionRequestNo'];
morphologyCode = json['morphologyCode'];
morphologyDescription = json['morphologyDescription'];
}
Map<String, dynamic> toJson() {
@ -200,6 +207,8 @@ class AdmissionRequest {
data['episodeID'] = this.episodeID;
data['admissionRequestNo'] = this.admissionRequestNo;
data['intendedLengthOfStayId'] = this.intendedLengthOfStayId;
data['morphologyDescription'] = this.morphologyDescription;
data['morphologyCode'] = this.morphologyCode;
return data;
}
}

@ -41,6 +41,7 @@ class _AdmissionRequestThirdScreenState extends State<AdmissionRequestThirdScree
TextEditingController morphologyController = TextEditingController();
String diagnosisError = '', icdError = '', diagnosisTypeError = '',stayLengthError = '';
dynamic morphologyCode='';
SOAPViewModel? viewmodel;
@override
void initState() {
@ -137,6 +138,9 @@ class _AdmissionRequestThirdScreenState extends State<AdmissionRequestThirdScree
height: 10,
),
BaseView<SOAPViewModel>(
onModelReady: (model){
viewmodel = model;
},
builder: (_, soapModel, w) => Column(children: [
AppTextFieldCustom(
@ -381,6 +385,11 @@ class _AdmissionRequestThirdScreenState extends State<AdmissionRequestThirdScree
eventCategory: "Admission Request Third Screen",
eventAction: "Submit Admission Request",
);
if(viewmodel?.morphologyList?.isNotEmpty == true && morphologyController.text.isEmpty){
DrAppToastMsg.showErrorToast(TranslationBase.of(context).pleasFillMorphology);
return;
}
if (_selectedDiagnosis != null && _selectedIcd != null && _selectedDiagnosisType != null) {
model.admissionRequestData = admissionRequest;
@ -399,6 +408,8 @@ class _AdmissionRequestThirdScreenState extends State<AdmissionRequestThirdScree
model.admissionRequestData.diagnosis = "${_selectedIcd['code']} : ${_selectedIcd['description']}; ";
model.admissionRequestData!.admissionRequestDiagnoses = admissionRequestDiagnoses;
model.admissionRequestData!.morphologyCode = morphologyCode;
model.admissionRequestData!.morphologyDescription = morphologyController.text;
await model.makeAdmissionRequest();
if (model.state == ViewState.ErrorLocal) {

@ -454,6 +454,7 @@ class TranslationBase {
String get remarks => localizedValues['remarks']![locale.languageCode]!;
String get pleaseFill => localizedValues['pleaseFill']![locale.languageCode]!;
String get pleasFillMorphology => localizedValues['pleasFillMorphology']![locale.languageCode]!;
String get replay2 => localizedValues['replay2']![locale.languageCode]!;

Loading…
Cancel
Save