|
@@ -5,28 +5,38 @@ import 'package:fis_jsonrpc/utils.dart';
|
|
|
|
|
|
import 'package:fis_common/json_convert.dart';
|
|
|
|
|
|
-enum PatientGenderEnum {
|
|
|
- NotFilled,
|
|
|
- Male,
|
|
|
- Female,
|
|
|
+class DataItemDTO {
|
|
|
+ String? key;
|
|
|
+ String? value;
|
|
|
+
|
|
|
+ DataItemDTO({
|
|
|
+ this.key,
|
|
|
+ this.value,
|
|
|
+ });
|
|
|
+
|
|
|
+ factory DataItemDTO.fromJson(Map<String, dynamic> map) {
|
|
|
+ return DataItemDTO(
|
|
|
+ key: map['Key'],
|
|
|
+ value: map['Value'],
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
+ Map<String, dynamic> toJson() {
|
|
|
+ final map = Map<String, dynamic>();
|
|
|
+ if(key != null)
|
|
|
+ map['Key'] = key;
|
|
|
+ if(value != null)
|
|
|
+ map['Value'] = value;
|
|
|
+ return map;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
class CreatePatientRequest extends TokenRequest{
|
|
|
- String? name;
|
|
|
- String? phone;
|
|
|
- String? identityCard;
|
|
|
- String? insuranceCode;
|
|
|
- String? age;
|
|
|
- PatientGenderEnum gender;
|
|
|
+ List<DataItemDTO>? patientData;
|
|
|
List<String>? assignmentUserCodes;
|
|
|
|
|
|
CreatePatientRequest({
|
|
|
- this.name,
|
|
|
- this.phone,
|
|
|
- this.identityCard,
|
|
|
- this.insuranceCode,
|
|
|
- this.age,
|
|
|
- this.gender = PatientGenderEnum.NotFilled,
|
|
|
+ this.patientData,
|
|
|
this.assignmentUserCodes,
|
|
|
String? token,
|
|
|
}) : super(
|
|
@@ -35,12 +45,7 @@ class CreatePatientRequest extends TokenRequest{
|
|
|
|
|
|
factory CreatePatientRequest.fromJson(Map<String, dynamic> map) {
|
|
|
return CreatePatientRequest(
|
|
|
- name: map['Name'],
|
|
|
- phone: map['Phone'],
|
|
|
- identityCard: map['IdentityCard'],
|
|
|
- insuranceCode: map['InsuranceCode'],
|
|
|
- age: map['Age'],
|
|
|
- gender: PatientGenderEnum.values.firstWhere((e) => e.index == map['Gender']),
|
|
|
+ patientData: map['PatientData'] != null ? (map['PatientData'] as List).map((e)=>DataItemDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
|
|
|
assignmentUserCodes: map['AssignmentUserCodes'] != null ? map['AssignmentUserCodes'].cast<String>().toList() : null,
|
|
|
token: map['Token'],
|
|
|
);
|
|
@@ -48,17 +53,8 @@ class CreatePatientRequest extends TokenRequest{
|
|
|
|
|
|
Map<String, dynamic> toJson() {
|
|
|
final map = super.toJson();
|
|
|
- if(name != null)
|
|
|
- map['Name'] = name;
|
|
|
- if(phone != null)
|
|
|
- map['Phone'] = phone;
|
|
|
- if(identityCard != null)
|
|
|
- map['IdentityCard'] = identityCard;
|
|
|
- if(insuranceCode != null)
|
|
|
- map['InsuranceCode'] = insuranceCode;
|
|
|
- if(age != null)
|
|
|
- map['Age'] = age;
|
|
|
- map['Gender'] = gender.index;
|
|
|
+ if(patientData != null)
|
|
|
+ map['PatientData'] = patientData;
|
|
|
if(assignmentUserCodes != null)
|
|
|
map['AssignmentUserCodes'] = assignmentUserCodes;
|
|
|
return map;
|
|
@@ -67,22 +63,12 @@ class CreatePatientRequest extends TokenRequest{
|
|
|
|
|
|
class UpdatePatientRequest extends TokenRequest{
|
|
|
String? code;
|
|
|
- String? name;
|
|
|
- String? phone;
|
|
|
- String? identityCard;
|
|
|
- String? insuranceCode;
|
|
|
- String? age;
|
|
|
- PatientGenderEnum gender;
|
|
|
+ List<DataItemDTO>? patientData;
|
|
|
List<String>? assignmentUserCodes;
|
|
|
|
|
|
UpdatePatientRequest({
|
|
|
this.code,
|
|
|
- this.name,
|
|
|
- this.phone,
|
|
|
- this.identityCard,
|
|
|
- this.insuranceCode,
|
|
|
- this.age,
|
|
|
- this.gender = PatientGenderEnum.NotFilled,
|
|
|
+ this.patientData,
|
|
|
this.assignmentUserCodes,
|
|
|
String? token,
|
|
|
}) : super(
|
|
@@ -92,12 +78,7 @@ class UpdatePatientRequest extends TokenRequest{
|
|
|
factory UpdatePatientRequest.fromJson(Map<String, dynamic> map) {
|
|
|
return UpdatePatientRequest(
|
|
|
code: map['Code'],
|
|
|
- name: map['Name'],
|
|
|
- phone: map['Phone'],
|
|
|
- identityCard: map['IdentityCard'],
|
|
|
- insuranceCode: map['InsuranceCode'],
|
|
|
- age: map['Age'],
|
|
|
- gender: PatientGenderEnum.values.firstWhere((e) => e.index == map['Gender']),
|
|
|
+ patientData: map['PatientData'] != null ? (map['PatientData'] as List).map((e)=>DataItemDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
|
|
|
assignmentUserCodes: map['AssignmentUserCodes'] != null ? map['AssignmentUserCodes'].cast<String>().toList() : null,
|
|
|
token: map['Token'],
|
|
|
);
|
|
@@ -107,17 +88,8 @@ class UpdatePatientRequest extends TokenRequest{
|
|
|
final map = super.toJson();
|
|
|
if(code != null)
|
|
|
map['Code'] = code;
|
|
|
- if(name != null)
|
|
|
- map['Name'] = name;
|
|
|
- if(phone != null)
|
|
|
- map['Phone'] = phone;
|
|
|
- if(identityCard != null)
|
|
|
- map['IdentityCard'] = identityCard;
|
|
|
- if(insuranceCode != null)
|
|
|
- map['InsuranceCode'] = insuranceCode;
|
|
|
- if(age != null)
|
|
|
- map['Age'] = age;
|
|
|
- map['Gender'] = gender.index;
|
|
|
+ if(patientData != null)
|
|
|
+ map['PatientData'] = patientData;
|
|
|
if(assignmentUserCodes != null)
|
|
|
map['AssignmentUserCodes'] = assignmentUserCodes;
|
|
|
return map;
|
|
@@ -131,13 +103,11 @@ class PatientInfoBaseDTO extends BaseDTO{
|
|
|
String? identityCard;
|
|
|
String? insuranceCode;
|
|
|
String? age;
|
|
|
- PatientGenderEnum gender;
|
|
|
+ int gender;
|
|
|
bool isValid;
|
|
|
String? organizationCode;
|
|
|
List<String>? assignmentUserCodes;
|
|
|
- DateTime? birthday;
|
|
|
- String? height;
|
|
|
- String? weight;
|
|
|
+ List<DataItemDTO>? patientData;
|
|
|
int unReadRecordCount;
|
|
|
|
|
|
PatientInfoBaseDTO({
|
|
@@ -147,13 +117,11 @@ class PatientInfoBaseDTO extends BaseDTO{
|
|
|
this.identityCard,
|
|
|
this.insuranceCode,
|
|
|
this.age,
|
|
|
- this.gender = PatientGenderEnum.NotFilled,
|
|
|
+ this.gender = 0,
|
|
|
this.isValid = false,
|
|
|
this.organizationCode,
|
|
|
this.assignmentUserCodes,
|
|
|
- this.birthday,
|
|
|
- this.height,
|
|
|
- this.weight,
|
|
|
+ this.patientData,
|
|
|
this.unReadRecordCount = 0,
|
|
|
DateTime? createTime,
|
|
|
DateTime? updateTime,
|
|
@@ -170,13 +138,11 @@ class PatientInfoBaseDTO extends BaseDTO{
|
|
|
identityCard: map['IdentityCard'],
|
|
|
insuranceCode: map['InsuranceCode'],
|
|
|
age: map['Age'],
|
|
|
- gender: PatientGenderEnum.values.firstWhere((e) => e.index == map['Gender']),
|
|
|
+ gender: map['Gender'],
|
|
|
isValid: map['IsValid'],
|
|
|
organizationCode: map['OrganizationCode'],
|
|
|
assignmentUserCodes: map['AssignmentUserCodes'] != null ? map['AssignmentUserCodes'].cast<String>().toList() : null,
|
|
|
- birthday: map['Birthday'] != null ? DateTime.parse(map['Birthday']) : null,
|
|
|
- height: map['Height'],
|
|
|
- weight: map['Weight'],
|
|
|
+ patientData: map['PatientData'] != null ? (map['PatientData'] as List).map((e)=>DataItemDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
|
|
|
unReadRecordCount: map['UnReadRecordCount'],
|
|
|
createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
|
|
|
updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
|
|
@@ -197,33 +163,25 @@ class PatientInfoBaseDTO extends BaseDTO{
|
|
|
map['InsuranceCode'] = insuranceCode;
|
|
|
if(age != null)
|
|
|
map['Age'] = age;
|
|
|
- map['Gender'] = gender.index;
|
|
|
+ map['Gender'] = gender;
|
|
|
map['IsValid'] = isValid;
|
|
|
if(organizationCode != null)
|
|
|
map['OrganizationCode'] = organizationCode;
|
|
|
if(assignmentUserCodes != null)
|
|
|
map['AssignmentUserCodes'] = assignmentUserCodes;
|
|
|
- if(birthday != null)
|
|
|
- map['Birthday'] = JsonRpcUtils.dateFormat(birthday!);
|
|
|
- if(height != null)
|
|
|
- map['Height'] = height;
|
|
|
- if(weight != null)
|
|
|
- map['Weight'] = weight;
|
|
|
+ if(patientData != null)
|
|
|
+ map['PatientData'] = patientData;
|
|
|
map['UnReadRecordCount'] = unReadRecordCount;
|
|
|
return map;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
class PatientInfoDTO extends PatientInfoBaseDTO{
|
|
|
- List<String>? recordCodes;
|
|
|
String? creatorCode;
|
|
|
- String? sourceCode;
|
|
|
String? deviceCode;
|
|
|
|
|
|
PatientInfoDTO({
|
|
|
- this.recordCodes,
|
|
|
this.creatorCode,
|
|
|
- this.sourceCode,
|
|
|
this.deviceCode,
|
|
|
String? patientCode,
|
|
|
String? name,
|
|
@@ -231,13 +189,11 @@ class PatientInfoDTO extends PatientInfoBaseDTO{
|
|
|
String? identityCard,
|
|
|
String? insuranceCode,
|
|
|
String? age,
|
|
|
- PatientGenderEnum gender = PatientGenderEnum.NotFilled,
|
|
|
+ int gender = 0,
|
|
|
bool isValid = false,
|
|
|
String? organizationCode,
|
|
|
List<String>? assignmentUserCodes,
|
|
|
- DateTime? birthday,
|
|
|
- String? height,
|
|
|
- String? weight,
|
|
|
+ List<DataItemDTO>? patientData,
|
|
|
int unReadRecordCount = 0,
|
|
|
DateTime? createTime,
|
|
|
DateTime? updateTime,
|
|
@@ -252,9 +208,7 @@ class PatientInfoDTO extends PatientInfoBaseDTO{
|
|
|
isValid: isValid,
|
|
|
organizationCode: organizationCode,
|
|
|
assignmentUserCodes: assignmentUserCodes,
|
|
|
- birthday: birthday,
|
|
|
- height: height,
|
|
|
- weight: weight,
|
|
|
+ patientData: patientData,
|
|
|
unReadRecordCount: unReadRecordCount,
|
|
|
createTime: createTime,
|
|
|
updateTime: updateTime,
|
|
@@ -262,9 +216,7 @@ class PatientInfoDTO extends PatientInfoBaseDTO{
|
|
|
|
|
|
factory PatientInfoDTO.fromJson(Map<String, dynamic> map) {
|
|
|
return PatientInfoDTO(
|
|
|
- recordCodes: map['RecordCodes'] != null ? map['RecordCodes'].cast<String>().toList() : null,
|
|
|
creatorCode: map['CreatorCode'],
|
|
|
- sourceCode: map['SourceCode'],
|
|
|
deviceCode: map['DeviceCode'],
|
|
|
patientCode: map['PatientCode'],
|
|
|
name: map['Name'],
|
|
@@ -272,13 +224,11 @@ class PatientInfoDTO extends PatientInfoBaseDTO{
|
|
|
identityCard: map['IdentityCard'],
|
|
|
insuranceCode: map['InsuranceCode'],
|
|
|
age: map['Age'],
|
|
|
- gender: PatientGenderEnum.values.firstWhere((e) => e.index == map['Gender']),
|
|
|
+ gender: map['Gender'],
|
|
|
isValid: map['IsValid'],
|
|
|
organizationCode: map['OrganizationCode'],
|
|
|
assignmentUserCodes: map['AssignmentUserCodes'] != null ? map['AssignmentUserCodes'].cast<String>().toList() : null,
|
|
|
- birthday: map['Birthday'] != null ? DateTime.parse(map['Birthday']) : null,
|
|
|
- height: map['Height'],
|
|
|
- weight: map['Weight'],
|
|
|
+ patientData: map['PatientData'] != null ? (map['PatientData'] as List).map((e)=>DataItemDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
|
|
|
unReadRecordCount: map['UnReadRecordCount'],
|
|
|
createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
|
|
|
updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
|
|
@@ -287,12 +237,8 @@ class PatientInfoDTO extends PatientInfoBaseDTO{
|
|
|
|
|
|
Map<String, dynamic> toJson() {
|
|
|
final map = super.toJson();
|
|
|
- if(recordCodes != null)
|
|
|
- map['RecordCodes'] = recordCodes;
|
|
|
if(creatorCode != null)
|
|
|
map['CreatorCode'] = creatorCode;
|
|
|
- if(sourceCode != null)
|
|
|
- map['SourceCode'] = sourceCode;
|
|
|
if(deviceCode != null)
|
|
|
map['DeviceCode'] = deviceCode;
|
|
|
return map;
|
|
@@ -324,6 +270,47 @@ class CreatePatientsRequest extends TokenRequest{
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+class ClientPatientInfoBaseDTO extends BaseDTO{
|
|
|
+ String? patientCode;
|
|
|
+ bool isValid;
|
|
|
+ List<DataItemDTO>? patientData;
|
|
|
+ int unReadRecordCount;
|
|
|
+
|
|
|
+ ClientPatientInfoBaseDTO({
|
|
|
+ this.patientCode,
|
|
|
+ this.isValid = false,
|
|
|
+ this.patientData,
|
|
|
+ this.unReadRecordCount = 0,
|
|
|
+ DateTime? createTime,
|
|
|
+ DateTime? updateTime,
|
|
|
+ }) : super(
|
|
|
+ createTime: createTime,
|
|
|
+ updateTime: updateTime,
|
|
|
+ );
|
|
|
+
|
|
|
+ factory ClientPatientInfoBaseDTO.fromJson(Map<String, dynamic> map) {
|
|
|
+ return ClientPatientInfoBaseDTO(
|
|
|
+ patientCode: map['PatientCode'],
|
|
|
+ isValid: map['IsValid'],
|
|
|
+ patientData: map['PatientData'] != null ? (map['PatientData'] as List).map((e)=>DataItemDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
|
|
|
+ unReadRecordCount: map['UnReadRecordCount'],
|
|
|
+ createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
|
|
|
+ updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
+ Map<String, dynamic> toJson() {
|
|
|
+ final map = super.toJson();
|
|
|
+ if(patientCode != null)
|
|
|
+ map['PatientCode'] = patientCode;
|
|
|
+ map['IsValid'] = isValid;
|
|
|
+ if(patientData != null)
|
|
|
+ map['PatientData'] = patientData;
|
|
|
+ map['UnReadRecordCount'] = unReadRecordCount;
|
|
|
+ return map;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
class PageResult<T> {
|
|
|
int pageIndex;
|
|
|
int pageSize;
|
|
@@ -441,6 +428,99 @@ class FindPatientsPageRequest extends PageRequest{
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+class UserBaseDTO extends BaseDTO{
|
|
|
+ String? userCode;
|
|
|
+ String? userName;
|
|
|
+ String? headImageUrl;
|
|
|
+
|
|
|
+ UserBaseDTO({
|
|
|
+ this.userCode,
|
|
|
+ this.userName,
|
|
|
+ this.headImageUrl,
|
|
|
+ DateTime? createTime,
|
|
|
+ DateTime? updateTime,
|
|
|
+ }) : super(
|
|
|
+ createTime: createTime,
|
|
|
+ updateTime: updateTime,
|
|
|
+ );
|
|
|
+
|
|
|
+ factory UserBaseDTO.fromJson(Map<String, dynamic> map) {
|
|
|
+ return UserBaseDTO(
|
|
|
+ userCode: map['UserCode'],
|
|
|
+ userName: map['UserName'],
|
|
|
+ headImageUrl: map['HeadImageUrl'],
|
|
|
+ createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
|
|
|
+ updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
+ Map<String, dynamic> toJson() {
|
|
|
+ final map = super.toJson();
|
|
|
+ if(userCode != null)
|
|
|
+ map['UserCode'] = userCode;
|
|
|
+ if(userName != null)
|
|
|
+ map['UserName'] = userName;
|
|
|
+ if(headImageUrl != null)
|
|
|
+ map['HeadImageUrl'] = headImageUrl;
|
|
|
+ return map;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+class ClientPatientInfoDTO extends ClientPatientInfoBaseDTO{
|
|
|
+ String? creatorCode;
|
|
|
+ String? creatorName;
|
|
|
+ String? deviceCode;
|
|
|
+ List<UserBaseDTO>? assignmentUserList;
|
|
|
+
|
|
|
+ ClientPatientInfoDTO({
|
|
|
+ this.creatorCode,
|
|
|
+ this.creatorName,
|
|
|
+ this.deviceCode,
|
|
|
+ this.assignmentUserList,
|
|
|
+ String? patientCode,
|
|
|
+ bool isValid = false,
|
|
|
+ List<DataItemDTO>? patientData,
|
|
|
+ int unReadRecordCount = 0,
|
|
|
+ DateTime? createTime,
|
|
|
+ DateTime? updateTime,
|
|
|
+ }) : super(
|
|
|
+ patientCode: patientCode,
|
|
|
+ isValid: isValid,
|
|
|
+ patientData: patientData,
|
|
|
+ unReadRecordCount: unReadRecordCount,
|
|
|
+ createTime: createTime,
|
|
|
+ updateTime: updateTime,
|
|
|
+ );
|
|
|
+
|
|
|
+ factory ClientPatientInfoDTO.fromJson(Map<String, dynamic> map) {
|
|
|
+ return ClientPatientInfoDTO(
|
|
|
+ creatorCode: map['CreatorCode'],
|
|
|
+ creatorName: map['CreatorName'],
|
|
|
+ deviceCode: map['DeviceCode'],
|
|
|
+ assignmentUserList: map['AssignmentUserList'] != null ? (map['AssignmentUserList'] as List).map((e)=>UserBaseDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
|
|
|
+ patientCode: map['PatientCode'],
|
|
|
+ isValid: map['IsValid'],
|
|
|
+ patientData: map['PatientData'] != null ? (map['PatientData'] as List).map((e)=>DataItemDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
|
|
|
+ unReadRecordCount: map['UnReadRecordCount'],
|
|
|
+ createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
|
|
|
+ updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
+ Map<String, dynamic> toJson() {
|
|
|
+ final map = super.toJson();
|
|
|
+ if(creatorCode != null)
|
|
|
+ map['CreatorCode'] = creatorCode;
|
|
|
+ if(creatorName != null)
|
|
|
+ map['CreatorName'] = creatorName;
|
|
|
+ if(deviceCode != null)
|
|
|
+ map['DeviceCode'] = deviceCode;
|
|
|
+ if(assignmentUserList != null)
|
|
|
+ map['AssignmentUserList'] = assignmentUserList;
|
|
|
+ return map;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
class FindPatientByCodeRequest extends TokenRequest{
|
|
|
String? code;
|
|
|
|