You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
1.3 KiB
47 lines
1.3 KiB
import 'package:flutter/material.dart';
|
|
import 'package:healthcare_user/common/settings.dart';
|
|
|
|
class ReportsModel {
|
|
String patient_name='';
|
|
String age='';
|
|
String gender='';
|
|
String patient_type='';
|
|
String problem='';
|
|
String doctorName='';
|
|
String hospitalName='';
|
|
String date='';
|
|
String recordId='';
|
|
List findingsImages = [];
|
|
List reportImages = [];
|
|
List prescriptionImages = [];
|
|
|
|
ReportsModel();
|
|
|
|
factory ReportsModel.fromJson(Map<String, dynamic> json){
|
|
ReportsModel rtvm = new ReportsModel();
|
|
|
|
rtvm.patient_type = json['patientType'] ?? '';
|
|
rtvm.doctorName = json['doctorName'] ?? '';
|
|
rtvm.hospitalName = json['hospitalName'] ?? '';
|
|
rtvm.problem = json['problem'] ?? '';
|
|
rtvm.date = json['date'] ?? '';
|
|
rtvm.recordId = json['recordId'] ?? '';
|
|
rtvm.findingsImages = json['findings'] ?? [];
|
|
rtvm.reportImages = json['reports'] ?? [];
|
|
rtvm.prescriptionImages = json['prescription'] ?? [];
|
|
|
|
if(rtvm.patient_type.toString().toLowerCase()=='self'){
|
|
rtvm.age=AppSettings.age;
|
|
rtvm.gender=AppSettings.gender;
|
|
rtvm.patient_name=AppSettings.userName;
|
|
}
|
|
else{
|
|
rtvm.age=json['others']['age'].toString();
|
|
rtvm.gender=json['others']['gender'];
|
|
rtvm.patient_name=json['others']['name'];
|
|
}
|
|
|
|
return rtvm;
|
|
}
|
|
|
|
} |