123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381 |
- 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,
- String consultationCode) async {
- var rpcRst = await call("OpenReportEdit", [
- token,
- patientCode,
- reportCode,
- recordCode,
- referralRecordCode,
- consultationCode
- ]);
- 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<void> openLiveConsultationAsync(
- String consultationCode, bool isJoin, int pageIndex, String token) async {
- await call(
- "OpenLiveConsultation", [consultationCode, isJoin, pageIndex, token]);
- }
-
-
-
- Future<void> openDeviceLiveWindow(String deviceCode, String token) {
- return call("OpenDeviceLiveWindow", [deviceCode, token]);
- }
-
- Future<int> getWindowsNum() async {
- var rpcRst = await call("GetWindowsNum");
- return rpcRst;
- }
-
- Future<void> closeSlaveWindow() async {
- var rpcRst = await call("CloseSlaveWindow");
- return rpcRst;
- }
-
- Future<void> closeLiveConsultation() async {
- var rpcRst = await call("CloseLiveConsultation");
- 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(String token) async {
- var rpcRst = await call("ThesaurusChange", [token]);
- 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;
- }
-
- Future<void> startRecording(
- String filePrefixTitle, String micDeviceId) async {
- var rpcRst = await call("StartRecording", [filePrefixTitle, micDeviceId]);
- return rpcRst;
- }
-
- Future<void> pauseRecording(bool isPause) async {
- var rpcRst = await call("PauseRecording", [isPause]);
- return rpcRst;
- }
-
- Future<void> stopRecording() async {
- var rpcRst = await call("StopRecording");
- return rpcRst;
- }
-
- Future<bool> exportConsultationZipFile(String data, String fileName) async {
- var rpcRst = await call("ExportConsultationZipFile", [data, fileName]);
- return rpcRst;
- }
-
- Future<bool> doUpgradClient(String upgradInfo) async {
- var rpcRst = await call("DoUpgradClient", [upgradInfo]);
- return rpcRst;
- }
-
- Future<String> getCurrentAppVersion() async {
- var rpcRst = await call("GetCurrentAppVersion");
- return rpcRst;
- }
-
- Future<void> downloadMeasureData(String url) async {
- var rpcRst = await call("DownloadMeasureData", [url]);
- return rpcRst;
- }
- }
|