123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522 |
- import 'package:fis_common/json_convert.dart';
- enum GenderTypeEnum {
- Male,
- Female,
- }
- enum PatientTypeEnum {
- Default,
- }
- class PatientInfo {
- String? patientCode;
- String? firstName;
- String? lastName;
- String? patientCardNo;
- DateTime? birthday;
- GenderTypeEnum genderType;
- String? patientCaseHistory;
- String? patientPhone;
- PatientTypeEnum patientType;
- String? id;
- DateTime? createTime;
- DateTime? updateTime;
- bool isDelete;
- PatientInfo({
- this.patientCode,
- this.firstName,
- this.lastName,
- this.patientCardNo,
- this.birthday,
- this.genderType=GenderTypeEnum.Male,
- this.patientCaseHistory,
- this.patientPhone,
- this.patientType=PatientTypeEnum.Default,
- this.id,
- this.createTime,
- this.updateTime,
- this.isDelete=false,
- });
- factory PatientInfo.fromJson(Map<String, dynamic> map) {
- return PatientInfo(
- patientCode: map['PatientCode'],
- firstName: map['FirstName'],
- lastName: map['LastName'],
- patientCardNo: map['PatientCardNo'],
- birthday: map['Birthday'] != null ? DateTime.parse(map['Birthday']) : null,
- genderType: GenderTypeEnum.values.firstWhere((e) => e.index == map['GenderType']),
- patientCaseHistory: map['PatientCaseHistory'],
- patientPhone: map['PatientPhone'],
- patientType: PatientTypeEnum.values.firstWhere((e) => e.index == map['PatientType']),
- id: map['Id'],
- createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
- updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
- isDelete: map['IsDelete'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- if(patientCode != null)
- map['PatientCode'] = patientCode;
- if(firstName != null)
- map['FirstName'] = firstName;
- if(lastName != null)
- map['LastName'] = lastName;
- if(patientCardNo != null)
- map['PatientCardNo'] = patientCardNo;
- if(birthday != null)
- map['Birthday'] = birthday;
- map['GenderType'] = genderType.index;
- if(patientCaseHistory != null)
- map['PatientCaseHistory'] = patientCaseHistory;
- if(patientPhone != null)
- map['PatientPhone'] = patientPhone;
- map['PatientType'] = patientType.index;
- if(id != null)
- map['Id'] = id;
- if(createTime != null)
- map['CreateTime'] = createTime;
- if(updateTime != null)
- map['UpdateTime'] = updateTime;
- map['IsDelete'] = isDelete;
- return map;
- }
- }
- class CreatePatientInfoRequest {
- PatientInfo? info;
- String? sessionId;
- CreatePatientInfoRequest({
- this.info,
- this.sessionId,
- });
- factory CreatePatientInfoRequest.fromJson(Map<String, dynamic> map) {
- return CreatePatientInfoRequest(
- info: map['Info'],
- sessionId: map['SessionId'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- if(info != null)
- map['Info'] = info;
- if(sessionId != null)
- map['SessionId'] = sessionId;
- return map;
- }
- }
- enum DeviceDataTypeEnum {
- Default,
- }
- class DeviceData {
- String? deviceDataCode;
- String? deviceCode;
- String? deviceFileCode;
- String? recordCode;
- String? patientCode;
- String? previewImageToken;
- String? dataToken;
- DeviceDataTypeEnum deviceDataType;
- String? processResult;
- String? id;
- DateTime? createTime;
- DateTime? updateTime;
- bool isDelete;
- DeviceData({
- this.deviceDataCode,
- this.deviceCode,
- this.deviceFileCode,
- this.recordCode,
- this.patientCode,
- this.previewImageToken,
- this.dataToken,
- this.deviceDataType=DeviceDataTypeEnum.Default,
- this.processResult,
- this.id,
- this.createTime,
- this.updateTime,
- this.isDelete=false,
- });
- factory DeviceData.fromJson(Map<String, dynamic> map) {
- return DeviceData(
- deviceDataCode: map['DeviceDataCode'],
- deviceCode: map['DeviceCode'],
- deviceFileCode: map['DeviceFileCode'],
- recordCode: map['RecordCode'],
- patientCode: map['PatientCode'],
- previewImageToken: map['PreviewImageToken'],
- dataToken: map['DataToken'],
- deviceDataType: DeviceDataTypeEnum.values.firstWhere((e) => e.index == map['DeviceDataType']),
- processResult: map['ProcessResult'],
- id: map['Id'],
- createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
- updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
- isDelete: map['IsDelete'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- if(deviceDataCode != null)
- map['DeviceDataCode'] = deviceDataCode;
- if(deviceCode != null)
- map['DeviceCode'] = deviceCode;
- if(deviceFileCode != null)
- map['DeviceFileCode'] = deviceFileCode;
- if(recordCode != null)
- map['RecordCode'] = recordCode;
- if(patientCode != null)
- map['PatientCode'] = patientCode;
- if(previewImageToken != null)
- map['PreviewImageToken'] = previewImageToken;
- if(dataToken != null)
- map['DataToken'] = dataToken;
- map['DeviceDataType'] = deviceDataType.index;
- if(processResult != null)
- map['ProcessResult'] = processResult;
- if(id != null)
- map['Id'] = id;
- if(createTime != null)
- map['CreateTime'] = createTime;
- if(updateTime != null)
- map['UpdateTime'] = updateTime;
- map['IsDelete'] = isDelete;
- return map;
- }
- }
- class CreateDeviceDataRequest {
- DeviceData? info;
- String? sessionId;
- CreateDeviceDataRequest({
- this.info,
- this.sessionId,
- });
- factory CreateDeviceDataRequest.fromJson(Map<String, dynamic> map) {
- return CreateDeviceDataRequest(
- info: map['Info'],
- sessionId: map['SessionId'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- if(info != null)
- map['Info'] = info;
- if(sessionId != null)
- map['SessionId'] = sessionId;
- return map;
- }
- }
- enum RecordTypeEnum {
- Ultrasound,
- Electrocardio,
- }
- enum CheckTypeEnum {
- Default,
- }
- enum RecordStatusEnum {
- Default,
- }
- class RecordInfo {
- String? recordCode;
- String? patientCode;
- String? patientName;
- String? orgName;
- RecordTypeEnum recordType;
- CheckTypeEnum checkType;
- String? localRecordCode;
- RecordStatusEnum recordStatus;
- String? recordRemark;
- String? tags;
- String? id;
- DateTime? createTime;
- DateTime? updateTime;
- bool isDelete;
- RecordInfo({
- this.recordCode,
- this.patientCode,
- this.patientName,
- this.orgName,
- this.recordType=RecordTypeEnum.Ultrasound,
- this.checkType=CheckTypeEnum.Default,
- this.localRecordCode,
- this.recordStatus=RecordStatusEnum.Default,
- this.recordRemark,
- this.tags,
- this.id,
- this.createTime,
- this.updateTime,
- this.isDelete=false,
- });
- factory RecordInfo.fromJson(Map<String, dynamic> map) {
- return RecordInfo(
- recordCode: map['RecordCode'],
- patientCode: map['PatientCode'],
- patientName: map['PatientName'],
- orgName: map['OrgName'],
- recordType: RecordTypeEnum.values.firstWhere((e) => e.index == map['RecordType']),
- checkType: CheckTypeEnum.values.firstWhere((e) => e.index == map['CheckType']),
- localRecordCode: map['LocalRecordCode'],
- recordStatus: RecordStatusEnum.values.firstWhere((e) => e.index == map['RecordStatus']),
- recordRemark: map['RecordRemark'],
- tags: map['Tags'],
- id: map['Id'],
- createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
- updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
- isDelete: map['IsDelete'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- if(recordCode != null)
- map['RecordCode'] = recordCode;
- if(patientCode != null)
- map['PatientCode'] = patientCode;
- if(patientName != null)
- map['PatientName'] = patientName;
- if(orgName != null)
- map['OrgName'] = orgName;
- map['RecordType'] = recordType.index;
- map['CheckType'] = checkType.index;
- if(localRecordCode != null)
- map['LocalRecordCode'] = localRecordCode;
- map['RecordStatus'] = recordStatus.index;
- if(recordRemark != null)
- map['RecordRemark'] = recordRemark;
- if(tags != null)
- map['Tags'] = tags;
- if(id != null)
- map['Id'] = id;
- if(createTime != null)
- map['CreateTime'] = createTime;
- if(updateTime != null)
- map['UpdateTime'] = updateTime;
- map['IsDelete'] = isDelete;
- return map;
- }
- }
- class CreateRecordInfoRequest {
- RecordInfo? info;
- String? sessionId;
- CreateRecordInfoRequest({
- this.info,
- this.sessionId,
- });
- factory CreateRecordInfoRequest.fromJson(Map<String, dynamic> map) {
- return CreateRecordInfoRequest(
- info: map['Info'],
- sessionId: map['SessionId'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- if(info != null)
- map['Info'] = info;
- if(sessionId != null)
- map['SessionId'] = sessionId;
- return map;
- }
- }
- class GetDeviceDataDetailRequest {
- String? deviceDataCode;
- String? sessionId;
- GetDeviceDataDetailRequest({
- this.deviceDataCode,
- this.sessionId,
- });
- factory GetDeviceDataDetailRequest.fromJson(Map<String, dynamic> map) {
- return GetDeviceDataDetailRequest(
- deviceDataCode: map['DeviceDataCode'],
- sessionId: map['SessionId'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- if(deviceDataCode != null)
- map['DeviceDataCode'] = deviceDataCode;
- if(sessionId != null)
- map['SessionId'] = sessionId;
- return map;
- }
- }
- class GetRecordInfoDetailRequest {
- String? recordCode;
- String? sessionId;
- GetRecordInfoDetailRequest({
- this.recordCode,
- this.sessionId,
- });
- factory GetRecordInfoDetailRequest.fromJson(Map<String, dynamic> map) {
- return GetRecordInfoDetailRequest(
- recordCode: map['RecordCode'],
- sessionId: map['SessionId'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- if(recordCode != null)
- map['RecordCode'] = recordCode;
- if(sessionId != null)
- map['SessionId'] = sessionId;
- return map;
- }
- }
- class GetDeviceDataListRequest {
- String? recordCode;
- String? sessionId;
- GetDeviceDataListRequest({
- this.recordCode,
- this.sessionId,
- });
- factory GetDeviceDataListRequest.fromJson(Map<String, dynamic> map) {
- return GetDeviceDataListRequest(
- recordCode: map['RecordCode'],
- sessionId: map['SessionId'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- if(recordCode != null)
- map['RecordCode'] = recordCode;
- if(sessionId != null)
- map['SessionId'] = sessionId;
- return map;
- }
- }
- class PageCollection<T> {
- int currentPage;
- int pageSize;
- int dataCount;
- List<T>? pageData;
- PageCollection({
- this.currentPage=0,
- this.pageSize=0,
- this.dataCount=0,
- this.pageData,
- });
- factory PageCollection.fromJson(Map<String, dynamic> map) {
- List<T> pageDataList = [];
- if (map['PageData'] != null) {
- pageDataList.addAll(
- (map['PageData'] as List).map((e) => FJsonConvert.fromJson<T>(e)!));
- }
- return PageCollection(
- currentPage: map['CurrentPage'],
- pageSize: map['PageSize'],
- dataCount: map['DataCount'],
- pageData: pageDataList,
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- map['CurrentPage'] = currentPage;
- map['PageSize'] = pageSize;
- map['DataCount'] = dataCount;
- if(pageData != null)
- map['PageData'] = pageData;
- return map;
- }
- }
- class PageRequest {
- int currentPage;
- int pageSize;
- Map<String,String>? filter;
- String? sessionId;
- PageRequest({
- this.currentPage=0,
- this.pageSize=0,
- this.filter,
- this.sessionId,
- });
- factory PageRequest.fromJson(Map<String, dynamic> map) {
- return PageRequest(
- currentPage: map['CurrentPage'],
- pageSize: map['PageSize'],
- filter: map['Filter'].cast<String,String>(),
- sessionId: map['SessionId'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- map['CurrentPage'] = currentPage;
- map['PageSize'] = pageSize;
- if(filter != null)
- map['Filter'] = filter;
- if(sessionId != null)
- map['SessionId'] = sessionId;
- return map;
- }
- }
- class GetPatientInfoRequest {
- String? patientCode;
- String? sessionId;
- GetPatientInfoRequest({
- this.patientCode,
- this.sessionId,
- });
- factory GetPatientInfoRequest.fromJson(Map<String, dynamic> map) {
- return GetPatientInfoRequest(
- patientCode: map['PatientCode'],
- sessionId: map['SessionId'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- if(patientCode != null)
- map['PatientCode'] = patientCode;
- if(sessionId != null)
- map['SessionId'] = sessionId;
- return map;
- }
- }
|