merge-requests/360/head
hussam al-habibeh 5 years ago
parent 53f45adf69
commit 06fdee2d2d

@ -1,18 +1,21 @@
class PrescriptionReqModel { class PrescriptionReqModel {
String vidaAuthTokenID; String vidaAuthTokenID;
dynamic patientMRN; dynamic patientMRN;
dynamic appNo;
PrescriptionReqModel({this.vidaAuthTokenID, this.patientMRN}); PrescriptionReqModel({this.vidaAuthTokenID, this.patientMRN, this.appNo});
PrescriptionReqModel.fromJson(Map<String, dynamic> json) { PrescriptionReqModel.fromJson(Map<String, dynamic> json) {
vidaAuthTokenID = json['VidaAuthTokenID']; vidaAuthTokenID = json['VidaAuthTokenID'];
patientMRN = json['PatientMRN']; patientMRN = json['PatientMRN'];
appNo = json['AppointmentNo'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>(); final Map<String, dynamic> data = new Map<String, dynamic>();
data['VidaAuthTokenID'] = this.vidaAuthTokenID; data['VidaAuthTokenID'] = this.vidaAuthTokenID;
data['PatientMRN'] = this.patientMRN; data['PatientMRN'] = this.patientMRN;
data['AppointmentNo'] = this.appNo;
return data; return data;
} }
} }

@ -82,7 +82,9 @@ class PrescriptionService extends LookupService {
} }
Future getPrescription({int mrn}) async { Future getPrescription({int mrn}) async {
_prescriptionReqModel = PrescriptionReqModel(patientMRN: mrn); _prescriptionReqModel = PrescriptionReqModel(
patientMRN: mrn,
);
hasError = false; hasError = false;
_prescriptionList.clear(); _prescriptionList.clear();
await baseAppClient.post(GET_PRESCRIPTION_LIST, await baseAppClient.post(GET_PRESCRIPTION_LIST,

@ -31,128 +31,122 @@ class _MedicalFilePageState extends State<MedicalFilePage> {
body: NetworkBaseView( body: NetworkBaseView(
baseViewModel: model, baseViewModel: model,
child: SingleChildScrollView( child: SingleChildScrollView(
child: Center( child: Container(
child: Container( color: Colors.white,
color: Colors.white, child: Column(
child: Column( // mainAxisAlignment: model.medicalFileList.length != 0 &&
// mainAxisAlignment: model.medicalFileList.length != 0 && // model.medicalFileList != null
// model.medicalFileList != null // ? MainAxisAlignment.start
// ? MainAxisAlignment.start // : MainAxisAlignment.center,
// : MainAxisAlignment.center, children: [
children: [ PatientPageHeaderWidget(patient),
PatientPageHeaderWidget(patient), Divider(
Divider( height: 1.0,
height: 1.0, thickness: 1.0,
thickness: 1.0, color: Colors.grey,
color: Colors.grey, ),
), (model.medicalFileList != null &&
(model.medicalFileList.length != 0 && model.medicalFileList.length != 0)
model.medicalFileList != null) ? ListView.builder(
? ListView.builder( //physics: ,
//physics: , physics: NeverScrollableScrollPhysics(),
physics: NeverScrollableScrollPhysics(), scrollDirection: Axis.vertical,
scrollDirection: Axis.vertical, shrinkWrap: true,
shrinkWrap: true, itemCount: model.medicalFileList[0].entityList[0]
itemCount: model.medicalFileList[0].entityList[0] .timelines.length,
.timelines.length, itemBuilder: (BuildContext ctxt, int index) {
itemBuilder: (BuildContext ctxt, int index) { return Padding(
return Padding( padding: EdgeInsets.symmetric(
padding: EdgeInsets.symmetric( horizontal: 12.0, vertical: 8.0),
horizontal: 12.0, vertical: 8.0), child: InkWell(
child: InkWell( child: Container(
child: Container( child: Column(
child: Column( children: [
children: [ Row(
Row( children: [
children: [ AppText(
AppText( TranslationBase.of(context).branch +
TranslationBase.of(context) ": ",
.branch + fontWeight: FontWeight.w700,
": ", ),
fontWeight: FontWeight.w700, AppText(model
), .medicalFileList[0]
AppText(model .entityList[0]
.medicalFileList[0] .timelines[index]
.entityList[0] .projectName),
.timelines[index] ],
.projectName), ),
], Row(
), children: [
Row( AppText(
children: [ TranslationBase.of(context)
AppText( .doctorName
TranslationBase.of(context) .toUpperCase() +
.doctorName ": ",
.toUpperCase() + fontWeight: FontWeight.w700,
": ", ),
fontWeight: FontWeight.w700, Expanded(
), child: AppText(
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(
model model
.medicalFileList[0] .medicalFileList[0]
.entityList[0] .entityList[0]
.timelines[index] .timelines[index]
.clinicName, .doctorName,
fontWeight: FontWeight.w700,
), ),
], ),
), ],
SizedBox(height: 10.0), ),
Divider( Row(
height: 1.0, children: [
thickness: 1.0, AppText(
color: Colors.grey.shade400, 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,
)),
);
},
), ),
); onTap: () {
}) Navigator.push(
: Center( context,
child: Container( MaterialPageRoute(
child: AppText( builder: (context) =>
'THERES NO MEDICAL FILE FOR THIS Patient', 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',
),
)
],
), ),
), ),
), ),

@ -35,7 +35,7 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
final routeArgs = ModalRoute.of(context).settings.arguments as Map; final routeArgs = ModalRoute.of(context).settings.arguments as Map;
patient = routeArgs['patient']; patient = routeArgs['patient'];
return BaseView<PrescriptionViewModel>( return BaseView<PrescriptionViewModel>(
onModelReady: (model) => model.getPrescription(mrn: 0), onModelReady: (model) => model.getPrescription(mrn: patient.patientId),
builder: builder:
(BuildContext context, PrescriptionViewModel model, Widget child) => (BuildContext context, PrescriptionViewModel model, Widget child) =>
AppScaffold( AppScaffold(

Loading…
Cancel
Save