123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383 |
- 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;
- 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,
- 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,
- 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;
- 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;
- }
- }
|