Merge branch 'in_patient_soap' into 'development'

In patient soap

See merge request Cloud_Solution/doctor_app_flutter!796
merge-requests/797/merge
Mohammad Aljammal 5 years ago
commit 68e1a2b399

@ -9,19 +9,14 @@ class RadiologyService extends BaseService {
List<FinalRadiology> finalRadiologyList = List(); List<FinalRadiology> finalRadiologyList = List();
String url = ''; String url = '';
Future getRadImageURL( Future getRadImageURL({int invoiceNo, int lineItem, int projectId, @required PatiantInformtion patient}) async {
{int invoiceNo,
int lineItem,
int projectId,
@required PatiantInformtion patient}) async {
hasError = false; hasError = false;
final Map<String, dynamic> body = new Map<String, dynamic>(); final Map<String, dynamic> body = new Map<String, dynamic>();
body['InvoiceNo'] = invoiceNo; body['InvoiceNo'] = invoiceNo;
body['LineItemNo'] = lineItem; body['LineItemNo'] = lineItem;
body['ProjectID'] = projectId; body['ProjectID'] = projectId;
await baseAppClient.postPatient(GET_RAD_IMAGE_URL, patient: patient, await baseAppClient.postPatient(GET_RAD_IMAGE_URL, patient: patient, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) {
url = response['Data']; url = response['Data'];
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
@ -29,24 +24,22 @@ class RadiologyService extends BaseService {
}, body: body); }, body: body);
} }
Future getPatientRadOrders(PatiantInformtion patient, Future getPatientRadOrders(PatiantInformtion patient, {isInPatient = false}) async {
{isInPatient = false}) async {
String url = GET_PATIENT_ORDERS; String url = GET_PATIENT_ORDERS;
final Map<String, dynamic> body = new Map<String, dynamic>(); final Map<String, dynamic> body = new Map<String, dynamic>();
if (isInPatient) { if (isInPatient) {
url = GET_IN_PATIENT_ORDERS; url = GET_IN_PATIENT_ORDERS;
body['ProjectID'] = patient.projectId; body['ProjectID'] = patient.projectId;
} }
finalRadiologyList.clear();
hasError = false; hasError = false;
await baseAppClient.postPatient(url, patient: patient, await baseAppClient.postPatient(url, patient: patient, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) {
finalRadiologyList = []; finalRadiologyList = [];
String label = "ListRAD"; String label = "ListRAD";
if (isInPatient) { if (isInPatient) {
label = "List_GetRadOreders"; label = "List_GetRadOreders";
} }
if(response[label] == null || response[label].length == 0){ if (response[label] == null || response[label].length == 0) {
label = "FinalRadiologyList"; label = "FinalRadiologyList";
} }
response[label].forEach((radiology) { response[label].forEach((radiology) {

@ -18,12 +18,7 @@ class LabResultWidget extends StatelessWidget {
final bool isInpatient; final bool isInpatient;
LabResultWidget( LabResultWidget(
{Key key, {Key key, this.filterName, this.patientLabResultList, this.patientLabOrder, this.patient, this.isInpatient})
this.filterName,
this.patientLabResultList,
this.patientLabOrder,
this.patient,
this.isInpatient})
: super(key: key); : super(key: key);
ProjectViewModel projectViewModel; ProjectViewModel projectViewModel;
@ -37,32 +32,32 @@ class LabResultWidget extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
// if (!isInpatient) // if (!isInpatient)
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
AppText(filterName), AppText(filterName),
InkWell( InkWell(
onTap: () { onTap: () {
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
page: FlowChartPage( page: FlowChartPage(
filterName: filterName, filterName: filterName,
patientLabOrder: patientLabOrder, patientLabOrder: patientLabOrder,
patient: patient, patient: patient,
isInpatient: isInpatient, isInpatient: isInpatient,
),
), ),
); ),
}, );
child: AppText( },
TranslationBase.of(context).showMoreBtn, child: AppText(
textDecoration: TextDecoration.underline, TranslationBase.of(context).showMoreBtn,
color: Colors.blue, textDecoration: TextDecoration.underline,
), color: Colors.blue,
), ),
], ),
), ],
),
Row( Row(
children: [ children: [
Expanded( Expanded(
@ -122,9 +117,9 @@ class LabResultWidget extends StatelessWidget {
color: Colors.white, color: Colors.white,
child: Center( child: Center(
child: AppText( child: AppText(
'${patientLabResultList[index].testCode}\n' + '${patientLabResultList[index].testCode}\n' + patientLabResultList[index].description,
patientLabResultList[index].description,
textAlign: TextAlign.center, textAlign: TextAlign.center,
isCopyable: true,
), ),
), ),
), ),
@ -135,10 +130,10 @@ class LabResultWidget extends StatelessWidget {
color: Colors.white, color: Colors.white,
child: Center( child: Center(
child: AppText( child: AppText(
patientLabResultList[index].resultValue ??""+ patientLabResultList[index].resultValue ??
" " + "" + " " + "${patientLabResultList[index].uOM ?? ""}",
"${patientLabResultList[index].uOM ?? ""}",
textAlign: TextAlign.center, textAlign: TextAlign.center,
isCopyable: true,
), ),
), ),
), ),
@ -151,6 +146,7 @@ class LabResultWidget extends StatelessWidget {
child: AppText( child: AppText(
patientLabResultList[index].referanceRange, patientLabResultList[index].referanceRange,
textAlign: TextAlign.center, textAlign: TextAlign.center,
isCopyable: true,
), ),
), ),
), ),

@ -88,20 +88,16 @@ class _LaboratoryResultWidgetState extends State<LaboratoryResultWidget> {
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
child: Container( child: Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(left: 10, right: 10),
left: 10, right: 10),
child: AppText( child: AppText(
TranslationBase.of(context) TranslationBase.of(context).generalResult,
.generalResult,
bold: true, bold: true,
))), ))),
Container( Container(
width: 25, width: 25,
height: 25, height: 25,
child: Icon( child: Icon(
_isShowMoreGeneral _isShowMoreGeneral ? Icons.keyboard_arrow_up : Icons.keyboard_arrow_down,
? Icons.keyboard_arrow_up
: Icons.keyboard_arrow_down,
color: Colors.grey[800], color: Colors.grey[800],
size: 22, size: 22,
), ),
@ -132,11 +128,8 @@ class _LaboratoryResultWidgetState extends State<LaboratoryResultWidget> {
model.labResultLists.length, model.labResultLists.length,
(index) => LabResultWidget( (index) => LabResultWidget(
patientLabOrder: widget.patientLabOrder, patientLabOrder: widget.patientLabOrder,
filterName: model filterName: model.labResultLists[index].filterName,
.labResultLists[index].filterName, patientLabResultList: model.labResultLists[index].patientLabResultList,
patientLabResultList: model
.labResultLists[index]
.patientLabResultList,
patient: widget.patient, patient: widget.patient,
isInpatient: widget.isInpatient, isInpatient: widget.isInpatient,
), ),
@ -173,20 +166,16 @@ class _LaboratoryResultWidgetState extends State<LaboratoryResultWidget> {
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
child: Container( child: Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(left: 10, right: 10),
left: 10, right: 10),
child: AppText( child: AppText(
TranslationBase.of(context) TranslationBase.of(context).specialResult,
.specialResult,
bold: true, bold: true,
))), ))),
Container( Container(
width: 25, width: 25,
height: 25, height: 25,
child: Icon( child: Icon(
_isShowMore _isShowMore ? Icons.keyboard_arrow_up : Icons.keyboard_arrow_down,
? Icons.keyboard_arrow_up
: Icons.keyboard_arrow_down,
color: Colors.grey[800], color: Colors.grey[800],
size: 22, size: 22,
), ),
@ -211,14 +200,10 @@ class _LaboratoryResultWidgetState extends State<LaboratoryResultWidget> {
width: double.infinity, width: double.infinity,
child: !Helpers.isTextHtml(widget.details) child: !Helpers.isTextHtml(widget.details)
? AppText( ? AppText(
widget.details ?? widget.details ?? TranslationBase.of(context).noDataAvailable,
TranslationBase.of(context)
.noDataAvailable,
) )
: Html( : Html(
data: widget.details ?? data: widget.details ?? TranslationBase.of(context).noDataAvailable,
TranslationBase.of(context)
.noDataAvailable,
), ),
), ),
), ),

@ -29,7 +29,6 @@ class _LabsHomePageState extends State<LabsHomePage> {
bool isInpatient; bool isInpatient;
bool isFromLiveCare; bool isFromLiveCare;
@override @override
void didChangeDependencies() { void didChangeDependencies() {
super.didChangeDependencies(); super.didChangeDependencies();
@ -66,8 +65,7 @@ class _LabsHomePageState extends State<LabsHomePage> {
SizedBox( SizedBox(
height: 12, height: 12,
), ),
if (model.patientLabOrdersList.isNotEmpty && if (model.patientLabOrdersList.isNotEmpty && patient.patientStatusType != 43)
patient.patientStatusType != 43)
Padding( Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Column( child: Column(
@ -87,8 +85,7 @@ class _LabsHomePageState extends State<LabsHomePage> {
], ],
), ),
), ),
if (patient.patientStatusType != null && if (patient.patientStatusType != null && patient.patientStatusType == 43)
patient.patientStatusType == 43)
Padding( Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Column( child: Column(
@ -108,8 +105,7 @@ class _LabsHomePageState extends State<LabsHomePage> {
], ],
), ),
), ),
if ((patient.patientStatusType != null && if ((patient.patientStatusType != null && patient.patientStatusType == 43) ||
patient.patientStatusType == 43) ||
(isFromLiveCare && patient.appointmentNo != null)) (isFromLiveCare && patient.appointmentNo != null))
AddNewOrder( AddNewOrder(
onTap: () { onTap: () {
@ -146,37 +142,26 @@ class _LabsHomePageState extends State<LabsHomePage> {
width: 20, width: 20,
height: 160, height: 160,
decoration: BoxDecoration( decoration: BoxDecoration(
color: model.patientLabOrdersList[index] color: model.patientLabOrdersList[index].isLiveCareAppointment
.isLiveCareAppointment
? Colors.red[900] ? Colors.red[900]
: !model.patientLabOrdersList[index] : !model.patientLabOrdersList[index].isInOutPatient
.isInOutPatient
? Colors.black ? Colors.black
: Color(0xffa9a089), : Color(0xffa9a089),
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
topLeft: projectViewModel.isArabic? Radius.circular(0):Radius.circular(8), topLeft: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(8),
bottomLeft: projectViewModel.isArabic? Radius.circular(0):Radius.circular(8), bottomLeft: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(8),
topRight: projectViewModel.isArabic? Radius.circular(8):Radius.circular(0), topRight: projectViewModel.isArabic ? Radius.circular(8) : Radius.circular(0),
bottomRight: projectViewModel.isArabic? Radius.circular(8):Radius.circular(0) bottomRight: projectViewModel.isArabic ? Radius.circular(8) : Radius.circular(0)),
),
), ),
child: RotatedBox( child: RotatedBox(
quarterTurns: 3, quarterTurns: 3,
child: Center( child: Center(
child: Text( child: Text(
model.patientLabOrdersList[index] model.patientLabOrdersList[index].isLiveCareAppointment
.isLiveCareAppointment ? TranslationBase.of(context).liveCare.toUpperCase()
? TranslationBase.of(context) : !model.patientLabOrdersList[index].isInOutPatient
.liveCare ? TranslationBase.of(context).inPatientLabel.toUpperCase()
.toUpperCase() : TranslationBase.of(context).outpatient.toUpperCase(),
: !model.patientLabOrdersList[index]
.isInOutPatient
? TranslationBase.of(context)
.inPatientLabel
.toUpperCase()
: TranslationBase.of(context)
.outpatient
.toUpperCase(),
style: TextStyle(color: Colors.white), style: TextStyle(color: Colors.white),
), ),
)), )),
@ -190,24 +175,18 @@ class _LabsHomePageState extends State<LabsHomePage> {
page: LaboratoryResultPage( page: LaboratoryResultPage(
patientLabOrders: model.patientLabOrdersList[index], patientLabOrders: model.patientLabOrdersList[index],
patient: patient, patient: patient,
isInpatient:isInpatient, isInpatient: isInpatient,
arrivalType: arrivalType, arrivalType: arrivalType,
patientType: patientType, patientType: patientType,
), ),
), ),
), ),
doctorName: doctorName: model.patientLabOrdersList[index].doctorName,
model.patientLabOrdersList[index].doctorName, invoiceNO: ' ${model.patientLabOrdersList[index].invoiceNo}',
invoiceNO: profileUrl: model.patientLabOrdersList[index].doctorImageURL,
' ${model.patientLabOrdersList[index].invoiceNo}', branch: model.patientLabOrdersList[index].projectName,
profileUrl: model clinic: model.patientLabOrdersList[index].clinicDescription,
.patientLabOrdersList[index].doctorImageURL, appointmentDate: model.patientLabOrdersList[index].orderDate,
branch:
model.patientLabOrdersList[index].projectName,
clinic: model
.patientLabOrdersList[index].clinicDescription,
appointmentDate:
model.patientLabOrdersList[index].orderDate.add(Duration(days: 1)),
orderNo: model.patientLabOrdersList[index].orderNo, orderNo: model.patientLabOrdersList[index].orderNo,
isShowTime: false, isShowTime: false,
), ),
@ -216,8 +195,7 @@ class _LabsHomePageState extends State<LabsHomePage> {
), ),
), ),
), ),
if (model.patientLabOrdersList.isEmpty && if (model.patientLabOrdersList.isEmpty && patient.patientStatusType != 43)
patient.patientStatusType != 43)
Center( Center(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,

@ -75,6 +75,7 @@ class RadiologyDetailsPage extends StatelessWidget {
child: AppText( child: AppText(
'${finalRadiology.reportData.trim()}', '${finalRadiology.reportData.trim()}',
textAlign: TextAlign.start, textAlign: TextAlign.start,
isCopyable: true,
fontSize: 17, fontSize: 17,
color: Color(0xff575757), color: Color(0xff575757),
), ),

@ -12,8 +12,7 @@ import 'package:url_launcher/url_launcher.dart';
import 'large_avatar.dart'; import 'large_avatar.dart';
class PatientProfileAppBar extends StatelessWidget class PatientProfileAppBar extends StatelessWidget with PreferredSizeWidget {
with PreferredSizeWidget {
final PatiantInformtion patient; final PatiantInformtion patient;
final double height; final double height;
final bool isInpatient; final bool isInpatient;
@ -35,8 +34,7 @@ class PatientProfileAppBar extends StatelessWidget
final bool isFromLabResult; final bool isFromLabResult;
final VoidCallback onPressed; final VoidCallback onPressed;
PatientProfileAppBar( PatientProfileAppBar(this.patient,
this.patient,
{this.height = 0.0, {this.height = 0.0,
this.isInpatient = false, this.isInpatient = false,
this.isDischargedPatient = false, this.isDischargedPatient = false,
@ -53,8 +51,8 @@ class PatientProfileAppBar extends StatelessWidget
this.episode, this.episode,
this.visitDate, this.visitDate,
this.isAppointmentHeader = false, this.isAppointmentHeader = false,
this.isFromLabResult = false, this.onPressed}); this.isFromLabResult = false,
this.onPressed});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -73,51 +71,44 @@ class PatientProfileAppBar extends StatelessWidget
right: 5, right: 5,
bottom: 5, bottom: 5,
), ),
decoration: BoxDecoration( decoration: BoxDecoration(color: Colors.white, border: Border(bottom: BorderSide(color: Color(0xFFEFEFEF)))),
color: Colors.white,
border: Border( bottom: BorderSide(color:Color(0xFFEFEFEF)))
),
child: Container( child: Container(
padding: EdgeInsets.only(left: 10, right: 10, bottom: 10), padding: EdgeInsets.only(left: 10, right: 10, bottom: 10),
margin: EdgeInsets.only(top: SizeConfig.isHeightVeryShort ? 30 : 50),
margin: EdgeInsets.only(top: SizeConfig.isHeightVeryShort?30: 50),
child: Column( child: Column(
children: [ children: [
Container( Container(
padding: EdgeInsets.only(left: SizeConfig.isHeightVeryShort?0: 12.0), padding: EdgeInsets.only(left: SizeConfig.isHeightVeryShort ? 0 : 12.0),
child: Row(children: [ child: Row(children: [
IconButton( IconButton(
icon: Icon(Icons.arrow_back_ios), icon: Icon(Icons.arrow_back_ios),
color: Color(0xFF2B353E), //Colors.black, color: Color(0xFF2B353E), //Colors.black,
onPressed: () { onPressed: () {
if(onPressed!=null) if (onPressed != null) onPressed();
onPressed(); Navigator.pop(context);
Navigator.pop(context);
}, },
), ),
Expanded( Expanded(
child: AppText( child: AppText(
patient.firstName != null patient.firstName != null
? (Helpers.capitalize(patient.firstName) + ? (Helpers.capitalize(patient.firstName) + " " + Helpers.capitalize(patient.lastName))
" " + : Helpers.capitalize(patient.fullName ?? patient.patientDetails.fullName),
Helpers.capitalize(patient.lastName))
: Helpers.capitalize(patient.fullName??patient.patientDetails.fullName),
fontSize: SizeConfig.textMultiplier * 1.8, fontSize: SizeConfig.textMultiplier * 1.8,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontFamily: 'Poppins', fontFamily: 'Poppins',
color: Color(0xFF2B353E), color: Color(0xFF2B353E),
isCopyable: true,
), ),
), ),
gender == 1 gender == 1
? Icon( ? Icon(
DoctorApp.male_2, DoctorApp.male_2,
color: Colors.blue, color: Colors.blue,
) )
: Icon( : Icon(
DoctorApp.female_1, DoctorApp.female_1,
color: Colors.pink, color: Colors.pink,
), ),
Container( Container(
margin: EdgeInsets.symmetric(horizontal: 4), margin: EdgeInsets.symmetric(horizontal: 4),
child: InkWell( child: InkWell(
@ -134,14 +125,12 @@ class PatientProfileAppBar extends StatelessWidget
), ),
Row(children: [ Row(children: [
Padding( Padding(
padding: EdgeInsets.only(left: SizeConfig.isHeightVeryShort?0: 12.0), padding: EdgeInsets.only(left: SizeConfig.isHeightVeryShort ? 0 : 12.0),
child: Container( child: Container(
width: SizeConfig.getTextMultiplierBasedOnWidth()*20, width: SizeConfig.getTextMultiplierBasedOnWidth() * 20,
height: SizeConfig.getTextMultiplierBasedOnWidth()*20, height: SizeConfig.getTextMultiplierBasedOnWidth() * 20,
child: Image.asset( child: Image.asset(
gender == 1 gender == 1 ? 'assets/images/male_avatar.png' : 'assets/images/female_avatar.png',
? 'assets/images/male_avatar.png'
: 'assets/images/female_avatar.png',
fit: BoxFit.cover, fit: BoxFit.cover,
), ),
), ),
@ -155,33 +144,28 @@ class PatientProfileAppBar extends StatelessWidget
children: [ children: [
patient.patientStatusType != null patient.patientStatusType != null
? Container( ? Container(
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
patient.patientStatusType == 43 patient.patientStatusType == 43
? AppText( ? AppText(
TranslationBase TranslationBase.of(context).arrivedP,
.of(context) color: Colors.green,
.arrivedP, fontWeight: FontWeight.bold,
color: Colors.green, fontFamily: 'Poppins',
fontWeight: FontWeight.bold, fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5,
fontFamily: 'Poppins', )
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.5,
)
: AppText( : AppText(
TranslationBase.of(context).notArrived, TranslationBase.of(context).notArrived,
color: Colors.red[800], color: Colors.red[800],
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.5, fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5,
), ),
patient.startTime != null patient.startTime != null
? AppText( ? AppText(patient.startTime != null ? patient.startTime : '',
patient.startTime != null
? patient.startTime
: '',
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.5, fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5,
color: Color(0xFF2E303A)) color: Color(0xFF2E303A))
: SizedBox() : SizedBox()
], ],
@ -194,17 +178,17 @@ class PatientProfileAppBar extends StatelessWidget
Row( Row(
children: [ children: [
AppText( AppText(
TranslationBase TranslationBase.of(context).fileNumber,
.of(context) fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3,
.fileNumber,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3,
color: Color(0xFF575757), color: Color(0xFF575757),
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
), ),
SizedBox(width: 1,), SizedBox(
width: 1,
),
AppText( AppText(
patient.patientId.toString(), patient.patientId.toString(),
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.5, fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5,
color: Color(0xFF2E303A), color: Color(0xFF2E303A),
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
isCopyable: true, isCopyable: true,
@ -214,23 +198,21 @@ class PatientProfileAppBar extends StatelessWidget
Row( Row(
children: [ children: [
AppText( AppText(
patient.nationalityName ?? patient.nationality?? patient.nationalityId ?? '', patient.nationalityName ?? patient.nationality ?? patient.nationalityId ?? '',
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.5, fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5,
), ),
patient.nationalityFlagURL != null patient.nationalityFlagURL != null
? ClipRRect( ? ClipRRect(
borderRadius: BorderRadius.circular(20.0), borderRadius: BorderRadius.circular(20.0),
child: Image.network( child: Image.network(
patient.nationalityFlagURL, patient.nationalityFlagURL,
height: 25, height: 25,
width: 30, width: 30,
errorBuilder: (BuildContext context, errorBuilder: (BuildContext context, Object exception, StackTrace stackTrace) {
Object exception, return Text('No Image');
StackTrace stackTrace) { },
return Text('No Image'); ))
},
))
: SizedBox() : SizedBox()
], ],
) )
@ -246,35 +228,32 @@ class PatientProfileAppBar extends StatelessWidget
), ),
children: <TextSpan>[ children: <TextSpan>[
new TextSpan( new TextSpan(
text: TranslationBase text: TranslationBase.of(context).age + " : ",
.of(context) style: TextStyle(
.age + " : ", fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3,
style: TextStyle(fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3, fontWeight: FontWeight.w600,color: Color(0xFF575757),)), fontWeight: FontWeight.w600,
color: Color(0xFF575757),
)),
new TextSpan( new TextSpan(
text: text:
"${AppDateUtils.getAgeByBirthday( "${AppDateUtils.getAgeByBirthday(patient.patientDetails != null ? patient.patientDetails.dateofBirth ?? "" : patient.dateofBirth ?? "", context, isServerFormat: !isFromLiveCare)}",
patient.patientDetails != null
? patient.patientDetails.dateofBirth ??
""
: patient.dateofBirth ?? "", context,
isServerFormat: !isFromLiveCare)}",
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.5, fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5,
color: Color(0xFF2E303A),)), color: Color(0xFF2E303A),
)),
], ],
), ),
), ),
), ),
if ( patient.appointmentDate != null && patient.appointmentDate.isNotEmpty && !isFromLabResult) if (patient.appointmentDate != null && patient.appointmentDate.isNotEmpty && !isFromLabResult)
Row( Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[ children: <Widget>[
AppText( AppText(
TranslationBase.of(context).appointmentDate + TranslationBase.of(context).appointmentDate + " : ",
" : ", fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3,
color: Color(0xFF575757), color: Color(0xFF575757),
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontFamily: 'Poppins', fontFamily: 'Poppins',
@ -283,13 +262,10 @@ class PatientProfileAppBar extends StatelessWidget
width: 3.5, width: 3.5,
), ),
AppText( AppText(
AppDateUtils AppDateUtils.getDayMonthYearDateFormatted(
.getDayMonthYearDateFormatted( AppDateUtils.convertStringToDate(patient.appointmentDate)),
AppDateUtils.convertStringToDate(
patient.appointmentDate))
,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.5, fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5,
color: Color(0xFF2E303A), color: Color(0xFF2E303A),
), ),
SizedBox( SizedBox(
@ -297,105 +273,96 @@ class PatientProfileAppBar extends StatelessWidget
) )
], ],
), ),
if(isFromLabResult)Container( if (isFromLabResult)
child: RichText( Container(
text: new TextSpan( child: RichText(
style: new TextStyle( text: new TextSpan(
fontSize: 1.6 * SizeConfig.textMultiplier, style: new TextStyle(
color: Colors.black, fontSize: 1.6 * SizeConfig.textMultiplier,
fontFamily: 'Poppins', color: Colors.black,
fontFamily: 'Poppins',
),
children: <TextSpan>[
new TextSpan(
text: "Result Date: ",
style: TextStyle(
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3,
color: Color(0xFF575757),
fontWeight: FontWeight.w600,
fontFamily: 'Poppins',
)),
new TextSpan(
text:
'${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate, isArabic: projectViewModel.isArabic)}',
style: TextStyle(fontWeight: FontWeight.w700, fontSize: 12)),
],
), ),
children: <TextSpan>[
new TextSpan(
text: "Result Date: ",
style: TextStyle( fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3,
color: Color(0xFF575757),
fontWeight: FontWeight.w600,
fontFamily: 'Poppins',)),
new TextSpan(
text:
'${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate, isArabic: projectViewModel.isArabic)}',
style: TextStyle(
fontWeight: FontWeight.w700, fontSize: 12)),
],
), ),
), ),
),
// if(isInpatient) // if(isInpatient)
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
if(patient.admissionDate != null && patient.admissionDate.isNotEmpty) if (patient.admissionDate != null && patient.admissionDate.isNotEmpty)
Container( Container(
child: RichText( child: RichText(
text: new TextSpan( text: new TextSpan(
style: new TextStyle( style: new TextStyle(
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3, fontWeight: FontWeight.w600,color: Color(0xFF575757), fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3,
fontWeight: FontWeight.w600,
color: Color(0xFF575757),
fontFamily: 'Poppins', fontFamily: 'Poppins',
), ),
children: <TextSpan>[ children: <TextSpan>[
new TextSpan( new TextSpan(
text: patient.admissionDate == null text: patient.admissionDate == null
? "" ? ""
: TranslationBase.of(context) : TranslationBase.of(context).admissionDate + " : ",
.admissionDate + style: TextStyle(fontSize: 10)),
" : ", new TextSpan(
style: TextStyle(fontSize: 10)), text: patient.admissionDate == null
new TextSpan( ? ""
text: patient.admissionDate == null : "${AppDateUtils.getDayMonthYearDateFormatted((AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate.toString())))}",
? "" style: TextStyle(
: "${AppDateUtils fontWeight: FontWeight.w700,
.getDayMonthYearDateFormatted( fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5,
(AppDateUtils color: Color(0xFF2E303A),
.getDateTimeFromServerFormat( )),
patient.admissionDate ]))),
.toString())))}", if (patient.admissionDate != null)
style: TextStyle( Row(
fontWeight: FontWeight.w700, children: [
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.5, AppText(
color: Color(0xFF2E303A),)), "${TranslationBase.of(context).numOfDays}: ",
]))), fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3,
if (patient.admissionDate != null) fontWeight: FontWeight.w600,
Row( color: Color(0xFF575757),
children: [ isCopyable: true,
),
if (isDischargedPatient && patient.dischargeDate != null)
AppText(
"${AppDateUtils.getDateTimeFromServerFormat(patient.dischargeDate).difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}",
fontWeight: FontWeight.w700,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5,
color: Color(0xFF2E303A),
)
else
AppText( AppText(
"${TranslationBase.of(context).numOfDays}: ", "${DateTime.now().difference(AppDateUtils.getDateTimeFromServerFormat(patient.admissionDate)).inDays + 1}",
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3, fontWeight: FontWeight.w600,color: Color(0xFF575757) fontWeight: FontWeight.w700,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5,
color: Color(0xFF2E303A),
isCopyable: true,
), ),
if(isDischargedPatient && ],
patient.dischargeDate != null) ),
AppText( ],
"${AppDateUtils ),
.getDateTimeFromServerFormat(
patient.dischargeDate)
.difference(AppDateUtils
.getDateTimeFromServerFormat(
patient.admissionDate))
.inDays + 1}",
fontWeight: FontWeight.w700,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.5,
color: Color(0xFF2E303A),
)
else
AppText(
"${DateTime
.now()
.difference(AppDateUtils
.getDateTimeFromServerFormat(
patient.admissionDate))
.inDays + 1}",
fontWeight: FontWeight.w700,
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.5,
color: Color(0xFF2E303A),),
],
),
],
),
], ],
), ),
), ),
]), ]),
if(isAppointmentHeader) if (isAppointmentHeader)
Row( Row(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -403,16 +370,12 @@ class PatientProfileAppBar extends StatelessWidget
width: 30, width: 30,
height: 30, height: 30,
margin: EdgeInsets.only( margin: EdgeInsets.only(
left: projectViewModel.isArabic ? 10 : 85, left: projectViewModel.isArabic ? 10 : 85, right: projectViewModel.isArabic ? 85 : 10, top: 5),
right: projectViewModel.isArabic ? 85 : 10,
top: 5),
decoration: BoxDecoration( decoration: BoxDecoration(
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
border: Border( border: Border(
bottom: BorderSide( bottom: BorderSide(color: Colors.grey[400], width: 2.5),
color: Colors.grey[400], width: 2.5), left: BorderSide(color: Colors.grey[400], width: 2.5),
left: BorderSide(
color: Colors.grey[400], width: 2.5),
)), )),
), ),
Expanded( Expanded(
@ -430,105 +393,105 @@ class PatientProfileAppBar extends StatelessWidget
height: 25, height: 25,
margin: EdgeInsets.only(top: 10), margin: EdgeInsets.only(top: 10),
), ),
Expanded( Expanded(
flex: 5, flex: 5,
child: Container( child: Container(
margin: EdgeInsets.all(10), margin: EdgeInsets.all(10),
child: Column( child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[
crossAxisAlignment: CrossAxisAlignment AppText(
.start, '${TranslationBase.of(context).dr}$doctorName',
children: <Widget>[ color: Color(0xFF2E303A),
AppText( fontWeight: FontWeight.w700,
'${TranslationBase fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5,
.of(context) ),
.dr}$doctorName', if (orderNo != null && !isPrescriptions)
color: Color(0xFF2E303A), Row(
fontWeight: FontWeight.w700, children: <Widget>[
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.5, AppText(
), 'Order No: ',
if (orderNo != null && fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3,
!isPrescriptions) fontWeight: FontWeight.w600,
Row( color: Color(0xFF575757),
children: <Widget>[
AppText('Order No: ',
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3, fontWeight: FontWeight.w600,color: Color(0xFF575757),),
AppText(orderNo ?? '',
fontSize: 12)
],
), ),
if (invoiceNO != null && AppText(orderNo ?? '', fontSize: 12)
!isPrescriptions) ],
Row( ),
children: <Widget>[ if (invoiceNO != null && !isPrescriptions)
AppText('Invoice: ', Row(
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3, fontWeight: FontWeight.w600,color: Color(0xFF575757),), children: <Widget>[
AppText(invoiceNO ?? "", AppText(
fontSize: 12) 'Invoice: ',
], fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3,
fontWeight: FontWeight.w600,
color: Color(0xFF575757),
), ),
if (branch != null) AppText(invoiceNO ?? "", fontSize: 12)
Row( ],
children: [ ),
AppText('Branch: ', if (branch != null)
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3, fontWeight: FontWeight.w600,color: Color(0xFF575757),), Row(
AppText(branch ?? '', children: [
fontSize: 12) AppText(
], 'Branch: ',
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3,
fontWeight: FontWeight.w600,
color: Color(0xFF575757),
), ),
AppText(branch ?? '', fontSize: 12)
if (clinic != null) ],
Row( ),
children: [ if (clinic != null)
AppText('Clinic: ', Row(
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3, fontWeight: FontWeight.w600,color: Color(0xFF575757),), children: [
AppText(clinic ?? '', AppText(
fontSize: 12) 'Clinic: ',
], fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3,
fontWeight: FontWeight.w600,
color: Color(0xFF575757),
), ),
if (isMedicalFile && AppText(clinic ?? '', fontSize: 12)
episode != null) ],
Row( ),
children: [ if (isMedicalFile && episode != null)
AppText('Episode: ', Row(
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3, fontWeight: FontWeight.w600,color: Color(0xFF575757),), children: [
AppText(episode ?? '', AppText(
fontSize: 12) 'Episode: ',
], fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3,
fontWeight: FontWeight.w600,
color: Color(0xFF575757),
), ),
if (isMedicalFile && AppText(episode ?? '', fontSize: 12)
visitDate != null) ],
Row( ),
children: [ if (isMedicalFile && visitDate != null)
AppText('Visit Date: ', Row(
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3, fontWeight: FontWeight.w600,color: Color(0xFF575757),), children: [
AppText(visitDate ?? '', AppText(
fontSize: 12) 'Visit Date: ',
], fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3,
fontWeight: FontWeight.w600,
color: Color(0xFF575757),
), ),
if (!isMedicalFile) AppText(visitDate ?? '', fontSize: 12)
Row( ],
),
children: <Widget>[ if (!isMedicalFile)
AppText( Row(
!isPrescriptions children: <Widget>[
? 'Result Date:' AppText(
: 'Prescriptions Date ', !isPrescriptions ? 'Result Date:' : 'Prescriptions Date ',
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3, fontWeight: FontWeight.w600,color: Color(0xFF575757), fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3,
), fontWeight: FontWeight.w600,
AppText( color: Color(0xFF575757),
'${AppDateUtils ),
.getDayMonthYearDateFormatted( AppText(
appointmentDate, '${AppDateUtils.getDayMonthYearDateFormatted(appointmentDate, isArabic: projectViewModel.isArabic)}',
isArabic: projectViewModel fontSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5,
.isArabic)}',
fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3.5,
)
],
) )
]), ],
)
]),
), ),
), ),
], ],
@ -542,9 +505,19 @@ class PatientProfileAppBar extends StatelessWidget
), ),
); );
} }
@override @override
Size get preferredSize => Size get preferredSize => Size(
Size(double.maxFinite, height == 0 double.maxFinite,
? isInpatient ? (isFromLabResult?200:190) : isAppointmentHeader ? 290 : SizeConfig.isHeightVeryShort?137:SizeConfig.isHeightShort?190: SizeConfig.heightMultiplier * (SizeConfig.isWidthLarge?25:20) height == 0
? isInpatient
? (isFromLabResult ? 200 : 190)
: isAppointmentHeader
? 290
: SizeConfig.isHeightVeryShort
? 137
: SizeConfig.isHeightShort
? 190
: SizeConfig.heightMultiplier * (SizeConfig.isWidthLarge ? 25 : 20)
: height); : height);
} }

@ -62,7 +62,7 @@ class AppText extends StatefulWidget {
this.textOverflow, this.textOverflow,
this.textDecoration, this.textDecoration,
this.letterSpacing, this.letterSpacing,
this.isCopyable = true, this.isCopyable = false,
}); });
@override @override
@ -103,10 +103,7 @@ class _AppTextState extends State<AppText> {
margin: widget.margin != null margin: widget.margin != null
? EdgeInsets.all(widget.margin) ? EdgeInsets.all(widget.margin)
: EdgeInsets.only( : EdgeInsets.only(
top: widget.marginTop, top: widget.marginTop, right: widget.marginRight, bottom: widget.marginBottom, left: widget.marginLeft),
right: widget.marginRight,
bottom: widget.marginBottom,
left: widget.marginLeft),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -121,21 +118,16 @@ class _AppTextState extends State<AppText> {
right: 0, right: 0,
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
gradient: LinearGradient( gradient: LinearGradient(colors: [
colors: [ Theme.of(context).backgroundColor,
Theme.of(context).backgroundColor, Theme.of(context).backgroundColor.withOpacity(0),
Theme.of(context).backgroundColor.withOpacity(0), ], begin: Alignment.bottomCenter, end: Alignment.topCenter)),
],
begin: Alignment.bottomCenter,
end: Alignment.topCenter)),
height: 30, height: 30,
), ),
) )
], ],
), ),
if (widget.allowExpand && if (widget.allowExpand && widget.readMore && text.length > widget.maxLength)
widget.readMore &&
text.length > widget.maxLength)
Padding( Padding(
padding: EdgeInsets.only(top: 8.0, right: 8.0, bottom: 8.0), padding: EdgeInsets.only(top: 8.0, right: 8.0, bottom: 8.0),
child: InkWell( child: InkWell(
@ -172,13 +164,7 @@ class _AppTextState extends State<AppText> {
), ),
child: Container( child: Container(
child: SelectableText( child: SelectableText(
!hidden !hidden ? text : (text.substring(0, text.length > widget.maxLength ? widget.maxLength : text.length)),
? text
: (text.substring(
0,
text.length > widget.maxLength
? widget.maxLength
: text.length)),
textAlign: widget.textAlign, textAlign: widget.textAlign,
// overflow: widget.maxLines != null // overflow: widget.maxLines != null
// ? ((widget.maxLines > 1) // ? ((widget.maxLines > 1)
@ -196,8 +182,7 @@ class _AppTextState extends State<AppText> {
fontStyle: widget.italic ? FontStyle.italic : null, fontStyle: widget.italic ? FontStyle.italic : null,
color: widget.color != null ? widget.color : Colors.black, color: widget.color != null ? widget.color : Colors.black,
fontSize: widget.fontSize ?? _getFontSize(), fontSize: widget.fontSize ?? _getFontSize(),
letterSpacing: widget.letterSpacing ?? letterSpacing: widget.letterSpacing ?? (widget.variant == "overline" ? 1.5 : null),
(widget.variant == "overline" ? 1.5 : null),
fontWeight: widget.fontWeight ?? _getFontWeight(), fontWeight: widget.fontWeight ?? _getFontWeight(),
fontFamily: widget.fontFamily ?? 'Poppins', fontFamily: widget.fontFamily ?? 'Poppins',
decoration: widget.textDecoration, decoration: widget.textDecoration,
@ -207,19 +192,9 @@ class _AppTextState extends State<AppText> {
); );
} else { } else {
return Text( return Text(
!hidden !hidden ? text : (text.substring(0, text.length > widget.maxLength ? widget.maxLength : text.length)),
? text
: (text.substring(
0,
text.length > widget.maxLength
? widget.maxLength
: text.length)),
textAlign: widget.textAlign, textAlign: widget.textAlign,
overflow: widget.maxLines != null overflow: widget.maxLines != null ? ((widget.maxLines > 1) ? TextOverflow.fade : TextOverflow.ellipsis) : null,
? ((widget.maxLines > 1)
? TextOverflow.fade
: TextOverflow.ellipsis)
: null,
maxLines: widget.maxLines ?? null, maxLines: widget.maxLines ?? null,
style: widget.style != null style: widget.style != null
? _getFontStyle().copyWith( ? _getFontStyle().copyWith(
@ -231,8 +206,7 @@ class _AppTextState extends State<AppText> {
fontStyle: widget.italic ? FontStyle.italic : null, fontStyle: widget.italic ? FontStyle.italic : null,
color: widget.color != null ? widget.color : Colors.black, color: widget.color != null ? widget.color : Colors.black,
fontSize: widget.fontSize ?? _getFontSize(), fontSize: widget.fontSize ?? _getFontSize(),
letterSpacing: widget.letterSpacing ?? letterSpacing: widget.letterSpacing ?? (widget.variant == "overline" ? 1.5 : null),
(widget.variant == "overline" ? 1.5 : null),
fontWeight: widget.fontWeight ?? _getFontWeight(), fontWeight: widget.fontWeight ?? _getFontWeight(),
fontFamily: widget.fontFamily ?? 'Poppins', fontFamily: widget.fontFamily ?? 'Poppins',
decoration: widget.textDecoration, decoration: widget.textDecoration,

@ -664,7 +664,7 @@ packages:
name: meta name: meta
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.3.0-nullsafety.3" version: "1.3.0-nullsafety.4"
mime: mime:
dependency: transitive dependency: transitive
description: description:
@ -956,7 +956,7 @@ packages:
name: stack_trace name: stack_trace
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.10.0-nullsafety.1" version: "1.10.0-nullsafety.2"
sticky_headers: sticky_headers:
dependency: "direct main" dependency: "direct main"
description: description:
@ -1154,5 +1154,5 @@ packages:
source: hosted source: hosted
version: "2.2.1" version: "2.2.1"
sdks: sdks:
dart: ">=2.10.0 <2.11.0" dart: ">=2.10.0 <=2.11.0-213.1.beta"
flutter: ">=1.22.0 <2.0.0" flutter: ">=1.22.0 <2.0.0"

Loading…
Cancel
Save