#npm 包 object-hl7-parser 使用教程
##介绍
HL7是医疗保健领域的一种标准,用于交换医疗信息。HL7消息包含用于标识消息类型、消息内容、接收消息的应用程序等信息。object-hl7-parser是一个开源的npm包,提供了一种简单而有效的方法来解析HL7消息。
object-hl7-parser支持大多数HL7标准。使用该包可以快速轻松地解析与构建消息。
##安装
要使用object-hl7-parser,您需要首先安装Node.js和npm。
- 使用npm install object-hl7-parser命令安装object-hl7-parser。
--- ------- ----------------- ------
##使用
下面是一个非常基本的示例:解析一个HL7消息字符串并将其转换为JavaScript对象。
----- --------- - ----------------------------- ----- --- - -------------------------------------------------------------------------------- -------------------------------------------------------------------- ---------------------------------- - ----------------------------- ---------------------------------------------------------------- ------ ----- ----------------------------------- --------------- ----- ------------ --------------- ---------------------- -------------------------------------------------- ----- ------ - --- ------------ ----- ------ - ------------------ --------------------
上述代码输出:
- ---------------- - ----------------- ---- --------------------- -------- --------- - -------------- ------- -------------- --- ------------------ --- ------------------- -- -- ----------- - -------------- ------ -------------- --- ------------------ --- ------------------- -- -- ----------- - ------- ----------------- ----------- -- -- -------------- - -------------- ------ --------------- ------ ------------------- -- -- ------------------- --------------- --------------- - --------------- ---- ----------------- --- ------------ ------- -- --------------------------- ----- -------------------------------- ----- -------------- --- --------------- -- -- ------------------------ - -------- ---- ------------ - ----- ----------- ------------- --- ------------------- --- -------------- ------- -------------- --- ------------------ --- --------------------- --- -------------------- -- -- ------- - ----------- ------ ------------ ------- ------------- ---- --------- --- --------- -- -- -------------- - ------- - ------- ------- -------- ----- ------ ---- -- ------------ --- -------------------- -- -- -------------------- ---- --------------- --- ------- --- ----------------- --- ------------- --- ------------------ --- ---------------------- --- ------------------ --- ---------------- --- ----------- --- ---------------- --- ----------------------- --- ----------------------- --- -------------------- --- -------------- --- ------------- --- ------------------------- --- ------------- --- -------------- --- ------------------------- -- -- -------- - -------------- ------ --------------- ----- -------------------- ---------- -------------------- --- -------------------- --- -------------- ----- --------------- --- ----------------- - ----------- --- ------------------ - ----------------- - ----------- ---- ----------- --- ----------- --- ---------------- --- -------------- --- ----------- -- -- ---------------- - - -------------------- - -------------------- ------ -------------- ------ ----- ------- --------------- --- ----------------- --- ------------- --- ---------------------- --- ---------------- --- ------------------------ -- -- ----------- --- ----------- --- ----------- --- ---------------- --- -------------- --- ----------- -- - -- ---------------------------- --- ----------------------- --- ------------------ --- ---------------------- --- -------------------- -- -- ------------- --- ----------- --- --------------------- --- ------------------- -- -- -------------- --- ------------------------ - ------- ----------- ----------- -- -- ------------ --- ------------- --- ------------------- - -------------- --- -------------- --- ------------------ --- ------------------- -- -- ------------------- - -------------- --- ------- --- ------ --- ----------- --- ----------------- --- --------------------- --- ----------- --- -------- --- ---------------------- -- -- ---------------------- --- ------------------------- --- ------------------------- --- ----------------------- --- ----------------- --- ----------- --- -------------------------------- --- ------------------- - ----- --- ------------- --- ------------------- --- -------------- --- -------------- --- ------------------ --- --------------------- --- -------------------- --- ------------- --- ------------ --- ------------- --- --------- --- --------- -- - -- -------------------- - -------------- ------ ----------- - ------------- -------------- ------- ------------- --------------------- --------- ---------------------- --- ---------------- --- ------------------------------ -- -- -------------------- --- -------------------- --- ------------ - ------------- ------ ------- --------- --------------------- --------- ---------------------- --- ---------------- --- ------------------------------ -- -- ----------------- --- ----------------------------------------- - ---------- --- ------------ --- ------- --- -------------- --- ------------------ --- --------------- --- ------------------ --- -------------- -- -- -------------------- --- --------------------- --- ----------------- --- ---------------- --- ------------------ --- ----------------------------- --- ----------------------------------------- --- --------------------- --- --------------------------- --- -------------------------------- --- --------------------------------------- - ------- --- ----------- -- -- ----------------- --- ------------------- --- ---------------------------------------------------------- --- ---------- --- -------------- --- -------------------- --- ----------------------------------- --- ------------------------------------------ --- ------------------ -- -- ----------------------- - - -------------- ------ ------------------ - ----------------- --- ---------------- - - -------------------- - -------------------- ------ -------------- ------ ----- ------- --------------- --- ----------------- --- ---------------------- --- ---------------- --- ------------------------ -- -- ----------- --- ----------- --- ----------- --- ---------------- --- -------------- --- ----------- -- - -- ---------------------------- --- ----------------------- --- ------------------ --- ---------------------- --- -------------------- -- -- --------------------- --- ------------ --- ------- --- -------------- --- ------------------ --- ------------------------- - ------------ --- ---------- -- - - -- -------- - -------------- ------ -------- ----- --------------------- - ------------- --- ------- --- --------------------- --- ---------------------- --- ---------------- --- ------------------------------ -- -- ----------------------- - ------------- --- ------- --- --------------------- --- ---------------------- --- ---------------- --- ------------------------------ -- -- ----------------------- - ------------- --- ------- --- --------------------- --- ---------------------- --- ---------------- --- ------------------------------ -- -- --------------------- --- ----------------------------- --- ------------------------------- -- - -
##结论
object-hl7-parser是一个非常有用的解析HL7消息的npm包。它提供了许多方便的方法和属性,可以使解析HL7消息变得更加容易。此外,使用该包还可以轻松地构建HL7消息。
来源:JavaScript中文网 ,转载请联系管理员! 本文地址:https://www.javascriptcn.com/post/60057bc381e8991b448eb9d0