import 'notification.m.dart'; import 'liveConsultation.m.dart'; class SettingDTOClass { String? langugeKey; String? settingModule; String? customContent; String? completeContent; String? baseConfigVersion; String? version; SettingDTOClass({ this.langugeKey, this.settingModule, this.customContent, this.completeContent, this.baseConfigVersion, this.version, }); factory SettingDTOClass.fromJson(Map map) { return SettingDTOClass( langugeKey: map['LangugeKey'], settingModule: map['SettingModule'], customContent: map['CustomContent'], completeContent: map['CompleteContent'], baseConfigVersion: map['BaseConfigVersion'], version: map['Version'], ); } Map toJson() { final map = Map(); if(langugeKey != null) map['LangugeKey'] = langugeKey; if(settingModule != null) map['SettingModule'] = settingModule; if(customContent != null) map['CustomContent'] = customContent; if(completeContent != null) map['CompleteContent'] = completeContent; if(baseConfigVersion != null) map['BaseConfigVersion'] = baseConfigVersion; if(version != null) map['Version'] = version; return map; } } class ReferralOrganizationDTO { String? organizationCode; String? organizationName; ReferralOrganizationDTO({ this.organizationCode, this.organizationName, }); factory ReferralOrganizationDTO.fromJson(Map map) { return ReferralOrganizationDTO( organizationCode: map['OrganizationCode'], organizationName: map['OrganizationName'], ); } Map toJson() { final map = Map(); if(organizationCode != null) map['OrganizationCode'] = organizationCode; if(organizationName != null) map['OrganizationName'] = organizationName; return map; } } class OrganizationBasicDTO extends OrganizationBaseDTO{ String? regionCode; String? parentCode; String? logoUrl; OrganizationPatientTypeEnum patientType; bool isinvented; List? settings; List? diagnosisModules; bool isEncryptedShow; double referralLimitHours; List? referralOrganizationCodes; List? referralOrganizations; OrganizationBasicDTO({ this.regionCode, this.parentCode, this.logoUrl, this.patientType = OrganizationPatientTypeEnum.Person, this.isinvented = false, this.settings, this.diagnosisModules, this.isEncryptedShow = false, this.referralLimitHours = 0, this.referralOrganizationCodes, this.referralOrganizations, String? organizationCode, String? organizationName, DateTime? createTime, DateTime? updateTime, }) : super( organizationCode: organizationCode, organizationName: organizationName, createTime: createTime, updateTime: updateTime, ); factory OrganizationBasicDTO.fromJson(Map map) { return OrganizationBasicDTO( regionCode: map['RegionCode'], parentCode: map['ParentCode'], logoUrl: map['LogoUrl'], patientType: OrganizationPatientTypeEnum.values.firstWhere((e) => e.index == map['PatientType']), isinvented: map['Isinvented'], settings: map['Settings'] != null ? (map['Settings'] as List).map((e)=>SettingDTOClass.fromJson(e as Map)).toList() : null, diagnosisModules: map['DiagnosisModules'] != null ? map['DiagnosisModules'].cast().toList() : null, isEncryptedShow: map['IsEncryptedShow'], referralLimitHours: double.parse(map['ReferralLimitHours'].toString()), referralOrganizationCodes: map['ReferralOrganizationCodes'] != null ? map['ReferralOrganizationCodes'].cast().toList() : null, referralOrganizations: map['ReferralOrganizations'] != null ? (map['ReferralOrganizations'] as List).map((e)=>ReferralOrganizationDTO.fromJson(e as Map)).toList() : null, organizationCode: map['OrganizationCode'], organizationName: map['OrganizationName'], 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(regionCode != null) map['RegionCode'] = regionCode; if(parentCode != null) map['ParentCode'] = parentCode; if(logoUrl != null) map['LogoUrl'] = logoUrl; map['PatientType'] = patientType.index; map['Isinvented'] = isinvented; if(settings != null) map['Settings'] = settings; if(diagnosisModules != null) map['DiagnosisModules'] = diagnosisModules; map['IsEncryptedShow'] = isEncryptedShow; map['ReferralLimitHours'] = referralLimitHours; if(referralOrganizationCodes != null) map['ReferralOrganizationCodes'] = referralOrganizationCodes; if(referralOrganizations != null) map['ReferralOrganizations'] = referralOrganizations; return map; } } enum OrganizationTypeEnum { Corporation, Department, Section, } enum OrganizationStateEnum { WaitAudit, Audited, Rejected, } class OrganizationDTO extends OrganizationBasicDTO{ String? description; String? rootCode; OrganizationTypeEnum organizationType; List? authorityGroups; String? nautica; OrganizationStateEnum state; List? directors; List? assignedAdmins; String? patientSettingJson; String? examSettingJson; String? consultationSettingJson; String? patientSettingVersion; String? examSettingVersion; String? consultationSettingVersion; String? parentOrganizationName; OrganizationDTO({ this.description, this.rootCode, this.organizationType = OrganizationTypeEnum.Corporation, this.authorityGroups, this.nautica, this.state = OrganizationStateEnum.WaitAudit, this.directors, this.assignedAdmins, this.patientSettingJson, this.examSettingJson, this.consultationSettingJson, this.patientSettingVersion, this.examSettingVersion, this.consultationSettingVersion, this.parentOrganizationName, String? regionCode, String? parentCode, String? logoUrl, OrganizationPatientTypeEnum patientType = OrganizationPatientTypeEnum.Person, bool isinvented = false, List? settings, List? diagnosisModules, bool isEncryptedShow = false, double referralLimitHours = 0, List? referralOrganizationCodes, List? referralOrganizations, String? organizationCode, String? organizationName, DateTime? createTime, DateTime? updateTime, }) : super( regionCode: regionCode, parentCode: parentCode, logoUrl: logoUrl, patientType: patientType, isinvented: isinvented, settings: settings, diagnosisModules: diagnosisModules, isEncryptedShow: isEncryptedShow, referralLimitHours: referralLimitHours, referralOrganizationCodes: referralOrganizationCodes, referralOrganizations: referralOrganizations, organizationCode: organizationCode, organizationName: organizationName, createTime: createTime, updateTime: updateTime, ); factory OrganizationDTO.fromJson(Map map) { return OrganizationDTO( description: map['Description'], rootCode: map['RootCode'], organizationType: OrganizationTypeEnum.values.firstWhere((e) => e.index == map['OrganizationType']), authorityGroups: map['AuthorityGroups'] != null ? map['AuthorityGroups'].cast().toList() : null, nautica: map['Nautica'], state: OrganizationStateEnum.values.firstWhere((e) => e.index == map['State']), directors: map['Directors'] != null ? map['Directors'].cast().toList() : null, assignedAdmins: map['AssignedAdmins'] != null ? map['AssignedAdmins'].cast().toList() : null, patientSettingJson: map['PatientSettingJson'], examSettingJson: map['ExamSettingJson'], consultationSettingJson: map['ConsultationSettingJson'], patientSettingVersion: map['PatientSettingVersion'], examSettingVersion: map['ExamSettingVersion'], consultationSettingVersion: map['ConsultationSettingVersion'], parentOrganizationName: map['ParentOrganizationName'], regionCode: map['RegionCode'], parentCode: map['ParentCode'], logoUrl: map['LogoUrl'], patientType: OrganizationPatientTypeEnum.values.firstWhere((e) => e.index == map['PatientType']), isinvented: map['Isinvented'], settings: map['Settings'] != null ? (map['Settings'] as List).map((e)=>SettingDTOClass.fromJson(e as Map)).toList() : null, diagnosisModules: map['DiagnosisModules'] != null ? map['DiagnosisModules'].cast().toList() : null, isEncryptedShow: map['IsEncryptedShow'], referralLimitHours: double.parse(map['ReferralLimitHours'].toString()), referralOrganizationCodes: map['ReferralOrganizationCodes'] != null ? map['ReferralOrganizationCodes'].cast().toList() : null, referralOrganizations: map['ReferralOrganizations'] != null ? (map['ReferralOrganizations'] as List).map((e)=>ReferralOrganizationDTO.fromJson(e as Map)).toList() : null, organizationCode: map['OrganizationCode'], organizationName: map['OrganizationName'], 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(description != null) map['Description'] = description; if(rootCode != null) map['RootCode'] = rootCode; map['OrganizationType'] = organizationType.index; if(authorityGroups != null) map['AuthorityGroups'] = authorityGroups; if(nautica != null) map['Nautica'] = nautica; map['State'] = state.index; if(directors != null) map['Directors'] = directors; if(assignedAdmins != null) map['AssignedAdmins'] = assignedAdmins; if(patientSettingJson != null) map['PatientSettingJson'] = patientSettingJson; if(examSettingJson != null) map['ExamSettingJson'] = examSettingJson; if(consultationSettingJson != null) map['ConsultationSettingJson'] = consultationSettingJson; if(patientSettingVersion != null) map['PatientSettingVersion'] = patientSettingVersion; if(examSettingVersion != null) map['ExamSettingVersion'] = examSettingVersion; if(consultationSettingVersion != null) map['ConsultationSettingVersion'] = consultationSettingVersion; if(parentOrganizationName != null) map['ParentOrganizationName'] = parentOrganizationName; return map; } } class SearchOrganizationsRequest extends TokenRequest{ String? keyword; String? parentCode; OrganizationTypeEnum organizationType; SearchOrganizationsRequest({ this.keyword, this.parentCode, this.organizationType = OrganizationTypeEnum.Corporation, String? token, }) : super( token: token, ); factory SearchOrganizationsRequest.fromJson(Map map) { return SearchOrganizationsRequest( keyword: map['Keyword'], parentCode: map['ParentCode'], organizationType: OrganizationTypeEnum.values.firstWhere((e) => e.index == map['OrganizationType']), token: map['Token'], ); } Map toJson() { final map = super.toJson(); if(keyword != null) map['Keyword'] = keyword; if(parentCode != null) map['ParentCode'] = parentCode; map['OrganizationType'] = organizationType.index; return map; } } class GetOrganizationByCodeRequest extends TokenRequest{ String? organizationCode; GetOrganizationByCodeRequest({ this.organizationCode, String? token, }) : super( token: token, ); factory GetOrganizationByCodeRequest.fromJson(Map map) { return GetOrganizationByCodeRequest( organizationCode: map['OrganizationCode'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); if(organizationCode != null) map['OrganizationCode'] = organizationCode; return map; } } class GetParentOrganizationListRequest extends TokenRequest{ GetParentOrganizationListRequest({ String? token, }) : super( token: token, ); factory GetParentOrganizationListRequest.fromJson(Map map) { return GetParentOrganizationListRequest( token: map['Token'], ); } Map toJson() { final map = super.toJson(); return map; } } class FindOrganizationListRequest extends PageRequest{ String? keyWord; FindOrganizationListRequest({ this.keyWord, int pageIndex = 0, int pageSize = 0, String? token, }) : super( pageIndex: pageIndex, pageSize: pageSize, token: token, ); factory FindOrganizationListRequest.fromJson(Map map) { return FindOrganizationListRequest( keyWord: map['KeyWord'], pageIndex: map['PageIndex'], pageSize: map['PageSize'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); if(keyWord != null) map['KeyWord'] = keyWord; return map; } } class FindPatientOrganizationsByPageRequest extends PageRequest{ String? keyWord; FindPatientOrganizationsByPageRequest({ this.keyWord, int pageIndex = 0, int pageSize = 0, String? token, }) : super( pageIndex: pageIndex, pageSize: pageSize, token: token, ); factory FindPatientOrganizationsByPageRequest.fromJson(Map map) { return FindPatientOrganizationsByPageRequest( keyWord: map['KeyWord'], pageIndex: map['PageIndex'], pageSize: map['PageSize'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); if(keyWord != null) map['KeyWord'] = keyWord; return map; } } class GetPersonOrganizationRequest extends TokenRequest{ GetPersonOrganizationRequest({ String? token, }) : super( token: token, ); factory GetPersonOrganizationRequest.fromJson(Map map) { return GetPersonOrganizationRequest( token: map['Token'], ); } Map toJson() { final map = super.toJson(); return map; } } class SavePersonOrganizationRequest { String? token; String? regionCode; String? parentCode; String? logoUrl; String? organizationCode; String? organizationName; OrganizationPatientTypeEnum patientType; bool isEncryptedShow; double referralLimitHours; List? referralOrganizationCodes; SavePersonOrganizationRequest({ this.token, this.regionCode, this.parentCode, this.logoUrl, this.organizationCode, this.organizationName, this.patientType = OrganizationPatientTypeEnum.Person, this.isEncryptedShow = false, this.referralLimitHours = 0, this.referralOrganizationCodes, }); factory SavePersonOrganizationRequest.fromJson(Map map) { return SavePersonOrganizationRequest( token: map['Token'], regionCode: map['RegionCode'], parentCode: map['ParentCode'], logoUrl: map['LogoUrl'], organizationCode: map['OrganizationCode'], organizationName: map['OrganizationName'], patientType: OrganizationPatientTypeEnum.values.firstWhere((e) => e.index == map['PatientType']), isEncryptedShow: map['IsEncryptedShow'], referralLimitHours: double.parse(map['ReferralLimitHours'].toString()), referralOrganizationCodes: map['ReferralOrganizationCodes'] != null ? map['ReferralOrganizationCodes'].cast().toList() : null, ); } Map toJson() { final map = Map(); if(token != null) map['Token'] = token; if(regionCode != null) map['RegionCode'] = regionCode; if(parentCode != null) map['ParentCode'] = parentCode; if(logoUrl != null) map['LogoUrl'] = logoUrl; if(organizationCode != null) map['OrganizationCode'] = organizationCode; if(organizationName != null) map['OrganizationName'] = organizationName; map['PatientType'] = patientType.index; map['IsEncryptedShow'] = isEncryptedShow; map['ReferralLimitHours'] = referralLimitHours; if(referralOrganizationCodes != null) map['ReferralOrganizationCodes'] = referralOrganizationCodes; return map; } } class OrganizationItemDTO { String? organizationName; String? parentCode; String? extendsData; OrganizationPatientTypeEnum patientType; OrganizationItemDTO({ this.organizationName, this.parentCode, this.extendsData, this.patientType = OrganizationPatientTypeEnum.Person, }); factory OrganizationItemDTO.fromJson(Map map) { return OrganizationItemDTO( organizationName: map['OrganizationName'], parentCode: map['ParentCode'], extendsData: map['ExtendsData'], patientType: OrganizationPatientTypeEnum.values.firstWhere((e) => e.index == map['PatientType']), ); } Map toJson() { final map = Map(); if(organizationName != null) map['OrganizationName'] = organizationName; if(parentCode != null) map['ParentCode'] = parentCode; if(extendsData != null) map['ExtendsData'] = extendsData; map['PatientType'] = patientType.index; return map; } } class AddOrganizationsRequest extends TokenRequest{ List? organizationInfos; String? languageCode; AddOrganizationsRequest({ this.organizationInfos, this.languageCode, String? token, }) : super( token: token, ); factory AddOrganizationsRequest.fromJson(Map map) { return AddOrganizationsRequest( organizationInfos: map['OrganizationInfos'] != null ? (map['OrganizationInfos'] as List).map((e)=>OrganizationItemDTO.fromJson(e as Map)).toList() : null, languageCode: map['LanguageCode'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); if(organizationInfos != null) map['OrganizationInfos'] = organizationInfos; if(languageCode != null) map['LanguageCode'] = languageCode; return map; } } class RemoveOrganizationsRequest extends TokenRequest{ List? organizationCodes; RemoveOrganizationsRequest({ this.organizationCodes, String? token, }) : super( token: token, ); factory RemoveOrganizationsRequest.fromJson(Map map) { return RemoveOrganizationsRequest( organizationCodes: map['OrganizationCodes'] != null ? map['OrganizationCodes'].cast().toList() : null, token: map['Token'], ); } Map toJson() { final map = super.toJson(); if(organizationCodes != null) map['OrganizationCodes'] = organizationCodes; return map; } } class UpdateOrganizationNameRequest extends TokenRequest{ String? organizationCode; String? organizationName; UpdateOrganizationNameRequest({ this.organizationCode, this.organizationName, String? token, }) : super( token: token, ); factory UpdateOrganizationNameRequest.fromJson(Map map) { return UpdateOrganizationNameRequest( organizationCode: map['OrganizationCode'], organizationName: map['OrganizationName'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); if(organizationCode != null) map['OrganizationCode'] = organizationCode; if(organizationName != null) map['OrganizationName'] = organizationName; return map; } } class OrganizationSettingResult { String? settingVersion; String? cMSTemplateCode; String? settingData; OrganizationSettingResult({ this.settingVersion, this.cMSTemplateCode, this.settingData, }); factory OrganizationSettingResult.fromJson(Map map) { return OrganizationSettingResult( settingVersion: map['SettingVersion'], cMSTemplateCode: map['CMSTemplateCode'], settingData: map['SettingData'], ); } Map toJson() { final map = Map(); if(settingVersion != null) map['SettingVersion'] = settingVersion; if(cMSTemplateCode != null) map['CMSTemplateCode'] = cMSTemplateCode; if(settingData != null) map['SettingData'] = settingData; return map; } } enum OrganizationSettingTypeEnum { Patient, Exam, Consultation, StatisticsFake, IsOpenFake, } class GetUserOrganizationSettingRequest extends TokenRequest{ OrganizationSettingTypeEnum settingType; String? version; GetUserOrganizationSettingRequest({ this.settingType = OrganizationSettingTypeEnum.Patient, this.version, String? token, }) : super( token: token, ); factory GetUserOrganizationSettingRequest.fromJson(Map map) { return GetUserOrganizationSettingRequest( settingType: OrganizationSettingTypeEnum.values.firstWhere((e) => e.index == map['SettingType']), version: map['Version'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); map['SettingType'] = settingType.index; if(version != null) map['Version'] = version; return map; } } class ServerLangugeClass { String? langugeKey; List? langugeModules; ServerLangugeClass({ this.langugeKey, this.langugeModules, }); factory ServerLangugeClass.fromJson(Map map) { return ServerLangugeClass( langugeKey: map['LangugeKey'], langugeModules: map['LangugeModules'] != null ? map['LangugeModules'].cast().toList() : null, ); } Map toJson() { final map = Map(); if(langugeKey != null) map['LangugeKey'] = langugeKey; if(langugeModules != null) map['LangugeModules'] = langugeModules; return map; } } class ServerSettingResult { List? serverLangugeList; Map? serverConfigList; int heartRateSeconds; int liveConsultationDefaultQueryDays; String? notificationUrl; int liveConsultationRateSeconds; String? cMSUrl; bool isSelfRtcService; String? liveProtocol; ServerSettingResult({ this.serverLangugeList, this.serverConfigList, this.heartRateSeconds = 0, this.liveConsultationDefaultQueryDays = 0, this.notificationUrl, this.liveConsultationRateSeconds = 0, this.cMSUrl, this.isSelfRtcService = false, this.liveProtocol, }); factory ServerSettingResult.fromJson(Map map) { return ServerSettingResult( serverLangugeList: map['ServerLangugeList'] != null ? (map['ServerLangugeList'] as List).map((e)=>ServerLangugeClass.fromJson(e as Map)).toList() : null, serverConfigList: map['ServerConfigList'] != null ? map['ServerConfigList'].cast() : null, heartRateSeconds: map['HeartRateSeconds'], liveConsultationDefaultQueryDays: map['LiveConsultationDefaultQueryDays'], notificationUrl: map['NotificationUrl'], liveConsultationRateSeconds: map['LiveConsultationRateSeconds'], cMSUrl: map['CMSUrl'], isSelfRtcService: map['IsSelfRtcService'], liveProtocol: map['LiveProtocol'], ); } Map toJson() { final map = Map(); if(serverLangugeList != null) map['ServerLangugeList'] = serverLangugeList; if(serverConfigList != null) map['ServerConfigList'] = serverConfigList; map['HeartRateSeconds'] = heartRateSeconds; map['LiveConsultationDefaultQueryDays'] = liveConsultationDefaultQueryDays; if(notificationUrl != null) map['NotificationUrl'] = notificationUrl; map['LiveConsultationRateSeconds'] = liveConsultationRateSeconds; if(cMSUrl != null) map['CMSUrl'] = cMSUrl; map['IsSelfRtcService'] = isSelfRtcService; if(liveProtocol != null) map['LiveProtocol'] = liveProtocol; return map; } } class LangugeDataResult { String? version; String? content; String? langugeModule; LangugeDataResult({ this.version, this.content, this.langugeModule, }); factory LangugeDataResult.fromJson(Map map) { return LangugeDataResult( version: map['Version'], content: map['Content'], langugeModule: map['LangugeModule'], ); } Map toJson() { final map = Map(); if(version != null) map['Version'] = version; if(content != null) map['Content'] = content; if(langugeModule != null) map['LangugeModule'] = langugeModule; return map; } } class LangugeDataItemRequest { String? version; String? langugeModule; LangugeDataItemRequest({ this.version, this.langugeModule, }); factory LangugeDataItemRequest.fromJson(Map map) { return LangugeDataItemRequest( version: map['Version'], langugeModule: map['LangugeModule'], ); } Map toJson() { final map = Map(); if(version != null) map['Version'] = version; if(langugeModule != null) map['LangugeModule'] = langugeModule; return map; } } class LangugeDataRequest extends TokenRequest{ String? langugeKey; List? langugeDataItemList; LangugeDataRequest({ this.langugeKey, this.langugeDataItemList, String? token, }) : super( token: token, ); factory LangugeDataRequest.fromJson(Map map) { return LangugeDataRequest( langugeKey: map['LangugeKey'], langugeDataItemList: map['LangugeDataItemList'] != null ? (map['LangugeDataItemList'] as List).map((e)=>LangugeDataItemRequest.fromJson(e as Map)).toList() : null, token: map['Token'], ); } Map toJson() { final map = super.toJson(); if(langugeKey != null) map['LangugeKey'] = langugeKey; if(langugeDataItemList != null) map['LangugeDataItemList'] = langugeDataItemList; return map; } }