import 'liveConsultation.m.dart'; import 'vitalDiagnosis.m.dart'; import 'vitalContractRecord.m.dart'; import 'notification.m.dart'; import 'device.m.dart'; import 'package:fis_jsonrpc/utils.dart'; class CreatePatientRequest2 extends TokenRequest{ String? code; String? patientName; String? phone; String? cardNo; String? nationality; DateTime? birthday; List? crowdLabels; CardTypeEnum cardType; GenderEnum patientGender; String? patientAddress; String? permanentResidenceAddress; String? teamRegionCode; String? contractedDoctor; CreatePatientRequest2({ this.code, this.patientName, this.phone, this.cardNo, this.nationality, this.birthday, this.crowdLabels, this.cardType = CardTypeEnum.Identity, this.patientGender = GenderEnum.Unknown, this.patientAddress, this.permanentResidenceAddress, this.teamRegionCode, this.contractedDoctor, String? token, }) : super( token: token, ); factory CreatePatientRequest2.fromJson(Map map) { return CreatePatientRequest2( code: map['Code'], patientName: map['PatientName'], phone: map['Phone'], cardNo: map['CardNo'], nationality: map['Nationality'], birthday: map['Birthday'] != null ? DateTime.parse(map['Birthday']) : null, crowdLabels: map['CrowdLabels']?.cast().toList(), cardType: CardTypeEnum.values.firstWhere((e) => e.index == map['CardType']), patientGender: GenderEnum.values.firstWhere((e) => e.index == map['PatientGender']), patientAddress: map['PatientAddress'], permanentResidenceAddress: map['PermanentResidenceAddress'], teamRegionCode: map['TeamRegionCode'], contractedDoctor: map['ContractedDoctor'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); if (code != null) map['Code'] = code; if (patientName != null) map['PatientName'] = patientName; if (phone != null) map['Phone'] = phone; if (cardNo != null) map['CardNo'] = cardNo; if (nationality != null) map['Nationality'] = nationality; if (birthday != null) map['Birthday'] = JsonRpcUtils.dateFormat(birthday!); if (crowdLabels != null) map['CrowdLabels'] = crowdLabels; map['CardType'] = cardType.index; map['PatientGender'] = patientGender.index; if (patientAddress != null) map['PatientAddress'] = patientAddress; if (permanentResidenceAddress != null) map['PermanentResidenceAddress'] = permanentResidenceAddress; if (teamRegionCode != null) map['TeamRegionCode'] = teamRegionCode; if (contractedDoctor != null) map['ContractedDoctor'] = contractedDoctor; return map; } } enum PatientStatusEnum { Created, Cancellation, } class PatientDTO extends BaseDTO{ String? code; String? recordNo; String? patientName; String? phone; String? cardNo; String? nationality; DateTime? birthday; List? crowdLabels; CardTypeEnum cardType; GenderEnum patientGender; String? patientAddress; String? permanentResidenceAddress; String? teamRegionCode; String? createdDoctor; String? contractedDoctor; List? labelNames; String? createdDoctorName; String? createdOrgName; String? createdTeamName; PatientStatusEnum status; String? createdOrgCode; String? createdTeamCode; String? contractedDoctorName; ContractStateEnum contractState; List? photos; PatientDTO({ this.code, this.recordNo, this.patientName, this.phone, this.cardNo, this.nationality, this.birthday, this.crowdLabels, this.cardType = CardTypeEnum.Identity, this.patientGender = GenderEnum.Unknown, this.patientAddress, this.permanentResidenceAddress, this.teamRegionCode, this.createdDoctor, this.contractedDoctor, this.labelNames, this.createdDoctorName, this.createdOrgName, this.createdTeamName, this.status = PatientStatusEnum.Created, this.createdOrgCode, this.createdTeamCode, this.contractedDoctorName, this.contractState = ContractStateEnum.Unsigned, this.photos, DateTime? createTime, DateTime? updateTime, }) : super( createTime: createTime, updateTime: updateTime, ); factory PatientDTO.fromJson(Map map) { return PatientDTO( code: map['Code'], recordNo: map['RecordNo'], patientName: map['PatientName'], phone: map['Phone'], cardNo: map['CardNo'], nationality: map['Nationality'], birthday: map['Birthday'] != null ? DateTime.parse(map['Birthday']) : null, crowdLabels: map['CrowdLabels']?.cast().toList(), cardType: CardTypeEnum.values.firstWhere((e) => e.index == map['CardType']), patientGender: GenderEnum.values.firstWhere((e) => e.index == map['PatientGender']), patientAddress: map['PatientAddress'], permanentResidenceAddress: map['PermanentResidenceAddress'], teamRegionCode: map['TeamRegionCode'], createdDoctor: map['CreatedDoctor'], contractedDoctor: map['ContractedDoctor'], labelNames: map['LabelNames']?.cast().toList(), createdDoctorName: map['CreatedDoctorName'], createdOrgName: map['CreatedOrgName'], createdTeamName: map['CreatedTeamName'], status: PatientStatusEnum.values.firstWhere((e) => e.index == map['Status']), createdOrgCode: map['CreatedOrgCode'], createdTeamCode: map['CreatedTeamCode'], contractedDoctorName: map['ContractedDoctorName'], contractState: ContractStateEnum.values.firstWhere((e) => e.index == map['ContractState']), photos: map['Photos']?.cast().toList(), createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null, updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null, ); } Map toJson() { final map = super.toJson(); if (code != null) map['Code'] = code; if (recordNo != null) map['RecordNo'] = recordNo; if (patientName != null) map['PatientName'] = patientName; if (phone != null) map['Phone'] = phone; if (cardNo != null) map['CardNo'] = cardNo; if (nationality != null) map['Nationality'] = nationality; if (birthday != null) map['Birthday'] = JsonRpcUtils.dateFormat(birthday!); if (crowdLabels != null) map['CrowdLabels'] = crowdLabels; map['CardType'] = cardType.index; map['PatientGender'] = patientGender.index; if (patientAddress != null) map['PatientAddress'] = patientAddress; if (permanentResidenceAddress != null) map['PermanentResidenceAddress'] = permanentResidenceAddress; if (teamRegionCode != null) map['TeamRegionCode'] = teamRegionCode; if (createdDoctor != null) map['CreatedDoctor'] = createdDoctor; if (contractedDoctor != null) map['ContractedDoctor'] = contractedDoctor; if (labelNames != null) map['LabelNames'] = labelNames; if (createdDoctorName != null) map['CreatedDoctorName'] = createdDoctorName; if (createdOrgName != null) map['CreatedOrgName'] = createdOrgName; if (createdTeamName != null) map['CreatedTeamName'] = createdTeamName; map['Status'] = status.index; if (createdOrgCode != null) map['CreatedOrgCode'] = createdOrgCode; if (createdTeamCode != null) map['CreatedTeamCode'] = createdTeamCode; if (contractedDoctorName != null) map['ContractedDoctorName'] = contractedDoctorName; map['ContractState'] = contractState.index; if (photos != null) map['Photos'] = photos; return map; } } class GetPatientRequest extends TokenRequest{ String? code; GetPatientRequest({ this.code, String? token, }) : super( token: token, ); factory GetPatientRequest.fromJson(Map map) { return GetPatientRequest( code: map['Code'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); if (code != null) map['Code'] = code; return map; } } class GetPatientByKeyRequest extends TokenRequest{ String? key; String? value; GetPatientByKeyRequest({ this.key, this.value, String? token, }) : super( token: token, ); factory GetPatientByKeyRequest.fromJson(Map map) { return GetPatientByKeyRequest( key: map['Key'], value: map['Value'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); if (key != null) map['Key'] = key; if (value != null) map['Value'] = value; return map; } } class PatientPageRequest extends PageRequest{ List? crowdLabels; String? keyword; DateTime? startTime; DateTime? endTime; PatientPageRequest({ this.crowdLabels, this.keyword, this.startTime, this.endTime, int pageIndex = 0, int pageSize = 0, String? token, }) : super( pageIndex: pageIndex, pageSize: pageSize, token: token, ); factory PatientPageRequest.fromJson(Map map) { return PatientPageRequest( crowdLabels: map['CrowdLabels']?.cast().toList(), keyword: map['Keyword'], startTime: map['StartTime'] != null ? DateTime.parse(map['StartTime']) : null, endTime: map['EndTime'] != null ? DateTime.parse(map['EndTime']) : null, pageIndex: map['PageIndex'], pageSize: map['PageSize'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); if (crowdLabels != null) map['CrowdLabels'] = crowdLabels; if (keyword != null) map['Keyword'] = keyword; if (startTime != null) map['StartTime'] = JsonRpcUtils.dateFormat(startTime!); if (endTime != null) map['EndTime'] = JsonRpcUtils.dateFormat(endTime!); return map; } } class RemovePatientRequest extends TokenRequest{ String? code; RemovePatientRequest({ this.code, String? token, }) : super( token: token, ); factory RemovePatientRequest.fromJson(Map map) { return RemovePatientRequest( code: map['Code'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); if (code != null) map['Code'] = code; return map; } } class GetPatientListRequest extends TokenRequest{ List? codes; GetPatientListRequest({ this.codes, String? token, }) : super( token: token, ); factory GetPatientListRequest.fromJson(Map map) { return GetPatientListRequest( codes: map['Codes']?.cast().toList(), token: map['Token'], ); } Map toJson() { final map = super.toJson(); if (codes != null) map['Codes'] = codes; return map; } } class UpdatePatientRequest2 extends TokenRequest{ String? code; String? patientName; String? phone; String? cardNo; String? nationality; DateTime? birthday; List? crowdLabels; CardTypeEnum? cardType; GenderEnum? patientGender; String? patientAddress; String? permanentResidenceAddress; String? teamRegionCode; String? contractedDoctor; UpdatePatientRequest2({ this.code, this.patientName, this.phone, this.cardNo, this.nationality, this.birthday, this.crowdLabels, this.cardType, this.patientGender, this.patientAddress, this.permanentResidenceAddress, this.teamRegionCode, this.contractedDoctor, String? token, }) : super( token: token, ); factory UpdatePatientRequest2.fromJson(Map map) { return UpdatePatientRequest2( code: map['Code'], patientName: map['PatientName'], phone: map['Phone'], cardNo: map['CardNo'], nationality: map['Nationality'], birthday: map['Birthday'] != null ? DateTime.parse(map['Birthday']) : null, crowdLabels: map['CrowdLabels']?.cast().toList(), cardType: map['CardType'] != null ? CardTypeEnum.values.firstWhere((e) => e.index == map['CardType']) : null, patientGender: map['PatientGender'] != null ? GenderEnum.values.firstWhere((e) => e.index == map['PatientGender']) : null, patientAddress: map['PatientAddress'], permanentResidenceAddress: map['PermanentResidenceAddress'], teamRegionCode: map['TeamRegionCode'], contractedDoctor: map['ContractedDoctor'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); if (code != null) map['Code'] = code; if (patientName != null) map['PatientName'] = patientName; if (phone != null) map['Phone'] = phone; if (cardNo != null) map['CardNo'] = cardNo; if (nationality != null) map['Nationality'] = nationality; if (birthday != null) map['Birthday'] = JsonRpcUtils.dateFormat(birthday!); if (crowdLabels != null) map['CrowdLabels'] = crowdLabels; if (cardType != null) map['CardType'] = cardType; if (patientGender != null) map['PatientGender'] = patientGender; if (patientAddress != null) map['PatientAddress'] = patientAddress; if (permanentResidenceAddress != null) map['PermanentResidenceAddress'] = permanentResidenceAddress; if (teamRegionCode != null) map['TeamRegionCode'] = teamRegionCode; if (contractedDoctor != null) map['ContractedDoctor'] = contractedDoctor; return map; } } class SetCrowdLabelsRequest extends TokenRequest{ String? code; List? crowdLabels; SetCrowdLabelsRequest({ this.code, this.crowdLabels, String? token, }) : super( token: token, ); factory SetCrowdLabelsRequest.fromJson(Map map) { return SetCrowdLabelsRequest( code: map['Code'], crowdLabels: map['CrowdLabels']?.cast().toList(), token: map['Token'], ); } Map toJson() { final map = super.toJson(); if (code != null) map['Code'] = code; if (crowdLabels != null) map['CrowdLabels'] = crowdLabels; return map; } } class UpdatePatientPhotosRequest extends TokenRequest{ String? code; List? photos; UpdatePatientPhotosRequest({ this.code, this.photos, String? token, }) : super( token: token, ); factory UpdatePatientPhotosRequest.fromJson(Map map) { return UpdatePatientPhotosRequest( code: map['Code'], photos: map['Photos']?.cast().toList(), token: map['Token'], ); } Map toJson() { final map = super.toJson(); if (code != null) map['Code'] = code; if (photos != null) map['Photos'] = photos; return map; } } enum FaceScanErrorTypeEnum2 { Success, NoCreated, APIError, } class PatientBaseDTO { bool isSuccess; FaceScanErrorTypeEnum2 faceScanErrorType; String? errorMessage; String? cardNo; String? patientName; String? nationality; DateTime? birthday; GenderEnum patientGender; String? patientAddress; PatientBaseDTO({ this.isSuccess = false, this.faceScanErrorType = FaceScanErrorTypeEnum2.Success, this.errorMessage, this.cardNo, this.patientName, this.nationality, this.birthday, this.patientGender = GenderEnum.Unknown, this.patientAddress, }); factory PatientBaseDTO.fromJson(Map map) { return PatientBaseDTO( isSuccess: map['IsSuccess'], faceScanErrorType: FaceScanErrorTypeEnum2.values.firstWhere((e) => e.index == map['FaceScanErrorType']), errorMessage: map['ErrorMessage'], cardNo: map['CardNo'], patientName: map['PatientName'], nationality: map['Nationality'], birthday: map['Birthday'] != null ? DateTime.parse(map['Birthday']) : null, patientGender: GenderEnum.values.firstWhere((e) => e.index == map['PatientGender']), patientAddress: map['PatientAddress'], ); } Map toJson() { final map = Map(); map['IsSuccess'] = isSuccess; map['FaceScanErrorType'] = faceScanErrorType.index; if (errorMessage != null) { map['ErrorMessage'] = errorMessage; } if (cardNo != null) { map['CardNo'] = cardNo; } if (patientName != null) { map['PatientName'] = patientName; } if (nationality != null) { map['Nationality'] = nationality; } if (birthday != null) { map['Birthday'] = JsonRpcUtils.dateFormat(birthday!); } map['PatientGender'] = patientGender.index; if (patientAddress != null) { map['PatientAddress'] = patientAddress; } return map; } } class GetPatientBaseByImageRequest extends TokenRequest{ String? image; GetPatientBaseByImageRequest({ this.image, String? token, }) : super( token: token, ); factory GetPatientBaseByImageRequest.fromJson(Map map) { return GetPatientBaseByImageRequest( image: map['Image'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); if (image != null) map['Image'] = image; return map; } } class GetPatientBaseByFaceImageRequest extends TokenRequest{ String? image; GetPatientBaseByFaceImageRequest({ this.image, String? token, }) : super( token: token, ); factory GetPatientBaseByFaceImageRequest.fromJson(Map map) { return GetPatientBaseByFaceImageRequest( image: map['Image'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); if (image != null) map['Image'] = image; return map; } } class SavePersonDTO { bool success; String? bindCardNo; String? errMessage; SavePersonDTO({ this.success = false, this.bindCardNo, this.errMessage, }); factory SavePersonDTO.fromJson(Map map) { return SavePersonDTO( success: map['Success'], bindCardNo: map['BindCardNo'], errMessage: map['ErrMessage'], ); } Map toJson() { final map = Map(); map['Success'] = success; if (bindCardNo != null) { map['BindCardNo'] = bindCardNo; } if (errMessage != null) { map['ErrMessage'] = errMessage; } return map; } } class SavePatientBaseByFaceImageRequest extends TokenRequest{ String? cardNo; String? image; SavePatientBaseByFaceImageRequest({ this.cardNo, this.image, String? token, }) : super( token: token, ); factory SavePatientBaseByFaceImageRequest.fromJson(Map map) { return SavePatientBaseByFaceImageRequest( cardNo: map['CardNo'], image: map['Image'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); if (cardNo != null) map['CardNo'] = cardNo; if (image != null) map['Image'] = image; return map; } } class DeletePersonDTO { bool success; String? errMessage; DeletePersonDTO({ this.success = false, this.errMessage, }); factory DeletePersonDTO.fromJson(Map map) { return DeletePersonDTO( success: map['Success'], errMessage: map['ErrMessage'], ); } Map toJson() { final map = Map(); map['Success'] = success; if (errMessage != null) { map['ErrMessage'] = errMessage; } return map; } } class UnbindAndCreateByFaceImageRequest extends TokenRequest{ String? oldCardNo; String? newCardNo; String? image; UnbindAndCreateByFaceImageRequest({ this.oldCardNo, this.newCardNo, this.image, String? token, }) : super( token: token, ); factory UnbindAndCreateByFaceImageRequest.fromJson(Map map) { return UnbindAndCreateByFaceImageRequest( oldCardNo: map['OldCardNo'], newCardNo: map['NewCardNo'], image: map['Image'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); if (oldCardNo != null) map['OldCardNo'] = oldCardNo; if (newCardNo != null) map['NewCardNo'] = newCardNo; if (image != null) map['Image'] = image; return map; } } class UnbindByCardNoRequest extends TokenRequest{ String? cardNo; UnbindByCardNoRequest({ this.cardNo, String? token, }) : super( token: token, ); factory UnbindByCardNoRequest.fromJson(Map map) { return UnbindByCardNoRequest( cardNo: map['CardNo'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); if (cardNo != null) map['CardNo'] = cardNo; return map; } }