|
@@ -124,7 +124,8 @@ class UpdatePatientRequest extends TokenRequest{
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-class UploadPatientDTO extends BaseDTO{
|
|
|
+class PatientInfoBaseDTO extends BaseDTO{
|
|
|
+ String? patientCode;
|
|
|
String? name;
|
|
|
String? phone;
|
|
|
String? identityCard;
|
|
@@ -132,12 +133,15 @@ class UploadPatientDTO extends BaseDTO{
|
|
|
String? age;
|
|
|
PatientGenderEnum gender;
|
|
|
bool isValid;
|
|
|
- String? creatorCode;
|
|
|
- String? sourceCode;
|
|
|
String? organizationCode;
|
|
|
List<String>? assignmentUserCodes;
|
|
|
+ DateTime? birthday;
|
|
|
+ String? height;
|
|
|
+ String? weight;
|
|
|
+ int unReadRecordCount;
|
|
|
|
|
|
- UploadPatientDTO({
|
|
|
+ PatientInfoBaseDTO({
|
|
|
+ this.patientCode,
|
|
|
this.name,
|
|
|
this.phone,
|
|
|
this.identityCard,
|
|
@@ -145,10 +149,12 @@ class UploadPatientDTO extends BaseDTO{
|
|
|
this.age,
|
|
|
this.gender = PatientGenderEnum.NotFilled,
|
|
|
this.isValid = false,
|
|
|
- this.creatorCode,
|
|
|
- this.sourceCode,
|
|
|
this.organizationCode,
|
|
|
this.assignmentUserCodes,
|
|
|
+ this.birthday,
|
|
|
+ this.height,
|
|
|
+ this.weight,
|
|
|
+ this.unReadRecordCount = 0,
|
|
|
DateTime? createTime,
|
|
|
DateTime? updateTime,
|
|
|
}) : super(
|
|
@@ -156,8 +162,9 @@ class UploadPatientDTO extends BaseDTO{
|
|
|
updateTime: updateTime,
|
|
|
);
|
|
|
|
|
|
- factory UploadPatientDTO.fromJson(Map<String, dynamic> map) {
|
|
|
- return UploadPatientDTO(
|
|
|
+ factory PatientInfoBaseDTO.fromJson(Map<String, dynamic> map) {
|
|
|
+ return PatientInfoBaseDTO(
|
|
|
+ patientCode: map['PatientCode'],
|
|
|
name: map['Name'],
|
|
|
phone: map['Phone'],
|
|
|
identityCard: map['IdentityCard'],
|
|
@@ -165,10 +172,12 @@ class UploadPatientDTO extends BaseDTO{
|
|
|
age: map['Age'],
|
|
|
gender: PatientGenderEnum.values.firstWhere((e) => e.index == map['Gender']),
|
|
|
isValid: map['IsValid'],
|
|
|
- creatorCode: map['CreatorCode'],
|
|
|
- sourceCode: map['SourceCode'],
|
|
|
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'],
|
|
|
+ unReadRecordCount: map['UnReadRecordCount'],
|
|
|
createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
|
|
|
updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
|
|
|
);
|
|
@@ -176,6 +185,8 @@ class UploadPatientDTO extends BaseDTO{
|
|
|
|
|
|
Map<String, dynamic> toJson() {
|
|
|
final map = super.toJson();
|
|
|
+ if(patientCode != null)
|
|
|
+ map['PatientCode'] = patientCode;
|
|
|
if(name != null)
|
|
|
map['Name'] = name;
|
|
|
if(phone != null)
|
|
@@ -188,75 +199,73 @@ class UploadPatientDTO extends BaseDTO{
|
|
|
map['Age'] = age;
|
|
|
map['Gender'] = gender.index;
|
|
|
map['IsValid'] = isValid;
|
|
|
- if(creatorCode != null)
|
|
|
- map['CreatorCode'] = creatorCode;
|
|
|
- if(sourceCode != null)
|
|
|
- map['SourceCode'] = sourceCode;
|
|
|
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;
|
|
|
+ map['UnReadRecordCount'] = unReadRecordCount;
|
|
|
return map;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-class CreatePatientsRequest extends TokenRequest{
|
|
|
- List<UploadPatientDTO>? patients;
|
|
|
-
|
|
|
- CreatePatientsRequest({
|
|
|
- this.patients,
|
|
|
- String? token,
|
|
|
- }) : super(
|
|
|
- token: token,
|
|
|
- );
|
|
|
-
|
|
|
- factory CreatePatientsRequest.fromJson(Map<String, dynamic> map) {
|
|
|
- return CreatePatientsRequest(
|
|
|
- patients: map['Patients'] != null ? map['Patients'].map((e)=>UploadPatientDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
|
|
|
- token: map['Token'],
|
|
|
- );
|
|
|
- }
|
|
|
-
|
|
|
- Map<String, dynamic> toJson() {
|
|
|
- final map = super.toJson();
|
|
|
- if(patients != null)
|
|
|
- map['Patients'] = patients;
|
|
|
- return map;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-class PatientInfoBaseDTO extends BaseDTO{
|
|
|
- String? patientCode;
|
|
|
- String? name;
|
|
|
- String? phone;
|
|
|
- String? identityCard;
|
|
|
- String? insuranceCode;
|
|
|
- String? age;
|
|
|
- PatientGenderEnum gender;
|
|
|
- bool isValid;
|
|
|
- String? organizationCode;
|
|
|
- List<String>? assignmentUserCodes;
|
|
|
+class PatientInfoDTO extends PatientInfoBaseDTO{
|
|
|
+ List<String>? recordCodes;
|
|
|
+ String? creatorCode;
|
|
|
+ String? sourceCode;
|
|
|
+ String? deviceCode;
|
|
|
|
|
|
- PatientInfoBaseDTO({
|
|
|
- this.patientCode,
|
|
|
- this.name,
|
|
|
- this.phone,
|
|
|
- this.identityCard,
|
|
|
- this.insuranceCode,
|
|
|
- this.age,
|
|
|
- this.gender = PatientGenderEnum.NotFilled,
|
|
|
- this.isValid = false,
|
|
|
- this.organizationCode,
|
|
|
- this.assignmentUserCodes,
|
|
|
+ PatientInfoDTO({
|
|
|
+ this.recordCodes,
|
|
|
+ this.creatorCode,
|
|
|
+ this.sourceCode,
|
|
|
+ this.deviceCode,
|
|
|
+ String? patientCode,
|
|
|
+ String? name,
|
|
|
+ String? phone,
|
|
|
+ String? identityCard,
|
|
|
+ String? insuranceCode,
|
|
|
+ String? age,
|
|
|
+ PatientGenderEnum gender = PatientGenderEnum.NotFilled,
|
|
|
+ bool isValid = false,
|
|
|
+ String? organizationCode,
|
|
|
+ List<String>? assignmentUserCodes,
|
|
|
+ DateTime? birthday,
|
|
|
+ String? height,
|
|
|
+ String? weight,
|
|
|
+ int unReadRecordCount = 0,
|
|
|
DateTime? createTime,
|
|
|
DateTime? updateTime,
|
|
|
}) : super(
|
|
|
+ patientCode: patientCode,
|
|
|
+ name: name,
|
|
|
+ phone: phone,
|
|
|
+ identityCard: identityCard,
|
|
|
+ insuranceCode: insuranceCode,
|
|
|
+ age: age,
|
|
|
+ gender: gender,
|
|
|
+ isValid: isValid,
|
|
|
+ organizationCode: organizationCode,
|
|
|
+ assignmentUserCodes: assignmentUserCodes,
|
|
|
+ birthday: birthday,
|
|
|
+ height: height,
|
|
|
+ weight: weight,
|
|
|
+ unReadRecordCount: unReadRecordCount,
|
|
|
createTime: createTime,
|
|
|
updateTime: updateTime,
|
|
|
);
|
|
|
|
|
|
- factory PatientInfoBaseDTO.fromJson(Map<String, dynamic> map) {
|
|
|
- return 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'],
|
|
|
phone: map['Phone'],
|
|
@@ -267,6 +276,10 @@ class PatientInfoBaseDTO extends BaseDTO{
|
|
|
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'],
|
|
|
+ unReadRecordCount: map['UnReadRecordCount'],
|
|
|
createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
|
|
|
updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
|
|
|
);
|
|
@@ -274,24 +287,39 @@ class PatientInfoBaseDTO extends BaseDTO{
|
|
|
|
|
|
Map<String, dynamic> toJson() {
|
|
|
final map = super.toJson();
|
|
|
- if(patientCode != null)
|
|
|
- map['PatientCode'] = patientCode;
|
|
|
- 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;
|
|
|
- map['IsValid'] = isValid;
|
|
|
- if(organizationCode != null)
|
|
|
- map['OrganizationCode'] = organizationCode;
|
|
|
- if(assignmentUserCodes != null)
|
|
|
- map['AssignmentUserCodes'] = assignmentUserCodes;
|
|
|
+ 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;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+class CreatePatientsRequest extends TokenRequest{
|
|
|
+ List<PatientInfoDTO>? patients;
|
|
|
+
|
|
|
+ CreatePatientsRequest({
|
|
|
+ this.patients,
|
|
|
+ String? token,
|
|
|
+ }) : super(
|
|
|
+ token: token,
|
|
|
+ );
|
|
|
+
|
|
|
+ factory CreatePatientsRequest.fromJson(Map<String, dynamic> map) {
|
|
|
+ return CreatePatientsRequest(
|
|
|
+ patients: map['Patients'] != null ? map['Patients'].map((e)=>PatientInfoDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
|
|
|
+ token: map['Token'],
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
+ Map<String, dynamic> toJson() {
|
|
|
+ final map = super.toJson();
|
|
|
+ if(patients != null)
|
|
|
+ map['Patients'] = patients;
|
|
|
return map;
|
|
|
}
|
|
|
}
|
|
@@ -362,15 +390,23 @@ class PageRequest extends TokenRequest{
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+enum PatientValidStatusEnum {
|
|
|
+ All,
|
|
|
+ CheckOut,
|
|
|
+ CheckIn,
|
|
|
+}
|
|
|
+
|
|
|
class FindPatientsPageRequest extends PageRequest{
|
|
|
String? keyWord;
|
|
|
DateTime? startTime;
|
|
|
DateTime? endTime;
|
|
|
+ PatientValidStatusEnum isValid;
|
|
|
|
|
|
FindPatientsPageRequest({
|
|
|
this.keyWord,
|
|
|
this.startTime,
|
|
|
this.endTime,
|
|
|
+ this.isValid = PatientValidStatusEnum.All,
|
|
|
int pageIndex = 0,
|
|
|
int pageSize = 0,
|
|
|
String? token,
|
|
@@ -385,6 +421,7 @@ class FindPatientsPageRequest extends PageRequest{
|
|
|
keyWord: map['KeyWord'],
|
|
|
startTime: map['StartTime'] != null ? DateTime.parse(map['StartTime']) : null,
|
|
|
endTime: map['EndTime'] != null ? DateTime.parse(map['EndTime']) : null,
|
|
|
+ isValid: PatientValidStatusEnum.values.firstWhere((e) => e.index == map['IsValid']),
|
|
|
pageIndex: map['PageIndex'],
|
|
|
pageSize: map['PageSize'],
|
|
|
token: map['Token'],
|
|
@@ -399,69 +436,7 @@ class FindPatientsPageRequest extends PageRequest{
|
|
|
map['StartTime'] = JsonRpcUtils.dateFormat(startTime!);
|
|
|
if(endTime != null)
|
|
|
map['EndTime'] = JsonRpcUtils.dateFormat(endTime!);
|
|
|
- return map;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-class PatientInfoDTO extends PatientInfoBaseDTO{
|
|
|
- List<String>? recordCodes;
|
|
|
- String? creatorCode;
|
|
|
-
|
|
|
- PatientInfoDTO({
|
|
|
- this.recordCodes,
|
|
|
- this.creatorCode,
|
|
|
- String? patientCode,
|
|
|
- String? name,
|
|
|
- String? phone,
|
|
|
- String? identityCard,
|
|
|
- String? insuranceCode,
|
|
|
- String? age,
|
|
|
- PatientGenderEnum gender = PatientGenderEnum.NotFilled,
|
|
|
- bool isValid = false,
|
|
|
- String? organizationCode,
|
|
|
- List<String>? assignmentUserCodes,
|
|
|
- DateTime? createTime,
|
|
|
- DateTime? updateTime,
|
|
|
- }) : super(
|
|
|
- patientCode: patientCode,
|
|
|
- name: name,
|
|
|
- phone: phone,
|
|
|
- identityCard: identityCard,
|
|
|
- insuranceCode: insuranceCode,
|
|
|
- age: age,
|
|
|
- gender: gender,
|
|
|
- isValid: isValid,
|
|
|
- organizationCode: organizationCode,
|
|
|
- assignmentUserCodes: assignmentUserCodes,
|
|
|
- createTime: createTime,
|
|
|
- updateTime: updateTime,
|
|
|
- );
|
|
|
-
|
|
|
- factory PatientInfoDTO.fromJson(Map<String, dynamic> map) {
|
|
|
- return PatientInfoDTO(
|
|
|
- recordCodes: map['RecordCodes'] != null ? map['RecordCodes'].cast<String>().toList() : null,
|
|
|
- creatorCode: map['CreatorCode'],
|
|
|
- patientCode: map['PatientCode'],
|
|
|
- name: map['Name'],
|
|
|
- phone: map['Phone'],
|
|
|
- identityCard: map['IdentityCard'],
|
|
|
- insuranceCode: map['InsuranceCode'],
|
|
|
- age: map['Age'],
|
|
|
- gender: PatientGenderEnum.values.firstWhere((e) => e.index == map['Gender']),
|
|
|
- isValid: map['IsValid'],
|
|
|
- organizationCode: map['OrganizationCode'],
|
|
|
- assignmentUserCodes: map['AssignmentUserCodes'] != null ? map['AssignmentUserCodes'].cast<String>().toList() : null,
|
|
|
- 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(recordCodes != null)
|
|
|
- map['RecordCodes'] = recordCodes;
|
|
|
- if(creatorCode != null)
|
|
|
- map['CreatorCode'] = creatorCode;
|
|
|
+ map['IsValid'] = isValid.index;
|
|
|
return map;
|
|
|
}
|
|
|
}
|
|
@@ -546,4 +521,34 @@ class FindValidPatientsByNameRequest extends TokenRequest{
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+class SetValidPatientRequest extends TokenRequest{
|
|
|
+ String? newPatientCode;
|
|
|
+ String? oldPatientCode;
|
|
|
+
|
|
|
+ SetValidPatientRequest({
|
|
|
+ this.newPatientCode,
|
|
|
+ this.oldPatientCode,
|
|
|
+ String? token,
|
|
|
+ }) : super(
|
|
|
+ token: token,
|
|
|
+ );
|
|
|
+
|
|
|
+ factory SetValidPatientRequest.fromJson(Map<String, dynamic> map) {
|
|
|
+ return SetValidPatientRequest(
|
|
|
+ newPatientCode: map['NewPatientCode'],
|
|
|
+ oldPatientCode: map['OldPatientCode'],
|
|
|
+ token: map['Token'],
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
+ Map<String, dynamic> toJson() {
|
|
|
+ final map = super.toJson();
|
|
|
+ if(newPatientCode != null)
|
|
|
+ map['NewPatientCode'] = newPatientCode;
|
|
|
+ if(oldPatientCode != null)
|
|
|
+ map['OldPatientCode'] = oldPatientCode;
|
|
|
+ return map;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
|