123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642 |
- import 'notification.m.dart';
- import 'appletAPI.m.dart';
- import 'liveConsultation.m.dart';
- import 'package:fis_jsonrpc/utils.dart';
- enum BookingTypeEnum {
- Personal,
- Group,
- }
- enum BookingStatusEnum {
- UnSubmitted,
- Booked,
- Canceled,
- }
- class HealthExamPersonDTO {
- String? name;
- PatientGenderEnum gender;
- String? identityCard;
- String? phone;
- HealthExamPersonDTO({
- this.name,
- this.gender = PatientGenderEnum.NotFilled,
- this.identityCard,
- this.phone,
- });
- factory HealthExamPersonDTO.fromJson(Map<String, dynamic> map) {
- return HealthExamPersonDTO(
- name: map['Name'],
- gender: PatientGenderEnum.values.firstWhere((e) => e.index == map['Gender']),
- identityCard: map['IdentityCard'],
- phone: map['Phone'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- if (name != null) {
- map['Name'] = name;
- }
- map['Gender'] = gender.index;
- if (identityCard != null) {
- map['IdentityCard'] = identityCard;
- }
- if (phone != null) {
- map['Phone'] = phone;
- }
- return map;
- }
- }
- class HealthExamItemDTO {
- String? name;
- String? content;
- HealthExamItemDTO({
- this.name,
- this.content,
- });
- factory HealthExamItemDTO.fromJson(Map<String, dynamic> map) {
- return HealthExamItemDTO(
- name: map['Name'],
- content: map['Content'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- if (name != null) {
- map['Name'] = name;
- }
- if (content != null) {
- map['Content'] = content;
- }
- return map;
- }
- }
- class HealthExamBookingDTO extends BaseDTO{
- String? code;
- BookingTypeEnum bookingType;
- String? name;
- String? location;
- DateTime? startDate;
- DateTime? endDate;
- String? subject;
- String? description;
- String? initiatorCode;
- String? orgCode;
- BookingStatusEnum status;
- List<HealthExamPersonDTO>? persons;
- List<HealthExamItemDTO>? examItems;
- String? shareUrl;
- HealthExamBookingDTO({
- this.code,
- this.bookingType = BookingTypeEnum.Personal,
- this.name,
- this.location,
- this.startDate,
- this.endDate,
- this.subject,
- this.description,
- this.initiatorCode,
- this.orgCode,
- this.status = BookingStatusEnum.UnSubmitted,
- this.persons,
- this.examItems,
- this.shareUrl,
- DateTime? createTime,
- DateTime? updateTime,
- }) : super(
- createTime: createTime,
- updateTime: updateTime,
- );
- factory HealthExamBookingDTO.fromJson(Map<String, dynamic> map) {
- return HealthExamBookingDTO(
- code: map['Code'],
- bookingType: BookingTypeEnum.values.firstWhere((e) => e.index == map['BookingType']),
- name: map['Name'],
- location: map['Location'],
- startDate: map['StartDate'] != null ? DateTime.parse(map['StartDate']) : null,
- endDate: map['EndDate'] != null ? DateTime.parse(map['EndDate']) : null,
- subject: map['Subject'],
- description: map['Description'],
- initiatorCode: map['InitiatorCode'],
- orgCode: map['OrgCode'],
- status: BookingStatusEnum.values.firstWhere((e) => e.index == map['Status']),
- persons: map['Persons'] != null ? (map['Persons'] as List).map((e)=>HealthExamPersonDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
- examItems: map['ExamItems'] != null ? (map['ExamItems'] as List).map((e)=>HealthExamItemDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
- shareUrl: map['ShareUrl'],
- 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 (code != null)
- map['Code'] = code;
- map['BookingType'] = bookingType.index;
- if (name != null)
- map['Name'] = name;
- if (location != null)
- map['Location'] = location;
- if (startDate != null)
- map['StartDate'] = JsonRpcUtils.dateFormat(startDate!);
- if (endDate != null)
- map['EndDate'] = JsonRpcUtils.dateFormat(endDate!);
- if (subject != null)
- map['Subject'] = subject;
- if (description != null)
- map['Description'] = description;
- if (initiatorCode != null)
- map['InitiatorCode'] = initiatorCode;
- if (orgCode != null)
- map['OrgCode'] = orgCode;
- map['Status'] = status.index;
- if (persons != null)
- map['Persons'] = persons;
- if (examItems != null)
- map['ExamItems'] = examItems;
- if (shareUrl != null)
- map['ShareUrl'] = shareUrl;
- return map;
- }
- }
- class GetHealthExamBookingPageRequest extends PageRequest{
- String? keyword;
- List<String>? orgCodes;
- GetHealthExamBookingPageRequest({
- this.keyword,
- this.orgCodes,
- int pageIndex = 0,
- int pageSize = 0,
- String? token,
- }) : super(
- pageIndex: pageIndex,
- pageSize: pageSize,
- token: token,
- );
- factory GetHealthExamBookingPageRequest.fromJson(Map<String, dynamic> map) {
- return GetHealthExamBookingPageRequest(
- keyword: map['Keyword'],
- orgCodes: map['OrgCodes']?.cast<String>().toList(),
- pageIndex: map['PageIndex'],
- pageSize: map['PageSize'],
- token: map['Token'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if (keyword != null)
- map['Keyword'] = keyword;
- if (orgCodes != null)
- map['OrgCodes'] = orgCodes;
- return map;
- }
- }
- class SaveHealthExamBookingRequest extends TokenRequest{
- String? code;
- BookingTypeEnum bookingType;
- String? name;
- String? location;
- DateTime? startDate;
- DateTime? endDate;
- String? subject;
- String? description;
- String? initiatorCode;
- String? orgCode;
- BookingStatusEnum status;
- List<HealthExamPersonDTO>? persons;
- List<HealthExamItemDTO>? examItems;
- SaveHealthExamBookingRequest({
- this.code,
- this.bookingType = BookingTypeEnum.Personal,
- this.name,
- this.location,
- this.startDate,
- this.endDate,
- this.subject,
- this.description,
- this.initiatorCode,
- this.orgCode,
- this.status = BookingStatusEnum.UnSubmitted,
- this.persons,
- this.examItems,
- String? token,
- }) : super(
- token: token,
- );
- factory SaveHealthExamBookingRequest.fromJson(Map<String, dynamic> map) {
- return SaveHealthExamBookingRequest(
- code: map['Code'],
- bookingType: BookingTypeEnum.values.firstWhere((e) => e.index == map['BookingType']),
- name: map['Name'],
- location: map['Location'],
- startDate: map['StartDate'] != null ? DateTime.parse(map['StartDate']) : null,
- endDate: map['EndDate'] != null ? DateTime.parse(map['EndDate']) : null,
- subject: map['Subject'],
- description: map['Description'],
- initiatorCode: map['InitiatorCode'],
- orgCode: map['OrgCode'],
- status: BookingStatusEnum.values.firstWhere((e) => e.index == map['Status']),
- persons: map['Persons'] != null ? (map['Persons'] as List).map((e)=>HealthExamPersonDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
- examItems: map['ExamItems'] != null ? (map['ExamItems'] as List).map((e)=>HealthExamItemDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
- token: map['Token'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if (code != null)
- map['Code'] = code;
- map['BookingType'] = bookingType.index;
- if (name != null)
- map['Name'] = name;
- if (location != null)
- map['Location'] = location;
- if (startDate != null)
- map['StartDate'] = JsonRpcUtils.dateFormat(startDate!);
- if (endDate != null)
- map['EndDate'] = JsonRpcUtils.dateFormat(endDate!);
- if (subject != null)
- map['Subject'] = subject;
- if (description != null)
- map['Description'] = description;
- if (initiatorCode != null)
- map['InitiatorCode'] = initiatorCode;
- if (orgCode != null)
- map['OrgCode'] = orgCode;
- map['Status'] = status.index;
- if (persons != null)
- map['Persons'] = persons;
- if (examItems != null)
- map['ExamItems'] = examItems;
- return map;
- }
- }
- class GetHealthExamBookingRequest extends TokenRequest{
- String? code;
- GetHealthExamBookingRequest({
- this.code,
- String? token,
- }) : super(
- token: token,
- );
- factory GetHealthExamBookingRequest.fromJson(Map<String, dynamic> map) {
- return GetHealthExamBookingRequest(
- code: map['Code'],
- token: map['Token'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if (code != null)
- map['Code'] = code;
- return map;
- }
- }
- class DeleteHealthExamBookingRequest extends TokenRequest{
- String? code;
- DeleteHealthExamBookingRequest({
- this.code,
- String? token,
- }) : super(
- token: token,
- );
- factory DeleteHealthExamBookingRequest.fromJson(Map<String, dynamic> map) {
- return DeleteHealthExamBookingRequest(
- code: map['Code'],
- token: map['Token'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if (code != null)
- map['Code'] = code;
- return map;
- }
- }
- class SignUpHealthExamBookingRequest extends TokenRequest{
- String? code;
- String? name;
- PatientGenderEnum gender;
- String? identityCard;
- String? phone;
- SignUpHealthExamBookingRequest({
- this.code,
- this.name,
- this.gender = PatientGenderEnum.NotFilled,
- this.identityCard,
- this.phone,
- String? token,
- }) : super(
- token: token,
- );
- factory SignUpHealthExamBookingRequest.fromJson(Map<String, dynamic> map) {
- return SignUpHealthExamBookingRequest(
- code: map['Code'],
- name: map['Name'],
- gender: PatientGenderEnum.values.firstWhere((e) => e.index == map['Gender']),
- identityCard: map['IdentityCard'],
- phone: map['Phone'],
- token: map['Token'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if (code != null)
- map['Code'] = code;
- if (name != null)
- map['Name'] = name;
- map['Gender'] = gender.index;
- if (identityCard != null)
- map['IdentityCard'] = identityCard;
- if (phone != null)
- map['Phone'] = phone;
- return map;
- }
- }
- class GetExamBookingByIDCardRequest extends TokenRequest{
- String? iDCardNo;
- String? operatorCode;
- GetExamBookingByIDCardRequest({
- this.iDCardNo,
- this.operatorCode,
- String? token,
- }) : super(
- token: token,
- );
- factory GetExamBookingByIDCardRequest.fromJson(Map<String, dynamic> map) {
- return GetExamBookingByIDCardRequest(
- iDCardNo: map['IDCardNo'],
- operatorCode: map['OperatorCode'],
- token: map['Token'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if (iDCardNo != null)
- map['IDCardNo'] = iDCardNo;
- if (operatorCode != null)
- map['OperatorCode'] = operatorCode;
- return map;
- }
- }
- class AddRegiterInfoRequest {
- String? iDCardNo;
- String? name;
- String? sex;
- String? age;
- String? phone;
- String? adress;
- String? orgUniqueCode;
- String? organizationCode;
- AddRegiterInfoRequest({
- this.iDCardNo,
- this.name,
- this.sex,
- this.age,
- this.phone,
- this.adress,
- this.orgUniqueCode,
- this.organizationCode,
- });
- factory AddRegiterInfoRequest.fromJson(Map<String, dynamic> map) {
- return AddRegiterInfoRequest(
- iDCardNo: map['IDCardNo'],
- name: map['Name'],
- sex: map['Sex'],
- age: map['Age'],
- phone: map['Phone'],
- adress: map['Adress'],
- orgUniqueCode: map['OrgUniqueCode'],
- organizationCode: map['OrganizationCode'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- if (iDCardNo != null) {
- map['IDCardNo'] = iDCardNo;
- }
- if (name != null) {
- map['Name'] = name;
- }
- if (sex != null) {
- map['Sex'] = sex;
- }
- if (age != null) {
- map['Age'] = age;
- }
- if (phone != null) {
- map['Phone'] = phone;
- }
- if (adress != null) {
- map['Adress'] = adress;
- }
- if (orgUniqueCode != null) {
- map['OrgUniqueCode'] = orgUniqueCode;
- }
- if (organizationCode != null) {
- map['OrganizationCode'] = organizationCode;
- }
- return map;
- }
- }
- class UpdateRegiterInfoRequest extends AddRegiterInfoRequest{
- String? code;
- UpdateRegiterInfoRequest({
- this.code,
- String? iDCardNo,
- String? name,
- String? sex,
- String? age,
- String? phone,
- String? adress,
- String? orgUniqueCode,
- String? organizationCode,
- }) : super(
- iDCardNo: iDCardNo,
- name: name,
- sex: sex,
- age: age,
- phone: phone,
- adress: adress,
- orgUniqueCode: orgUniqueCode,
- organizationCode: organizationCode,
- );
- factory UpdateRegiterInfoRequest.fromJson(Map<String, dynamic> map) {
- return UpdateRegiterInfoRequest(
- code: map['Code'],
- iDCardNo: map['IDCardNo'],
- name: map['Name'],
- sex: map['Sex'],
- age: map['Age'],
- phone: map['Phone'],
- adress: map['Adress'],
- orgUniqueCode: map['OrgUniqueCode'],
- organizationCode: map['OrganizationCode'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if (code != null)
- map['Code'] = code;
- return map;
- }
- }
- enum ExamStateEnum {
- Unchecked,
- Invalid,
- Inspected,
- }
- class RegisterInfoDTO extends BaseDTO{
- String? code;
- String? physicalExamNumber;
- String? iDCardNo;
- String? name;
- String? sex;
- String? age;
- String? phone;
- String? adress;
- ExamStateEnum state;
- String? organizationCode;
- RegisterInfoDTO({
- this.code,
- this.physicalExamNumber,
- this.iDCardNo,
- this.name,
- this.sex,
- this.age,
- this.phone,
- this.adress,
- this.state = ExamStateEnum.Unchecked,
- this.organizationCode,
- DateTime? createTime,
- DateTime? updateTime,
- }) : super(
- createTime: createTime,
- updateTime: updateTime,
- );
- factory RegisterInfoDTO.fromJson(Map<String, dynamic> map) {
- return RegisterInfoDTO(
- code: map['Code'],
- physicalExamNumber: map['PhysicalExamNumber'],
- iDCardNo: map['IDCardNo'],
- name: map['Name'],
- sex: map['Sex'],
- age: map['Age'],
- phone: map['Phone'],
- adress: map['Adress'],
- state: ExamStateEnum.values.firstWhere((e) => e.index == map['State']),
- organizationCode: map['OrganizationCode'],
- 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 (code != null)
- map['Code'] = code;
- if (physicalExamNumber != null)
- map['PhysicalExamNumber'] = physicalExamNumber;
- if (iDCardNo != null)
- map['IDCardNo'] = iDCardNo;
- if (name != null)
- map['Name'] = name;
- if (sex != null)
- map['Sex'] = sex;
- if (age != null)
- map['Age'] = age;
- if (phone != null)
- map['Phone'] = phone;
- if (adress != null)
- map['Adress'] = adress;
- map['State'] = state.index;
- if (organizationCode != null)
- map['OrganizationCode'] = organizationCode;
- return map;
- }
- }
- class GetRegiterInfoPageRequest extends PageRequest{
- String? keyword;
- String? operatorCode;
- GetRegiterInfoPageRequest({
- this.keyword,
- this.operatorCode,
- int pageIndex = 0,
- int pageSize = 0,
- String? token,
- }) : super(
- pageIndex: pageIndex,
- pageSize: pageSize,
- token: token,
- );
- factory GetRegiterInfoPageRequest.fromJson(Map<String, dynamic> map) {
- return GetRegiterInfoPageRequest(
- keyword: map['Keyword'],
- operatorCode: map['OperatorCode'],
- pageIndex: map['PageIndex'],
- pageSize: map['PageSize'],
- token: map['Token'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if (keyword != null)
- map['Keyword'] = keyword;
- if (operatorCode != null)
- map['OperatorCode'] = operatorCode;
- return map;
- }
- }
|