清除过滤器
公告
Claire Zheng · 六月 14, 2023
Hi 开发者们,
欢迎观看视频,以了解 InterSystems TrakCare 创新工具包( Innovation Toolkit),该工具包可免费下载,使 TrakCare 用户能够快速访问标准 HL7® FHIR® 格式的数据,使记录系统成为转型系统:
⏯ TrakCare 创新工具包介绍 @ 2022 年全球峰会
🗣主持人:Eslam Farahat,InterSystems 产品经理
订阅InterSystems B站!
文章
Claire Zheng · 十一月 8, 2021
InterSystems 2021全球线上峰会精彩内容梳理:两个重磅论坛集中探讨Analytics(分析)的奥义,InterSystems数据平台与医疗行业的愿景分享!
文章
Qiao Peng · 三月 5, 2021
这是一个第三方写的在 IRIS 2020.1 和 Caché 2018.1.3 上工作的代码示例
不会与新版本保持同步
也不会获得 InterSystems 支持提供的服务!
Caché/Ensemble/IRIS 中的 Global 通常在 SQL 访问中是不可见的 本示例将展示如何克服此限制。Global 将呈现为一个表,其中包含它们的下标和存储的内容。 要查看的 global 通过一个静态 WHERE 条件传递给 SQL, 该条件需要 3 个参数:
名称 (必需)
开始下标 (可选)
结束下标 (可选)
只提供 global 名称将获得整个 global 的导出数据。还可以为 global 提供扩展引用,并且由于这是 SQL 表,因此各种附加条件都适用。
小心, 在 SQL 和 Caché/Ensemble/IRIS 之间进行正确引用可能是一个挑战。
示例:select * from zrcc_G.dump where zrcc_G.Dump('^|"CACHE"|Sample.PersonD',2,4)=1
ID Global Subscript Value
1 ^|"CACHE"|Sample.PersonD (2) $lb("",792533244,"GlobaDynamics Holdings Inc.",64256,"C1787","Y5365","A5","A658","R1770","","Ironhorse,Alice D.","T3710","O3","I4011","W8367","557-37-6758",83059958205089661,"1841-01-02 00:00:00")
2 ^|"CACHE"|Sample.PersonD (3) $lb("",862705606,"TeleLateral Associates",34553,"V8155","T8918","X9","V8732","K1167","","Eisenstien,Peter E.","H208","C8","Q2015","Q3357","702-46-8467",57275722714358892,"2020-06-23 13:27:18")
3 ^|"CACHE"|Sample.PersonD (4) $lb("",677194559,"RoboSoft Group Ltd.",52738,"F4851","Z364","S8","O6888","O4367","","Eagleman,Clint C.","C8051","R6","V1659","C9814","664-33-8809",-53705244349891319,"2020-06-23 13:27:18")
select TOP 15 * from zrcc_G.dump where zrcc_G.Dump('^%SYS','"JOURNAL"')=1
ID Global Subscript Value
1 ^%SYS ("JOURNAL") 0
2 ^%SYS ("JOURNAL","ALTDIR") "C:\InterSystems\IRIS\altjournal\"
3 ^%SYS ("JOURNAL","CURDIR") "C:\InterSystems\IRIS\mgr\journal\"
4 ^%SYS ("JOURNAL","CURRENT") "1^C:\InterSystems\IRIS\mgr\journal\20200801.009"
5 ^%SYS ("JOURNAL","EXPSIZE") 0
6 ^%SYS ("JOURNAL","LAST") "1^C:\InterSystems\IRIS\mgr\journal\20200801.009"
7 ^%SYS ("JOURNAL","LIFESPAN","FILE") "2,2"
8 ^%SYS ("JOURNAL","MAXSIZE") 1073741824
9 ^%SYS ("JOURNAL","PREFIX") ""
10 ^%SYS ("JOURNAL","PURGED","c:\intersystems\iris\mgr\journal\20191104.001") "2019-11-07 17:38:30"
11 ^%SYS ("JOURNAL","PURGED","c:\intersystems\iris\mgr\journal\20191104.002") "2019-11-07 17:38:30"
12 ^%SYS ("JOURNAL","PURGED","c:\intersystems\iris\mgr\journal\20191104.003") "2019-11-07 17:38:30"
13 ^%SYS ("JOURNAL","PURGED","c:\intersystems\iris\mgr\journal\20191104.004") "2019-11-07 17:38:30"
14 ^%SYS ("JOURNAL","PURGED","c:\intersystems\iris\mgr\journal\20191104.005") "2019-11-08 08:39:47"
15 ^%SYS ("JOURNAL","PURGED","c:\intersystems\iris\mgr\journal\20191105.001") "2019-11-08 08:39:47"
文章
jieliang liu · 十月 27, 2021
技术概要:InterSystems IRIS Native API for Python
目录
技术概要: InterSystems IRIS Native API for Python 1
InterSystems IRIS 存储结构简介 1
探索 IRIS Native for Python 1
用前须知 2
安装 Native API 包 2
IRIS Native 应用程序 2
运行练习 3
确认管理门户(Management Portal)中的变更 3
了解有关 IRIS Native 的更多信息 3
技术概要:InterSystems IRIS Native API for Python
本技术概要(First Look)指南解释了如何使用 InterSystems IRIS Native 功能从 Python 应用程序访问 InterSystems IRIS® globals。IRIS Native 还允许您运行 ObjectScript 方法、函数和例程。在本文中,您将首先连接到 InterSystems IRIS。然后您将在 InterSystems IRIS 中设置和检索一个 global 节点的值,并在另一个 global 节点上进行迭代。您还将调用 InterSystems IRIS 类方法。所有这些活动都将在 Python 3 应用程序中执行。
为了让您体验 IRIS Native,而又不陷入细节的困境,本次探索特意设计得很简单。这些活动被设计成只使用默认设置和功能,这样您就可以熟悉功能的基本原理,而不必处理那些离题或过于复杂的细节。当您把 IRIS Native 引入您的生产系统时,您可能需要做一些不同的事情。请确保不要把这种对 IRIS Native 的探索与真实的情况相混淆! 本文档末尾提供的参考资料将使您对在生产中使用 IRIS Native 的情况有一个很好的了解。
要浏览所有的技术概要(First Look),包括可以在 InterSystems IRIS 免费的评估实例上执行的那些,请参见 InterSystems First Looks(《InterSystems 技术概要》)。
InterSystems IRIS 存储结构简介
InterSystems IRIS 提供了一种易于使用的方法来将数据存储在持久化多维数组中。global 是存储在物理 InterSystems IRIS 数据库中的命名多维数组。在应用程序中,globals 到物理数据库的映射基于当前命名空间,命名空间提供一个或多个物理数据库的逻辑统一视图。例如,要使用一个名为* ^Settings* 的 global 将值 "Red "与键 "Color "关联起来,请使用 InterSystems IRIS Basics:Connecting an IDE(《InterSystems IRIS 基础: 连接一个 IDE》)中的为您的实例描述的程序打开 InterSystems 终端(InterSystems Terminal),并输入以下代码:
set ^Settings("Color")="Red"
您可以利用 globals 的多维特性来定义一个更复杂的结构:
set ^Settings( "Auto1 ", "Properties ", "Color ") = "Red " set ^Settings( "Auto1 ", "Properties ", "Model ") = "SUV " set ^Settings( "Auto2 ", "Owner ") = "Mo "
set ^Settings( "Auto2 ", "Properties ", "Color ") = "Green "
有关 globals 的更多信息,请参见 Using Globals(《使用 globals》)。
探索 IRIS Native for Python
现在,您已经准备好实验 IRIS Native 了。下面的简短演示向您演示了如何在一个简单的 Python 应用程序中使用 IRIS Native。
想试试 InterSystems Native API for Python 的在线视频演示吗?请查看 Python QuickStart(Python 快速入门)!
探索 IRIS Native for Python
用前须知
要使用这个程序,您需要一个正在运行的 InterSystems IRIS 实例和一个使用 Python 3 和 PIP 实用程序以及您喜欢的 Python IDE 的系统。(在 Windows 系统中,确保 Python 解释器包含在您的 PATH 环境变量中)。您对 InterSystems IRIS 的选择包括多种类型的已授权的和免费的评估实例;该实例不需要由您正在工作的系统托管(尽管它们必须相互具有网络访问权限)。关于如何部署每种类型的实例的信息(如果您还没有可使用的实例),请参见 InterSystems IRIS Basics: Connecting an IDE(《InterSystems IRIS 基础:连接一个 IDE》)中的 Deploying InterSystems IRIS(部署 InterSystems IRIS)。使用同一文档中的 InterSystems IRIS Connection Information(InterSystems IRIS 连接信息)和 Python IDE 中的信息,将 Visual Studio 连接到您的 InterSystemsIRIS 实例。
安装 Native API 包
在运行示例 Python 程序之前,您需要使用 PIP 包管理器来安装 irisnative 包,您可以从 https://github.com/intersystems/quickstarts-python/tree/master/Solutions/nativeAPI_wheel 下载。
如果您的本地系统上安装了 InterSystems IRIS,wheel 文件已经安装在子目录 install-dir dev python 中,其中 install-dir 是 InterSystems IRIS 实例的安装目录, Python 3 包的名称 (.whl 文件) 包括 cp34。
要安装 wheel 文件,在命令行中输入命令 pip install irisnative-1.0.0 whl file,其中 irisnative-1.0.0 whl file 是您的 Python 版本和操作系统对应的 wheel 文件。例如,如果您在 Linux 上使用 Python 3,请使用 irisnative-1.0.0-cp34-abi3-linux_x86_64.whl。
IRIS Native 应用程序
现在您已经创建了项目,接下来您将创建一个小的应用程序,演示 Native API 的一些功能。
在您的 IDE 中,在 IRISNative 目录中创建一个新的源文件,将该文件保存为 IRISNative.py。
将以下代码粘贴到 IRISNative.py 中,将 InterSystems IRIS 实例的连接信息替换为 kwargs 中的值。您可以指定所示的 USER 命名空间,也可以选择在实例上创建的另一个命名空间:
import irisnative
# Modify connection info based on your environment ip = "127.0.0.1 "
port = 1972 namespace = "USER " username = " _SYSTEM " password = "SYS "
# create database connection and IRIS instance
connection = irisnative.createConnection(ip,port,namespace,username,password) dbnative = irisnative.createIris(connection)
print( " [1. Setting and getting a global ] ") # setting and getting a global
# ObjectScript equivalent: set ^testglobal( "1 ") = 8888 dbnative.set(8888, "testglobal ", "1 ")
# ObjectScript equivalent: set globalValue = $get( ^testglobal( "1 ")) globalValue = dbnative.get( "testglobal ", "1 ")
print( "The value of testglobal is ", globalValue) print()
print( " [2 Iterating over a global ] ") # modify global to iterate over
# ObjectScript equivalent: set ^testglobal( "1 ") = 8888 # ObjectScript equivalent: set ^testglobal( "2 ") = 9999 dbnative.set(8888, "testglobal ", "1 ")
dbnative.set(9999, "testglobal ", "2 ")
Iter = dbnative.iterator( "testglobal ") print( "walk forwards ")
了解有关 IRIS Native 的更多信息
for subscript, value in Iter.items():
print( "subscript= {}, value={} ".format(subscript, value)) print()
print( " [3. Calling a class method ] ") # calling a class method
# ObjectScript equivalent: set returnValue = ##class(%Library.Utility).Date(5) returnValue = dbnative.classMethodValue( "%Library.Utility ", "Date ", 5) print(returnValue)
# close connection connection.close()
示例代码分为三个部分:
第一部分展示了如何设置一个 global 的值以及稍后如何检索它。这部分里面执行的命令等同于 ObjectScript 的 SET 和 GET 命令。
第二部分展示了如何迭代 global 的子节点,类似于 ** $ORDER** ObjectScript 函数。
第三部分展示了如何使用 IRIS Native 从您的 Python 应用程序调用 ObjectScript 类方法。
注意: ObjectScript中的 Globals 以插入符号( ^)开头。在使用 InterSystems IRIS Native API 的 Python 应用程序中,这不是必需的。
运行练习
现在您已经准备好运行演示应用程序了。如果示例执行成功,您应该会看到带有示例代码结果的打印输出:
[1. Setting and getting a global ] The value of testglobal(1) is 8888
[2.Iterating over a global ] walk forwards
subscript=1, value=8888 subscript=2, value=9999
[3. Calling a class method ] Jan 30, 2018
确认管理门户(Management Portal)中的变更
接下来,使用以下程序在管理门户(Management Portal)中确认您的结果:
使用 InterSystems IRIS Basics:Connecting an IDE(《InterSystems IRIS 基础:连接一个 IDE》)中为您的实例描述的 URL,在浏览器中打开您的实例的管理门户(Management Portal)。
<span id="3_Learn_More_About_IRIS_Native" class="anchor"></span>如果您不在代码指定的命名空间中,请切换到该命名空间。
导航到 Globals 页面(System Explorer(系统资源管理器) > Globals)。您应该会看到示例代码中创建的 testglobal global。点击 View(查看)来查看其内容。您应该会看到 global 的两个节点: ^testglobal(1) = 8888 和
^testglobal(2) = 9999。
了解有关 IRIS Native 的更多信息
有关 IRIS Native、globals 和 InterSystems IRIS 的更多信息,请参见:Using the Native API for Python(《使用 Native API for Python》)
了解有关 IRIS Native 的更多信息
Using Globals(《使用 Globals》)
文章
Qiao Peng · 三月 5, 2021
Global 扫描和切片
这是一个在 IRIS 2020.1 和 Caché 2018.1.3 上工作的代码示例
不会与新版本保持同步
也不会获得 InterSystems 提供的支持服务!
大多数情况下,默认存储使用的 global 只有 1 个表示 IDKEY 的下标级别。 对于索引 global,可能有 2 个或更多下标级别。
数组、父子关系或扩展了基础数据类的持久化类 是具有更多下标级别的示例。 但所有这些 global 都非常统一。 我们还能看到与类或表无关的 global,例如 ^SPOOL、^ERRORS 或 ^%SYS 其中的结构取决于各个级别的具有特殊含义的下标。
分析这些不一致的 global 是一个挑战,而只是把它的内容导出来不一定有助于理解依赖关系。
本示例的原理就像那个古老的笑话:“如何吃一头大象?” ==>“切成片吃!”
以下是实现的功能:
通过一条 SQL 语句,您可以逐级显示任意 global 的结构。
您提供 global 名称和要显示的最大级别,即可获得相关下标、节点的 $Data、后面的子节点数量以及在该级别存储的内容(如果有的话)。
示例:**SELECT * FROM rcc\_G.scan where rcc\_G.Scan('^%SYS',1)=1**
Reference Level $D SubN Value
^%SYS 0 10 25
("CSP") 1 10
("CSPAppSec") 1 1 64
("CacheTempDir") 1 1 "c:\intersystems\iris\mgr\iristemp\"
("DBRefByName") 1 10
("Ensemble") 1 11 "2020-04-25 18:37:18"
("ErrorPurge") 1 1 30
("FIPSMode") 1 1 0
("IRISTempDir") 1 1 "c:\intersystems\iris\mgr\iristemp\"
("JOURNAL") 1 11 0
("LANGUAGE") 1 10
("LASTSESSIONGUID") 1 1 "EÊcRù¢GM£ô"_$c(127)_"¹9¾ÒÆ"
("LOCALE") 1 10
("ModuleRoot") 1 10
("NLS") 1 10
("SERVICE") 1 10
("SSPort") 1 1 51773
("StreamLocation") 1 10
("SystemMode") 1 1 "TEST"
("TempDir") 1 1 "C:\InterSystems\IRIS\mgr\Temp"
("WebServer") 1 10
("bindir") 1 1 "c:\intersystems\iris\bin\"
("shutdownlogerrors") 1 1 0
("sql") 1 10
("sysdir") 1 1 "c:\intersystems\iris\mgr\"
("tercap") 1 10
26 lines
**SELECT * FROM rcc\_G.scan where rcc\_G.Scan('^%SYS',2)=1**
Reference Level $D SubN Value
^%SYS 0 10 25
("CSP") 1 10 1
("CSP","LastUpdate") 2 1 "65553,44452"
("CSPAppSec") 1 1 0 64
("CacheTempDir") 1 1 0 "c:\intersystems\iris\mgr\iristemp\"
("DBRefByName") 1 10 9
("DBRefByName","CACHE") 2 1 "^^c:\intersystems\iris\mgr\cache\"
("DBRefByName","CACHEUSER") 2 1 "^^c:\intersystems\user\"
("DBRefByName","ENSLIB") 2 1 "^^c:\intersystems\iris\mgr\enslib\"
("DBRefByName","IRISAUDIT") 2 1 "^^c:\intersystems\iris\mgr\irisaudit\"
("DBRefByName","IRISLIB") 2 1 "^^c:\intersystems\iris\mgr\irislib\"
("DBRefByName","IRISLOCALDATA") 2 1 "^^c:\intersystems\iris\mgr\irislocaldata\"
< 60 lines more >
**SELECT * FROM rcc\_G.scan where rcc\_G.Scan('^ERRORS',37)=1 and id['Jour'**
Reference Level $D SubNodes Value
(65588,1,"*STACK",1,"V","%00000","N","""JournalState""") 8 1 0 4
(65592,1,"*STACK",1,"V","%00000","N","""JournalState""") 8 1 0 4
(65592,2,"*STACK",1,"V","%00000","N","""JournalState""") 8 1 0 4 很棒的文章,辛苦乔老爷!
公告
Claire Zheng · 二月 15, 2023
InterSystems 纠正了一个可能导致 InterSystems IRIS® 和 Caché 无法在 Windows 上利用大页共享内存的问题,即使这些产品得到的信息是已分配到了大页内存。这会对系统性能产生不利影响。
该问题是由于 Windows 10 中的一个更改引起的,该更改需要 InterSystems IRIS® 和 Caché做相应的修改。请注意,此问题还会影响所有基于 InterSystems IRIS® 或 Caché 的 InterSystems 产品。以下版本的 Windows 会出现此问题:
Windows 10(版本 1703 及以上)
Windows 11
Windows Server 2019
Windows Server 2022
Windows Server 2016 不受影响。
作为参考,此问题的更正标识为 RJF533。此更正将包含在所有未来的 InterSystems IRIS® 和 Caché 发行版中。该更正也作为受支持产品版本的补丁提供。
InterSystems 建议采取以下措施以避免潜在的严重系统性能下降:
对于使用大页内存的系统,推迟升级到受影响的 Windows 版本,直到实施更正。
对于已经运行受影响的 Windows 版本并使用大页内存的系统,在任何有计划的系统负载增加之前实施更正。
InterSystems 通常建议使用大页内存以提高性能。有关更多信息,请参阅在 Windows和memlock上配置大页内存的文档部分。
如果您对此警报有任何疑问或需要更正的临时分发,请联系全球响应中心(WRC)。
文章
Jingwei Wang · 十一月 29, 2022
在Windows配置DSN
确认InterSystems ODBC客户端驱动已安装
InterSystems IRIS ODBC驱动会随着InterSystems IRIS安装包默认安装。
如果没有随着InterSystems IRIS安装,请由此下载驱动,下载后执行.exe文件进行安装。
定义DSN(Data Source Names)
打开Administrative Tools
打开ODBC Data Sources Administrator(32-bit 或者 64-bit)
选择‘System DSN’,点击右边 ‘Add’,弹出‘Create New Data Source’窗口。
选择一个InterSystems IRIS 安装版本的ODBC驱动,点击‘Finish’
如下图所示,输入驱动名称,IP地址,端口号(使用超级服务端口号),命名空间,用户名和密码。
然后点击 'Test Connection' 进行连接测试
在Linux配置DSN
确认InterSystems ODBC客户端驱动已安装
InterSystems IRIS ODBC驱动会随着InterSystems IRIS安装包默认安装。
如果没有随着InterSystems IRIS安装,请先安装ODBC驱动
Linux
点击下载ODBC驱动
创建一个文件夹,例如/usr/irisodbc,存放刚刚下载的.tar文件
解压.tar文件,执行ODBCinstall安装脚本,irisodbc.ini会被创建:
# tar xvf ODBC-2022.1.0.209.0-lnxrharm64.tar.gz
# ./ODBCInstall
Mac
执行以下命令安装unixODBC
brew install unixODBC
配置DSN - 根据InterSystems IRIS服务器修改odbcinst.ini文件的配置信息
[ODBC Data Sources]
User = User
Userunixodbc = Userunixodbc
[User]
Driver = /isc/iris/bin/libirisodbc35.so
Description = IRIS ODBC driver
Host = localhost
Namespace = IRISAPP
UID = username
Password = pws
Port = 51773
Protocol = TCP
Query Timeout = 1
Static Cursors = 0
Trace = off
TraceFile = iodbctrace.log
Authentication Method = 0
Security Level = 2
Service Principal Name = iris/localhost.domain.com
[Userunixodbc]
Driver = /isc/iris/bin/libirisodbcur6435.so
Description = IRIS ODBC driver
Host = localhost
Namespace = IRISAPP
UID = username
Password = pws
Port = 51773
Protocol = TCP
Query Timeout = 1
Static Cursors = 0
Trace = off
TraceFile = iodbctrace.log
Authentication Method = 0
Security Level = 2
Service Principal Name = iris/localhost.domain.com
您好,问下配置sqlsever的odbc应该怎么配置呢 您是在什么环境配置呢?windows的话,照着上面的截图配置,Linux的话需要安装配置unixODBC。 linux下,自己安装了unixODBC,安装之后配置了DSN,在页面中怎么才能选择到自己安装配置的DSN呢
文章
姚 鑫 · 七月 14, 2022
# 第五章 使用嵌入式 Python (二)
## 在 Python 脚本文件 (.py) 中
还可以使用 `irispython` 命令执行 `Python` 脚本。
考虑 `Windows` 系统上的文件 `C:\python\test.py`,其中包含以下代码:
```python
# print the members of the Fibonacci series that are less than 10
print('Fibonacci series:')
a, b = 0, 1
while a < 10:
print(a, end=' ')
a, b = b, a + b
# import the iris module and show the classes in this namespace
import iris
print('\nInterSystems IRIS classes in this namespace:')
status = iris.cls('%SYSTEM.OBJ').ShowClasses()
print(status)
```
可以从命令行运行 `test.py`,如下所示:
```python
C:\InterSystems\IRIS\bin>set IRISUSERNAME =
C:\InterSystems\IRIS\bin>set IRISPASSWORD =
C:\InterSystems\IRIS\bin>set IRISNAMESPACE = USER
C:\InterSystems\IRIS\bin>irispython \python\test.py
Fibonacci series:
0 1 1 2 3 5 8
InterSystems IRIS classes in this namespace:
User.Company
User.Person
1
```
在基于 `UNIX` 的系统上,使用 `export` 而不是 `set`。
```python
/InterSystems/IRIS/bin$ export IRISUSERNAME=
/InterSystems/IRIS/bin$ export IRISPASSWORD=
/InterSystems/IRIS/bin$ export IRISNAMESPACE=USER
/InterSystems/IRIS/bin$ ./irispython /python/test.py
Fibonacci series:
0 1 1 2 3 5 8
InterSystems IRIS classes in this namespace:
User.Company
User.Person
1
```
注意:如果运行 `import iris` 并看到一条消息说 `IRIS_ACCESSDENIED`,请启用 `%Service_Callin`。在管理门户中,转至 `System Administration > Security > Services`,选择 `%Service_CallIn`,然后选中启用服务框。
# 在 IRIS 类的方法中
可以使用 `Language` 关键字在 `IRIS` 类中编写 `Python` 方法。然后,可以调用该方法,就像调用用 `ObjectScript` 编写的方法一样。
例如,使用 `Python` 编写的具有类方法的以下类:
```python
Class User.EmbeddedPython
{
/// Description
ClassMethod Test() As %Status [ Language = python ]
{
# print the members of the Fibonacci series that are less than 10
print('Fibonacci series:')
a, b = 0, 1
while a < 10:
print(a, end=' ')
a, b = b, a + b
# import the iris module and show the classes in this namespace
import iris
print('\nInterSystems IRIS classes in this namespace:')
status = iris.cls('%SYSTEM.OBJ').ShowClasses()
return status
}
}
```
可以从 `ObjectScript` 调用此方法:
```python
USER>set status = ##class(User.EmbeddedPython).Test()
Fibonacci series:
0 1 1 2 3 5 8
InterSystems IRIS classes in this namespace:
User.Company
User.EmbeddedPython
User.Person
USER>write status
1
```
或来自 `Python`:
```python
>>> import iris
>>> status = iris.cls('User.EmbeddedPython').Test()
Fibonacci series:
0 1 1 2 3 5 8
InterSystems IRIS classes in this namespace:
User.Company
User.EmbeddedPython
User.Person
>>> print(status)
1
```
## 在 SQL 函数和存储过程中
还可以通过在 `CREATE` 语句中指定参数 `LANGUAGE PYTHON` 来使用 `Embedded Python` 编写 `SQL` 函数或存储过程,如下所示:
```python
CREATE FUNCTION tzconvert(dt DATETIME, tzfrom VARCHAR, tzto VARCHAR)
RETURNS DATETIME
LANGUAGE PYTHON
{
from datetime import datetime
from dateutil import parser, tz
d = parser.parse(dt)
if (tzfrom is not None):
tzf = tz.gettz(tzfrom)
d = d.replace(tzinfo = tzf)
return d.astimezone(tz.gettz(tzto)).strftime("%Y-%m-%d %H:%M:%S")
}
```
该代码使用 `Python datetime` 和 `dateutil` 模块中的函数。
以下 `SELECT` 语句调用 `SQL` 函数,将当前日期/时间从东部时间转换为协调世界时 (`UTC`)。
```sql
SELECT tzconvert(now(), 'US/Eastern', 'UTC')
```
该函数返回如下内容:
```sql
2021-10-19 15:10:05
```
文章
Michael Lei · 七月 20, 2022
IRIS 命令qlist或list可以用来把输出结果输出到一个文件。
qlist的结果以文本格式输出,以^为分隔符。
第三部分,以^为界,包含运行状态数据。
$ iris qlist IRIS > iris.log
$ cat iris.log
IRIS^/Applications/iris^2022.1.0.164.0^running, since Thu Apr 7 16:37:03 2022^iris.cpf^1972^52773^0^alert^IRIS^^^/Applications/iris
在列表的情况下,以status:为前缀的一行包含运行状态数据。
对于基于Unix的操作系统
$ iris list IRIS > iris.log
$ cat iris.log
Configuration 'IRIS' (default)
directory: /Applications/iris
versionid: 2021.2.0.650.0
datadir: /Applications/iris
conf file: iris.cpf (SuperServer port = 1972, WebServer = 80)
status: running, since Thu Apr 7 16:37:03 2022
state: alert
product: InterSystems IRIS
Windows 环境下,不显示STATE行。
C:\InterSystems\IRIS\bin>iris listInstance 'IRIS' (Development installation) directory: 'C:\InterSystems\IRIS' versionid: '2021.2.0.650.0' conf file: 'c:\intersystems\iris\iris.cpf' (SuperServer port = 1972, WebServer port = 80) status : 'running, since Wed Jun 1 19:26:09 2022' Product : InterSystems IRIS
公告
Claire Zheng · 四月 8, 2021
InterSystems中国正在招聘SE,具体职位需求以英文发布,详情如下,欢迎将简历砸过来 (claire.zheng@intersystems.com)or 私信联系 :)
Job Details
Seniority Level
Mid-Senior level
Industry
Information Technology & Services
Computer Software
Employment Type
Full-time
Job Functions
Sales
Information Technology
About the job
Intersystems China 系联软件(北京)有限公司, is the trusted Healthcare IT solution provider for many World-Class hospitals and clinics in China, such as China’s largest foreign-invested hospital, United Family Healthcare 和睦家医疗, and one of China’s most prestige medical institution, Peking Union Medical College Hospital 北京协和医院。
The company has a small but collaborative team of talented and passionate individuals working the Greater China Region.
Due to China’s economic growth, aging population and the government’s determination in the Healthcare reform, China has become one of InterSystems’ most important strategic regions with unparalleled growth potentials in the years to come.
Based at our Beijing office, the Sales Engineer will provide guidance in the use of InterSystems' products as they best suit the requirements of the customer and its market. Product and business strategies are coordinated with the InterSystems Sales Team to apply existing and new products to customers' database and application needs. The role is very wide-ranging and challenging, requiring a mixture of design skills, hands-on coding, presentation skills, technical architecture, sales awareness, business acumen, evangelism, mentoring and training. This role requires regular travel across China and occasionally overseas.
Responsibilities
Investigate & demonstrate the use of InterSystems products with other 3rd party technologies.
Manage the technical relationship with customer accounts, ensuring that they are aware of the latest product capabilities.
Identify new opportunities within existing accounts.
Build and demonstrate Proof of Concepts (POCs) for prospects and customers to illustrate the suitability, ease of use, performance, features, and reliability and/or connectivity capabilities of InterSystems technology.
Participate in business and detailed technical discussions at all levels and in all departments of the customer's organisation to foster the adoption, use and deployment of InterSystems’ technologies.
Recommend technical architecture, database schema, design patterns, migration and upgrade strategies and operational best practices.
Install InterSystems software and assist with benchmarking exercises to determine optimal deployment configurations.
Work as a hands-on lead application developer to coach partners and prospects, particularly in the early stages of adoption or during particularly technically challenging projects.
Provide application programming in a variety of InterSystems technologies, and other technologies.
Give corporate presentations to InterSystems' customers and prospects at site visits, marketing events and such venues. Topics include strategic and tactical considerations across both technical and business directions. Provide technical product demonstrations.
Carry out formal training courses in InterSystems technologies.
Support customers and prospects during beta test programmes or pre-launch activities and provide feedback to the software development groups.
Assist with troubleshooting and interact with the World-wide Response Centre (WRC) to support resolution of technical problems.
Provide consulting services for the Sales Department and other InterSystems departments (Marketing, Support, Development, Documentation among others) as requested
Skills and Qualifications
Extensive previous experience as a Sales Engineer or related role, preferably in the Healthcare industry.
Outstanding interpersonal, communication and presentation skills
Demonstrated expertise in developing and implementing the functional specifications for integration projects in the healthcare marketplace, including routing and/or transformation engines
Demonstrated experience in all or most of the following: HTML, CSS, JavaScript, XML, XSLT, XPath, XSD, SAX, JSP/Servlets, ASP, SOAP, Web Services
Demonstrated expertise in SQL and ODBC / JDBC
Demonstrated experience in developing applications in various modern Object-oriented programming languages such as Java, C# and VB.Net
Understanding of all or most of the following: Network domains and network configurations, IP Addressing, DNS, WINS, FTP, HTTP, SFTP, SMTP, TELNET and SNMP
High level of understanding in Analytics and Business Intelligence concepts.
Experience
Broad knowledge of IT industry issues & trends including integration, data management, application development and cloud, with specific vertical market & technical knowledge in Integration (SOA, ESB, EAI, ETL, BI…).
Proven experience or technical management in an application development environment.
At least 4 years programming with demonstrable current hands-on expertise in object-oriented languages such as C#, C++ or Java / J2EE.
Knowledge of ESB, Enterprise Application Integration (EAI) experience using InterSystems Ensemble, Health Connece, BEA Software, IBM, Oracle, Microsoft or similar.
Ongoing experience within the design, development & deployment of complex applications.
Knowledge of application frameworks, application servers and server-less programming models.
Knowledge of agile software development processes and continuous development.
Extensive use of 2 or more databases such as InterSystems Caché, Oracle, SQLServer, Sybase, Informix or DB2/UDB, including designing logical and physical database schema, good SQL and JDBC/ODBC expertise, installation and configuration skills, and performance tuning.
Proven business analysis and problem-solving skills.
Strong presentation, influencing and communication skills.
Understanding of the business considerations of application development, support and deployment.
Software Engineering experience.
Familiarity with healthcare related integration in particular HL7 and FHIR standards and protocols.
Experience with Business Intelligence and Analytics technologies and approaches.
Familiarity with modern web-based development frameworks such as Angular, React, Vue.js or similar.
Familiarity with Machine Learning tools and languages
English language fluency.
欢迎简历继续砸过来。。。 我们又开始招人啦!
文章
Claire Zheng · 二月 13, 2023
在InterSystems 2022年全球峰会上,InterSystems 创始人兼 CEO Terry Ragon 分享了如何才能使企业获得持续发展。他是“愿景领导公司”的坚定信徒,他认为,愿景、热情与专注对于推动业务发展、保持企业创新活力至关重要。InterSystems 的愿景是:我们是一家提供创新数据技术服务的公司,对卓越和客户成功充满激情。
文章
Louis Lu · 十一月 2, 2021
本文档介绍了 XEP API(com.intersystems.xep),它提供了在 InterSystems IRIS®数据平台上极其快速的对Java 对象存储和检索的能力。文档概述了使用 XEP 将 Java 对象持久化的方法,并引导您通过一个简单的场景来演示该API 的主要功能。
这些演示的内容、只使用默认设置和功能,这样您就可以熟悉 XEP 的基本原理,而不必处理超出本概述范围的细节问题。有关 XEP 的完整文档,请参见 Persisting Java Objects with InterSystems XEP(《使用 InterSystems XEP 持久化 Java 对象》)。
要浏览所有的技术概要(First Look),包括可以在 InterSystems IRIS 免费的评估实例上执行的那些,请参见 InterSystems First Looks(《InterSystems 技术概要》)。
快速的 Java 对象存储和检索
Java 是一种面向对象的语言,因此对于 Java 应用程序来说,将数据建模为对象是很自然的。然而,当应用程序需要将数据存储在数据库中时,这可能会出现问题。如果您使用 JDBC 来存储和检索对象,您就面临着将对象数据转换为一组关系表,然后再将查询结果集转化为对象的问题。这个问题的通常解决方案是使用对象-关系映射(ORM)框架——如 Hibernate——来自动化这个过程。InterSystems IRIS 提供了一个标准的 Hibernate 接口,InterSystems 推荐它用于大型、复杂的对象层次结构。
另一方面,对于执行实时数据采集等任务的应用程序,主要问题是速度而不是数据复杂性。虽然 Hibernate 绝对不慢(如果适当优化的话),但对于需要极其快速地存储和检索简单或中等复杂数据的任务来说,XEP 是一个更好的选择。在大多数情况下,它将比 Hibernate 或 JDBC 快得多。
XEP 是如何工作的?
XEP 是一个轻量级的 Java API,它将 Java 对象数据作为持久化事件(persistent event)来处理。持久化事件(persistent event)是 InterSystems IRIS 类(通常是 %Persistent 的子类)的一个实例,包含 Java 对象中数据字段的副本。与任何此类实例一样,可以通过对象访问、SQL 查询或直接 global 访问来检索它。
在创建和存储持久化事件(persistent event)之前,XEP 必须分析相应的 Java 类,并将 schema 导入数据库。Schema 定义了用于存储 Java 对象的持久化事件类的结构。如果持久化事件类还不存在,导入 schema 将自动为其创建数据库定义。来自分析的信息可能是 XEP 导入 schema 所需要的全部信息。对于更复杂的结构,您可以提供额外的信息,允许 XEP 生成索引并覆盖导入字段的默认规则。
在为类创建 schema 之后,您可以使用各种 XEP 方法来存储、更新或删除事件、运行 SQL 查询,并遍历查询结果集。
试一试!XEP 的实际操作
现在是您自己尝试 XEP 的时候了。这个 XepSimple 演示是一个非常小的程序,但它提供了大多数重要的XEP 功能的示例,并概述了如何使用 XEP API。
想试试 InterSystems IRIS Java 开发和互操作性功能的在线视频演示吗?请查看 Java QuickStart(Java 快速入门)!
用前须知
要使用该程序,您需要在一个系统上安装 JDK 1.8 版本和任意的 Java IDE,并连接一个正在运行的 InterSystems IRIS 实例。您对 InterSystems IRIS 的选择包括多种已授权的和免费的评估实例;实例不需要是您正在工作的系统(尽管它们必须具有网络访问权限)。关于如何部署每种类型的实例的信息(如果您还没有可使用的实例),请参见 InterSystems IRIS Basics: Connecting an IDE(《InterSystems IRIS 基础:连接一个 IDE》)中的 Deploying InterSystems IRIS(部署 InterSystems IRIS)。使用同一文档中的 InterSystems IRIS Connection Information(InterSystems IRIS 连接信息)和 Java IDE 中的信息,将 IDE 连接到您的 InterSystems IRIS 实例。
添加示例代码
下面的演示向您演示如何使用 XEP 和 InterSystems IRIS。XepSimple 演示是一个非常小的程序,但它提供了大多数关键 XEP 功能的示例,并概述了如何使用 XEP API。
您可以阅读这里列出的代码,或者您可以从 InterSystems GitHub 存储库下载并自己运行它。下载的内容包括一个 ReadMe,其中包含开始时需要的所有信息。
演示程序分为四个部分,每个部分演示四个主要 XEP 类中的一个:EventPersister、Event、EventQuery 和 EventQueryIterator:
class XepSimple
package xepsimple;
import com.intersystems.xep.*;
import xep.samples.SingleStringSample;
public class XepSimple {
public static void main(String[] args) throws Exception {
// Generate 12 SingleStringSample objects for use as test data
SingleStringSample[] sampleArray = SingleStringSample.generateSampleData(12);
// EventPersister
EventPersister xepPersister = PersisterFactory.createPersister();
xepPersister.connect("127.0.0.1",51773,"User","_SYSTEM","SYS"); // connect to localhost
xepPersister.deleteExtent("xep.samples.SingleStringSample"); // remove old test data
xepPersister.importSchema("xep.samples.SingleStringSample"); // import flat schema
// Event
Event xepEvent = xepPersister.getEvent("xep.samples.SingleStringSample");
for (int i=0; i < sampleArray.length; i++) {
SingleStringSample sample = sampleArray[i]; // array initialized on line 8
sample.name = "Sample object #" + i;
xepEvent.store(sample);
System.out.println("Persisted " + sample.name);
}
// EventQuery
String sqlQuery = "SELECT * FROM xep_samples.SingleStringSample WHERE %ID BETWEEN ? AND ?";
EventQuery<SingleStringSample> xepQuery = xepEvent.createQuery(sqlQuery);
xepQuery.setParameter(1,3); // assign value 3 to first SQL parameter
xepQuery.setParameter(2,12); // assign value 12 to second SQL parameter
xepQuery.execute(); // get resultset for IDs between 3 and 12
// EventQueryIterator
EventQueryIterator<SingleStringSample> xepIter = xepQuery.getIterator();
while (xepIter.hasNext()) {
SingleStringSample newSample = xepIter.next();
newSample.name = newSample.name + " has been updated";
xepIter.set(newSample);
System.out.println(newSample.name);
}
xepQuery.close();
xepEvent.close();
xepPersister.close();
} // end main()
} // end class XepSimple
XepSimple 执行以下任务:
首先,通过调用示例数据类(sample data class) xep.samples.SingleStringSample 的方法生成一些示例对象。
EventPersister 是 XEP 的主要入口点(main entry point),并提供到数据库的连接。
它创建一个名为 xepPersister 的实例,该实例建立到数据库的连接并删除任何现有的示例数据。然后调用 importSchema() 来分析示例类并将 schema 发送到数据库,进而扩展空间保存持久化 SingleStringSample 对象。
EventPersister 包含连接 InterSystems IRIS 实例所需信息——主机名、端口、IRIS命名空间、用户名和密码。使用实例的正确信息更新它们,如 InterSystems IRIS Basics:Connecting an IDE( 《InterSystems IRIS 基础:连接一个 IDE》)中的 InterSystems IRIS Connection Information(InterSystems IRIS 连接信息)所述,这与您用来连接 IDE 和实例的信息相同。可以指定使用 USER 命名空间,或者使用您在已安装的实例中创建的另一个命名空间。如果实例是本地安装的,并且连接使用 localhost 作为服务器地址,程序将使用本地共享内存连接,这比标准的 TCP/IP 连接还要快。
Event 封装了(encapsulate) Java 对象和相应的数据库对象之间的接口。
一旦生成了 schema ,xepPersister 就可以为示例类创建一个名为 xepEvent 的 Event 对象。在循环中,SingleStringSample 的每个实例都将被修改,然后被持久化到数据库中。 xepEvent store() 方法使用了xepPersister 中定义的连接和 schema。
EventQuery 用于准备和执行 SQL 查询。
名为 xepQuery 的 EventQuery<SingleStringSample> 对象是通过将查询字符串传递给 xepEvent 对象的 createQuery() 方法创建的。 该字符串定义了一个接受两个参数(? 字符)的 SQL 查询。 参数值是通过调用 setParameter() 定义的,调用 execute() 可查询结果集。
EventQueryIterator 用于从结果集中读取行,并更新或删除相应的持久化对象。
现在 xepQuery 包含了查询结果集,可以通过调用 getIterator() 为它创建一个名为 xepIter 的迭代器。在循环中,迭代器的 next() 方法被用来获取每一行数据并将其分配给 SingleStringSample 对象。然后修改对象,迭代器的 set() 方法更新数据库中相应的持久化对象。
当处理完成后,它通过调用 XEP 对象的 close() 方法进行清理。
SingleStringSample 类
如果您感兴趣,下面是我们的示例类列表:
了解有关 XEP 和对象持久化的更多信息
xep.samples.SingleStringSample
public class SingleStringSample {
public String name;
public SingleStringSample() {}
SingleStringSample(String str) {
name = str;
}
public static SingleStringSample[] generateSampleData(int objectCount) {
SingleStringSample[] data = new SingleStringSample[objectCount];
for (int i=0;i<objectCount;i++) {
data[i] = new SingleStringSample("single string test");
}
return data;
}
}
之所以选择这个类,部分原因是在 XEP 生成 schema 之前不需要添加标注 annotation。大多数类都需要一个或多个标注来进行 schema 优化(这超出了本文的讨论范围)。
下一步
XepSimple 演示的目的是让您体验 XEP,而又不陷入细节困境,它并非用于实际生产代码的模型——它甚至没有进行异常检查。最重要的简化是在示例数据中。您不需要标注或其他机制来帮助 schema 的生成和优化,类持久化了一些很小的 Java 对象。实际应用程序通常需要一些标注(尽管通常比 Hibernate 少)。
当您把 XEP 引入生产系统时,您将需要了解 XEP 为提要优化、索引控制、批量加载和其他重要任务提供的全部工具 。主要的 XEP 书籍 Persisting Java Objects with InterSystems XEP (《使用 InterSystems XEP 持久化 Java 对象》)对这些功能进行了全面描述。本文档末尾列出的参考资料描述了 InterSystems IRIS 对 Java 支持的其他方面。
了解有关 XEP 和对象持久化的更多信息
要了解有关 Java 对象持久化和其他 InterSystems Java 互操作性技术的更多信息,请参见:
First Look: JDBC and InterSystems Databases(《技术概要:JDBC 和 InterSystems 数据库》)介绍了如何通过 JDBC 连接到 InterSystems IRIS:它提供了产品简介、特殊功能介绍,以及一个亲自尝试的机会。这是一个简单了解并熟悉 InterSystems IRIS 对 Java 支持的起点。
Using Java with the InterSystems JDBC Driver (《在 InterSystems JDBC 驱动程序中使用 Java》)中的 “InterSystems Java Connectivity Options(InterSystems Java 连接选项)”概述了 JDBC 驱动程序支持的所有 InterSystems IRIS Java 技术。
InterSystems IRIS 提供了 Java API,通过 SQL 表、对象和多维存储轻松访问数据库。有关每种类型访问的详细信息,请参见以下书籍:
Using Java with the InterSystems JDBC Driver(《在 InterSystems JDBC 驱动程序中使用 Java》)进行 SQL 表访问。InterSystems JDBC 驱动程序允许 InterSystems IRIS 建立到外部应用程序的 JDBC 连接,并通过 SQL 提供对外部数据源的访问。
Using the Native API for Java(《使用 Native API for Java》)进行本机多维存储访问。InterSystems IRIS 本机 API 允许您直接访问本机基于树的多维存储数据结构,这些结构是 InterSystems IRIS 对象和 SQL 表接口的基础
Persisting Java Objects with InterSystems XEP(《使用 InterSystems XEP 持久化 Java 对象》)进行对象访问。XEP 针对事务处理应用程序进行了优化,这些应用程序处理简单到中等复杂的对象层次结构,并需要极快的对象数据持久化和检索。
Implementation Reference for Java Third Party APIs(《Java 第三方 API 的实施参考 》)中的 "Hibernate Support(Hibernate 支持)"描述了 InterSystems IRIS 的 Hibernate 实现。这个实现了对 Java Persistence Architecture(JPA)的支持,这是推荐用于 Java 项目中大型、复杂对象层次结构的持久化技术。
公告
Claire Zheng · 三月 10, 2021
亲爱的社区开发者,
我们诚挚邀请您参加 InterSystems编程大奖赛获奖成员线上见面会!
时间: 周五(2021年3月12日)-22:00(北京时间)
在此次线上见面会,您可以:
了解获胜者的个人履历
观看获奖应用的简短demo
针对此次大奖赛使用到的技术、奖金和各类疑问,您可以畅所欲言,各抒己见,为下一次竞赛做准备!
线上见面会参与成员:
@Dmitriy Maslennikov, CaretDev Corp联合创始人、首席技术官和开发者倡导者,
@José Roberto Pereira, Shift Consultoria e Sistemas Ltda BI开发者
@Henrique Dias, Sao Paulo Federal Court 系统管理专家/数据库管理员
@Botai Zhang, 中国开发者
@Weiwei Yang, 中国开发者
@Evgeny Shvarov, InterSystems 开发者生态系统经理
您还将有机会在一个特别的网络研讨会上向我们的开发人员提出任何问题。
欢迎您参加线上见面会!
现在就来报名吧! 什么时候搞中国自己的? Good question! 想围观中国获奖成员线上见面会的给Michael点赞
文章
he hf · 十月 8, 2022
安装InterSystems IRIS数据库的ODBC驱动,在Windows系统中配置数据源后,可以使用Microsoft Visual Studio 开发工具 中的服务器资源管理器很方便地连接到InterSystems IRIS数据库服务器,利用数据库连接的可视化视图,可以非常方便快捷地进行连接到InterSystems IRIS数据库的应用开发。本文将展示一个利用以上方式实现的例子,开发工具为Microsoft Visual Studio 2019,开发语言为C#,10分钟快速开发实现一个连接到InterSystems IRIS数据库的C#应用,在本例子中,可以通过选择日期和科室,查询指定日期和科室的就诊日志。
1、在成功安装InterSystems IRIS数据库的ODBC驱动后,从Windows的“控制面板”中选择“管理工具”,在“管理工具”中选择“ODBC数据源”。
2、在ODBC数据源管理的“用户DSN”标签下,选择“添加”,在随后弹出的“创建新数据源”窗口中选择“InterSystems ODBC”,点击“完成”进入下一步。
3、在弹出的“InterSystems ODBC数据源设置”窗口中,为数据源命名,填写连接数据库的信息,访问用户名和密码,点击“测试连接”,成功后点击“OK”保存。
4、打开Microsoft Visual Studio 2019,选择“文件”->“新建”->“项目” ,在弹出的创建新项目窗口中,选择C#语言、Windows窗体应用。
5、新建项目完成后,在 Microsoft Visual Studio 2019开发工具的菜单栏选择“视图”->“服务器资源管理器”,右键“服务器资源管理器”视图中的“数据连接”,在弹出的“添加数据库连接”窗口中,指定在3中已经新建好的数据源,点击“测试连接”,测试连接成功后,点击“确定”关闭窗口,在“服务器资源管理器”视图中的“数据连接”中可以看到添加成功的数据库连接,选中数据库后可以展开其中的表。
6、在本例子中,将介绍两种数据库查询操作方式,其一为常见使用SQL语句的方式,其二为添加数据集的方式,添加数据集的操作如下:从菜单栏选择“视图”->“其他窗口”->“数据源”,在“数据源”视图中点击“添加新数据源”,选择数据库后,可以为数据集添加绑定数据库的表,如为本例中Loc1(科室)数据集成功添加绑定CT_Loc表后,可以在可视化视图中查看数据表数据,并可以被Form可视化窗体中添加的控件直接使用。
7、在Form可视化窗体设计器中,通过工具箱视图添加3个Label控件,分别显示应用标题、日期和科室,再添加1个DateTimePicker日期/时间选择器,并在其CustomFormat属性中设置日期/时间格式“yyyy-MM-dd”,用于选择查询日期;1个ComboBox下拉列表选择框,用于选择查询科室;1个Button按钮,用于执行查询;一个DataGridView数据网格视图,用于显示查询结果。
8、选中ComboBox下拉列表选择框控件,点击控件中右上角出现的箭头,弹出ComboBox数据绑定窗口,勾选“使用数据绑定项”,之后选择6中添加的数据集Loc1,设置“显示成员”为“科室名称”字段,“值成员”为“科室ID”字段,“选定值”为“科室ID”,上述操作便完成了ComboBox控件直接使用数据集的设置。
9、点击项目启动按钮,点击选择科室的下拉列表框,可以看到科室列表,由此可以看出,通过上面6、7、8三个步骤的简单操作,即完成了C#窗体控件与已添加的数据集的快速绑定,实现了查询IRIS数据库的快速操作。
10、最后双击窗体中的“查询科室日志”按钮,在按钮点击事件函数中,添加通过SQL语句查询IRIS数据库的代码,并通过DataGridView的DataSource属性将SQL语句的查询结果绑定到DataGridView数据网格视图。完成后,再次运行项目,可以实现通过选择日期和科室,查询指定日期和科室的就诊日志。
附上项目的核心代码,少部分细节地方参见代码中注释部分:
Form1.cs //C#窗体及控件加载和操作代码
using System;
using System.Windows.Forms;
namespace QuickApp1
{
public partial class Form1 : Form
{
//新建IRIS数据库的ODBC连接对象
ODBCHelper1 dBCHelper1 = new ODBCHelper1();
//避免comboBox数据未绑定时的异常退出
bool cmbFlag = false;
public Form1()
{
InitializeComponent();
}
private void Loc_comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
//排除窗体未加载时comboBox数据未绑定时的异常退出错误
try
{
if (cmbFlag && !String.IsNullOrEmpty(Loc_comboBox1.SelectedValue.ToString()))
{
string selectLoc = Loc_comboBox1.SelectedValue.ToString();
}
}
catch (Exception)
{
;
}
}
//按钮点击事件
private void findAdmListBtn1_Click(object sender, EventArgs e)
{
//取日期选择器的日期
string selectDate = dateTimePicker1.Text.ToString();
//取科室下拉选择框的科室
string selectLoc = Loc_comboBox1.SelectedValue.ToString();
//通过SQL语句查询IRIS数据库
string sql = "SELECT A.PAADM_DepCode_DR->CTLOC_Desc 科室, A.PAADM_PAPMI_DR->PAPMI_Name 患者姓名,decode(A.PAADM_PAPMI_DR->PAPMI_Sex_DR,1,'女',2,'男','未知') 性别,A.PAADM_AdmDocCodeDR->CTPCP_Desc 医生姓名, A.PAADM_ADMNo 就诊流水号,A.PAADM_AdmDate 就诊日期,A.PAADM_AdmTime 就诊时间 FROM PA_Adm A WHERE A.PAADM_AdmDate =" +
"'" + selectDate + "'" +
"AND A.PAADM_DepCode_DR = " +
"'" + selectLoc + "'";
//通过DataGridView的DataSource属性将SQL语句的查询结果绑定到DataGridView数据表格视图
this.dataGridView1.DataSource = dBCHelper1.CacheExeQuery(sql);
}
private void dataGridView1_RowsAdded(object sender, DataGridViewRowsAddedEventArgs e)
{
//为DataGridView数据表格添加行序号
try
{
for (int i = 0; i < dataGridView1.Rows.Count; i++)
this.dataGridView1.Rows[i].HeaderCell.Value = (i + 1).ToString();
}
catch
{
MessageBox.Show("处理异常:表格行序号添加异常");
}
}
private void Form1_Load(object sender, EventArgs e)
{
//窗体加载时处理
// TODO: 这行代码将数据加载到表“loc1.CT_Loc”中。您可以根据需要移动或删除它。
this.cT_LocTableAdapter.Fill(this.loc1.CT_Loc);
cmbFlag = true;
}
}
}
ODBCHelper1.cs //ODBC数据库连接公共类
using System.Data;
using System.Data.Odbc;
namespace QuickApp1
{
internal class ODBCHelper1
{
//ODBC连接格式化字符串,将Dsn(连接名称)、Server(IRIS服务器IP)、Port(端口)、DataBase(数据库)、Uid(用户名)、Pwd(用户名)换成你自己的。
public static string conString = "Dsn=irisxxx;Server=xxx.xxx.xxx.xxx;Port=xxxx;DataBase=xxxx;Authentication method=0;Uid=xxxxxx;Pwd=******;static cursors=0;query timeout=0;unicode sqltypes=0;";
public DataTable CacheExeQuery(string sql)
{
using (OdbcConnection con = new OdbcConnection(conString))
{
using (OdbcCommand cmd = new OdbcCommand(sql, con))
{
using (OdbcDataAdapter da = new OdbcDataAdapter(cmd))
{
DataTable dt = new DataTable();
con.Open();
da.Fill(dt);
return dt;
}
}
}
}
}
}
好文! 快速开发、快速接入、快速应用、良好兼容,轻量级开发的好平台。 感谢分享 赞,值得学习 简单实用,学习了。 感谢分享!刚上班的小白接触感觉很有用
文章
Michael Lei · 十月 10, 2022
Kong提供了一个开源的配置管理工具(用Go语言编写),称为decK(即声明式Kong,declarative Kong)。
通过deck ping检查deck是否能识别你的Kong Gateway安装
deck ping
Successfully connected to Kong!
Kong version: 2.3.3.2-enterprise-edition
通过deck dump把 Kong Gateway 配置导出到一个叫 "kong.yaml" 的文件
deck dump
修改kong.yaml文件后, 通过 deck diff 显示区别
deck diff
updating service alerts {
"connect_timeout": 60000,
- "host": "172.24.156.176",
+ "host": "192.10.10.18",
"id": "3bdd7db4-0b75-4148-93b3-2ff11e961f64",
"name": "alerts",
"path": "/alerts",
"port": 50200,
"protocol": "http",
"read_timeout": 60000,
"retries": 5,
"write_timeout": 60000
}
Summary:
Created: 0
Updated: 1
Deleted: 0
通过 deck sync 应用变化
deck sync
updating service alerts {
"connect_timeout": 60000,
- "host": "172.24.156.176",
+ "host": "192.10.10.18",
"id": "3bdd7db4-0b75-4148-93b3-2ff11e961f64",
"name": "alerts",
"path": "/alerts",
"port": 50200,
"protocol": "http",
"read_timeout": 60000,
"retries": 5,
"write_timeout": 60000
}
Summary:
Created: 0
Updated: 1
Deleted: 0
deck sync -s workspace1.yaml --workspace workspace1
deck sync -s workspace2.yaml --workspace workspace2
需要更多信息 :
https://docs.konghq.com/deck/1.11.x/guides/getting-started/
https://docs.konghq.com/deck/1.11.x/guides/best-practices/