From 06fdee2d2da93a7e514b9cf918b59c82ed9d9b55 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Mon, 22 Mar 2021 15:49:04 +0200 Subject: [PATCH] hussam --- lib/core/model/prescription_req_model.dart | 5 +- lib/core/service/prescription_service.dart | 4 +- .../medical-file/medical_file_page.dart | 222 +++++++++--------- .../prescription/prescription_screen.dart | 2 +- 4 files changed, 116 insertions(+), 117 deletions(-) diff --git a/lib/core/model/prescription_req_model.dart b/lib/core/model/prescription_req_model.dart index 3accb428..3eb71072 100644 --- a/lib/core/model/prescription_req_model.dart +++ b/lib/core/model/prescription_req_model.dart @@ -1,18 +1,21 @@ class PrescriptionReqModel { String vidaAuthTokenID; dynamic patientMRN; + dynamic appNo; - PrescriptionReqModel({this.vidaAuthTokenID, this.patientMRN}); + PrescriptionReqModel({this.vidaAuthTokenID, this.patientMRN, this.appNo}); PrescriptionReqModel.fromJson(Map json) { vidaAuthTokenID = json['VidaAuthTokenID']; patientMRN = json['PatientMRN']; + appNo = json['AppointmentNo']; } Map toJson() { final Map data = new Map(); data['VidaAuthTokenID'] = this.vidaAuthTokenID; data['PatientMRN'] = this.patientMRN; + data['AppointmentNo'] = this.appNo; return data; } } diff --git a/lib/core/service/prescription_service.dart b/lib/core/service/prescription_service.dart index 8b518c07..758f4595 100644 --- a/lib/core/service/prescription_service.dart +++ b/lib/core/service/prescription_service.dart @@ -82,7 +82,9 @@ class PrescriptionService extends LookupService { } Future getPrescription({int mrn}) async { - _prescriptionReqModel = PrescriptionReqModel(patientMRN: mrn); + _prescriptionReqModel = PrescriptionReqModel( + patientMRN: mrn, + ); hasError = false; _prescriptionList.clear(); await baseAppClient.post(GET_PRESCRIPTION_LIST, diff --git a/lib/screens/medical-file/medical_file_page.dart b/lib/screens/medical-file/medical_file_page.dart index 2b817d8b..79f7416f 100644 --- a/lib/screens/medical-file/medical_file_page.dart +++ b/lib/screens/medical-file/medical_file_page.dart @@ -31,128 +31,122 @@ class _MedicalFilePageState extends State { body: NetworkBaseView( baseViewModel: model, child: SingleChildScrollView( - child: Center( - child: Container( - color: Colors.white, - child: Column( - // mainAxisAlignment: model.medicalFileList.length != 0 && - // model.medicalFileList != null - // ? MainAxisAlignment.start - // : MainAxisAlignment.center, - children: [ - PatientPageHeaderWidget(patient), - Divider( - height: 1.0, - thickness: 1.0, - color: Colors.grey, - ), - (model.medicalFileList.length != 0 && - model.medicalFileList != null) - ? ListView.builder( - //physics: , - physics: NeverScrollableScrollPhysics(), - scrollDirection: Axis.vertical, - shrinkWrap: true, - itemCount: model.medicalFileList[0].entityList[0] - .timelines.length, - itemBuilder: (BuildContext ctxt, int index) { - return Padding( - padding: EdgeInsets.symmetric( - horizontal: 12.0, vertical: 8.0), - child: InkWell( - child: Container( - child: Column( - children: [ - Row( - children: [ - AppText( - TranslationBase.of(context) - .branch + - ": ", - fontWeight: FontWeight.w700, - ), - AppText(model - .medicalFileList[0] - .entityList[0] - .timelines[index] - .projectName), - ], - ), - Row( - children: [ - AppText( - TranslationBase.of(context) - .doctorName - .toUpperCase() + - ": ", - fontWeight: FontWeight.w700, - ), - Expanded( - child: AppText( - model - .medicalFileList[0] - .entityList[0] - .timelines[index] - .doctorName, - fontWeight: FontWeight.w700, - ), - ), - ], - ), - Row( - children: [ - AppText( - TranslationBase.of(context) - .clinicName + - ": ", - fontWeight: FontWeight.w700, - ), - AppText( + child: Container( + color: Colors.white, + child: Column( + // mainAxisAlignment: model.medicalFileList.length != 0 && + // model.medicalFileList != null + // ? MainAxisAlignment.start + // : MainAxisAlignment.center, + children: [ + PatientPageHeaderWidget(patient), + Divider( + height: 1.0, + thickness: 1.0, + color: Colors.grey, + ), + (model.medicalFileList != null && + model.medicalFileList.length != 0) + ? ListView.builder( + //physics: , + physics: NeverScrollableScrollPhysics(), + scrollDirection: Axis.vertical, + shrinkWrap: true, + itemCount: model.medicalFileList[0].entityList[0] + .timelines.length, + itemBuilder: (BuildContext ctxt, int index) { + return Padding( + padding: EdgeInsets.symmetric( + horizontal: 12.0, vertical: 8.0), + child: InkWell( + child: Container( + child: Column( + children: [ + Row( + children: [ + AppText( + TranslationBase.of(context).branch + + ": ", + fontWeight: FontWeight.w700, + ), + AppText(model + .medicalFileList[0] + .entityList[0] + .timelines[index] + .projectName), + ], + ), + Row( + children: [ + AppText( + TranslationBase.of(context) + .doctorName + .toUpperCase() + + ": ", + fontWeight: FontWeight.w700, + ), + Expanded( + child: AppText( model .medicalFileList[0] .entityList[0] .timelines[index] - .clinicName, + .doctorName, + fontWeight: FontWeight.w700, ), - ], - ), - SizedBox(height: 10.0), - Divider( - height: 1.0, - thickness: 1.0, - color: Colors.grey.shade400, - ) - ], - ), + ), + ], + ), + Row( + children: [ + AppText( + TranslationBase.of(context) + .clinicName + + ": ", + fontWeight: FontWeight.w700, + ), + AppText( + model + .medicalFileList[0] + .entityList[0] + .timelines[index] + .clinicName, + ), + ], + ), + SizedBox(height: 10.0), + Divider( + height: 1.0, + thickness: 1.0, + color: Colors.grey.shade400, + ) + ], ), - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => - MedicalFileDetails( - age: patient.age, - firstName: patient.firstName, - lastName: patient.lastName, - gender: - patient.genderDescription, - encounterNumber: index, - pp: patient.patientId, - )), - ); - }, ), - ); - }) - : Center( - child: Container( - child: AppText( - 'THERES NO MEDICAL FILE FOR THIS Patient', + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => + MedicalFileDetails( + age: patient.age, + firstName: patient.firstName, + lastName: patient.lastName, + gender: patient.genderDescription, + encounterNumber: index, + pp: patient.patientId, + )), + ); + }, ), - ), - ) - ], - ), + ); + }) + : Container( + child: AppText( + 'THERES NO MEDICAL FILE FOR THIS Patient', + ), + ) + ], ), ), ), diff --git a/lib/screens/prescription/prescription_screen.dart b/lib/screens/prescription/prescription_screen.dart index 87202979..18655e65 100644 --- a/lib/screens/prescription/prescription_screen.dart +++ b/lib/screens/prescription/prescription_screen.dart @@ -35,7 +35,7 @@ class _NewPrescriptionScreenState extends State { final routeArgs = ModalRoute.of(context).settings.arguments as Map; patient = routeArgs['patient']; return BaseView( - onModelReady: (model) => model.getPrescription(mrn: 0), + onModelReady: (model) => model.getPrescription(mrn: patient.patientId), builder: (BuildContext context, PrescriptionViewModel model, Widget child) => AppScaffold(