diff --git a/lib/core/model/medical_file_model.dart b/lib/core/model/medical_file_model.dart index 0496d0eb..4e9d8f3e 100644 --- a/lib/core/model/medical_file_model.dart +++ b/lib/core/model/medical_file_model.dart @@ -1,9 +1,8 @@ class MedicalFileModel { List entityList; - int rowcount; - Null statusMessage; + dynamic statusMessage; - MedicalFileModel({this.entityList, this.rowcount, this.statusMessage}); + MedicalFileModel({this.entityList, this.statusMessage}); MedicalFileModel.fromJson(Map json) { if (json['entityList'] != null) { @@ -12,7 +11,6 @@ class MedicalFileModel { entityList.add(new EntityList.fromJson(v)); }); } - rowcount = json['rowcount']; statusMessage = json['statusMessage']; } @@ -21,57 +19,17 @@ class MedicalFileModel { if (this.entityList != null) { data['entityList'] = this.entityList.map((v) => v.toJson()).toList(); } - data['rowcount'] = this.rowcount; data['statusMessage'] = this.statusMessage; return data; } } class EntityList { - List admissions; - ClinicalSummary clinicalSummary; - List doctorWisePatientEpisodes; - List procedures; - List lstAllEpisodes; List timelines; - EntityList( - {this.admissions, - this.clinicalSummary, - this.doctorWisePatientEpisodes, - this.procedures, - this.lstAllEpisodes, - this.timelines}); + EntityList({this.timelines}); EntityList.fromJson(Map json) { - if (json['Admissions'] != null) { - admissions = new List(); - json['Admissions'].forEach((v) { - admissions.add(new Admissions.fromJson(v)); - }); - } - clinicalSummary = json['ClinicalSummary'] != null - ? new ClinicalSummary.fromJson(json['ClinicalSummary']) - : null; - if (json['DoctorWisePatientEpisodes'] != null) { - doctorWisePatientEpisodes = new List(); - json['DoctorWisePatientEpisodes'].forEach((v) { - doctorWisePatientEpisodes - .add(new DoctorWisePatientEpisodes.fromJson(v)); - }); - } - if (json['Procedures'] != null) { - procedures = new List(); - json['Procedures'].forEach((v) { - procedures.add(new Procedures.fromJson(v)); - }); - } - if (json['lstAllEpisodes'] != null) { - lstAllEpisodes = new List(); - json['lstAllEpisodes'].forEach((v) { - lstAllEpisodes.add(new LstAllEpisodes.fromJson(v)); - }); - } if (json['Timelines'] != null) { timelines = new List(); json['Timelines'].forEach((v) { @@ -82,23 +40,6 @@ class EntityList { Map toJson() { final Map data = new Map(); - if (this.admissions != null) { - data['Admissions'] = this.admissions.map((v) => v.toJson()).toList(); - } - if (this.clinicalSummary != null) { - data['ClinicalSummary'] = this.clinicalSummary.toJson(); - } - if (this.doctorWisePatientEpisodes != null) { - data['DoctorWisePatientEpisodes'] = - this.doctorWisePatientEpisodes.map((v) => v.toJson()).toList(); - } - if (this.procedures != null) { - data['Procedures'] = this.procedures.map((v) => v.toJson()).toList(); - } - if (this.lstAllEpisodes != null) { - data['lstAllEpisodes'] = - this.lstAllEpisodes.map((v) => v.toJson()).toList(); - } if (this.timelines != null) { data['Timelines'] = this.timelines.map((v) => v.toJson()).toList(); } @@ -106,89 +47,45 @@ class EntityList { } } -class Admissions { - String admissionDate; - int admissionNo; - String clinic; - String doctor; - int projectID; - String projectName; - String setupID; - List lstDischargeDiag; - - Admissions( - {this.admissionDate, - this.admissionNo, - this.clinic, - this.doctor, - this.projectID, - this.projectName, - this.setupID, - this.lstDischargeDiag}); - - Admissions.fromJson(Map json) { - admissionDate = json['AdmissionDate']; - admissionNo = json['AdmissionNo']; - clinic = json['Clinic']; - doctor = json['Doctor']; - projectID = json['ProjectID']; - projectName = json['ProjectName']; - setupID = json['SetupID']; - if (json['lstDischargeDiag'] != null) { - lstDischargeDiag = new List(); - json['lstDischargeDiag'].forEach((v) { - lstDischargeDiag.add(new LstDischargeDiag.fromJson(v)); - }); - } - } - - Map toJson() { - final Map data = new Map(); - data['AdmissionDate'] = this.admissionDate; - data['AdmissionNo'] = this.admissionNo; - data['Clinic'] = this.clinic; - data['Doctor'] = this.doctor; - data['ProjectID'] = this.projectID; - data['ProjectName'] = this.projectName; - data['SetupID'] = this.setupID; - if (this.lstDischargeDiag != null) { - data['lstDischargeDiag'] = - this.lstDischargeDiag.map((v) => v.toJson()).toList(); - } - return data; - } -} - -class LstDischargeDiag { - int admissionNo; - String codeID; - String description; - int dischargeNo; +class Timelines { + int clinicId; + String clinicName; + String date; + int doctorId; + String doctorImage; + String doctorName; + int encounterNumber; + String encounterType; int projectID; String projectName; - String remarks; String setupID; List timeLineEvents; - LstDischargeDiag( - {this.admissionNo, - this.codeID, - this.description, - this.dischargeNo, + Timelines( + {this.clinicId, + this.clinicName, + this.date, + this.doctorId, + this.doctorImage, + this.doctorName, + this.encounterNumber, + this.encounterType, this.projectID, this.projectName, - this.remarks, this.setupID, this.timeLineEvents}); - LstDischargeDiag.fromJson(Map json) { - admissionNo = json['AdmissionNo']; - codeID = json['CodeID']; - description = json['Description']; - dischargeNo = json['DischargeNo']; + Timelines.fromJson(Map json) { + clinicId = json['ClinicId']; + clinicName = json['ClinicName']; + date = json['Date']; + doctorId = json['DoctorId']; + doctorImage = json['DoctorImage']; + doctorName = json['DoctorName']; + encounterNumber = json['EncounterNumber']; + encounterType = json['EncounterType']; projectID = json['ProjectID']; projectName = json['ProjectName']; - remarks = json['Remarks']; setupID = json['SetupID']; if (json['TimeLineEvents'] != null) { timeLineEvents = new List(); @@ -200,13 +97,16 @@ class LstDischargeDiag { Map toJson() { final Map data = new Map(); - data['AdmissionNo'] = this.admissionNo; - data['CodeID'] = this.codeID; - data['Description'] = this.description; - data['DischargeNo'] = this.dischargeNo; + data['ClinicId'] = this.clinicId; + data['ClinicName'] = this.clinicName; + data['Date'] = this.date; + data['DoctorId'] = this.doctorId; + data['DoctorImage'] = this.doctorImage; + data['DoctorName'] = this.doctorName; + data['EncounterNumber'] = this.encounterNumber; + data['EncounterType'] = this.encounterType; data['ProjectID'] = this.projectID; data['ProjectName'] = this.projectName; - data['Remarks'] = this.remarks; data['SetupID'] = this.setupID; if (this.timeLineEvents != null) { data['TimeLineEvents'] = @@ -219,659 +119,32 @@ class LstDischargeDiag { class TimeLineEvents { List admissions; String colorClass; - List consulations; - String disPlayName; - Null doctorName; - ERData eRData; - int eventId; - String fullName; - String iconClass; - bool isDisabled; - List labOrders; - List radReports; - String toolTip; + List consulations; - TimeLineEvents( - {this.admissions, - this.colorClass, - this.consulations, - this.disPlayName, - this.doctorName, - this.eRData, - this.eventId, - this.fullName, - this.iconClass, - this.isDisabled, - this.labOrders, - this.radReports, - this.toolTip}); + TimeLineEvents({this.admissions, this.colorClass, this.consulations}); TimeLineEvents.fromJson(Map json) { - // if (json['Admissions'] != null) { - // admissions = new List(); - // json['Admissions'].forEach((v) { - // admissions.add(new Null.fromJson(v)); - // }); - // } - // colorClass = json['ColorClass']; - // if (json['Consulations'] != null) { - // consulations = new List(); - // json['Consulations'].forEach((v) { - // consulations.add(new Null.fromJson(v)); - // }); - // } - disPlayName = json['DisPlayName']; - doctorName = json['DoctorName']; - eRData = - json['ERData'] != null ? new ERData.fromJson(json['ERData']) : null; - eventId = json['EventId']; - fullName = json['FullName']; - iconClass = json['IconClass']; - isDisabled = json['IsDisabled']; - // if (json['LabOrders'] != null) { - // labOrders = new List(); - // json['LabOrders'].forEach((v) { - // labOrders.add(new Null.fromJson(v)); - // }); - // } - // if (json['RadReports'] != null) { - // radReports = new List(); - // json['RadReports'].forEach((v) { - // radReports.add(new Null.fromJson(v)); - // }); - // } - toolTip = json['ToolTip']; - } - - Map toJson() { - final Map data = new Map(); - // if (this.admissions != null) { - // data['Admissions'] = this.admissions.map((v) => v.toJson()).toList(); - // } - // data['ColorClass'] = this.colorClass; - // if (this.consulations != null) { - // data['Consulations'] = this.consulations.map((v) => v.toJson()).toList(); - // } - data['DisPlayName'] = this.disPlayName; - data['DoctorName'] = this.doctorName; - if (this.eRData != null) { - data['ERData'] = this.eRData.toJson(); - } - data['EventId'] = this.eventId; - data['FullName'] = this.fullName; - data['IconClass'] = this.iconClass; - data['IsDisabled'] = this.isDisabled; - // if (this.labOrders != null) { - // data['LabOrders'] = this.labOrders.map((v) => v.toJson()).toList(); - // } - // if (this.radReports != null) { - // data['RadReports'] = this.radReports.map((v) => v.toJson()).toList(); - // } - data['ToolTip'] = this.toolTip; - return data; - } -} - -class ERData { - List admissions; - List consulations; - List labOrders; - List radReports; - List lstErDischargeSummary; - - ERData( - {this.admissions, - this.consulations, - this.labOrders, - this.radReports, - this.lstErDischargeSummary}); - - ERData.fromJson(Map json) { - // if (json['Admissions'] != null) { - // admissions = new List(); - // json['Admissions'].forEach((v) { - // admissions.add(new Null.fromJson(v)); - // }); - // } - // if (json['Consulations'] != null) { - // consulations = new List(); - // json['Consulations'].forEach((v) { - // consulations.add(new Null.fromJson(v)); - // }); - // } - // if (json['LabOrders'] != null) { - // labOrders = new List(); - // json['LabOrders'].forEach((v) { - // labOrders.add(new Null.fromJson(v)); - // }); - // } - // if (json['RadReports'] != null) { - // radReports = new List(); - // json['RadReports'].forEach((v) { - // radReports.add(new Null.fromJson(v)); - // }); - // } - // if (json['lstErDischargeSummary'] != null) { - // lstErDischargeSummary = new List(); - // json['lstErDischargeSummary'].forEach((v) { - // lstErDischargeSummary.add(new Null.fromJson(v)); - // }); - // } - } - - Map toJson() { - final Map data = new Map(); - // if (this.admissions != null) { - // data['Admissions'] = this.admissions.map((v) => v.toJson()).toList(); - // } - // if (this.consulations != null) { - // data['Consulations'] = this.consulations.map((v) => v.toJson()).toList(); - // } - // if (this.labOrders != null) { - // data['LabOrders'] = this.labOrders.map((v) => v.toJson()).toList(); - // } - // if (this.radReports != null) { - // data['RadReports'] = this.radReports.map((v) => v.toJson()).toList(); - // } - // if (this.lstErDischargeSummary != null) { - // data['lstErDischargeSummary'] = - // this.lstErDischargeSummary.map((v) => v.toJson()).toList(); - // } - return data; - } -} - -class ClinicalSummary { - List labAbnormalResults; - List lstAllergy; - List lstComplaintsDetail; - List lstDiagnosis; - List lstEncounterHistory; - List lstMedication; - List lstPastHistory; - - ClinicalSummary( - {this.labAbnormalResults, - this.lstAllergy, - this.lstComplaintsDetail, - this.lstDiagnosis, - this.lstEncounterHistory, - this.lstMedication, - this.lstPastHistory}); - - ClinicalSummary.fromJson(Map json) { - if (json['LabAbnormalResults'] != null) { - labAbnormalResults = new List(); - json['LabAbnormalResults'].forEach((v) { - labAbnormalResults.add(new LabAbnormalResults.fromJson(v)); - }); - } - if (json['lstAllergy'] != null) { - lstAllergy = new List(); - json['lstAllergy'].forEach((v) { - lstAllergy.add(new LstAllergy.fromJson(v)); - }); - } - if (json['lstComplaintsDetail'] != null) { - lstComplaintsDetail = new List(); - json['lstComplaintsDetail'].forEach((v) { - lstComplaintsDetail.add(new LstComplaintsDetail.fromJson(v)); - }); - } - if (json['lstDiagnosis'] != null) { - lstDiagnosis = new List(); - json['lstDiagnosis'].forEach((v) { - lstDiagnosis.add(new LstDiagnosis.fromJson(v)); - }); - } - if (json['lstEncounterHistory'] != null) { - lstEncounterHistory = new List(); - json['lstEncounterHistory'].forEach((v) { - lstEncounterHistory.add(new LstEncounterHistory.fromJson(v)); - }); - } - if (json['lstMedication'] != null) { - lstMedication = new List(); - json['lstMedication'].forEach((v) { - lstMedication.add(new LstMedication.fromJson(v)); + colorClass = json['ColorClass']; + if (json['Consulations'] != null) { + consulations = new List(); + json['Consulations'].forEach((v) { + consulations.add(new Consulations.fromJson(v)); }); } - if (json['lstPastHistory'] != null) { - lstPastHistory = new List(); - json['lstPastHistory'].forEach((v) { - lstPastHistory.add(new LstPastHistory.fromJson(v)); - }); - } - } - - Map toJson() { - final Map data = new Map(); - if (this.labAbnormalResults != null) { - data['LabAbnormalResults'] = - this.labAbnormalResults.map((v) => v.toJson()).toList(); - } - if (this.lstAllergy != null) { - data['lstAllergy'] = this.lstAllergy.map((v) => v.toJson()).toList(); - } - if (this.lstComplaintsDetail != null) { - data['lstComplaintsDetail'] = - this.lstComplaintsDetail.map((v) => v.toJson()).toList(); - } - if (this.lstDiagnosis != null) { - data['lstDiagnosis'] = this.lstDiagnosis.map((v) => v.toJson()).toList(); - } - if (this.lstEncounterHistory != null) { - data['lstEncounterHistory'] = - this.lstEncounterHistory.map((v) => v.toJson()).toList(); - } - if (this.lstMedication != null) { - data['lstMedication'] = - this.lstMedication.map((v) => v.toJson()).toList(); - } - if (this.lstPastHistory != null) { - data['lstPastHistory'] = - this.lstPastHistory.map((v) => v.toJson()).toList(); - } - return data; - } -} - -class LabAbnormalResults { - String createdOn; - String description; - bool isPackage; - int orderNo; - int packageID; - String packageName; - int projectID; - String projectName; - String referenceRange; - double referenceRangeLow; - double referenceRangeHigh; - String resultCriticalFlag; - String resultValue; - String resultValueFlag; - String setupID; - String testCode; - int testID; - String verifiedOn; - bool isAbnormal; - bool isCritical; - String unit; - - LabAbnormalResults( - {this.createdOn, - this.description, - this.isPackage, - this.orderNo, - this.packageID, - this.packageName, - this.projectID, - this.projectName, - this.referenceRange, - this.referenceRangeLow, - this.referenceRangeHigh, - this.resultCriticalFlag, - this.resultValue, - this.resultValueFlag, - this.setupID, - this.testCode, - this.testID, - this.verifiedOn, - this.isAbnormal, - this.isCritical, - this.unit}); - - LabAbnormalResults.fromJson(Map json) { - createdOn = json['CreatedOn']; - description = json['Description']; - isPackage = json['IsPackage']; - orderNo = json['OrderNo']; - packageID = json['PackageID']; - packageName = json['PackageName']; - projectID = json['ProjectID']; - projectName = json['ProjectName']; - referenceRange = json['ReferenceRange']; - referenceRangeLow = json['ReferenceRange_Low']; - referenceRangeHigh = json['ReferenceRange_high']; - resultCriticalFlag = json['ResultCriticalFlag']; - resultValue = json['ResultValue']; - resultValueFlag = json['ResultValueFlag']; - setupID = json['SetupID']; - testCode = json['TestCode']; - testID = json['TestID']; - verifiedOn = json['VerifiedOn']; - isAbnormal = json['isAbnormal']; - isCritical = json['isCritical']; - unit = json['unit']; - } - - Map toJson() { - final Map data = new Map(); - data['CreatedOn'] = this.createdOn; - data['Description'] = this.description; - data['IsPackage'] = this.isPackage; - data['OrderNo'] = this.orderNo; - data['PackageID'] = this.packageID; - data['PackageName'] = this.packageName; - data['ProjectID'] = this.projectID; - data['ProjectName'] = this.projectName; - data['ReferenceRange'] = this.referenceRange; - data['ReferenceRange_Low'] = this.referenceRangeLow; - data['ReferenceRange_high'] = this.referenceRangeHigh; - data['ResultCriticalFlag'] = this.resultCriticalFlag; - data['ResultValue'] = this.resultValue; - data['ResultValueFlag'] = this.resultValueFlag; - data['SetupID'] = this.setupID; - data['TestCode'] = this.testCode; - data['TestID'] = this.testID; - data['VerifiedOn'] = this.verifiedOn; - data['isAbnormal'] = this.isAbnormal; - data['isCritical'] = this.isCritical; - data['unit'] = this.unit; - return data; - } -} - -class LstAllergy { - String allergy; - int projectID; - String projectName; - String setupID; - - LstAllergy({this.allergy, this.projectID, this.projectName, this.setupID}); - - LstAllergy.fromJson(Map json) { - allergy = json['Allergy']; - projectID = json['ProjectID']; - projectName = json['ProjectName']; - setupID = json['SetupID']; } Map toJson() { final Map data = new Map(); - data['Allergy'] = this.allergy; - data['ProjectID'] = this.projectID; - data['ProjectName'] = this.projectName; - data['SetupID'] = this.setupID; - return data; - } -} - -class LstComplaintsDetail { - String cCDate; - String createdBy; - String plainChiefComplaint; - int projectID; - String projectName; - String setupID; - String rtfChiefComplaint; - - LstComplaintsDetail( - {this.cCDate, - this.createdBy, - this.plainChiefComplaint, - this.projectID, - this.projectName, - this.setupID, - this.rtfChiefComplaint}); - - LstComplaintsDetail.fromJson(Map json) { - cCDate = json['CCDate']; - createdBy = json['CreatedBy']; - plainChiefComplaint = json['PlainChiefComplaint']; - projectID = json['ProjectID']; - projectName = json['ProjectName']; - setupID = json['SetupID']; - rtfChiefComplaint = json['rtfChiefComplaint']; - } - - Map toJson() { - final Map data = new Map(); - data['CCDate'] = this.cCDate; - data['CreatedBy'] = this.createdBy; - data['PlainChiefComplaint'] = this.plainChiefComplaint; - data['ProjectID'] = this.projectID; - data['ProjectName'] = this.projectName; - data['SetupID'] = this.setupID; - data['rtfChiefComplaint'] = this.rtfChiefComplaint; - return data; - } -} - -class LstDiagnosis { - String diagnosis; - int projectID; - String projectName; - String setupID; - String state; - String status; - - LstDiagnosis( - {this.diagnosis, - this.projectID, - this.projectName, - this.setupID, - this.state, - this.status}); - LstDiagnosis.fromJson(Map json) { - diagnosis = json['Diagnosis']; - projectID = json['ProjectID']; - projectName = json['ProjectName']; - setupID = json['SetupID']; - state = json['State']; - status = json['Status']; - } - - Map toJson() { - final Map data = new Map(); - data['Diagnosis'] = this.diagnosis; - data['ProjectID'] = this.projectID; - data['ProjectName'] = this.projectName; - data['SetupID'] = this.setupID; - data['State'] = this.state; - data['Status'] = this.status; - return data; - } -} - -class LstEncounterHistory { - String clinician; - String date; - String encounterType; - int projectID; - String projectName; - String reason; - String setupID; - String speciality; - String type; - - LstEncounterHistory( - {this.clinician, - this.date, - this.encounterType, - this.projectID, - this.projectName, - this.reason, - this.setupID, - this.speciality, - this.type}); - - LstEncounterHistory.fromJson(Map json) { - clinician = json['Clinician']; - date = json['Date']; - encounterType = json['EncounterType']; - projectID = json['ProjectID']; - projectName = json['ProjectName']; - reason = json['Reason']; - setupID = json['SetupID']; - speciality = json['Speciality']; - type = json['Type']; - } - - Map toJson() { - final Map data = new Map(); - data['Clinician'] = this.clinician; - data['Date'] = this.date; - data['EncounterType'] = this.encounterType; - data['ProjectID'] = this.projectID; - data['ProjectName'] = this.projectName; - data['Reason'] = this.reason; - data['SetupID'] = this.setupID; - data['Speciality'] = this.speciality; - data['Type'] = this.type; - return data; - } -} - -class LstMedication { - String date; - int doseDurationDays; - String lastFilled; - String medication; - String prescription; - int projectID; - String projectName; - String setupID; - String icon; - - LstMedication( - {this.date, - this.doseDurationDays, - this.lastFilled, - this.medication, - this.prescription, - this.projectID, - this.projectName, - this.setupID, - this.icon}); - - LstMedication.fromJson(Map json) { - date = json['Date']; - doseDurationDays = json['DoseDurationDays']; - lastFilled = json['LastFilled']; - medication = json['Medication']; - prescription = json['Prescription']; - projectID = json['ProjectID']; - projectName = json['ProjectName']; - setupID = json['SetupID']; - icon = json['icon']; - } - - Map toJson() { - final Map data = new Map(); - data['Date'] = this.date; - data['DoseDurationDays'] = this.doseDurationDays; - data['LastFilled'] = this.lastFilled; - data['Medication'] = this.medication; - data['Prescription'] = this.prescription; - data['ProjectID'] = this.projectID; - data['ProjectName'] = this.projectName; - data['SetupID'] = this.setupID; - data['icon'] = this.icon; - return data; - } -} - -class LstPastHistory { - String history; - String historyType; - String historyTypeID; - String historyTypeName; - int projectID; - String projectName; - String remarks; - String setupID; - - LstPastHistory( - {this.history, - this.historyType, - this.historyTypeID, - this.historyTypeName, - this.projectID, - this.projectName, - this.remarks, - this.setupID}); - - LstPastHistory.fromJson(Map json) { - history = json['History']; - historyType = json['HistoryType']; - historyTypeID = json['HistoryTypeID']; - historyTypeName = json['HistoryTypeName']; - projectID = json['ProjectID']; - projectName = json['ProjectName']; - remarks = json['Remarks']; - setupID = json['SetupID']; - } - - Map toJson() { - final Map data = new Map(); - data['History'] = this.history; - data['HistoryType'] = this.historyType; - data['HistoryTypeID'] = this.historyTypeID; - data['HistoryTypeName'] = this.historyTypeName; - data['ProjectID'] = this.projectID; - data['ProjectName'] = this.projectName; - data['Remarks'] = this.remarks; - data['SetupID'] = this.setupID; - return data; - } -} - -class DoctorWisePatientEpisodes { - String clinicName; - String lastVisitDate; - int projectID; - String projectName; - String setupID; - int doctorID; - String doctorName; - List lstEpisodes; - - DoctorWisePatientEpisodes( - {this.clinicName, - this.lastVisitDate, - this.projectID, - this.projectName, - this.setupID, - this.doctorID, - this.doctorName, - this.lstEpisodes}); - - DoctorWisePatientEpisodes.fromJson(Map json) { - clinicName = json['ClinicName']; - lastVisitDate = json['LastVisitDate']; - projectID = json['ProjectID']; - projectName = json['ProjectName']; - setupID = json['SetupID']; - doctorID = json['doctorID']; - doctorName = json['doctorName']; - if (json['lstEpisodes'] != null) { - lstEpisodes = new List(); - json['lstEpisodes'].forEach((v) { - lstEpisodes.add(new LstEpisodes.fromJson(v)); - }); - } - } - - Map toJson() { - final Map data = new Map(); - data['ClinicName'] = this.clinicName; - data['LastVisitDate'] = this.lastVisitDate; - data['ProjectID'] = this.projectID; - data['ProjectName'] = this.projectName; - data['SetupID'] = this.setupID; - data['doctorID'] = this.doctorID; - data['doctorName'] = this.doctorName; - if (this.lstEpisodes != null) { - data['lstEpisodes'] = this.lstEpisodes.map((v) => v.toJson()).toList(); + data['ColorClass'] = this.colorClass; + if (this.consulations != null) { + data['Consulations'] = this.consulations.map((v) => v.toJson()).toList(); } return data; } } -class LstEpisodes { +class Consulations { int admissionNo; String appointmentDate; int appointmentNo; @@ -894,8 +167,10 @@ class LstEpisodes { String dispalyName; List lstAssessments; List lstPhysicalExam; + List lstProcedure; + List lstMedicalHistory; - LstEpisodes( + Consulations( {this.admissionNo, this.appointmentDate, this.appointmentNo, @@ -917,9 +192,11 @@ class LstEpisodes { this.visitType, this.dispalyName, this.lstAssessments, - this.lstPhysicalExam}); + this.lstPhysicalExam, + this.lstProcedure, + this.lstMedicalHistory}); - LstEpisodes.fromJson(Map json) { + Consulations.fromJson(Map json) { admissionNo = json['AdmissionNo']; appointmentDate = json['AppointmentDate']; appointmentNo = json['AppointmentNo']; @@ -952,6 +229,18 @@ class LstEpisodes { lstPhysicalExam.add(new LstPhysicalExam.fromJson(v)); }); } + if (json['lstProcedure'] != null) { + lstProcedure = new List(); + json['lstProcedure'].forEach((v) { + lstProcedure.add(new LstProcedure.fromJson(v)); + }); + } + if (json['lstMedicalHistory'] != null) { + lstMedicalHistory = new List(); + json['lstMedicalHistory'].forEach((v) { + lstMedicalHistory.add(new LstMedicalHistory.fromJson(v)); + }); + } } Map toJson() { @@ -984,6 +273,13 @@ class LstEpisodes { data['lstPhysicalExam'] = this.lstPhysicalExam.map((v) => v.toJson()).toList(); } + if (this.lstProcedure != null) { + data['lstProcedure'] = this.lstProcedure.map((v) => v.toJson()).toList(); + } + if (this.lstMedicalHistory != null) { + data['lstMedicalHistory'] = + this.lstMedicalHistory.map((v) => v.toJson()).toList(); + } return data; } } @@ -1118,7 +414,7 @@ class LstPhysicalExam { } } -class Procedures { +class LstProcedure { int appointmentNo; int episodeID; String orderDate; @@ -1131,7 +427,7 @@ class Procedures { String setupID; String dispalyName; - Procedures( + LstProcedure( {this.appointmentNo, this.episodeID, this.orderDate, @@ -1144,7 +440,7 @@ class Procedures { this.setupID, this.dispalyName}); - Procedures.fromJson(Map json) { + LstProcedure.fromJson(Map json) { appointmentNo = json['AppointmentNo']; episodeID = json['EpisodeID']; orderDate = json['OrderDate']; @@ -1175,245 +471,59 @@ class Procedures { } } -class LstAllEpisodes { - int admissionNo; - String appointmentDate; +class LstMedicalHistory { int appointmentNo; - String appointmentType; - String clinicID; - String clinicName; - int doctorID; - String doctorName; - String endTime; - String episodeDate; + String checked; int episodeID; + String history; int patientID; + String patientType; int projectID; String projectName; String remarks; String setupID; - String startTime; - String visitFor; - String visitType; String dispalyName; - List lstAssessments; - List lstCheifComplaint; - List lstMedicalHistory; - List lstMedicine; - List lstPhysicalExam; - List lstProcedure; - List lstTreatmentPlan; - List lstVitalSign; - LstAllEpisodes( - {this.admissionNo, - this.appointmentDate, - this.appointmentNo, - this.appointmentType, - this.clinicID, - this.clinicName, - this.doctorID, - this.doctorName, - this.endTime, - this.episodeDate, + LstMedicalHistory( + {this.appointmentNo, + this.checked, this.episodeID, + this.history, this.patientID, + this.patientType, this.projectID, this.projectName, this.remarks, this.setupID, - this.startTime, - this.visitFor, - this.visitType, - this.dispalyName, - this.lstAssessments, - this.lstCheifComplaint, - this.lstMedicalHistory, - this.lstMedicine, - this.lstPhysicalExam, - this.lstProcedure, - this.lstTreatmentPlan, - this.lstVitalSign}); + this.dispalyName}); - LstAllEpisodes.fromJson(Map json) { - admissionNo = json['AdmissionNo']; - appointmentDate = json['AppointmentDate']; + LstMedicalHistory.fromJson(Map json) { appointmentNo = json['AppointmentNo']; - appointmentType = json['AppointmentType']; - clinicID = json['ClinicID']; - clinicName = json['ClinicName']; - doctorID = json['DoctorID']; - doctorName = json['DoctorName']; - endTime = json['EndTime']; - episodeDate = json['EpisodeDate']; + checked = json['Checked']; episodeID = json['EpisodeID']; + history = json['History']; patientID = json['PatientID']; + patientType = json['PatientType']; projectID = json['ProjectID']; projectName = json['ProjectName']; remarks = json['Remarks']; setupID = json['SetupID']; - startTime = json['StartTime']; - visitFor = json['VisitFor']; - visitType = json['VisitType']; dispalyName = json['dispalyName']; - // if (json['lstAssessments'] != null) { - // lstAssessments = new List(); - // json['lstAssessments'].forEach((v) { - // lstAssessments.add(new Null.fromJson(v)); - // }); - // } - // if (json['lstCheifComplaint'] != null) { - // lstCheifComplaint = new List(); - // json['lstCheifComplaint'].forEach((v) { - // lstCheifComplaint.add(new Null.fromJson(v)); - // }); - // } - // if (json['lstMedicalHistory'] != null) { - // lstMedicalHistory = new List(); - // json['lstMedicalHistory'].forEach((v) { - // lstMedicalHistory.add(new Null.fromJson(v)); - // }); - // } - // if (json['lstMedicine'] != null) { - // lstMedicine = new List(); - // json['lstMedicine'].forEach((v) { - // lstMedicine.add(new Null.fromJson(v)); - // }); - // } - // if (json['lstPhysicalExam'] != null) { - // lstPhysicalExam = new List(); - // json['lstPhysicalExam'].forEach((v) { - // lstPhysicalExam.add(new Null.fromJson(v)); - // }); - // } - // if (json['lstProcedure'] != null) { - // lstProcedure = new List(); - // json['lstProcedure'].forEach((v) { - // lstProcedure.add(new Null.fromJson(v)); - // }); - // } - // if (json['lstTreatmentPlan'] != null) { - // lstTreatmentPlan = new List(); - // json['lstTreatmentPlan'].forEach((v) { - // lstTreatmentPlan.add(new Null.fromJson(v)); - // }); - // } - // if (json['lstVitalSign'] != null) { - // lstVitalSign = new List(); - // json['lstVitalSign'].forEach((v) { - // lstVitalSign.add(new Null.fromJson(v)); - // }); - // } } Map toJson() { final Map data = new Map(); - data['AdmissionNo'] = this.admissionNo; - data['AppointmentDate'] = this.appointmentDate; data['AppointmentNo'] = this.appointmentNo; - data['AppointmentType'] = this.appointmentType; - data['ClinicID'] = this.clinicID; - data['ClinicName'] = this.clinicName; - data['DoctorID'] = this.doctorID; - data['DoctorName'] = this.doctorName; - data['EndTime'] = this.endTime; - data['EpisodeDate'] = this.episodeDate; + data['Checked'] = this.checked; data['EpisodeID'] = this.episodeID; + data['History'] = this.history; data['PatientID'] = this.patientID; + data['PatientType'] = this.patientType; data['ProjectID'] = this.projectID; data['ProjectName'] = this.projectName; data['Remarks'] = this.remarks; data['SetupID'] = this.setupID; - data['StartTime'] = this.startTime; - data['VisitFor'] = this.visitFor; - data['VisitType'] = this.visitType; data['dispalyName'] = this.dispalyName; - // if (this.lstAssessments != null) { - // data['lstAssessments'] = - // this.lstAssessments.map((v) => v.toJson()).toList(); - // } - // if (this.lstCheifComplaint != null) { - // data['lstCheifComplaint'] = - // this.lstCheifComplaint.map((v) => v.toJson()).toList(); - // } - // if (this.lstMedicalHistory != null) { - // data['lstMedicalHistory'] = - // this.lstMedicalHistory.map((v) => v.toJson()).toList(); - // } - // if (this.lstMedicine != null) { - // data['lstMedicine'] = this.lstMedicine.map((v) => v.toJson()).toList(); - // } - // if (this.lstPhysicalExam != null) { - // data['lstPhysicalExam'] = - // this.lstPhysicalExam.map((v) => v.toJson()).toList(); - // } - // if (this.lstProcedure != null) { - // data['lstProcedure'] = this.lstProcedure.map((v) => v.toJson()).toList(); - // } - // if (this.lstTreatmentPlan != null) { - // data['lstTreatmentPlan'] = - // this.lstTreatmentPlan.map((v) => v.toJson()).toList(); - // } - // if (this.lstVitalSign != null) { - // data['lstVitalSign'] = this.lstVitalSign.map((v) => v.toJson()).toList(); - // } - return data; - } -} - -class Timelines { - int clinicId; - String clinicName; - String date; - int doctorId; - String doctorImage; - String doctorName; - int encounterNumber; - String encounterType; - int projectID; - String projectName; - String setupID; - - Timelines( - {this.clinicId, - this.clinicName, - this.date, - this.doctorId, - this.doctorImage, - this.doctorName, - this.encounterNumber, - this.encounterType, - this.projectID, - this.projectName, - this.setupID}); - - Timelines.fromJson(Map json) { - clinicId = json['ClinicId']; - clinicName = json['ClinicName']; - date = json['Date']; - doctorId = json['DoctorId']; - doctorImage = json['DoctorImage']; - doctorName = json['DoctorName']; - encounterNumber = json['EncounterNumber']; - encounterType = json['EncounterType']; - projectID = json['ProjectID']; - projectName = json['ProjectName']; - setupID = json['SetupID']; - } - - Map toJson() { - final Map data = new Map(); - data['ClinicId'] = this.clinicId; - data['ClinicName'] = this.clinicName; - data['Date'] = this.date; - data['DoctorId'] = this.doctorId; - data['DoctorImage'] = this.doctorImage; - data['DoctorName'] = this.doctorName; - data['EncounterNumber'] = this.encounterNumber; - data['EncounterType'] = this.encounterType; - data['ProjectID'] = this.projectID; - data['ProjectName'] = this.projectName; - data['SetupID'] = this.setupID; return data; } } diff --git a/lib/core/service/medical_file_service.dart b/lib/core/service/medical_file_service.dart index 0f6af46a..f1ab6dcd 100644 --- a/lib/core/service/medical_file_service.dart +++ b/lib/core/service/medical_file_service.dart @@ -9,12 +9,13 @@ class MedicalFileService extends BaseService { List get medicalFileList => _medicalFileList; MedicalFileRequestModel _fileRequestModel = MedicalFileRequestModel( - patientMRN: 1231755, + //patientMRN: 1231755, vidaAuthTokenID: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMDAyIiwianRpIjoiNDM1MGNjZTYtYzc3MS00YjBiLThiNDItMGZhY2IzYzgxMjQ4IiwiZW1haWwiOiIiLCJpZCI6IjEwMDIiLCJOYW1lIjoiVEVNUCAtIERPQ1RPUiIsIkVtcGxveWVlSWQiOiI0NzA5IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiI0NzA5IiwiU0VTU0lPTklEIjoiMjE1OTYwNTQiLCJDbGluaWNJZCI6IjEiLCJyb2xlIjpbIkRPQ1RPUlMiLCJIRUFEIERPQ1RPUlMiLCJBRE1JTklTVFJBVE9SUyIsIlJFQ0VQVElPTklTVCIsIkVSIE5VUlNFIiwiRVIgUkVDRVBUSU9OSVNUIiwiUEhBUk1BQ1kgQUNDT1VOVCBTVEFGRiIsIlBIQVJNQUNZIE5VUlNFIiwiSU5QQVRJRU5UIFBIQVJNQUNJU1QiLCJBRE1JU1NJT04gU1RBRkYiLCJBUFBST1ZBTCBTVEFGRiIsIkNPTlNFTlQgIiwiTUVESUNBTCBSRVBPUlQgLSBTSUNLIExFQVZFIE1BTkFHRVIiXSwibmJmIjoxNjA5MjI1MjMwLCJleHAiOjE2MTAwODkyMzAsImlhdCI6MTYwOTIyNTIzMH0.rs7lTBQ1ON4PbR11PBkOyjf818DdeMKuqz2IrCJMYQU", ); - Future getMedicalFile() async { + Future getMedicalFile({int mrn}) async { + _fileRequestModel = MedicalFileRequestModel(patientMRN: mrn); hasError = false; _medicalFileList.clear(); await baseAppClient.post(GET_MEDICAL_FILE, diff --git a/lib/core/viewModel/medical_file_view_model.dart b/lib/core/viewModel/medical_file_view_model.dart index 0ef21095..67760908 100644 --- a/lib/core/viewModel/medical_file_view_model.dart +++ b/lib/core/viewModel/medical_file_view_model.dart @@ -12,11 +12,11 @@ class MedicalFileViewModel extends BaseViewModel { List get medicalFileList => _medicalFileService.medicalFileList; - Future getMedicalFile() async { + Future getMedicalFile({int mrn}) async { hasError = false; //_insuranceCardService.clearInsuranceCard(); setState(ViewState.Busy); - await _medicalFileService.getMedicalFile(); + await _medicalFileService.getMedicalFile(mrn: mrn); if (_medicalFileService.hasError) { error = _medicalFileService.error; setState(ViewState.ErrorLocal); diff --git a/lib/screens/medical-file/medical_file_details.dart b/lib/screens/medical-file/medical_file_details.dart index 4f966781..c916842c 100644 --- a/lib/screens/medical-file/medical_file_details.dart +++ b/lib/screens/medical-file/medical_file_details.dart @@ -8,6 +8,7 @@ import 'package:doctor_app_flutter/widgets/shared/Text.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/expandable-widget-header-body.dart'; +import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:flutter/material.dart'; @@ -16,21 +17,42 @@ class MedicalFileDetails extends StatefulWidget { String firstName; String lastName; String gender; - MedicalFileDetails({this.age, this.firstName, this.lastName, this.gender}); + int encounterNumber; + int pp; + + MedicalFileDetails( + {this.age, + this.firstName, + this.lastName, + this.gender, + this.encounterNumber, + this.pp}); @override _MedicalFileDetailsState createState() => _MedicalFileDetailsState( - firstName: firstName, age: age, lastName: lastName, gender: gender); + firstName: firstName, + age: age, + lastName: lastName, + gender: gender, + encounterNumber: encounterNumber, + pp: pp); } class _MedicalFileDetailsState extends State { + int encounterNumber; String age; String firstName; String lastName; String gender; + int pp; _MedicalFileDetailsState( - {this.age, this.firstName, this.lastName, this.gender}); + {this.age, + this.firstName, + this.lastName, + this.gender, + this.encounterNumber, + this.pp}); bool isPhysicalExam = false; bool isProcedureExpand = false; bool isHistoryExpand = false; @@ -39,386 +61,689 @@ class _MedicalFileDetailsState extends State { @override Widget build(BuildContext context) { return BaseView( - //onModelReady: (model) => model.getMedicalFile(), + onModelReady: (model) => model.getMedicalFile(mrn: pp), builder: (BuildContext context, MedicalFileViewModel model, Widget child) => AppScaffold( isShowAppBar: true, appBarTitle: 'medical file'.toUpperCase(), - body: SingleChildScrollView( - child: Container( - child: Column( - children: [ - Padding( - padding: EdgeInsets.all(8.0), - child: Row( - children: [ - AvatarWidget( - Icon( - gender == "Male" - ? DoctorApp.male - : DoctorApp.female_icon, - size: 70, - color: Colors.white, - ), - ), - SizedBox( - width: 20, - ), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - firstName + ' ' + lastName, - color: Colors.black, - fontWeight: FontWeight.bold, + body: NetworkBaseView( + baseViewModel: model, + child: SingleChildScrollView( + child: Container( + child: Column( + children: [ + Padding( + padding: EdgeInsets.all(8.0), + child: Row( + children: [ + AvatarWidget( + Icon( + gender == "Male" + ? DoctorApp.male + : DoctorApp.female_icon, + size: 70, + color: Colors.white, ), - Row( - children: [ - AppText( - TranslationBase.of(context).age2, - color: Colors.black, - fontWeight: FontWeight.bold, - ), - SizedBox( - width: 5.0, - ), - AppText( - age, - color: Colors.black, - fontWeight: FontWeight.normal, - ), - ], - ), - ], - ) - ], - ), - ), - Divider( - height: 1.0, - thickness: 1.0, - color: Colors.grey, - ), - Padding( - padding: EdgeInsets.all(10.0), - child: Container( - child: Column( - children: [ - Row( - children: [ - AppText( - 'Visit Date : ', - fontWeight: FontWeight.w700, - ), - AppText( - '23/12/2020', - ), - SizedBox(width: 35.0), - AppText( - 'Appt Date : ', - fontWeight: FontWeight.w700, - ), - AppText( - '23/12/2020', - ), - ], ), - Row( - children: [ - AppText( - 'Doctor : '.toUpperCase(), - fontWeight: FontWeight.w700, - ), - AppText( - 'Muhammad assad'.toUpperCase(), - fontWeight: FontWeight.w700, - ), - ], - ), - Row( - children: [ - AppText( - 'Clinic : ', - fontWeight: FontWeight.w700, - ), - AppText( - 'Gastroenterology', - ), - ], + SizedBox( + width: 20, ), - Row( + Column( + crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - 'Episode Number : ', - fontWeight: FontWeight.w700, + firstName + ' ' + lastName, + color: Colors.black, + fontWeight: FontWeight.bold, ), - AppText( - '200012334', + Row( + children: [ + AppText( + TranslationBase.of(context).age2, + color: Colors.black, + fontWeight: FontWeight.bold, + ), + SizedBox( + width: 5.0, + ), + AppText( + age, + color: Colors.black, + fontWeight: FontWeight.normal, + ), + ], ), ], - ), - SizedBox(height: 15.0), - Divider( - height: 1.0, - thickness: 1.0, - color: Colors.grey.shade400, - ), - SizedBox(height: 25.0), - HeaderBodyExpandableNotifier( - headerWidget: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Row( - children: [ - Texts( - 'History of present illness' - .toUpperCase(), - variant: - isHistoryExpand ? "bodyText" : '', - bold: isHistoryExpand ? true : false, - color: Colors.black), - ], - ), - InkWell( - onTap: () { - setState(() { - isHistoryExpand = !isHistoryExpand; - }); - }, - child: Icon(isHistoryExpand - ? EvaIcons.minus - : EvaIcons.plus)) - ], - ), - bodyWidget: Column( - children: [ - Texts( - 'Ms J. K. is an 83 year old retired nurse with a long history of hypertension that was previously well controlled on diuretic therapy. She was first admitted to CPMC in 1995 when she presented with a complaint of intermittent midsternal chest pain.') - ], - ), - isExpand: isHistoryExpand, - ), - SizedBox( - height: 30, - ), - Container( - width: double.infinity, - height: 1, - color: Color(0xffCCCCCC), - ), - SizedBox( - height: 30, - ), - HeaderBodyExpandableNotifier( - headerWidget: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, + ) + ], + ), + ), + Divider( + height: 1.0, + thickness: 1.0, + color: Colors.grey, + ), + Padding( + padding: EdgeInsets.all(10.0), + child: Container( + child: Column( + children: [ + Row( children: [ - Row( - children: [ - Texts('assessment'.toUpperCase(), - variant: - isAssessmentExpand ? "bodyText" : '', - bold: isAssessmentExpand ? true : false, - color: Colors.black), - ], + AppText( + 'Visit Date : ', + fontWeight: FontWeight.w700, ), - InkWell( - onTap: () { - setState(() { - isAssessmentExpand = !isAssessmentExpand; - }); - }, - child: Icon(isAssessmentExpand - ? EvaIcons.minus - : EvaIcons.plus)) + if (model.medicalFileList.length != 0) + AppText(model + .medicalFileList[0] + .entityList[0] + .timelines[encounterNumber] + .timeLineEvents[0] + .consulations[0] + .appointmentDate + .toString()), + SizedBox(width: 35.0), + // AppText( + // 'Appt Date : ', + // fontWeight: FontWeight.w700, + // ), + // AppText( + // '23/12/2020', + // ), ], ), - bodyWidget: Column( - children: [ - Texts('ssss'), - ], - ), - isExpand: isAssessmentExpand, - ), - SizedBox( - height: 30, - ), - Container( - width: double.infinity, - height: 1, - color: Color(0xffCCCCCC), - ), - SizedBox( - height: 30, - ), - HeaderBodyExpandableNotifier( - headerWidget: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, + Row( children: [ - Row( - children: [ - Texts('Test / procedures'.toUpperCase(), - variant: - isProcedureExpand ? "bodyText" : '', - bold: isProcedureExpand ? true : false, - color: Colors.black), - ], + AppText( + 'Doctor : '.toUpperCase(), + fontWeight: FontWeight.w700, ), - InkWell( - onTap: () { - setState(() { - isProcedureExpand = !isProcedureExpand; - }); - }, - child: Icon(isProcedureExpand - ? EvaIcons.minus - : EvaIcons.plus)) + if (model.medicalFileList.length != 0) + AppText( + model + .medicalFileList[0] + .entityList[0] + .timelines[encounterNumber] + .timeLineEvents[0] + .consulations[0] + .doctorName + .toUpperCase(), + fontWeight: FontWeight.w700, + ), ], ), - bodyWidget: Column( - children: [ - SizedBox( - height: 20.0, - ), - Row( - children: [ - AppText( - 'Exam Type : ', - fontWeight: FontWeight.w700, - ), - AppText( - '59', - ), - ], - ), - Row( - children: [ - AppText( - 'ABDOMEN', - fontWeight: FontWeight.w700, - ), - ], - ), - Row( - children: [ - AppText( - 'Abnormal: ', - fontWeight: FontWeight.w700, - ), - AppText( - 'no', - ), - ], - ), - SizedBox(height: 15.0), - Row( - children: [ + if (model.medicalFileList.length != 0) + Row( + children: [ + AppText( + 'Clinic : ', + fontWeight: FontWeight.w700, + ), + if (model.medicalFileList.length != 0) AppText( - 'Some short remark about the allergy', - fontWeight: FontWeight.w300, + model + .medicalFileList[0] + .entityList[0] + .timelines[encounterNumber] + .timeLineEvents[0] + .consulations[0] + .clinicName, ), - ], - ), - ], - ), - isExpand: isProcedureExpand, - ), - SizedBox( - height: 30, - ), - Container( - width: double.infinity, - height: 1, - color: Color(0xffCCCCCC), - ), - SizedBox( - height: 30, - ), - HeaderBodyExpandableNotifier( - headerWidget: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, + ], + ), + Row( children: [ - Row( - children: [ - Texts('physical exam'.toUpperCase(), - variant: isPhysicalExam ? "bodyText" : '', - bold: isPhysicalExam ? true : false, - color: Colors.black), - ], + AppText( + 'Episode Number : ', + fontWeight: FontWeight.w700, ), - InkWell( - onTap: () { - setState(() { - isPhysicalExam = !isPhysicalExam; - }); - }, - child: Icon(isPhysicalExam - ? EvaIcons.minus - : EvaIcons.plus)) + if (model.medicalFileList.length != 0) + AppText( + model + .medicalFileList[0] + .entityList[0] + .timelines[encounterNumber] + .timeLineEvents[0] + .consulations[0] + .episodeID + .toString(), + ), ], ), - bodyWidget: Column( - children: [ - SizedBox( - height: 20.0, - ), - Row( + SizedBox(height: 15.0), + Divider( + height: 1.0, + thickness: 1.0, + color: Colors.grey.shade400, + ), + SizedBox(height: 25.0), + if (model.medicalFileList.length != 0) + HeaderBodyExpandableNotifier( + headerWidget: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, children: [ - AppText( - 'Exam Type : ', - fontWeight: FontWeight.w700, - ), - AppText( - '59', + Row( + children: [ + Texts( + 'History of present illness' + .toUpperCase(), + variant: + isHistoryExpand ? "bodyText" : '', + bold: isHistoryExpand ? true : false, + color: Colors.black), + ], ), + InkWell( + onTap: () { + setState(() { + isHistoryExpand = !isHistoryExpand; + }); + }, + child: Icon(isHistoryExpand + ? EvaIcons.minus + : EvaIcons.plus)) ], ), - Row( + bodyWidget: ListView.builder( + //physics: , + scrollDirection: Axis.vertical, + shrinkWrap: true, + itemCount: model + .medicalFileList[0] + .entityList[0] + .timelines[encounterNumber] + .timeLineEvents[0] + .consulations[0] + .lstMedicalHistory + .length, + itemBuilder: (BuildContext ctxt, int index) { + return Padding( + padding: EdgeInsets.all(8.0), + child: Container( + child: Column( + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Row( + children: [ + Expanded( + child: AppText( + model + .medicalFileList[0] + .entityList[0] + .timelines[ + encounterNumber] + .timeLineEvents[0] + .consulations[0] + .lstMedicalHistory[ + index] + .history + .trim(), + ), + ), + SizedBox(width: 35.0), + ], + ), + ], + ), + ), + ); + }), + isExpand: isHistoryExpand, + ), + SizedBox( + height: 30, + ), + Container( + width: double.infinity, + height: 1, + color: Color(0xffCCCCCC), + ), + SizedBox( + height: 30, + ), + if (model.medicalFileList.length != 0) + HeaderBodyExpandableNotifier( + headerWidget: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, children: [ - AppText( - 'ABDOMEN', - fontWeight: FontWeight.w700, + Row( + children: [ + Texts('assessment'.toUpperCase(), + variant: isAssessmentExpand + ? "bodyText" + : '', + bold: + isAssessmentExpand ? true : false, + color: Colors.black), + ], ), + InkWell( + onTap: () { + setState(() { + isAssessmentExpand = + !isAssessmentExpand; + }); + }, + child: Icon(isAssessmentExpand + ? EvaIcons.minus + : EvaIcons.plus)) ], ), - Row( + bodyWidget: ListView.builder( + //physics: , + scrollDirection: Axis.vertical, + shrinkWrap: true, + itemCount: model + .medicalFileList[0] + .entityList[0] + .timelines[encounterNumber] + .timeLineEvents[0] + .consulations[0] + .lstAssessments + .length, + itemBuilder: (BuildContext ctxt, int index) { + return Padding( + padding: EdgeInsets.all(8.0), + child: Container( + child: Column( + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Row( + children: [ + AppText( + 'ICD', + fontWeight: FontWeight.w700, + ), + AppText( + model + .medicalFileList[0] + .entityList[0] + .timelines[ + encounterNumber] + .timeLineEvents[0] + .consulations[0] + .lstAssessments[index] + .iCD10 + .trim(), + ), + SizedBox(width: 35.0), + AppText( + 'Condition: ', + fontWeight: FontWeight.w700, + ), + AppText( + model + .medicalFileList[0] + .entityList[0] + .timelines[ + encounterNumber] + .timeLineEvents[0] + .consulations[0] + .lstAssessments[index] + .condition + .trim(), + ), + ], + ), + Row( + children: [ + AppText( + model + .medicalFileList[0] + .entityList[0] + .timelines[ + encounterNumber] + .timeLineEvents[0] + .consulations[0] + .lstAssessments[index] + .description, + fontWeight: FontWeight.w700, + ) + ], + ), + Row( + children: [ + AppText( + 'Type: ', + fontWeight: FontWeight.w700, + ), + AppText(model + .medicalFileList[0] + .entityList[0] + .timelines[encounterNumber] + .timeLineEvents[0] + .consulations[0] + .lstAssessments[index] + .type), + ], + ), + SizedBox( + height: 15.0, + ), + AppText( + model + .medicalFileList[0] + .entityList[0] + .timelines[encounterNumber] + .timeLineEvents[0] + .consulations[0] + .lstAssessments[index] + .remarks + .trim(), + ), + Divider( + height: 1, + color: Colors.grey, + thickness: 1.0, + ), + SizedBox( + height: 8.0, + ), + ], + ), + ), + ); + }), + isExpand: isAssessmentExpand, + ), + SizedBox( + height: 30, + ), + Container( + width: double.infinity, + height: 1, + color: Color(0xffCCCCCC), + ), + SizedBox( + height: 30, + ), + if (model.medicalFileList.length != 0) + HeaderBodyExpandableNotifier( + headerWidget: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, children: [ - AppText( - 'Abnormal: ', - fontWeight: FontWeight.w700, - ), - AppText( - 'no', + Row( + children: [ + Texts('Test / procedures'.toUpperCase(), + variant: isProcedureExpand + ? "bodyText" + : '', + bold: + isProcedureExpand ? true : false, + color: Colors.black), + ], ), + InkWell( + onTap: () { + setState(() { + isProcedureExpand = + !isProcedureExpand; + }); + }, + child: Icon(isProcedureExpand + ? EvaIcons.minus + : EvaIcons.plus)) ], ), - SizedBox(height: 15.0), - Row( + bodyWidget: ListView.builder( + //physics: , + scrollDirection: Axis.vertical, + shrinkWrap: true, + itemCount: model + .medicalFileList[0] + .entityList[0] + .timelines[encounterNumber] + .timeLineEvents[0] + .consulations[0] + .lstProcedure + .length, + itemBuilder: (BuildContext ctxt, int index) { + return Padding( + padding: EdgeInsets.all(8.0), + child: Container( + child: Column( + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Row( + children: [ + AppText( + 'Procedure ID: ', + fontWeight: FontWeight.w700, + ), + AppText( + model + .medicalFileList[0] + .entityList[0] + .timelines[ + encounterNumber] + .timeLineEvents[0] + .consulations[0] + .lstProcedure[index] + .procedureId + .trim(), + ), + SizedBox(width: 35.0), + AppText( + 'Order Date: ', + fontWeight: FontWeight.w700, + ), + // AppText( + // model + // .medicalFileList[0] + // .entityList[0] + // .timelines[0] + // .timeLineEvents[0] + // .consulations[0] + // .lstProcedure[index] + // .orderDate + // .trim(), + // ), + ], + ), + Row( + children: [ + AppText( + model + .medicalFileList[0] + .entityList[0] + .timelines[ + encounterNumber] + .timeLineEvents[0] + .consulations[0] + .lstProcedure[index] + .procName, + fontWeight: FontWeight.w700, + ) + ], + ), + Row( + children: [ + AppText( + 'CPT Code : ', + fontWeight: FontWeight.w700, + ), + AppText(model + .medicalFileList[0] + .entityList[0] + .timelines[encounterNumber] + .timeLineEvents[0] + .consulations[0] + .lstProcedure[index] + .patientID + .toString()), + ], + ), + SizedBox( + height: 15.0, + ), + Divider( + height: 1, + color: Colors.grey, + thickness: 1.0, + ), + SizedBox( + height: 8.0, + ), + ], + ), + ), + ); + }), + isExpand: isProcedureExpand, + ), + SizedBox( + height: 30, + ), + Container( + width: double.infinity, + height: 1, + color: Color(0xffCCCCCC), + ), + SizedBox( + height: 30, + ), + if (model.medicalFileList.length != 0) + HeaderBodyExpandableNotifier( + headerWidget: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, children: [ - AppText( - 'Some short remark about the allergy', - fontWeight: FontWeight.w300, + Row( + children: [ + Texts('physical exam'.toUpperCase(), + variant: + isPhysicalExam ? "bodyText" : '', + bold: isPhysicalExam ? true : false, + color: Colors.black), + ], ), + InkWell( + onTap: () { + setState(() { + isPhysicalExam = !isPhysicalExam; + }); + }, + child: Icon(isPhysicalExam + ? EvaIcons.minus + : EvaIcons.plus)) ], ), - ], + bodyWidget: ListView.builder( + //physics: , + scrollDirection: Axis.vertical, + shrinkWrap: true, + itemCount: model + .medicalFileList[0] + .entityList[0] + .timelines[encounterNumber] + .timeLineEvents[0] + .consulations[0] + .lstPhysicalExam + .length, + itemBuilder: (BuildContext ctxt, int index) { + return Padding( + padding: EdgeInsets.all(8.0), + child: Container( + child: Column( + children: [ + Row( + children: [ + AppText( + 'Exam Type: ', + fontWeight: FontWeight.w700, + ), + AppText(model + .medicalFileList[0] + .entityList[0] + .timelines[encounterNumber] + .timeLineEvents[0] + .consulations[0] + .lstPhysicalExam[index] + .examType), + ], + ), + Row( + children: [ + AppText( + model + .medicalFileList[0] + .entityList[0] + .timelines[ + encounterNumber] + .timeLineEvents[0] + .consulations[0] + .lstPhysicalExam[index] + .examDesc, + fontWeight: FontWeight.w700, + ) + ], + ), + Row( + children: [ + AppText( + 'Abnormal: ', + fontWeight: FontWeight.w700, + ), + AppText(model + .medicalFileList[0] + .entityList[0] + .timelines[encounterNumber] + .timeLineEvents[0] + .consulations[0] + .lstPhysicalExam[index] + .abnormal), + ], + ), + SizedBox( + height: 15.0, + ), + AppText( + model + .medicalFileList[0] + .entityList[0] + .timelines[encounterNumber] + .timeLineEvents[0] + .consulations[0] + .lstPhysicalExam[index] + .remarks, + ), + Divider( + height: 1, + color: Colors.grey, + thickness: 1.0, + ), + SizedBox( + height: 8.0, + ), + ], + ), + ), + ); + }), + isExpand: isPhysicalExam, + ), + SizedBox( + height: 30, ), - isExpand: isPhysicalExam, - ), - SizedBox( - height: 30, - ), - Container( - width: double.infinity, - height: 1, - color: Color(0xffCCCCCC), - ), - ], + Container( + width: double.infinity, + height: 1, + color: Color(0xffCCCCCC), + ), + ], + ), ), ), - ), - ], + ], + ), ), ), ), diff --git a/lib/screens/medical-file/medical_file_page.dart b/lib/screens/medical-file/medical_file_page.dart index 44fee1be..ad693f47 100644 --- a/lib/screens/medical-file/medical_file_page.dart +++ b/lib/screens/medical-file/medical_file_page.dart @@ -22,7 +22,7 @@ class _MedicalFilePageState extends State { final routeArgs = ModalRoute.of(context).settings.arguments as Map; patient = routeArgs['patient']; return BaseView( - onModelReady: (model) => model.getMedicalFile(), + onModelReady: (model) => model.getMedicalFile(mrn: patient.patientMRN), builder: (BuildContext context, MedicalFileViewModel model, Widget child) => AppScaffold( @@ -30,140 +30,147 @@ class _MedicalFilePageState extends State { appBarTitle: 'medical Report'.toUpperCase(), body: NetworkBaseView( baseViewModel: model, - child: Container( - child: Column( - children: [ - Padding( - padding: EdgeInsets.all(8.0), - child: Row( - children: [ - AvatarWidget( - Icon( - patient.genderDescription == "Male" - ? DoctorApp.male - : DoctorApp.female_icon, - size: 70, - color: Colors.white, - ), - ), - SizedBox( - width: 20, - ), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - patient.firstName + ' ' + patient.lastName, - color: Colors.black, - fontWeight: FontWeight.bold, - ), - Row( - children: [ - AppText( - TranslationBase.of(context).fileNo, - color: Colors.black, - fontWeight: FontWeight.bold, - ), - SizedBox( - width: 5.0, - ), - AppText( - patient.age.toString(), - color: Colors.black, - fontWeight: FontWeight.normal, - ), - ], - ), - AppText( - "ALLERGIC TO: FOOD, ASPIRIN", - color: Color(0xFFB9382C), - fontWeight: FontWeight.bold, + child: SingleChildScrollView( + child: Container( + child: Column( + children: [ + Padding( + padding: EdgeInsets.all(8.0), + child: Row( + children: [ + AvatarWidget( + Icon( + patient.genderDescription == "Male" + ? DoctorApp.male + : DoctorApp.female_icon, + size: 70, + color: Colors.white, ), - ], - ) - ], - ), - ), - Divider( - height: 1.0, - thickness: 1.0, - color: Colors.grey, - ), - ListView.builder( - scrollDirection: Axis.vertical, - shrinkWrap: true, - itemCount: 2, - itemBuilder: (BuildContext ctxt, int index) { - return Padding( - padding: EdgeInsets.symmetric( - horizontal: 12.0, vertical: 8.0), - child: InkWell( - child: Container( - child: Column( + ), + SizedBox( + width: 20, + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + patient.firstName + ' ' + patient.lastName, + color: Colors.black, + fontWeight: FontWeight.bold, + ), + Row( children: [ - Row( - children: [ - AppText( - 'Branch : ', - fontWeight: FontWeight.w700, - ), - AppText( - model.medicalFileList[0].entityList[0] - .admissions[index].projectName, - ), - ], + AppText( + TranslationBase.of(context).fileNo, + color: Colors.black, + fontWeight: FontWeight.bold, ), - Row( - children: [ - AppText( - 'Doctor : '.toUpperCase(), - fontWeight: FontWeight.w700, - ), - AppText( - model.medicalFileList[0].entityList[0] - .admissions[index].doctor - .toUpperCase(), - fontWeight: FontWeight.w700, - ), - ], + SizedBox( + width: 5.0, + ), + AppText( + patient.age.toString(), + color: Colors.black, + fontWeight: FontWeight.normal, ), - Row( + ], + ), + AppText( + "ALLERGIC TO: FOOD, ASPIRIN", + color: Color(0xFFB9382C), + fontWeight: FontWeight.bold, + ), + ], + ) + ], + ), + ), + Divider( + height: 1.0, + thickness: 1.0, + color: Colors.grey, + ), + if (model.medicalFileList.length != 0) + ListView.builder( + //physics: , + 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: [ - AppText( - 'Clinic : ', - fontWeight: FontWeight.w700, + Row( + children: [ + AppText( + 'Branch : ', + fontWeight: FontWeight.w700, + ), + AppText(model + .medicalFileList[0] + .entityList[0] + .timelines[index] + .projectName), + ], ), - AppText( - model.medicalFileList[0].entityList[0] - .admissions[index].clinic, + Row( + children: [ + AppText( + 'Doctor : '.toUpperCase(), + fontWeight: FontWeight.w700, + ), + AppText( + model.medicalFileList[0].entityList[0] + .timelines[index].doctorName, + fontWeight: FontWeight.w700, + ), + ], ), + Row( + children: [ + AppText( + 'Clinic : ', + 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, + ) ], ), - 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.patientMRN, + )), + ); + }, ), - ), - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => MedicalFileDetails( - age: patient.age, - firstName: patient.firstName, - lastName: patient.lastName, - gender: patient.genderDescription, - )), - ); - }, - ), - ); - }) - ], + ); + }) + ], + ), ), ), ), diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index 6d1d7cf3..28d9c45f 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -10,6 +10,7 @@ import 'package:doctor_app_flutter/screens/prescription/prescription_screen.dart import 'package:doctor_app_flutter/screens/prescription/prescription_warnings.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/dynamic_elements.dart'; import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_text_form_field.dart'; @@ -17,14 +18,51 @@ import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; +import 'package:intl/intl.dart'; -void addPrescriptionForm(context, PrescriptionViewModel model) { +class AddPrescriptionFormScreen extends StatefulWidget { + @override + _AddPrescriptionFormScreenState createState() => + _AddPrescriptionFormScreenState(); +} + +class _AddPrescriptionFormScreenState extends State { + PrescriptionViewModel model = PrescriptionViewModel(); + // PostPrescriptionReqModel addPrescriptionModel = PostPrescriptionReqModel(); + // List sss = List(); + // void _presentDatePicker(id) { + // showDatePicker( + // context: context, + // initialDate: DateTime.now(), + // firstDate: DateTime(2019), + // lastDate: DateTime(2050), + // ).then((pickedDate) { + // if (pickedDate == null) { + // return; + // } + // setState(() { + // // var selectedDate = DateFormat.yMd().format(pickedDate); + // final df = new DateFormat('yyyy-MM-dd'); + // model.startDate = df.format(pickedDate); + // + // strengthController.text = sss.add(PrescriptionRequestModel(doseStartDate: '')); + // //addSickLeave.startDate = selectedDate; + // }); + // }); + // } + @override + Widget build(BuildContext context) { + return addPrescriptionForm(context, model); + } +} + +addPrescriptionForm(context, PrescriptionViewModel model) { TextEditingController durationController = TextEditingController(); TextEditingController strengthController = TextEditingController(); TextEditingController routeController = TextEditingController(); TextEditingController frequencyController = TextEditingController(); TextEditingController indicationController = TextEditingController(); - TextEditingController instructions = TextEditingController(); + TextEditingController instructionController = TextEditingController(); TextEditingController drugIdController = TextEditingController(); TextEditingController doseController = TextEditingController(); @@ -267,10 +305,12 @@ void addPrescriptionForm(context, PrescriptionViewModel model) { width: 1.0, color: HexColor("#CCCCCC"))), child: TextFields( + maxLines: 6, + minLines: 4, hintText: TranslationBase.of(context) .instruction, - controller: indicationController, - keyboardType: TextInputType.number, + controller: instructionController, + //keyboardType: TextInputType.number, validator: (value) { if (value.isEmpty) return TranslationBase.of(context) diff --git a/pubspec.lock b/pubspec.lock index 67028733..5650f5f9 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -461,7 +461,7 @@ packages: name: js url: "https://pub.dartlang.org" source: hosted - version: "0.6.2" + version: "0.6.3-nullsafety.1" json_annotation: dependency: transitive description: @@ -503,7 +503,7 @@ packages: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.3.0-nullsafety.3" + version: "1.3.0-nullsafety.4" mime: dependency: transitive description: @@ -760,7 +760,7 @@ packages: name: stack_trace url: "https://pub.dartlang.org" source: hosted - version: "1.10.0-nullsafety.1" + version: "1.10.0-nullsafety.2" stream_channel: dependency: transitive description: @@ -895,5 +895,5 @@ packages: source: hosted version: "2.2.1" 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"