|
@@ -0,0 +1,305 @@
|
|
|
+import 'package:fis_common/json_convert.dart';
|
|
|
+
|
|
|
+import '../client_base.dart';
|
|
|
+import 'platform.m.dart';
|
|
|
+
|
|
|
+
|
|
|
+class PlatformService extends JsonRpcClientBase {
|
|
|
+ PlatformService(
|
|
|
+ String host, {
|
|
|
+ String serviceName = "IPlatformService",
|
|
|
+ Map<String, String>? headers,
|
|
|
+ int? timeout,
|
|
|
+ }) : super(
|
|
|
+ host,
|
|
|
+ serviceName,
|
|
|
+ headers: headers,
|
|
|
+ timeout: timeout,
|
|
|
+ ) {
|
|
|
+
|
|
|
+ FJsonConvert.setDecoder((map) => LoadVidResult.fromJson(map));
|
|
|
+ FJsonConvert.setDecoder((map) => GetVidFrameResult.fromJson(map));
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ Future<bool> loadTheme(String name) async {
|
|
|
+ var rpcRst = await call("LoadTheme", name);
|
|
|
+ return rpcRst;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ Future<bool> saveConfig(String jsonText) async {
|
|
|
+ var rpcRst = await call("SaveConfig", jsonText);
|
|
|
+ return rpcRst;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ Future<String?> getConfig() async {
|
|
|
+ var rpcRst = await call("GetConfig");
|
|
|
+ return rpcRst;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ Future<bool> saveText(String name, String text) async {
|
|
|
+ var rpcRst = await call("SaveText", [name, text]);
|
|
|
+ return rpcRst;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ Future<String?> getText(String name) async {
|
|
|
+ var rpcRst = await call("GetText", name);
|
|
|
+ return rpcRst;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ Future<LoadVidResult> loadVid(String url) async {
|
|
|
+ var rpcRst = await call("LoadVid", url);
|
|
|
+ var result = LoadVidResult.fromJson(rpcRst as Map<String, dynamic>);
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ Future<GetVidFrameResult> getVidFrame(GetVidFrameRequest request) async {
|
|
|
+ var rpcRst = await call("GetVidFrame", request);
|
|
|
+ var result = GetVidFrameResult.fromJson(rpcRst as Map<String, dynamic>);
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ void releaseVid() => notify("ReleaseVid");
|
|
|
+
|
|
|
+
|
|
|
+ Future<GetVidFrameResult> getSingleImage(String url) async {
|
|
|
+ var rpcRst = await call("GetSingleImage", url);
|
|
|
+ var result = GetVidFrameResult.fromJson(rpcRst as Map<String, dynamic>);
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ Future<String?> getVidFile(String url) async {
|
|
|
+ var rpcRst = await call("GetVidFile", [url]);
|
|
|
+ return rpcRst;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ Future<bool> setBytesToExport(String data, String fileName) async {
|
|
|
+ var rpcRst = await call("SetBytesToExport", [data, fileName]);
|
|
|
+ return rpcRst;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ Future<bool> setBinaryFileCache(String data, String fileName) async {
|
|
|
+ var rpcRst = await call("SetBinaryFileCache", [data, fileName]);
|
|
|
+ return rpcRst;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ Future<String?> getBinaryFileCache(String fileName) async {
|
|
|
+ var rpcRst = await call("GetBinaryFileCache", [fileName]);
|
|
|
+ return rpcRst;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ Future<bool> exportPatientZipFile(String data, String fileName) async {
|
|
|
+ var rpcRst = await call("ExportPatientZipFile", [data, fileName]);
|
|
|
+ return rpcRst;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ Future<bool> abortExportOperation() async {
|
|
|
+ var rpcRst = await call("AbortExportOperation", []);
|
|
|
+ return rpcRst;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ Future<bool?> openImageMeasureAsync(String token, String patientCode,
|
|
|
+ String remedicalCode, String recordCode) async {
|
|
|
+ var rpcRst = await call(
|
|
|
+ "OpenImageMeasure", [token, patientCode, remedicalCode, recordCode]);
|
|
|
+ return rpcRst;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ Future<bool?> openReportPreviewAsync(String token, String reportCode,
|
|
|
+ String recordCode, String isFormEditor) async {
|
|
|
+ var rpcRst = await call(
|
|
|
+ "OpenReportPreview", [token, reportCode, recordCode, isFormEditor]);
|
|
|
+ return rpcRst;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ Future<bool?> openReportEditAsync(String token, String patientCode,
|
|
|
+ String reportCode, String recordCode, String referralRecordCode) async {
|
|
|
+ var rpcRst = await call("OpenReportEdit",
|
|
|
+ [token, patientCode, reportCode, recordCode, referralRecordCode]);
|
|
|
+ return rpcRst;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ Future<bool?> openReportDesignerAsync(String templateId, String name,
|
|
|
+ String type, String token, String json) async {
|
|
|
+ var rpcRst =
|
|
|
+ await call("OpenReportDesigner", [templateId, name, type, token, json]);
|
|
|
+ return rpcRst;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ Future<int> getWindowsNum() async {
|
|
|
+ var rpcRst = await call("GetWindowsNum");
|
|
|
+ return rpcRst;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ Future<void> closeSlaveWindow() async {
|
|
|
+ var rpcRst = await call("CloseSlaveWindow");
|
|
|
+ return rpcRst;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ Future<void> beginWindowDrag(String windowName) async {
|
|
|
+ var rpcRst = await call("BeginWindowDrag", [windowName]);
|
|
|
+ return rpcRst;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ Future<void> endWindowDrag(String windowName) async {
|
|
|
+ var rpcRst = await call("EndWindowDrag", [windowName]);
|
|
|
+ return rpcRst;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ Future<void> minimizeWindow(String windowName) async {
|
|
|
+ var rpcRst = await call("MinimizeWindow", [windowName]);
|
|
|
+ return rpcRst;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ Future<void> maximizeWindow(String windowName) async {
|
|
|
+ var rpcRst = await call("MaximizeWindow", [windowName]);
|
|
|
+ return rpcRst;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ Future<void> restoreWindow(String windowName) async {
|
|
|
+ var rpcRst = await call("RestoreWindow", [windowName]);
|
|
|
+ return rpcRst;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ Future<int> getWindowState(String windowName) async {
|
|
|
+ var rpcRst = await call("GetWindowStateAsync", [windowName]);
|
|
|
+ return rpcRst;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ Future<void> closeWindow(String windowName) async {
|
|
|
+ var rpcRst = await call("CloseWindow", [windowName]);
|
|
|
+ return rpcRst;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ Future<void> setLanguageCodeAsync(String code) async {
|
|
|
+ var rpcRst = await call("SetLanguageCode", [code]);
|
|
|
+ return rpcRst;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ Future<String> getLanguageCodeAsync() async {
|
|
|
+ var rpcRst = await call("GetLanguageCode");
|
|
|
+ return rpcRst;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ Future<void> setLoginUserInfoAsync(String userInfo) async {
|
|
|
+ var rpcRst = await call("SetUserLoginInfo", [userInfo]);
|
|
|
+ return rpcRst;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ Future<void> setSecondWindowStateInfoAsync(bool isSecondWindowMode) async {
|
|
|
+ var rpcRst = await call("SetSecondWindowState", [isSecondWindowMode]);
|
|
|
+ return rpcRst;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ Future<void> thesaurusChange() async {
|
|
|
+ var rpcRst = await call("ThesaurusChange");
|
|
|
+ return rpcRst;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ Future<void> onSubmitReport(String patientId, String code) async {
|
|
|
+ var rpcRst = await call("OnSubmitReport", [patientId, code]);
|
|
|
+ return rpcRst;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ Future<void> refershReports() async {
|
|
|
+ var rpcRst = await call("RefershReports", []);
|
|
|
+ return rpcRst;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ Future<void> reloadConfig() async {
|
|
|
+ var rpcRst = await call("ReloadConfig", []);
|
|
|
+ return rpcRst;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ Future<bool> getIsUseSecondWindow() async {
|
|
|
+ var rpcRst = await call("GetIsUseSecondWindow", []);
|
|
|
+ return rpcRst;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ Future<bool> getIsWin7() async {
|
|
|
+ var rpcRst = await call("GetIsWin7", []);
|
|
|
+ return rpcRst;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ Future<void> openConsole() async {
|
|
|
+ var rpcRst = await call("OpenConsole", []);
|
|
|
+ return rpcRst;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ Future<void> onMainWindowLogout() async {
|
|
|
+ var rpcRst = await call("OnMainWindowLogout", []);
|
|
|
+ return rpcRst;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ Future<void> setAutoStartAsync(bool isAutoStart) async {
|
|
|
+ var rpcRst = await call("SetAutoStart", [isAutoStart]);
|
|
|
+ return rpcRst;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ Future<void> startShellRecord() async {
|
|
|
+ var rpcRst = await call("StartShellRecord");
|
|
|
+ return rpcRst;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ Future<String> stopShellRecord() async {
|
|
|
+ var rpcRst = await call("StopShellRecord");
|
|
|
+ return rpcRst;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ Future<bool> exportAppLogZipFile(int exportType, String fileName) async {
|
|
|
+ var rpcRst = await call("ExportAppLogZipFile", [exportType, fileName]);
|
|
|
+ return rpcRst;
|
|
|
+ }
|
|
|
+}
|