123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309 |
- import 'liveConsultation.m.dart';
- import 'notification.m.dart';
- import 'vitalHealthExamBooking.m.dart';
- import 'device.m.dart';
- enum ReportStateEnum {
- Unchecked,
- Invalid,
- Reported,
- }
- class CreateReportRequest extends TokenRequest{
- String? code;
- String? key;
- String? patientCode;
- String? contractedDoctor;
- String? reportData;
- ReportStateEnum reportState;
- String? templateCode;
- CreateReportRequest({
- this.code,
- this.key,
- this.patientCode,
- this.contractedDoctor,
- this.reportData,
- this.reportState = ReportStateEnum.Unchecked,
- this.templateCode,
- String? token,
- }) : super(
- token: token,
- );
- factory CreateReportRequest.fromJson(Map<String, dynamic> map) {
- return CreateReportRequest(
- code: map['Code'],
- key: map['Key'],
- patientCode: map['PatientCode'],
- contractedDoctor: map['ContractedDoctor'],
- reportData: map['ReportData'],
- reportState: ReportStateEnum.values.firstWhere((e) => e.index == map['ReportState']),
- templateCode: map['TemplateCode'],
- token: map['Token'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if (code != null)
- map['Code'] = code;
- if (key != null)
- map['Key'] = key;
- if (patientCode != null)
- map['PatientCode'] = patientCode;
- if (contractedDoctor != null)
- map['ContractedDoctor'] = contractedDoctor;
- if (reportData != null)
- map['ReportData'] = reportData;
- map['ReportState'] = reportState.index;
- if (templateCode != null)
- map['TemplateCode'] = templateCode;
- return map;
- }
- }
- class ReportDTO2 extends BaseDTO{
- String? code;
- String? key;
- String? patientCode;
- String? contractedDoctor;
- Map<String,String>? reportData;
- ExamStateEnum examState;
- String? templateCode;
- ReportDTO2({
- this.code,
- this.key,
- this.patientCode,
- this.contractedDoctor,
- this.reportData,
- this.examState = ExamStateEnum.Unchecked,
- this.templateCode,
- DateTime? createTime,
- DateTime? updateTime,
- }) : super(
- createTime: createTime,
- updateTime: updateTime,
- );
- factory ReportDTO2.fromJson(Map<String, dynamic> map) {
- return ReportDTO2(
- code: map['Code'],
- key: map['Key'],
- patientCode: map['PatientCode'],
- contractedDoctor: map['ContractedDoctor'],
- reportData: map['ReportData']?.cast<String,String>(),
- examState: ExamStateEnum.values.firstWhere((e) => e.index == map['ExamState']),
- templateCode: map['TemplateCode'],
- 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 (key != null)
- map['Key'] = key;
- if (patientCode != null)
- map['PatientCode'] = patientCode;
- if (contractedDoctor != null)
- map['ContractedDoctor'] = contractedDoctor;
- if (reportData != null)
- map['ReportData'] = reportData;
- map['ExamState'] = examState.index;
- if (templateCode != null)
- map['TemplateCode'] = templateCode;
- return map;
- }
- }
- class GetReportRequest extends TokenRequest{
- String? code;
- GetReportRequest({
- this.code,
- String? token,
- }) : super(
- token: token,
- );
- factory GetReportRequest.fromJson(Map<String, dynamic> map) {
- return GetReportRequest(
- code: map['Code'],
- token: map['Token'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if (code != null)
- map['Code'] = code;
- return map;
- }
- }
- class GetReportByKeyRequest extends TokenRequest{
- String? key;
- String? value;
- GetReportByKeyRequest({
- this.key,
- this.value,
- String? token,
- }) : super(
- token: token,
- );
- factory GetReportByKeyRequest.fromJson(Map<String, dynamic> map) {
- return GetReportByKeyRequest(
- key: map['Key'],
- value: map['Value'],
- token: map['Token'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if (key != null)
- map['Key'] = key;
- if (value != null)
- map['Value'] = value;
- return map;
- }
- }
- class ReportPageRequest extends PageRequest{
- ReportPageRequest({
- int pageIndex = 0,
- int pageSize = 0,
- String? token,
- }) : super(
- pageIndex: pageIndex,
- pageSize: pageSize,
- token: token,
- );
- factory ReportPageRequest.fromJson(Map<String, dynamic> map) {
- return ReportPageRequest(
- pageIndex: map['PageIndex'],
- pageSize: map['PageSize'],
- token: map['Token'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- return map;
- }
- }
- class RemoveReportRequest extends TokenRequest{
- String? code;
- RemoveReportRequest({
- this.code,
- String? token,
- }) : super(
- token: token,
- );
- factory RemoveReportRequest.fromJson(Map<String, dynamic> map) {
- return RemoveReportRequest(
- code: map['Code'],
- token: map['Token'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if (code != null)
- map['Code'] = code;
- return map;
- }
- }
- class GetReportListRequest extends TokenRequest{
- List<String>? codes;
- GetReportListRequest({
- this.codes,
- String? token,
- }) : super(
- token: token,
- );
- factory GetReportListRequest.fromJson(Map<String, dynamic> map) {
- return GetReportListRequest(
- codes: map['Codes']?.cast<String>().toList(),
- token: map['Token'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if (codes != null)
- map['Codes'] = codes;
- return map;
- }
- }
- class UpdateReportRequest extends TokenRequest{
- String? code;
- String? key;
- String? patientCode;
- String? contractedDoctor;
- String? reportData;
- ReportStateEnum? reportState;
- String? templateCode;
- UpdateReportRequest({
- this.code,
- this.key,
- this.patientCode,
- this.contractedDoctor,
- this.reportData,
- this.reportState,
- this.templateCode,
- String? token,
- }) : super(
- token: token,
- );
- factory UpdateReportRequest.fromJson(Map<String, dynamic> map) {
- return UpdateReportRequest(
- code: map['Code'],
- key: map['Key'],
- patientCode: map['PatientCode'],
- contractedDoctor: map['ContractedDoctor'],
- reportData: map['ReportData'],
- reportState: map['ReportState'] != null ? ReportStateEnum.values.firstWhere((e) => e.index == map['ReportState']) : null,
- templateCode: map['TemplateCode'],
- token: map['Token'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if (code != null)
- map['Code'] = code;
- if (key != null)
- map['Key'] = key;
- if (patientCode != null)
- map['PatientCode'] = patientCode;
- if (contractedDoctor != null)
- map['ContractedDoctor'] = contractedDoctor;
- if (reportData != null)
- map['ReportData'] = reportData;
- if (reportState != null)
- map['ReportState'] = reportState;
- if (templateCode != null)
- map['TemplateCode'] = templateCode;
- return map;
- }
- }
|