123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805 |
- 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<String>? 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<String, dynamic> 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<String>().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<String, dynamic> 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<String>? crowdLabels;
- CardTypeEnum cardType;
- GenderEnum patientGender;
- String? patientAddress;
- String? permanentResidenceAddress;
- String? teamRegionCode;
- String? createdDoctor;
- String? contractedDoctor;
- List<String>? labelNames;
- String? createdDoctorName;
- String? createdOrgName;
- String? createdTeamName;
- PatientStatusEnum status;
- String? createdOrgCode;
- String? createdTeamCode;
- String? contractedDoctorName;
- ContractStateEnum contractState;
- List<String>? 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<String, dynamic> 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<String>().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<String>().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<String>().toList(),
- 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 (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<String, dynamic> map) {
- return GetPatientRequest(
- code: map['Code'],
- token: map['Token'],
- );
- }
- Map<String, dynamic> 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<String, dynamic> map) {
- return GetPatientByKeyRequest(
- 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 PatientPageRequest extends PageRequest{
- List<String>? 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<String, dynamic> map) {
- return PatientPageRequest(
- crowdLabels: map['CrowdLabels']?.cast<String>().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<String, dynamic> 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<String, dynamic> map) {
- return RemovePatientRequest(
- code: map['Code'],
- token: map['Token'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if (code != null)
- map['Code'] = code;
- return map;
- }
- }
- class GetPatientListRequest extends TokenRequest{
- List<String>? codes;
- GetPatientListRequest({
- this.codes,
- String? token,
- }) : super(
- token: token,
- );
- factory GetPatientListRequest.fromJson(Map<String, dynamic> map) {
- return GetPatientListRequest(
- 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 UpdatePatientRequest2 extends TokenRequest{
- String? code;
- String? patientName;
- String? phone;
- String? cardNo;
- String? nationality;
- DateTime? birthday;
- List<String>? 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<String, dynamic> 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<String>().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<String, dynamic> 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<String>? crowdLabels;
- SetCrowdLabelsRequest({
- this.code,
- this.crowdLabels,
- String? token,
- }) : super(
- token: token,
- );
- factory SetCrowdLabelsRequest.fromJson(Map<String, dynamic> map) {
- return SetCrowdLabelsRequest(
- code: map['Code'],
- crowdLabels: map['CrowdLabels']?.cast<String>().toList(),
- token: map['Token'],
- );
- }
- Map<String, dynamic> 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<String>? photos;
- UpdatePatientPhotosRequest({
- this.code,
- this.photos,
- String? token,
- }) : super(
- token: token,
- );
- factory UpdatePatientPhotosRequest.fromJson(Map<String, dynamic> map) {
- return UpdatePatientPhotosRequest(
- code: map['Code'],
- photos: map['Photos']?.cast<String>().toList(),
- token: map['Token'],
- );
- }
- Map<String, dynamic> 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<String, dynamic> 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<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- 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<String, dynamic> map) {
- return GetPatientBaseByImageRequest(
- image: map['Image'],
- token: map['Token'],
- );
- }
- Map<String, dynamic> 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<String, dynamic> map) {
- return GetPatientBaseByFaceImageRequest(
- image: map['Image'],
- token: map['Token'],
- );
- }
- Map<String, dynamic> 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<String, dynamic> map) {
- return SavePersonDTO(
- success: map['Success'],
- bindCardNo: map['BindCardNo'],
- errMessage: map['ErrMessage'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- 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<String, dynamic> map) {
- return SavePatientBaseByFaceImageRequest(
- cardNo: map['CardNo'],
- image: map['Image'],
- token: map['Token'],
- );
- }
- Map<String, dynamic> 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<String, dynamic> map) {
- return DeletePersonDTO(
- success: map['Success'],
- errMessage: map['ErrMessage'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- 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<String, dynamic> map) {
- return UnbindAndCreateByFaceImageRequest(
- oldCardNo: map['OldCardNo'],
- newCardNo: map['NewCardNo'],
- image: map['Image'],
- token: map['Token'],
- );
- }
- Map<String, dynamic> 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<String, dynamic> map) {
- return UnbindByCardNoRequest(
- cardNo: map['CardNo'],
- token: map['Token'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if (cardNo != null)
- map['CardNo'] = cardNo;
- return map;
- }
- }
|