更新内容和上下文 #1
17
.vitepress/theme/index.ts
Normal file
@ -0,0 +1,17 @@
|
||||
// https://vitepress.dev/guide/custom-theme
|
||||
import { h } from 'vue'
|
||||
import type { Theme } from 'vitepress'
|
||||
import DefaultTheme from 'vitepress/theme'
|
||||
import './style.css'
|
||||
|
||||
export default {
|
||||
extends: DefaultTheme,
|
||||
Layout: () => {
|
||||
return h(DefaultTheme.Layout, null, {
|
||||
// https://vitepress.dev/guide/extending-default-theme#layout-slots
|
||||
})
|
||||
},
|
||||
enhanceApp({ app, router, siteData }) {
|
||||
// ...
|
||||
}
|
||||
} satisfies Theme
|
||||
139
.vitepress/theme/style.css
Normal file
@ -0,0 +1,139 @@
|
||||
/**
|
||||
* Customize default theme styling by overriding CSS variables:
|
||||
* https://github.com/vuejs/vitepress/blob/main/src/client/theme-default/styles/vars.css
|
||||
*/
|
||||
|
||||
/**
|
||||
* Colors
|
||||
*
|
||||
* Each colors have exact same color scale system with 3 levels of solid
|
||||
* colors with different brightness, and 1 soft color.
|
||||
*
|
||||
* - `XXX-1`: The most solid color used mainly for colored text. It must
|
||||
* satisfy the contrast ratio against when used on top of `XXX-soft`.
|
||||
*
|
||||
* - `XXX-2`: The color used mainly for hover state of the button.
|
||||
*
|
||||
* - `XXX-3`: The color for solid background, such as bg color of the button.
|
||||
* It must satisfy the contrast ratio with pure white (#ffffff) text on
|
||||
* top of it.
|
||||
*
|
||||
* - `XXX-soft`: The color used for subtle background such as custom container
|
||||
* or badges. It must satisfy the contrast ratio when putting `XXX-1` colors
|
||||
* on top of it.
|
||||
*
|
||||
* The soft color must be semi transparent alpha channel. This is crucial
|
||||
* because it allows adding multiple "soft" colors on top of each other
|
||||
* to create a accent, such as when having inline code block inside
|
||||
* custom containers.
|
||||
*
|
||||
* - `default`: The color used purely for subtle indication without any
|
||||
* special meanings attached to it such as bg color for menu hover state.
|
||||
*
|
||||
* - `brand`: Used for primary brand colors, such as link text, button with
|
||||
* brand theme, etc.
|
||||
*
|
||||
* - `tip`: Used to indicate useful information. The default theme uses the
|
||||
* brand color for this by default.
|
||||
*
|
||||
* - `warning`: Used to indicate warning to the users. Used in custom
|
||||
* container, badges, etc.
|
||||
*
|
||||
* - `danger`: Used to show error, or dangerous message to the users. Used
|
||||
* in custom container, badges, etc.
|
||||
* -------------------------------------------------------------------------- */
|
||||
|
||||
:root {
|
||||
--vp-c-default-1: var(--vp-c-gray-1);
|
||||
--vp-c-default-2: var(--vp-c-gray-2);
|
||||
--vp-c-default-3: var(--vp-c-gray-3);
|
||||
--vp-c-default-soft: var(--vp-c-gray-soft);
|
||||
|
||||
--vp-c-brand-1: var(--vp-c-indigo-1);
|
||||
--vp-c-brand-2: var(--vp-c-indigo-2);
|
||||
--vp-c-brand-3: var(--vp-c-indigo-3);
|
||||
--vp-c-brand-soft: var(--vp-c-indigo-soft);
|
||||
|
||||
--vp-c-tip-1: var(--vp-c-brand-1);
|
||||
--vp-c-tip-2: var(--vp-c-brand-2);
|
||||
--vp-c-tip-3: var(--vp-c-brand-3);
|
||||
--vp-c-tip-soft: var(--vp-c-brand-soft);
|
||||
|
||||
--vp-c-warning-1: var(--vp-c-yellow-1);
|
||||
--vp-c-warning-2: var(--vp-c-yellow-2);
|
||||
--vp-c-warning-3: var(--vp-c-yellow-3);
|
||||
--vp-c-warning-soft: var(--vp-c-yellow-soft);
|
||||
|
||||
--vp-c-danger-1: var(--vp-c-red-1);
|
||||
--vp-c-danger-2: var(--vp-c-red-2);
|
||||
--vp-c-danger-3: var(--vp-c-red-3);
|
||||
--vp-c-danger-soft: var(--vp-c-red-soft);
|
||||
}
|
||||
|
||||
/**
|
||||
* Component: Button
|
||||
* -------------------------------------------------------------------------- */
|
||||
|
||||
:root {
|
||||
--vp-button-brand-border: transparent;
|
||||
--vp-button-brand-text: var(--vp-c-white);
|
||||
--vp-button-brand-bg: var(--vp-c-brand-3);
|
||||
--vp-button-brand-hover-border: transparent;
|
||||
--vp-button-brand-hover-text: var(--vp-c-white);
|
||||
--vp-button-brand-hover-bg: var(--vp-c-brand-2);
|
||||
--vp-button-brand-active-border: transparent;
|
||||
--vp-button-brand-active-text: var(--vp-c-white);
|
||||
--vp-button-brand-active-bg: var(--vp-c-brand-1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Component: Home
|
||||
* -------------------------------------------------------------------------- */
|
||||
|
||||
:root {
|
||||
--vp-home-hero-name-color: transparent;
|
||||
--vp-home-hero-name-background: -webkit-linear-gradient(
|
||||
120deg,
|
||||
#bd34fe 30%,
|
||||
#41d1ff
|
||||
);
|
||||
|
||||
--vp-home-hero-image-background-image: linear-gradient(
|
||||
-45deg,
|
||||
#bd34fe 50%,
|
||||
#47caff 50%
|
||||
);
|
||||
--vp-home-hero-image-filter: blur(44px);
|
||||
}
|
||||
|
||||
@media (min-width: 640px) {
|
||||
:root {
|
||||
--vp-home-hero-image-filter: blur(56px);
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 960px) {
|
||||
:root {
|
||||
--vp-home-hero-image-filter: blur(68px);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Component: Custom Block
|
||||
* -------------------------------------------------------------------------- */
|
||||
|
||||
:root {
|
||||
--vp-custom-block-tip-border: transparent;
|
||||
--vp-custom-block-tip-text: var(--vp-c-text-1);
|
||||
--vp-custom-block-tip-bg: var(--vp-c-brand-soft);
|
||||
--vp-custom-block-tip-code-bg: var(--vp-c-brand-soft);
|
||||
}
|
||||
|
||||
/**
|
||||
* Component: Algolia
|
||||
* -------------------------------------------------------------------------- */
|
||||
|
||||
.DocSearch {
|
||||
--docsearch-primary-color: var(--vp-c-brand-1) !important;
|
||||
}
|
||||
|
||||
@ -2,11 +2,11 @@
|
||||
|
||||
请使用下面的联系方式和我们联系:
|
||||
|
||||
| 联系方式名称 | 联系方式 |
|
||||
|--------------------|-----------------------------------------------|
|
||||
| 电子邮件 | [service@ossez.com](mailto:service@ossez.com) |
|
||||
| QQ 或微信 | 103899765 |
|
||||
| 社区论坛 (使用 mumps 标签) | https://www.isharkfly.com/tag/mumps |
|
||||
| 联系方式名称 | 联系方式 |
|
||||
|---------------------|-----------------------------------------------|
|
||||
| 电子邮件 | [service@ossez.com](mailto:service@ossez.com) |
|
||||
| QQ 或微信 | 103899765 |
|
||||
| 社区论坛 (使用 health 标签) | https://www.isharkfly.com/tag/health |
|
||||
|
||||
# 公众平台
|
||||
|
||||
@ -1,19 +0,0 @@
|
||||
# 算法
|
||||
在应聘技术岗位的时候,可能都会有一个让绝大部分人都比较讨厌的算法环节。
|
||||
|
||||
也不知道是谁搞出这么无聊的东西,但没有办法现实总是残酷的,在抱怨的同时也只能在找工作之前复习下这些在实际工作中基本上不用的算法题了。
|
||||
|
||||
因为 MD 文档格式的限制,所以我们在这里只放一个索引并且维护这个索引,有关的具体内容,请通过索引访问我们的社区进行查看,我们也非常欢迎您参与讨论,
|
||||
您可以在社区注册后进行讨论。
|
||||
|
||||
## 算法问题
|
||||
在这里我将按照我遇到算法问题的先后顺序进行排列。很多算法题目都是题库上面的原题,你可以到题库上面去找找。
|
||||
|
||||
我这里只是结合我在面试的时候遇到的题目来进行解答和进行一些点评,就当时总结和消遣吧,如果你希望有什么问题一起讨论的话,欢迎 Fork 这个项目并且登录社区进行讨论。
|
||||
|
||||
最新的内容在最前面。
|
||||
|
||||
### 内容索引
|
||||
* [A “word-wrap” functionality(一个字符串包裹函数)](https://www.ossez.com/t/a-word-wrap-functionality/13452)
|
||||
* [Prime numbers from 1 to 100 (打印 100 以内的素数)](https://www.ossez.com/t/prime-numbers-from-1-to-100-100/13450)
|
||||
|
||||
@ -1,197 +0,0 @@
|
||||
# Discourse 文档
|
||||
Discourse 文档是通过官方文档的整理翻译过来的,下面的内容与官方的内容基本一致。
|
||||
|
||||
针对中文环境下的时候,我们对遇到的一些问题发布到我们的讨论区中以方便大家快速导航访问:
|
||||
|
||||
- [Discourse CentOS 8 全新安装手册](https://www.ossez.com/t/discourse-centos-8/594) - 在 CentOS/RHEL 平台上全新安装 Discourse 的过程和命令。
|
||||
|
||||
- [Discourse 如何不使用 Let’s Encrypt 而使用 CA 签名的密钥进行安装](https://www.ossez.com/t/discourse-lets-encrypt-ca/552) - 使用你自己已有的 CA 秘钥进行安装。
|
||||
|
||||
- [Discourse 设置 GTM](https://www.ossez.com/t/discourse-gtm/13240) - 使用 Google 的标签管理器来插入需要的 JS 代码。
|
||||
|
||||
## 云平台安装
|
||||
**在基于云平台的 Discourse 安装通常不会超过 30 分钟**,哪怕你没有任何有关 Rails 或 Linux shell 的知识都能够顺利完成安装。
|
||||
下面我们是通过 [DigitalOcean][do] 服务提供商来进行安装测的,但是所有的安装步骤都能够在
|
||||
所有兼容 **Docker** 的云计算平台上进行,同时也可以在本地的服务器上完成安装。
|
||||
|
||||
> 🔔 如果你连 30 分钟都没有的话?你可以联系 Discourse 社区来帮你完成安装,Discourse 社区将会收取一次性 $150 (美元)的费用。 [单击此处链接来对服务进行购买](https://www.literatecomputing.com/product/discourse-install/) 。
|
||||
|
||||
### 创建一个新的云服务器
|
||||
|
||||
创建一个你的新云服务器,例如:[DigitalOcean](https://www.digitalocean.com/?refcode=5fa48ac82415) ,当然你也可以使用其他平台提供的服务器。
|
||||
|
||||
- 默认配置 **当前版本的 LTS Ubuntu 操作系统** 能够很好的工作。最少,需要一个 64 位的 Linux 操作系统,并且这个操作系统的内核需要更新到最新的版本。
|
||||
|
||||
- 默认配置 **1 GB** 的内存针对小型的 Discourse 社区通常都能很好的运行。但我们推荐针对大型社区使用 2 GB 的内存。
|
||||
|
||||
- 默认配置 **New York** 数据中心针对北美和欧洲来说都是不错的地理分区,如果你的 Discourse 用户使用的对象多是其他地理位置的用户,那么你可以选择离你稍近的数据中心。
|
||||
|
||||
- 输入域名 `discourse.example.com` 来在 DigitalOcean 中创建一个 Droplet(Droplet 是 DigitalOcean 定义的服务器名称)。当然你也可以购买使用你自己的域名,通常 Discourse 的安装需要一个真实的域名,没有办法通过 IP 地址安装,所以我们建议你首先购买域名或者使用你已有域名的二级域名。
|
||||
|
||||
创建你的新 Droplet,这个过程就等于你在 DigitalOcean 上创建了一个服务器,也等同你在其他平台上面创建了一个 VPS 或者服务器。
|
||||
当完成创建后,你将会收到一个电子邮件,这个电子邮件中有你的 Root 用户的密码。
|
||||
但是我们建议你 [设置使用 SSH keys](https://www.google.com/search?q=digitalocean+ssh+keys) , 来增强你服务器访问的安全性。
|
||||
|
||||
### 访问你的云服务器
|
||||
|
||||
通过使用 IP 地址,并使用 SSH 来连接和访问你创建的服务器,或者针对 Windows 平台你可以安装 [Putty][put] 后运行下面的命令来进行连接:
|
||||
|
||||
ssh root@192.168.1.1
|
||||
|
||||
如果你没有配置 SSH Key 的话,你可以使用 DigitalOcean 发给你的电子邮件中包含的密码来进行登录,
|
||||
或者使用你本地的 SSH Key 来进行连接。
|
||||
|
||||
### 安装 Docker / Git (可选的)
|
||||
|
||||
如果你希望使用你自己的 Docker 版本,你可以现在在你新设置的服务器上进行安装。
|
||||
如果你的服务器上没有默认安装 Docker,那么 `discourse-setup` 将会自动为你从 get.docker.com 下载后进行安装。
|
||||
|
||||
### 安装 Discourse
|
||||
|
||||
从 [官方 Discourse Docker 镜像][dd] 仓库中克隆代码到本地计算机的 `/var/discourse` 目录。
|
||||
|
||||
sudo -s
|
||||
git clone https://github.com/discourse/discourse_docker.git /var/discourse
|
||||
cd /var/discourse
|
||||
|
||||
你只需要执行上面的命令即可,在 Discourse 安装的过程中需要 root 权限。
|
||||
|
||||
### 电子邮件
|
||||
|
||||
> ⚠️ **电子邮件系统在 Discourse 的用户创建过程中非常重要。**
|
||||
> 如果你没有在安装 Discourse 之前创建电子邮件 SMTP 服务器,那么你安装的 Discourse 无法访问也无法登录(HAVE A BROKEN SITE)!
|
||||
|
||||
- 如果你已经有你自己的 SMTP 邮件服务器了,那么你就可以直接使用你已有的邮件服务器配置信息。
|
||||
|
||||
- 还有没有邮件服务器?请访问 [**Discourse 推荐使用的邮件服务器**][mailconfig].
|
||||
|
||||
- 为了确保你的邮件能够被正常投递,你必须在你的 DNS 中添加有效的 [SPF 和 DKIM 记录](https://www.google.com/search?q=spf+dkim) 。请访问你邮件服务提供商的文档如何设置这些信息。
|
||||
|
||||
根据我们实际使用的情况,Discourse 的安装**必须**配置可用的域名和邮件服务器,针对中国境内的情况,你可以使用阿里云或者腾讯云提供的企业邮箱。
|
||||
通常我们建议你使用境外的邮件服务器,比如说 AWS 的 SES,或者 MailGun 都是不错的服务,你可能需要一张国际信用卡完成校验。
|
||||
但这一步是必须的,否则你的的 Discourse 无法完成安装。
|
||||
|
||||
### 域名
|
||||
|
||||
> 🔔 Discourse 不能通过 IP 地址来工作,你必须拥有一个域名或者二级域名来进行安装,例如 `example.com` 。
|
||||
|
||||
- 如果你已经拥有一个域名了,那么可以选择任何一个二级域名来进行安装,例如 `discourse.example.com` 或 `talk.example.com` 或 `forum.example.com` 来安装你的 Discourse 实例。
|
||||
|
||||
- 还没有域名的话,你可以访问 [NameCheap](https://www.namecheap.com/domains/domain-name-search/) 网站来搜索你喜欢的域名,或者直接 Google 搜索 [great domain name registrars](https://www.google.com/search?q=best+domain+name+registrars) 来选择你喜欢的域名注册商。
|
||||
|
||||
- 你的 DNS 控制台应该是能够访问的,在你购买域名后,你还需要访问你的 DNS 配置来配置 DNS。针对你安装的 Discourse 网站,你需要通过你的 DNS 创建一个 [`A` 记录](https://support.dnsimple.com/articles/a-record/) ,这个 A 记录需要将你要安装的域名指向到一个特定的 IP 地址。这个 IP 地址通常为你在第一步购买的服务器 IP 地址。
|
||||
|
||||
### 编辑 Discourse 配置
|
||||
|
||||
通过下面的命令运行配置工具
|
||||
|
||||
./discourse-setup
|
||||
|
||||
你需要根据下面的提示配置所有参数:
|
||||
|
||||
Hostname for your Discourse? [discourse.example.com]:
|
||||
Email address for admin account(s)? [me@example.com,you@example.com]:
|
||||
SMTP server address? [smtp.example.com]:
|
||||
SMTP port? [587]:
|
||||
SMTP user name? [user@example.com]:
|
||||
SMTP password? [pa$$word]:
|
||||
Let's Encrypt account email? (ENTER to skip) [me@example.com]:
|
||||
|
||||
上面的输入数据将会为你的 Discourse 实例创建一个 `app.yml` 文件,这个文件将会在安装进行后对你的 Discourse 实例进行配置。
|
||||
整个安装启动过程可能需要耗费 **2-8 分钟** 来为你的配置 Discourse。
|
||||
如果在安装完成后你还需要对你的配置进行修改,你可以再次运行 `./discourse-setup` 命令(这个命令将会把已经存在的 `app.yml` 文件重新载入)。
|
||||
或者你也可以手动直接编辑 `/containers/app.yml` 文件中的内容,然后再次运行 `./launcher rebuild app`,否则你的修改是不会生效的。
|
||||
|
||||
### 启动 Discourse
|
||||
|
||||
一旦初始化安装配置完成后,你的 Discourse 示例应该可以通过你配置的域名 `discourse.example.com` 在浏览器上进行访问。
|
||||
|
||||
<img src="https://cdn.ossez.com/discourse-uploads/optimized/2X/8/8db53b9128ec4fb74872bdb7c1231ff04d525218_2_616x500.png" width="650">
|
||||
|
||||
### 注册一个新的管理员账号
|
||||
|
||||
使用你再启动配置过程中输入的电子邮件地址来注册一个管理员账号。
|
||||
|
||||
<img src="https://cdn.ossez.com/discourse-uploads/original/2X/9/99476eac0ffa4aa3a923aa7ae864fedf546dab0a.png" width="650">
|
||||
|
||||
<img src="https://cdn.ossez.com/discourse-uploads/original/2X/5/58660d377a00d9797be8b74036ace9d0ebf57fff.png" width="650">
|
||||
|
||||
(如果你不能注册你的管理账号(Admin),请通过路径`/var/discourse/shared/standalone/log/rails/production.log` 检查日志,或者访问 [电子邮件问题检查列表](https://meta.discourse.org/t/troubleshooting-email-on-a-new-discourse-install/16326) 。)
|
||||
|
||||
当你完成管理员账号的注册后,设置向导将会启动并指引你配置你的 Discourse 实例。
|
||||
|
||||
<img src="https://cdn.ossez.com/discourse-uploads/original/2X/9/944509dd0c049a2cec42d6108369fa5cf5d92d0d.png" width="650">
|
||||
|
||||
当完成所有的设置向导,你将会看到职员主题(Staff topics)和 **READ ME FIRST: Admin Quick Start Guide** 。
|
||||
这个配置向导将会包含有针对后续配置的的一些建议和如何对你的 Discourse 安装实例进行自定义配置。
|
||||
|
||||
<img src="https://cdn.ossez.com/discourse-uploads/original/2X/8/8a60bc840705aaa1fc77b039a7babf77d6b4a10b.png" width="650">
|
||||
|
||||
### 安装后的维护
|
||||
|
||||
- 我们强烈建议打开你针对你操作系统的安全自动更新。在 Ubuntu 使用 `dpkg-reconfigure -plow unattended-upgrades` 命令。在 CentOS/RHEL,使用 [`yum-cron`](https://www.cyberciti.biz/faq/fedora-automatic-update-retrieval-installation-with-cron/) 包。
|
||||
- 如果你使用的是密码登录你的操作系统,而不是使用 SSH Key 的话,请确保你使用强密码。在 Ubuntu 使用 `apt-get install libpam-cracklib` 包。我们推荐使用 `fail2ban` ,这个将会对 3 次登录失败的 IP 地址禁止登录 10 分钟。
|
||||
- **Ubuntu**: `apt-get install fail2ban`
|
||||
- **CentOS/RHEL**: `sudo yum install fail2ban` (需要 [EPEL](https://support.rackspace.com/how-to/install-epel-and-additional-repositories-on-centos-and-red-hat/))
|
||||
- 如果你希望默认安装防火墙, 针对 Ubuntu [打开 ufw](https://meta.discourse.org/t/configure-a-firewall-for-discourse/20584) 或者针对 CentOS/RHEL 7 及其后续版本使用 `firewalld` 。
|
||||
|
||||
当 Discourse 有新版本更新的时候,你的邮件地址将会收到更新提示。
|
||||
请随时更新你的 Discourse 实例到最新版本以确保所有的安全问题被修复。
|
||||
要 **更新 Discourse 到最新的版本**,请通过你的浏览器访问 `/admin/upgrade` 然后单击更新按钮。
|
||||
|
||||
`/var/discourse` 目录中的 `launcher` 命令被用来使用一些系统级别的维护:
|
||||
|
||||
``` text
|
||||
Usage: launcher COMMAND CONFIG [--skip-prereqs] [--docker-args STRING]
|
||||
Commands:
|
||||
start: Start/initialize a container(启动/初始化容器)
|
||||
stop: Stop a running container(停止一个运行的容器)
|
||||
restart: Restart a container(重启容器)
|
||||
destroy: Stop and remove a container (停止然后删除一个容器)
|
||||
enter: Use nsenter to get a shell into a container (使用 nsenter 来访问容器内的 Shell)
|
||||
logs: View the Docker logs for a container(查看一个容器的日志)
|
||||
bootstrap: Bootstrap a container for the config based on a template(从配置模板中来启动一个容器的配置和初始化)
|
||||
rebuild: Rebuild a container (destroy old, bootstrap, start new)(重构一个容器,将会删除老的容器,初始一个容器,启动新的容器)
|
||||
cleanup: Remove all containers that have stopped for > 24 hours(针对停止运行超过 24 个小时的容器进行删除)
|
||||
|
||||
Options:
|
||||
--skip-prereqs Don't check launcher prerequisites (不运行安装器的环境校验)
|
||||
--docker-args Extra arguments to pass when running docker (传递给容器内的额外参数)
|
||||
```
|
||||
|
||||
### 添加更多的 Discourse 特性
|
||||
|
||||
下面的内容是一些快速的链接,能够帮助你扩展 Discourse 安装的功能:
|
||||
|
||||
- Users to log in *only* via your pre-existing website's registration system? [Configure Single-Sign-On](https://meta.discourse.org/t/official-single-sign-on-for-discourse/13045).
|
||||
|
||||
- 用户可以使用 [Google](https://www.ossez.com/t/discourse-google-google-login/13582), [Twitter](https://meta.discourse.org/t/configuring-twitter-login-for-discourse/13395), [GitHub](https://www.ossez.com/t/discourse-github/13562), or [Facebook](https://meta.discourse.org/t/configuring-facebook-login-for-discourse/13394) 进行注册登录。
|
||||
|
||||
- Users to post replies via email? [Configure reply via email](https://meta.discourse.org/t/set-up-reply-via-email-support/14003).
|
||||
|
||||
- Automatic daily backups? [Configure backups](https://meta.discourse.org/t/configure-automatic-backups-for-discourse/14855).
|
||||
|
||||
- Free HTTPS / SSL support? [Configure Let's Encrypt](https://meta.discourse.org/t/setting-up-lets-encrypt-cert-with-discourse-docker/40709). Paid HTTPS / SSL support? [Configure SSL](https://meta.discourse.org/t/allowing-ssl-for-your-discourse-docker-setup/13847).
|
||||
|
||||
- Use a plugin [from Discourse](https://github.com/discourse) or a third party? [Configure plugins](https://meta.discourse.org/t/install-a-plugin/19157)
|
||||
|
||||
- Multiple Discourse sites on the same server? [Configure multisite](https://meta.discourse.org/t/multisite-configuration-with-docker/14084).
|
||||
|
||||
- Webhooks when events happen in Discourse? [Configure webhooks](https://meta.discourse.org/t/setting-up-webhooks/49045).
|
||||
|
||||
- A Content Delivery Network to speed up worldwide access? [Configure a CDN](https://meta.discourse.org/t/enable-a-cdn-for-your-discourse/14857). We recommend [Fastly](http://www.fastly.com/).
|
||||
|
||||
- Import old content from vBulletin, PHPbb, Vanilla, Drupal, BBPress, etc? [See our open source importers](https://github.com/discourse/discourse/tree/main/script/import_scripts).
|
||||
|
||||
- A user friendly [offline page when rebuilding or upgrading?](https://meta.discourse.org/t/adding-an-offline-page-when-rebuilding/45238)
|
||||
|
||||
- To embed Discourse [in your WordPress install](https://github.com/discourse/wp-discourse), or [on your static HTML site](https://meta.discourse.org/t/embedding-discourse-comments-via-javascript/31963)?
|
||||
|
||||
Help us improve this guide! Feel free to ask about it on [meta.discourse.org][meta], or even better, submit a pull request.
|
||||
|
||||
[dd]: https://github.com/discourse/discourse_docker
|
||||
[ssh]: https://help.github.com/articles/generating-ssh-keys
|
||||
[meta]: https://meta.discourse.org
|
||||
[do]: https://www.digitalocean.com/?refcode=5fa48ac82415
|
||||
[put]: http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
|
||||
[mailconfig]: https://github.com/discourse/discourse/blob/main/docs/INSTALL-email.md
|
||||
BIN
docs/fhir/_images/Eclipse-Temurin-JDK.png
Normal file
|
After Width: | Height: | Size: 74 KiB |
BIN
docs/fhir/_images/php-install-04.png
Normal file
|
After Width: | Height: | Size: 41 KiB |
BIN
docs/fhir/_images/php-install-05.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
docs/fhir/_images/php-install-06.png
Normal file
|
After Width: | Height: | Size: 43 KiB |
9
docs/fhir/_sidebar.md
Normal file
@ -0,0 +1,9 @@
|
||||
- [FHIR 简介](/fhir-in-action/introduction/index.md)
|
||||
- [开发者眼中的 FHIR](/fhir-in-action/introduction/toreader.md)
|
||||
- [FHIR 实现](/fhir-in-action/introduction/fhir-mplementation.md)
|
||||
- [FHIR 概述](/fhir-in-action/introduction/fhir-overview.md)
|
||||
- [FHIR 开发者指南](/fhir-in-action/introduction/fhir-dev-guide.md)
|
||||
- [开放数据](/fhir-in-action/introduction/open-data-is-coming.md)
|
||||
- [Install JDK](/fhir-in-action/install_jdk.md)
|
||||
- [Install Eclipse](/fhir-in-action/introduction/install_eclipse.md)
|
||||
- [Naming Conventions](/fhir-in-action/naming_conventions.md)
|
||||
37
docs/fhir/index.md
Normal file
@ -0,0 +1,37 @@
|
||||
# FHIR In Action
|
||||
---
|
||||
|
||||
针对 FHIR 标准的指南和示例以及相关内容的讨论。
|
||||
|
||||
FHIR® – Fast Health Interoperable Resources (Index - FHIR v5.0.0) – 是由 HL7 提出的新一代标准框架。
|
||||
|
||||
FHIR 整合了 HL7 V2,V3 和 CDA 的优点,同时利用了最新的Web标准,紧紧围绕着 implementability 开发和实现。
|
||||
|
||||
如还想了解更多有关 FHIR 的定义,请访问链接:https://www.isharkfly.com/t/hl7-fhir/15160
|
||||
|
||||
## 版权
|
||||
|
||||
本文本遵守开源著作权的开放版权协议,你可以:
|
||||
|
||||
* 下载、保存以及打印本书
|
||||
* 网络链接、转载本书的部分或者全部内容,但是必须在明显处向读者提供访问本书发布网站的链接
|
||||
* 在你的程序中任意使用本书所附的程序代码,但是由本书的程序所引起的任何问题,作者不承担任何责任
|
||||
|
||||
## 在线电子版本
|
||||
|
||||
在线电子版本请访问:https://fhir.isharkfly.com
|
||||
|
||||
## 参考和框架
|
||||
|
||||
| 网站名称 | URL | NOTE |
|
||||
|-----------------|-----------------------------------------------------------------------------|-------------|
|
||||
| iSharkFly | https://www.isharkfly.com/c/industry-software/hospital-information-system/6 | HIS 相关信息 |
|
||||
| David Hay 博客 | http://fhirblog.com/ | |
|
||||
| Ewout Kramer 博客 | https://fire.ly/ | |
|
||||
| 硕士论文 | https://github.com/JaneBlue/PPTpaper | |
|
||||
| FHIR GitHub 参考 | https://github.com/wanghaisheng/fhir-in-action/ | |
|
||||
| HAPI FHIR 库源代码 | https://github.com/hapifhir/hapi-fhir | |
|
||||
| SMART 技术文档 | https://github.com/smart-on-fhir/smart-on-fhir.github.io | |
|
||||
| Fhirbase | https://github.com/fhirbase | 使用 Go 和技术方案 |
|
||||
|
||||
|
||||
411
docs/fhir/introduction/fhir-dev-guide.md
Normal file
@ -0,0 +1,411 @@
|
||||
## 1.7.1 开发者指南
|
||||
|
||||
FHIR (Fast Health Interoperability Resources)旨在数据交换,能够支撑医疗领域的多种流程。该标准基于Restful的最佳实践,能够实现跨团队的医疗系统的集成。
|
||||
|
||||
FHIR 所支持的范围很广泛,包括人、兽医、临床、公共卫生、临床试验、管理和财务等方面。全球通用且支持多种架构和场景。
|
||||
|
||||
### 1.7.1.1 框架
|
||||
|
||||
FHIR 是基于 `资源`这一通用组件. 每个资源都有如下 [通用特征](resources.html):
|
||||
|
||||
* 用URL来标识
|
||||
* 通用的元数据
|
||||
* [供人可读的XHTML概述](narrative.html)
|
||||
* 通用的数据元集合
|
||||
* [扩展的框架](extensibility.html)以支持医疗中的多样性
|
||||
|
||||
资源要么是 [XML](xml.html) ,要么是 [JSON](json.html)格式的. 目前已经定义了99种[资源类型](resourcelist.html)
|
||||
|
||||
### 1.7.1.2 Patient实例
|
||||
|
||||
如何用JSON来表示[patient](patient.html)。 标准中也定义了XML的表达方式。
|
||||
|
||||
```
|
||||
|
||||
|
||||
{
|
||||
"resourceType": "Patient",
|
||||
"id" : "23434",
|
||||
"meta" : {
|
||||
"versionId" : "12",
|
||||
"lastUpdated" : "2014-08-18T01:43:30Z"
|
||||
}
|
||||
"text": {
|
||||
"status": "generated",
|
||||
"div": "<!-- Snipped for Brevity -->"
|
||||
},
|
||||
"extension": [
|
||||
{
|
||||
"url": "http://example.org/consent#trials",
|
||||
"valueCode": "renal"
|
||||
}
|
||||
],
|
||||
"identifier": [
|
||||
{
|
||||
"use": "usual",
|
||||
"label": "MRN",
|
||||
"system": "http://www.goodhealth.org/identifiers/mrn",
|
||||
"value": "123456"
|
||||
}
|
||||
],
|
||||
"name": [
|
||||
{
|
||||
"family": [
|
||||
"Levin"
|
||||
],
|
||||
"given": [
|
||||
"Henry"
|
||||
],
|
||||
"suffix": [
|
||||
"The 7th"
|
||||
]
|
||||
}
|
||||
],
|
||||
"gender": {
|
||||
"text": "Male"
|
||||
},
|
||||
"birthDate": "1932-09-24",
|
||||
"active": true
|
||||
}
|
||||
|
||||
|
||||
````
|
||||
|
||||
每个资源包括如下内容:
|
||||
|
||||
* **resourceType** (line 2) - 必须要有: FHIR 中定义了多种资源类型,详细列表请查看[the full index](resourcelist.html)
|
||||
* **id** (line 3) - 资源自身的id(而非资源中数据的ID 相当于资源在数据库中的主键). 一般而言都是要有的,除了在新建时之外。
|
||||
* **meta** (lines 4 - 7) - 通常要由 : [所有资源都会有的属性(这里和其他地方对元数据的定义略有偏差,参考https://github.com/memect/hao/issues/296)](resources.html#meta)受基础架构控制. 如果没有元数据可以为空
|
||||
* **text** (lines 12 - 17) - 推荐使用: XHTML 包含了资源中 [供人可读的部分](narrative.html)
|
||||
* **extension** (lines 12 - 17) - 可选: [Extensions](extensibility.html)由扩展框架所定义
|
||||
* **data** (lines 18 - 43) - 可选: 每种资源所定义的数据项。
|
||||
|
||||
备注 尽管标准中总是以所定义的顺序来显示JSON中数据的顺序,但很多JSON库有其他排序标准。
|
||||
### 1.7.1.3 交互
|
||||
|
||||
为了操作数据,FHIR 定义了[REST API](http.html):
|
||||
|
||||
* [Create](http.html#create) = POST https://example.com/path/{resourceType}
|
||||
* [Read](http.html#read) = GET https://example.com/path/{resourceType}/{id}
|
||||
* [Update](http.html#update) = PUT https://example.com/path/{resourceType}/{id}
|
||||
* [Delete](http.html#delete) = DELETE https://example.com/path/{resourceType}/{id}
|
||||
* [Search](http.html#search) = GET https://example.com/path/{resourceType}?search parameters...
|
||||
* [History](http.html#history) = GET https://example.com/path/{resourceType}/{id}/_history
|
||||
* [Transaction](http.html#transaction) = POST https://example.com/path/
|
||||
* [Operation](operations.html) = GET https://example.com/path/{resourceType}/{id}/${opname}
|
||||
|
||||
除了RESTful API之外,FHIR 中还定义了其他的数据交换方式,包括 [文档](documents.html),
|
||||
[消息](messaging.html)和其他类型的[服务](services.html).
|
||||
|
||||
### 1.7.1.4 对多样性的管理
|
||||
|
||||
医疗行业的一大特点就是不同地区和细分行业都存在很大的差异性,并不存在一个集中式的权威机构来定义通用的行业规范。鉴于此,
|
||||
FHIR 中定义了[通用扩展框架](extensibility.html)和
|
||||
[管理多样性的框架](profiling.html).
|
||||
|
||||
### 1.7.1.5 新增资源
|
||||
|
||||
为了[新增资源](http.html#create), 需要发送一个 HTTP 的 POST 请求到某个资源节点(也就是某个URL).如下所示
|
||||
|
||||
```
|
||||
POST https://example.com/path/{resourceType}
|
||||
````
|
||||
|
||||
|
||||
```
|
||||
POST {some base path}/Patient HTTP/1.1
|
||||
Authorization: Bearer 37CC0B0E-C15B-4578-9AC1-D83DCED2B2F9
|
||||
Accept: application/json+fhir
|
||||
Content-Type: application/json+fhir
|
||||
Content-Length: 1198
|
||||
|
||||
{
|
||||
"resourceType": "Patient",
|
||||
...
|
||||
}
|
||||
````
|
||||
|
||||
向服务器提交一条患者记录, 服务器可以根据自己的情况分配ID来存储该患者记录。备注:
|
||||
|
||||
* **/Patient** (line 1) - 处理所有患者的节点- 这里使用资源类型的名称
|
||||
* **Authorization** (line 2) - 参考 [Security for FHIR](security.html)
|
||||
* **Accept, Content-Type** (lines 3-4) - 如果资源的数据是JSON格式,content type需要设置成这样application/json+fhir (XML的话设置成 application/xml+fhir). 数据的编码始终是UTF-8
|
||||
* **id** (line 9) - 待新建的记录中并没有id,由服务器来分配
|
||||
* Resource Content, lines 8+ - 这时候也没有任何元数据。资源的其他部分同上述示例
|
||||
|
||||
### 1.7.1.6 新增资源的响应
|
||||
|
||||
响应中包含HTTP 201,表示服务器已经成功新建该条记录。location header 属性中包含了访问该资源的URL。响应中亦可包含[OperationOutcome](operationoutcome.html) 资源来表达处理的一些细节,并不做硬性要求。
|
||||
|
||||
```
|
||||
HTTP/1.1 201 Created
|
||||
Content-Length: 161
|
||||
Content-Type: application/json+fhir
|
||||
Date: Mon, 18 Aug 2014 01:43:30 GMT
|
||||
ETag: "1"
|
||||
Location: http://example.com/Patient/347
|
||||
|
||||
{
|
||||
"resourceType": "OperationOutcome",
|
||||
"text": {
|
||||
"status": "generated",
|
||||
"div": "<div xmlns=\"http://www.w3.org/1999/xhtml\">The operation was successful</div>"
|
||||
}
|
||||
}
|
||||
````
|
||||
|
||||
Notes:
|
||||
|
||||
* **HTTP/1.1 201** (line 1) - 操作成功. Note that HTTP/1.1 is strongly recommended but not required
|
||||
* **ETag** (line 5) - used in the [version aware update](http.html#update) pattern
|
||||
* **Location** (line 6) - the id the server assigned to the resource. The id in the url must match the id in the resource when it is subsequently returned
|
||||
* **operationOutcome** (line 9) - OperationOutcome resources in this context have no id or meta element (they have no managed identity)
|
||||
|
||||
#### 1.7.1.6.1 Error response
|
||||
|
||||
出于多种原因,服务器会返回一个错误信息,FHIR 内容相关的一些错误信息以HTTP 状态码加一个[OperationOutcome](operationoutcome.html)来表达.
|
||||
如下是一个不满足服务器端业务规则时的返回信息:
|
||||
|
||||
```
|
||||
HTTP/1.1 422 Unprocessable Entity
|
||||
Content-Length: 161
|
||||
Content-Type: application/json+fhir
|
||||
Date: Mon, 18 Aug 2014 01:43:30 GMT
|
||||
|
||||
{
|
||||
"resourceType": "OperationOutcome",
|
||||
"text": {
|
||||
"status": "generated",
|
||||
"div": "<div xmlns=\"http://www.w3.org/1999/xhtml\">MRN conflict
|
||||
- the MRN 123456 is already assigned to a different patient</div>"
|
||||
},
|
||||
}
|
||||
````
|
||||
|
||||
Notes:
|
||||
|
||||
* 服务器可通过[OperationOutcome](operationoutcome.html)来表达更为详细的错误信息
|
||||
|
||||
### 1.7.1.7 Read Request
|
||||
|
||||
[读取资源内容](http.html#read)是通过HTTP GET请求来实现的.
|
||||
|
||||
```
|
||||
GET https://example.com/path/{resourceType}/{id}
|
||||
````
|
||||
|
||||
```
|
||||
GET /Patient/347?_format=xml HTTP/1.1
|
||||
Host: example.com
|
||||
Accept: application/xml+fhir
|
||||
Cache-Control: no-cache
|
||||
````
|
||||
|
||||
Notes:
|
||||
|
||||
* **347** (line 1) - 要访问资源的id
|
||||
* **_format=xml** (line 1) - 希望返回的数据格式,这种方式适合于客户端无法访问HTTP 头信息的情况,例如XSLT转换时,也可以通过HTTP 头中的accept字段来指定(see [Mime Types](http.html#mimetypes)
|
||||
* **cache control** (line 4) - 如何控制并发是很重要的,但FHIR中并未做出规定,更多信息请参考[http://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html](http://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html) 或者 [https://www.mnot.net/cache_docs/](https://www.mnot.net/cache_docs/)
|
||||
|
||||
### 1.7.1.8 Read Response
|
||||
|
||||
读取单个资源内容GET请求的响应是单独的一个资源.
|
||||
|
||||
```
|
||||
HTTP/1.1 200 OK
|
||||
Content-Length: 729
|
||||
Content-Type: application/xml+fhir
|
||||
Last-Modified: Sun, 17 Aug 2014 15:43:30 GMT
|
||||
ETag: "1"
|
||||
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Patient xmlns="http://hl7.org/fhir">
|
||||
<id value="347"/>
|
||||
<meta>
|
||||
<versionId value="1"/>
|
||||
<lastUpdated value="2014-08-18T01:43:30Z"/>
|
||||
</meta>
|
||||
<!-- content as shown above for patient -->
|
||||
</Patient>
|
||||
|
||||
````
|
||||
|
||||
Notes:
|
||||
|
||||
* **id** (line 8) - 资源的id,与请求中的id一致
|
||||
* **versionId** (line 11) - 该资源的最新版本. 最佳实践中要求该值与 ETag值匹配 (see [version aware update](http.html#update)), 对于客户端而言,不能认为二者总是匹配的. 一部分服务器并不记录资源的版本信息。
|
||||
* 尽管建议服务器能够保留版本信息,但不做强制性要求
|
||||
* **lastUpdated** (line 12) - 如果存在该字段,字段值应与HTTP header中的值保持一致
|
||||
|
||||
### 1.7.1.9 Search Request
|
||||
|
||||
除了读取单个资源内容之外,也可以通过[查询参数和变量](search.html) [查询资源内容](http.html#search),形式一般如下:
|
||||
|
||||
<div class="example">
|
||||
<pre class="http">
|
||||
GET https://example.com/path/{resourceType}?criteria
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
The criteria is a set of
|
||||
http parameters that specify which resources to return. The search operation
|
||||
|
||||
<div class="example">
|
||||
<pre class="http">
|
||||
https://example.com/base/MedicationPrescription?patient=347
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
会返回该患者的所有处方信息.
|
||||
|
||||
### 1.7.1.10 Search Response
|
||||
|
||||
查询请求返回的对象是一个[bundle](extras.html#bundle): 如未明确要求,只返回满足查询参数要求的资源元数据:
|
||||
|
||||
```
|
||||
{
|
||||
"resourceType": "Bundle",
|
||||
"id" : "eceb4882-5c7e-4ca4-af62-995dfb8cef01"
|
||||
"meta" : {
|
||||
"lastUpdated" : "2014-08-19T15:43:30Z"
|
||||
},
|
||||
"base": "http://example.com/base",
|
||||
"total": "3",
|
||||
"link": [
|
||||
{
|
||||
"relation" : "next",
|
||||
"url" : "https://example.com/base/MedicationPrescription?patient=347&searchId=ff15fd40-ff71-4b48-b366-09c706bed9d0&page=2"
|
||||
}, {
|
||||
"relation" : "self",
|
||||
"url" : "https://example.com/base/MedicationPrescription?patient=347"
|
||||
}
|
||||
],
|
||||
"entry": [
|
||||
{
|
||||
"resource" : {
|
||||
"resourceType": "MedicationPrescription",
|
||||
"id" : "3123",
|
||||
"meta" : {
|
||||
"versionId" : "1",
|
||||
"lastUpdated" : "2014-08-16T05:31:17Z"
|
||||
},
|
||||
... content of resource ...
|
||||
},
|
||||
},
|
||||
... 2 additional resources ....
|
||||
]
|
||||
}
|
||||
````
|
||||
Notes:
|
||||
|
||||
* **resourceType** (line 7) - "SearchResults" is the name for a bundle returned from a search
|
||||
* **id** (line 3) -服务器为该次查询响应bundle的唯一标识. 有些情况下要求该id满足 [ 全球唯一](extras.html#bundle-unique)
|
||||
* **meta.lastUpdated** (line 10) - This should match the HTTP header, and should be the date the search was executed, or more recent, depending on how the [server handles ongoing updates](search.html#currency). The lastUpdated data SHALL be the same or more recent than the most recent resource in the results
|
||||
* **base** (line 12) - 返回的内容中所有[资源引用](references.html) 相对地址的根地址。
|
||||
* **total** (line 13) - 满足查询条件的记录数量. 这里的数量指的是总数,而非仅该bundle中所包含的数量,详情查看 [可以对结果进行分页查询](http.html#search)
|
||||
* **link** (line 14) - A set of named links that give related contexts to this bundle. Names defined in this specification: [first](http.html#search), [prev](http.html#search), [next](http.html#search), [last](http.html#search), [self](http.html#search)
|
||||
* **item** (line 23) - 用来表达满足查询条件的实际资源的元数据信息
|
||||
* 如果加上include标签,可以强制要求服务器在返回结果中包含资源的内容,详情请参阅[return additional related resources](search.html#include)
|
||||
|
||||
### 1.7.1.11 Update Request
|
||||
|
||||
客户端用新版本的资源记录替换服务器中的老版本.
|
||||
|
||||
```
|
||||
PUT https://example.com/path/{resourceType}/{id}
|
||||
````
|
||||
|
||||
Note that there does not need to be a resource already existing at {id} - the server may elect to automatically create the resource at the specified address. Here is an example of updating a patient:
|
||||
```
|
||||
PUT /Patient/347 HTTP/1.1
|
||||
Host: example.com
|
||||
Content-Type: application/json+fhir
|
||||
Content-Length: 1435
|
||||
Accept: application/json+fhir
|
||||
If-Match: 1
|
||||
|
||||
{
|
||||
"resourceType": "Patient",
|
||||
"id" : "347",
|
||||
"meta" : {
|
||||
"versionId" : "1",
|
||||
"lastUpdated" : "2014-08-18T01:43:30Z"
|
||||
},
|
||||
...
|
||||
}
|
||||
````
|
||||
|
||||
Notes:
|
||||
|
||||
* **resourceType** (line 1) - "Patient" URL请求中的资源类型必须与提交的数据中的资源类型保持一致 (line 9)
|
||||
* **resource id** (line 1, "347") - URL中的资源id必须与提交的数据中id值保持一致(line 9)
|
||||
* **If-Match** (line 6) - 如果存在该字段,必须与资源内容中的meta.versionId值保持一致 (line 12), 服务器必须核实版本的完整性,如果不支持版本则返回412状态码
|
||||
* **meta.lastUpdated** (line 10) - This value is ignored, and will be updated by the server
|
||||
* **resource content** (line 14) - 这里省略了资源内容
|
||||
|
||||
### 1.7.1.12 Update Response
|
||||
|
||||
更新请求的响应包括了元数据、状态和OperationOutcome(可选):
|
||||
|
||||
```
|
||||
HTTP/1.1 200 OK
|
||||
Content-Length: 161
|
||||
Content-Type: application/json+fhir
|
||||
Date: Mon, 18 Aug 2014 01:43:30 GMT
|
||||
ETag: "2"
|
||||
|
||||
{
|
||||
"resourceType": "OperationOutcome",
|
||||
"text": {
|
||||
"status": "generated",
|
||||
"div": "<div xmlns=\"http://www.w3.org/1999/xhtml\">The operation was successful</div>"
|
||||
}
|
||||
}
|
||||
````
|
||||
|
||||
Notes:
|
||||
|
||||
* **ETag** (line 5) - This is the versionId of the new version
|
||||
|
||||
### 1.7.1.13 Base Resource Content
|
||||
|
||||
所有资源都会包含的基础信息:
|
||||
|
||||
```
|
||||
{
|
||||
"resourceType" : "X",
|
||||
"id" : "12",
|
||||
"meta" : {
|
||||
"versionId" : "12",
|
||||
"lastUpdated" : "2014-08-18T01:43:30Z",
|
||||
"profile" : ["http://example-consortium.org/fhir/profile/patient"],
|
||||
"security" : [{
|
||||
"system" : "http://hl7.org/fhir/v3/ActCode",
|
||||
"code" : "EMP"
|
||||
}],
|
||||
"tag" : [{
|
||||
"system" : "http://example.com/codes/workflow",
|
||||
"code" : "needs-review"
|
||||
}]
|
||||
},
|
||||
"implicitRules" : "http://example-consortium.org/fhir/ehr-plugins",
|
||||
"language" : "X"
|
||||
}
|
||||
````
|
||||
|
||||
Implementers notes:
|
||||
|
||||
* **resourceType** (line 2) - 每个资源都会资源类型的字段. XML的话也就是根节点
|
||||
* **id** (line 3) - 在资源新建之时分配后不再变化.只有在初次创建该资源时才没有该字段
|
||||
* **meta.versionId** (line 5) - 当资源内容(除了meta.security、meta.profile、meta.tag三个之外)发生变更时该值随之变化
|
||||
* **meta.lastUpdated** (line 6) - 随versionId的变化而变化. 如果服务器不维护版本信息,则不用记录该字段
|
||||
* **meta.profile** (line 7) - 表示资源的内容是否遵循某个规范(比方说满足阿里健康的开放API的要求或者说满足卫计委共享文档中的要求). 更多信息请参考 [Extending and Restricting Resources](profiling.html#resources). 当规范、值集本身发生变动时可以更改该字段的值
|
||||
* **meta.security** (lines 8 - 11) - [安全类标签](securitylabels.html). 该标签将资源与某些安全策略、基础架构策略联系起来。该字段的值可随资源内容的变动而变动,或者随安全体系的控制。
|
||||
* **meta.tag** (lines 12 - 16) - [其他类型的标签](extras.html). 如需将资源与特定的工作流程关联起来可以使用此类标签.在解读资源内容时无需考虑此类标签的值 。对此类标签值的更新不会影响资源内容版本的变化 [updated](http.html#tags) (这里好像是说 可以不变更资源的版本就修改tag标签的值 还是说tag值的修改压根就不影响资源版本 其他的security和profile tag三个字段是否都适用呢?待考证)
|
||||
* **implicitRules** (lines 17) - 如何准确安全的处理资源内容而在发送接收双方达成的[协议](profiling.html#agreement). 由于使用了该字段就意味着其他系统要使用其中的数据可能会出现解读错误的情况,限制了数据的重复利用,故不推荐适用该字段
|
||||
* **language** (lines 18) - [资源内容所采用的表达语言](narrative.html#language). 当前,资源内容中亦可包含其他语言的内容; 该字段表示的是资源的主要语言。
|
||||
|
||||
|
||||
© © HL7.org 2011+. FHIR DSTU (v0.5.0-5149) generated on Fri, Apr 3, 2015 14:36+1100\.
|
||||
链接:[试行版是什么](http://hl7.org/implement/standards/fhir/dstu.html) |[版本更新情况](http://hl7.org/implement/standards/fhir/history.html) | [许可协议](http://hl7.org/implement/standards/fhir/license.html) |[提交变更建议](http://gforge.hl7.org/gf/project/fhir/tracker/?action=TrackerItemAdd&tracker_id=677)
|
||||
|
||||
104
docs/fhir/introduction/fhir-mplementation.md
Normal file
@ -0,0 +1,104 @@
|
||||
## FHIR Implementation
|
||||
|
||||
* The current specification: [http://www.HL7.org/fhir/](http://www.HL7.org/fhir/) (or [the development version](http://hl7.org/implement/standards/FHIR-Develop/))
|
||||
* [FHIR Profiles from other Organizations](/index.php?title=FHIR_Profiles_from_other_Organizations "FHIR Profiles from other Organizations")
|
||||
* Contact Information
|
||||
* Implementation help: [[ask questions about FHIR](http://stackoverflow.com/questions/tagged/hl7_fhir)]
|
||||
* Formal Contact point for the project: [[fmgcontact@hl7.org](mailto:fmgcontact@hl7.org)]
|
||||
* [Skype Group Chats](/index.php?title=FHIR_Skype_Chat "FHIR Skype Chat")
|
||||
* [FHIR gForge Tracker](http://gforge.hl7.org/gf/project/fhir/tracker/?action=TrackerItemBrowse&tracker_id=677) for change requests/corrections
|
||||
* FHIR Project Team Leads (FHIR Core Team): [[Grahame Grieve](mailto:grahame@healthintersections.com.au)], [[Ewout Kramer](mailto:e.kramer@furore.com)], [[Lloyd Mckenzie](mailto:lloyd@lmckenzie.com)]
|
||||
* [List server](/index.php?title=FHIR_email_list_subscription_instructions "FHIR email list subscription instructions") - project email list
|
||||
|
||||
* Help / Getting Started
|
||||
* [FHIR Starter](/index.php?title=FHIR_Starter "FHIR Starter") - tutorial for FHIR newbies
|
||||
* [FHIR Cheat Sheet](http://www.furore.com/wp-content/uploads/2014/11/FURORE-CHEATSHEET-FHIR-R3.pdf) (DSTU 1)
|
||||
* [Help desk FAQs & knowledge-base articles](https://healthlevelseven.desk.com/) (HL7 members only)
|
||||
* [FHIR Tools Registry](/index.php?title=FHIR_Tools_Registry "FHIR Tools Registry") - a list of useful tools for FHIR implementers
|
||||
* [FHIR for Clinical Users](/index.php?title=FHIR_for_Clinical_Users "FHIR for Clinical Users") - an introduction to FHIR for non-technical people that will migrate to the specification in the future
|
||||
* [FHIR User Group](/index.php?title=FHIR_User_Group "FHIR User Group")
|
||||
* Social Media on FHIR
|
||||
* FHIR blogs [David Hay](http://fhirblog.com/), [Ewout Kramer](http://thefhirplace.com/), [Grahame Grieve](http://www.healthintersections.com.au/)
|
||||
* FHIR News on Twitter [FHIR News](http://www.twitter.com/FHIRnews)
|
||||
* FHIR Videos [HIMSS FHIR Session](https://live.blueskybroadcast.com/bsb/client/CL_DEFAULT.asp?Client=556675&PCAT=8341&CAT=8341&Review=true), [HL7.tv](http://www.hl7.tv/FHIR.html) and [Ringholm](https://vimeo.com/channels/hl7fhir).
|
||||
|
||||
* Testing
|
||||
* [Publicly Available FHIR Servers for testing](/index.php?title=Publicly_Available_FHIR_Servers_for_testing "Publicly Available FHIR Servers for testing")
|
||||
* [Open Source FHIR implementations](/index.php?title=Open_Source_FHIR_implementations "Open Source FHIR implementations")
|
||||
* [FHIR Connectathon 8](/index.php?title=FHIR_Connectathon_8 "FHIR Connectathon 8") (January, San Antonio)
|
||||
* [Organizations interested in FHIR](/index.php?title=Organizations_interested_in_FHIR "Organizations interested in FHIR")
|
||||
* [Profile Tooling](/index.php?title=Profile_Tooling "Profile Tooling")
|
||||
|
||||
* [FHIR Implementations](/index.php?title=FHIR_Implementations "FHIR Implementations")
|
||||
|
||||
* Connectathons
|
||||
* [Connectathon 9](http://wiki.hl7.org/index.php?title=FHIR_Connectathon_9) (May 9-10, Paris, France)
|
||||
|
||||
* Previous Connectathons and other events
|
||||
* [Historical Connectathons](/index.php?title=Category:FHIR_Connectathons "Category:FHIR Connectathons") (list)
|
||||
* [Clinical Connectathon 1](/index.php?title=FHIR_Clinical_Connectathon_Initiative "FHIR Clinical Connectathon Initiative") (September 2014, Chicago) (+ [Clinical Connectatathon 1 Tooling](/index.php?title=Clinical_Connectatathon_1_Tooling "Clinical Connectatathon 1 Tooling"))
|
||||
* [2 day seminar and Connectathon](http://www.healthintersections.com.au/?p=2237) (Nov 6-7, Melbourne Australia)
|
||||
* [International FHIR Development Days](http://fhir.furore.com/devdays/) (Nov 24-26, Amsterdam)
|
||||
|
||||
## FHIR Development
|
||||
|
||||
* How to
|
||||
* [FHIR DSTU monitoring](/index.php?title=FHIR_DSTU_monitoring "FHIR DSTU monitoring") - how to monitor DSTU feedback
|
||||
* [FHIR Ballot Prep](/index.php?title=FHIR_Ballot_Prep "FHIR Ballot Prep") - tasks for the next ballot and milestone dates
|
||||
* [FHIR Build Process](/index.php?title=FHIR_Build_Process "FHIR Build Process") - Setting up and running the FHIR build process
|
||||
* [Technical Guide](/index.php?title=FHIR_Guide_to_Authoring_Resources "FHIR Guide to Authoring Resources") - How to create resources
|
||||
* Materials: [gForge](http://gforge.hl7.org/gf/project/fhir/), [SVN Trunk](http://gforge.hl7.org/svn/fhir/trunk)
|
||||
* For read-only SVN access, use "anonymous" and your email as a password.
|
||||
* For Commit privileges, send a request to lloyd@lmckenzie.com
|
||||
* [FHIR resource and profile proposals](/index.php?title=Category:FHIR_Resource_Proposal "Category:FHIR Resource Proposal") - proposals for new resources & profiles
|
||||
* [FHIR Profile authoring](/index.php?title=FHIR_Profile_authoring "FHIR Profile authoring") - Creating and maintaining FHIR profiles (see also [Profile Tooling](/index.php?title=Profile_Tooling "Profile Tooling"))
|
||||
* [FHIR Change requests](/index.php?title=FHIR_Change_requests "FHIR Change requests") - Process for managing and resolving
|
||||
|
||||
* Guidelines
|
||||
* [Fundamental Principles of FHIR](/index.php?title=Fundamental_Principles_of_FHIR "Fundamental Principles of FHIR")
|
||||
* [FHIR Methodology Process](/index.php?title=FHIR_Methodology_Process "FHIR Methodology Process") - how the methodology is developed and maintained
|
||||
* [Methodology Guidelines](/index.php?title=FHIR_Guide_to_Designing_Resources "FHIR Guide to Designing Resources") - Content and quality guidelines
|
||||
* [Design Patterns](/index.php?title=FHIR_Design_Patterns "FHIR Design Patterns")
|
||||
* [FHIR Comparison to other RESTful API specifications](/index.php?title=FHIR_Comparison_to_other_RESTful_API_specifications "FHIR Comparison to other RESTful API specifications")
|
||||
|
||||
* Resources
|
||||
* [List server](/index.php?title=FHIR_email_list_subscription_instructions "FHIR email list subscription instructions") - discussions
|
||||
* Discussion pages: [Active Discussions](/index.php?title=Category:Active_FHIR_Discussion "Category:Active FHIR Discussion"), [All](/index.php?title=Category:FHIR_Discussion "Category:FHIR Discussion")
|
||||
* [FHIR Design Requirements Sources](/index.php?title=FHIR_Design_Requirements_Sources "FHIR Design Requirements Sources")
|
||||
* [FHIR Resource Types](/index.php?title=FHIR_Resource_Types "FHIR Resource Types")
|
||||
* [FHIR Resource Considerations](/index.php?title=FHIR_Resource_Considerations "FHIR Resource Considerations")
|
||||
* [(old)](/index.php?title=FHIR_Governance "FHIR Governance") - governance discussion with bits of methodology mixed in (to migrate to other pages)
|
||||
* [FHIR Terminology Service](/index.php?title=FHIR_Terminology_Service "FHIR Terminology Service")
|
||||
* [FHIR Digital Signature Working Page](/index.php?title=FHIR_Digital_Signature_Working_Page "FHIR Digital Signature Working Page")
|
||||
|
||||
* WG FHIR pages
|
||||
* [Patient Administration Resource development](/index.php?title=Patient_Administration_Resource_development "Patient Administration Resource development")
|
||||
* [CDA to FHIR Samples Group](/index.php?title=CDA_to_FHIR_Samples_Group "CDA to FHIR Samples Group")
|
||||
* [FHIR_Patient_Care_Resources](/index.php?title=FHIR_Patient_Care_Resources "FHIR Patient Care Resources")
|
||||
|
||||
|
||||
## Organizational
|
||||
|
||||
* Governance
|
||||
* [FHIR Governance Process](/index.php?title=FHIR_Governance_Process "FHIR Governance Process")
|
||||
* [FHIR Governance Board](/index.php?title=FHIR_Governance_Board "FHIR Governance Board") (FGB)
|
||||
* [FHIR Management Group](/index.php?title=FHIR_Management_Group "FHIR Management Group") (FMG)
|
||||
* [Modeling and Methodology](/index.php?title=Modeling_and_Methodology "Modeling and Methodology") (MnM)
|
||||
* [Work Groups](/index.php?title=FHIR_Work_Groups "FHIR Work Groups")
|
||||
* [FHIR Escalation Processes](/index.php?title=FHIR_Escalation_Processes "FHIR Escalation Processes")
|
||||
* [FHIR Ballot Process](/index.php?title=FHIR_Ballot_Process "FHIR Ballot Process")
|
||||
* [FHIR Web Server Hosting Record](/index.php?title=FHIR_Web_Server_Hosting_Record "FHIR Web Server Hosting Record")
|
||||
|
||||
* Agendas
|
||||
* **[Paris WGM](/index.php?title=FHIR_Agenda_201505_WGM "FHIR Agenda 201505 WGM")** (next meeting, May 2015)
|
||||
* [Past Working Group Meetings](/index.php?title=Category:FHIR_Meeting "Category:FHIR Meeting") (list of agendas/notes)
|
||||
* [MnM agendas](http://wiki.hl7.org/index.php?title=MnM_Schedule)
|
||||
* [FGB Agendas & Minutes](http://wiki.hl7.org/index.php?title=FHIR_Governance_Board#Meeting_Information)
|
||||
* [FMG Agendas & Minutes](http://wiki.hl7.org/index.php?title=FHIR_Management_Group#Meeting_Information)
|
||||
|
||||
## opensource project
|
||||
|
||||
* Testing
|
||||
* [FHIR 公开测试服务器的测试报告](http://www.projectcrucible.org/)
|
||||
* Lib
|
||||
* [Ruby语言的FHIR模型 工具等](https://github.com/fhir-crucible/)
|
||||
80
docs/fhir/introduction/fhir-overview.md
Normal file
@ -0,0 +1,80 @@
|
||||
# FHIR概述
|
||||
|
||||
欢迎使用 FHIR 标准,它是卫生保健信息电子化交换的一种标准。这部分是对标准的概述,作为一个路线图,希望能帮助初次接触的读者更快上手。
|
||||
|
||||
## 背景
|
||||
|
||||
医疗保健记录越来越多的被数字化。当病人在整个医疗系统中转诊的时候,要求他们的病历能够获得、能够找到和能够理解。更深层次的,能够支撑自动化地临床决策支持和其他机器处理,要求数据是结构化的 并且是标准化的。(参考[卫生保健所面临的数字化挑战](change.html))
|
||||
|
||||
[HL7](http://hl7.org/)在过去20多年里,一直致力于构建卫生保健数据交换和信息模型标准来解决这些难题。FHIR是一种新标准,采用了其他行业的通用方法,同时借鉴了在定义和实现 HL7V2,V3,RIM 和 CDA 标准过程中所获得成功、失败的教训。FHIR可以单独作为数据交换标准来使用,也可以和其他广泛应用的标准一起来使用(参考[FHIR与其他HL7标准的比较](comparison.html))
|
||||
|
||||
FHIR旨在不牺牲信息完整性的前提下简化开发和实现。它利用了现有的逻辑和理论模型,为不同的应用程序间交换数据提供了一种一致的、易于实现的、健壮的机制。FHIR的内在机制使得其能够追溯到 HL7 RIM 和其他内容模型,这就保证了与HL7之前定义的模式,最佳实践间的保持一致,毋须开发人员充分了解 RIM 和 HL7 V3 的其他衍生制品。(参考[FHIR与其他HL7标准的比较](comparison.html))
|
||||
|
||||
## 1.7.0.2 组件
|
||||
|
||||
FHIR 中最基本的组件叫做[资源](resource.html).所有可交换的内容都被定义成一个个资源。所有资源都拥有如下特征:
|
||||
|
||||
* 同一种[定义](resource.html)、[表达](formats.html)它们以及从[数据类型](datatypes.html)(最基本的可重用元素)构建它们的方式
|
||||
* 同样的[元数据](resource.html#metadata)集合
|
||||
* [供人可读的部分](narrative.html)
|
||||
|
||||
## 1.7.0.3 方法论
|
||||
|
||||
### 1.7.0.3.1 信息建模的方法
|
||||
|
||||
FHIR 的理念在于定义一个资源的基础集合,要么利用它们,要么相互结合来满足大多数常见的应用场景的需求。FHIR资源旨在定义绝大多数开发实现中通用的核心信息集合的信息内容和结构。如果需要的话,有内在的[扩展机制](extensibility.html)来满足剩下的需求。
|
||||
FHIR 的建模采用了一种组合式的方法论。相比而言,HL7 V3 建模是基于“model by constranit”(参考[FHIR与其他HL7标准的比较](comparison.html)) 。对于 FHIR,特殊的应用场景通常是通过利用[资源引用](references.html)整合资源来实现的。尽管对于一个特定场景,单独一个资源可能是存在价值的,更多的是对资源互相整合和裁剪来满足特定的需求。用来描述资源如何整合使用的两类特殊资源:
|
||||
* [一致性声明](../infra/conformance.html)——描述一种实现中所暴露的交换数据的接口
|
||||
* [规范profile](../infra/profile.html)——描述该实现中所使用的资源中定义的用以约束基数、可选性、术语、数据泪下和扩展的其他规则。
|
||||
|
||||
### 1.7.0.4 标准
|
||||
|
||||
基本上,FHIR标准分为三大块:
|
||||
|
||||
* 基础[文档](documentation.html)部分——描述了[资源是如何定义](resources.html)的,[数据类型](datatypes.html)、[编码](terminologies.html)的定义和[XML](xml.html) 、[JSON](json.html)格式的相关背景信息。
|
||||
* [开发实现部分](../impl/implementation)——描述在[REST](../impl/http.html) 、[消息](../impl/messaging.html)、[文档](../impl/documents.html)和[SOA](../impl/services.html)中使用资源。
|
||||
* [资源列表](resourcelist.html)——resourcelist.htmlFHIR中定义的所有资源的列表。其中又分为[临床类](../clin/clinical.html)、 [行政管理类](../admin/administration.html) 和[基础架构类](../infra/infrastructure.html)三大类。
|
||||
|
||||
资源有多种用途,从最基本的[护理计划](../clin/careplan.html)和[诊断报告](../clin/diagnosticreport.html)等临床内容到如[消息头](../infra/messageheader.html)、[一致性声明](../infra/conformance.html)等基础架构。虽然它们具有共同的技术特性,但却以完全不同的方式来使用。注意毋须为了使用资源而必须使用REST。
|
||||
|
||||
## 1.7.0.5 如何入门
|
||||
|
||||
最好是快速阅读一下 [资源列表](resourcelist.html),对已经有了哪些资源有个感性认识,然后看一下[患者](../clin/patient.html)的定义来看看资源的定义是什么样的,接着读一下以下介绍背景信息的章节:
|
||||
|
||||
* [资源](resource.html)——资源是如何定义的
|
||||
* 所有资源都有的[叙述性文本](narrative.html),以及[资源之间如何互相引用](references.html)
|
||||
* [格式](formats.html):[XML](xml.html) 、[JSON](json.html)
|
||||
* [扩展相关](extensibility.html)——标准能够保持简单的关键
|
||||
* 如果你之前了解 HL7 标准(V2 V3 CDA)的话,[FHIR 与其他 HL7 标准的比较](comparison.html)也值得一看。
|
||||
|
||||
### 1.7.0.5.1 顶部标签
|
||||
|
||||
整个标准中都会看到这些标签,很多读者可能会遗漏:
|
||||
|
||||

|
||||
[资源](resources.html)和[数据类型](datatypes.html)都是以一种类似XML的 易于阅读的方式来呈现的,它们也有详细描述内容的正规定义。另外,大多数资源映射到很多不同的格式,如HL7V2,HL7V3 RIM ,CDA,DICOM等。同时,所有资源至少包含一个实例(有时候会有更多),适当的时候,也会有描述它们如何在特殊情况下使用的profile规范。最后,一些资源包含了 帮助开发人员理解它们背后的设计原理的小贴士/备注。
|
||||
|
||||
## 1.7.0.6 寻求额外信息和提供反馈
|
||||
|
||||
为了能够让更多读者看懂的同时,FHIR标准是面向开发人员社区的——这些真正利用标准编写程序的人。为了满足开发人员社区的需求,编辑人员力求标准行文精确,减少在编写程序之前的阅读时间(然而这份标准并不如我们所想的那么简明扼要,有时候是医疗保健和现实世界的复杂度所致)。鉴于此,在开发过程中并不必要的信息,诸如原理、备选方案、一些争论点和将来的计划等并没有包含在标准里面。同样,开发人员时不时会发遇到标准不明晰或者不完整的清空。最终,会有一些情况,标准可能是错的,或者是对其进行修订以更好的满足开发人员的需求。
|
||||
因此HL7提供了多种方法,通过这些方法可以维护和获取一些额外的FHIR相关信息,能够提供一些帮助,响应一些变更请求。
|
||||
|
||||
### 1.7.0.6.1 评论
|
||||
|
||||
在每页底部,都有一个评论的部分,可以就特定章节进行提问和讨论。评论由 FHIR 编辑人员和HL7工作组来监管,每个问题都会在一定的时间内给予答复。This content will occasionally be currated to ensure ongoing relevance, particularly if the specification is subsequently updated to eliminate confusion that may have spawned an initial comment.
|
||||
|
||||
### 1.7.0.6.2 FHIR Wiki
|
||||
|
||||
FHIR 项目团队维护着一个[wiki](http://wiki.hl7.org/index.php?title=FHIR),记录了开发过程、方法学和设计决策。开发人员和其他人员也可以参与到wiki中来,提供一些暂未出现在标准中的指导和补充信息。注意 FHIR wiki上的内容不具有权威性,与FHIR标准的一致性无关。同样,一些内容可能也没有和最近的FHIR版本保持一致。
|
||||
FHIR标准中的每个页面在wiki中都有一页内容。用以记录原理、决策点和其他与开发人员无关的信息。额外的页面包括[FHIR 方法论](http://wiki.hl7.org/index.php?title=FHIR_Development_Process)、[FHIR 设计工具的使用](http://wiki.hl7.org/index.php?title=FHIR_Guide_to_Authoring_Resources)等。要研究wiki的话,建议从[首页](http://wiki.hl7.org/index.php?title=FHIR)开始.
|
||||
|
||||
### 1.7.0.6.3 正式变更请求
|
||||
|
||||
正式请求可以在[这里](http://gforge.hl7.org/gf/project/fhir/tracker/?action=TrackerItemAdd&tracker_id=677)提交。对应的工作组会审核这些请求,并作出是否将其纳入到标准中的决策,其中包括了纳入到那个版本。
|
||||
|
||||
### 1.7.0.6.3 源码/参与机制的额外信息
|
||||
|
||||
除了上述机制,HL7提供了一个 Stack Overflow 的标签,邮件列表和skype聊天频道来提供对开发人员各个层面的全方位的支持。如何使用这些请参考[指令](http://wiki.hl7.org/index.php?title=FHIR#More_help_and_Asking_Questions)
|
||||
|
||||
© © HL7.org 2011+. FHIR DSTU (v0.5.0-5149) generated on Fri, Apr 3, 2015 14:36+1100.
|
||||
链接:[试行版是什么](http://hl7.org/implement/standards/fhir/dstu.html) |[版本更新情况](http://hl7.org/implement/standards/fhir/history.html) | [许可协议](http://hl7.org/implement/standards/fhir/license.html) |[提交变更建议](http://gforge.hl7.org/gf/project/fhir/tracker/?action=TrackerItemAdd&tracker_id=677)
|
||||
10
docs/fhir/introduction/index.md
Normal file
@ -0,0 +1,10 @@
|
||||
# FHIR 简介
|
||||
---
|
||||
|
||||
主要是介绍一些FHIR 缘起的大背景,以及产业界对其唱衰唱好的各种论调。
|
||||
|
||||
- [开发者眼中的 FHIR](/fhir-in-action/introduction/toreader.md)
|
||||
- [FHIR 实现](/fhir-in-action/introduction/fhir-mplementation.md)
|
||||
- [FHIR 概述](/fhir-in-action/introduction/fhir-overview.md)
|
||||
- [FHIR 开发者指南](/fhir-in-action/introduction/fhir-dev-guide.md)
|
||||
- [开放数据](/fhir-in-action/introduction/open-data-is-coming.md)
|
||||
339
docs/fhir/introduction/open-data-is-coming.md
Normal file
@ -0,0 +1,339 @@
|
||||
# 开放数据专题
|
||||
有关医疗数据的开放标准的口水战和讨论早就开始了,这是因为美国方面的医疗病历数据主要掌握在 EPIC 的手上。
|
||||
很多医院和医疗机构都在使用 EPIC 的产品,但 EPIC 的产品线又非常封闭,导致医疗机构之间的数据通信和交换都非常困难。
|
||||
|
||||
这个页面中的主要内容都在说 EPIC 和 CommonWell 口水战。
|
||||
|
||||
这场口水战的主要起因还是有关国会的医疗预算,同时要求 ONC 能够解决医疗系统的数据互联互通问题。EPIC 当然是不愿意放弃这块的。
|
||||
|
||||
当我们现在再次重温这篇页面中的内容的时候已经是 2024 年了。现在来看在互联互通上已经有了很大的进展。
|
||||
|
||||
相对美国有关医疗系统的扯皮来看,我们国家的医疗系统起步比较晚,没有技术负担,相对美国来说,我们的医疗系统发展更加迅速和智能化。
|
||||
但也面临不少问题,其实也是标准化的互联互通问题,相信随着 FHIR 的标准的持续推进,在后续的互联互通难度应该是在逐步下降的。
|
||||
|
||||
## 立法进一步推动美国联邦政府开放更多数据
|
||||
|
||||
在2015年4月16号,一个因废止了Medicare中过时的根据可持续增长率来计算医生收入的公式而出名的Medicare Access and CHIP
|
||||
Reauthorization Act (MACRA) 正式成为了法律, 有人称此举给Affordable Care Act 法案的 Medicare Data Sharing
|
||||
Program 注入了一剂强心剂,更有人称其中的105章节要求政府将更多的 claim(医保报销)数据开放给准入机构,更是给中小型医疗机构带来了春天。
|
||||
|
||||
```
|
||||
1. 由于平价医疗法的存在,HHS也就是美国卫生部公开了一部分Medicare claim数据给准入机构,这些机构利用医保数据和商业化数据进行数据分析,来获取
|
||||
如何更好的达到要求的医疗质量和效率等指标来指导实践。由于此举风险甚高,议会持保守态度,但很快大家都意识到这样做远远不够,故在MACRA的105章节中放开更多数据
|
||||
2. 其中要求HHS Secretary不仅开放Medicare数据,也开放Medicaid和CHIP数据。这样子系统中的医保数据将会翻倍,能够支持更加复杂的数据分析。
|
||||
3. 尽管开放多少数据,开放不开放的决定权握在了HHS Secretary手里,但还是有很大希望的,毕竟Medicare的医保数据已经开放了2年,如果够快的话,Medicare每年应该能够开放
|
||||
```
|
||||
|
||||
### 背景资料
|
||||
|
||||
ACA平价法案
|
||||
|
||||
```
|
||||
美国总统奥巴马上任后积极推动医保改革,去年立法的《平价医疗法》当地时间12日却被上诉法院裁定违宪,令医保改革前路茫茫。分析指,表面上,共和党明显打赢一仗,但由于法院仅裁定强制参保条款违宪,其余部分仍然有效,最大输家其实是医保公司,民主党不但未必介怀,还可能对裁决乐观其成。
|
||||
|
||||
据报道,目前美国约有5000万人没有基本医疗保险,医院及纳税人被迫每年代为支付高达430亿美元(约合人民币2749亿元)。民主党控制的国会去年3月通过立法,规定由2014年起,美国所有18岁或以上的民众必须终生购买保险,否则会遭到税务惩罚,政府则会给予无力付款的民众津贴。
|
||||
|
||||
据介绍,强制参保条款是奥巴马医改法案的重点,能使3200万未投保的民众被纳入医保“保护伞”下,令美国全国医保覆盖率提升至95%,并要求保险公司接受已患病的民众投保。
|
||||
|
||||
分析认为,美国民主党其实并非很支持强制投保,最支持的是可赚大钱的保险公司。保险公司要求全民强制参保,才愿意接受早已患病的投保人。
|
||||
|
||||
民主党当初为平息保险公司的反对声音,支持全民投保只是权宜之计。若该条款最后被删除,其余部分仍有效,保险公司将被迫继续接受患病者的投保,民主党也可达成全民医保的目标,民主党何乐而不为?
|
||||
```
|
||||
|
||||
美国政府的开放数据集。自从Data.gov开放以来,美国已经公开了超过八万五千个政府数据集并提供免费下载。
|
||||
|
||||
有关美国联邦政府的数据开放计划,请参考:
|
||||
|
||||
* https://project-open-data.cio.gov/
|
||||
* https://github.com/project-open-data
|
||||
|
||||
## epic 和 CommonWell 之争
|
||||
|
||||
在美国的医疗病历领域,EPIC 是最封闭,最不愿意开放的公司。毕竟数据是这个公司的所有业务基石,公司的数据和软件生态系统非常封闭,当数据离开了公司提供的平台后完全无法运行。
|
||||
所以 EPIC 是数据互联互通最大的障碍。
|
||||
|
||||
EPIC 使用的 Caché 数据库,这个数据库的存储非常封闭,可恶的是 EPIC 在数据库的基础上又开发了一套自己的的数据库实例,虽然底层还是使用的
|
||||
Caché 数据库,但上层和 API 已经被完全重构了。
|
||||
|
||||
CommonWell 健康联盟是一个由医疗IT公司组成的行业协会,过去三年来一直致力于在其成员的技术之间建立数据互操作性。
|
||||
Cerner, McKesson, Allscripts, athenahealth, Greenway 和 RelayHealth 这几家公司宣布成立了相关的联盟用于对抗 EPIC。
|
||||
联盟的官方地址为:https://www.commonwellalliance.org/
|
||||
|
||||
相关参考链接:
|
||||
|
||||
* http://www.commonwellalliance.org/news/commonwell-health-alliance-announces-member-expansion-plans-for-2015/
|
||||
|
||||
CommonWell Health Alliance today announced the commitment of five of its health IT vendor members—athenahealth, Cerner,
|
||||
CPSI, Greenway Health and McKesson—to actively deploy CommonWell services to health care provider sites nationwide
|
||||
throughout 2015.
|
||||
|
||||
Already, more than 60 provider sites are live on CommonWell services across 15 states including: Alabama, Delaware,
|
||||
Florida, Illinois, Indiana, Kansas, Massachusetts, Mississippi, Nebraska, North Carolina, Ohio, South Carolina, South
|
||||
Dakota, Texas and Washington. CommonWell expects 2015 deployments to enable at least 5,000 provider sites to be live on
|
||||
the services nationwide. CommonWell’s built-in services include patient identification, record location, patient privacy
|
||||
and consent, and trusted data access.
|
||||
|
||||
### 缘起
|
||||
|
||||
2014年7月17号,在[众议院能源和商务委员会的小组委员会通讯技术和健康 House Energy and Commerce Committee's subcommittee on Communications and Technology and Health](https://energycommerce.house.gov/committees/subcommittee/health)
|
||||
的听证会上,从医生成为议员的 Rep. Phil Gingrey 指责 EPIC 道:
|
||||
|
||||
```
|
||||
一些电子病历的供应商的系统本身就在阻碍数据的共享和交换,就不应该拿到Meaningful Use incentive计划的钱。但根据RAND的一份报告,刺激计划的240亿美金中的一半以上都被
|
||||
Epic公司拿走了,可Epic玩的是自己的封闭平台,这是HITECH的初衷么,纳税人的钱是这么花的么。
|
||||
|
||||
无独有偶,在RAND的报告中建议国会“取消那些需要额外组件、费用和定制才能够实现数据共享的医疗信息化产品的认证资格”。同期的一份研究中也指出Meaningful Use program 计划
|
||||
第二阶段的数据共享的架构是不够健壮的,不足以支撑数据的共享。
|
||||
```
|
||||
|
||||
原文如下
|
||||
|
||||
```
|
||||
Electronic health record vendors--particularly Epic--may not deserve Meaningful Use incentive money because their systems hinder data sharing, according to physician-turned-lawmaker Rep. Phil Gingrey (R-Ga.).
|
||||
|
||||
In a July 17 hearing of the House Energy and Commerce Committee's subcommittee on Communications and Technology and Health, Gingrey (pictured) questioned whether the nation is currently on a path of interoperability or whether changes to the law need to be made. He expressed concern that according to a recent RAND report, more than half of the $24 billion spent by the Meaningful Use program has gone to Epic, a vendor operating a "closed platform."
|
||||
|
||||
Pointing out that the committee has jurisdiction over the Office of the National Coordinator for Health IT and the HITECH Act--which created the Meaningful Use program--Gingrey said that if the RAND report is true, "we have been subsidizing systems that block information instead of allowing for information transfers, which was never the intent of the [HITECH] statute.
|
||||
|
||||
"It may be time for this committee to take a closer look at the practices of vendor companies in this space given the possibility that fraud may be perpetrated against the American taxpayer," he added.
|
||||
|
||||
The hearing was focused on how healthcare and technology can accelerate the pace of cures in the U.S., which is an initiative of the committee.
|
||||
|
||||
Gingrey is not alone in his concern about EHRs' lack of interoperability. The coalition Health IT Now, buoyed by the RAND report that decried the lack of interoperability among EHRs, recommended that Congress "decertify systems that require additional modules, expenses, and customization to share data," and to investigate business practices that prohibit or restrict data sharing in federal incentive programs.
|
||||
|
||||
Another recent study revealed that the current architecture for data exchange required by Stage 2 of the Meaningful Use program doesn't allow for robust patient sharing.
|
||||
```
|
||||
|
||||
### ONC发布互操作性路线图
|
||||
|
||||
关于这个10年的互操作性路线图,更多中文信息可参考
|
||||
|
||||
1、[ 【OMAHA】美国联邦政府医疗信息化战略规划2015 - 2020](https://www.isharkfly.com/t/2015-2020/15499)
|
||||
|
||||
2、[一张图看美国互操作性路线图](https://www.isharkfly.com/t/topic/15500)
|
||||
|
||||
3、[ONC发布HIT互操作路线图 助推精准医学计划](https://www.isharkfly.com/t/onc-hit/15501)
|
||||
|
||||
某个组的老大如是说“如果我们能够让不同的系统能够互相'说话',那已经是相当牛逼了”
|
||||
|
||||
原文如下
|
||||
|
||||
```
|
||||
"If we just get the systems themselves to talk to each other, that would be a huge accomplishment," Health IT Policy Committee member Paul Egerman, former CEO of eScription, said at the meeting. "Perhaps we're making this harder than we need to make it, and it's already pretty hard."
|
||||
|
||||
尽管局部范围已经实现了一定程度的互操作性,但大规模的应用还是很大的问题。
|
||||
while interoperability has increased, widespread interoperability remains a challenge. The report identifies several barriers to interoperability, including unchanged provider practice patterns, the lack of standardization among EHRs and the lower priority placed on EHRs by providers who are ineligible for the Meaningful Use program.
|
||||
```
|
||||
|
||||
### Omnibus bill keeps ONC funding at same level as 2014
|
||||
|
||||
2015 年的 Omnibus 法案成为导火索
|
||||
|
||||
```
|
||||
The Omnibus Appropriations bill that passed Congress over the weekend will fund the Office of the National Coordinator for Health IT at the same level as last fiscal year with a budget of just under $60.4 million. After the bill passed the House last week, the Senate approved it Saturday night.
|
||||
|
||||
Additionally, the bill grants $14.9 million to the Federal Office of Rural Health Policy within the Health Resources and Services Administration to administer the Small Rural Hospital Improvement Grant program for quality improvement and adoption of health information technology. It also awards the VA $3.9 billion in IT funds, $200 million more than FY2014, including $344 million for the modernization of VistA and the development of an interoperable system with the Department of the Defense.
|
||||
|
||||
Of the total IT budget, $548.34 million is earmarked for IT development, modernization and enhancement.
|
||||
```
|
||||
|
||||
国会敦促 ONC :要专注在互操作性上。
|
||||
|
||||
在国会通过2015 omnibus appropriation
|
||||
bill法案的同时提交的[报告](https://www.isharkfly.com/t/division-g-department-of-labor/15502)中,国会很生气,敦促ONC:
|
||||
“”要合理使用你们手中的认证的权利来保障合格的产品能够医疗机构和人民群众带来价值。只给那些满足我们的认证标准的且没有阻碍区域医疗(
|
||||
医疗信息交换)的产品给予授权,对于阻碍信息共享的产品要收回执照。
|
||||
|
||||
```
|
||||
"[U]se its certification program judiciously in order to ensure certified electronic health record technology provides value to eligible hospitals, eligible providers and taxpayers. ONC should use its authority to certify only those products that clearly meet current meaningful use program standards and that do not block health information exchange. ONC should take steps to decertify products that proactively block the sharing of information because those practices frustrate congressional intent, devalue taxpayer investments in CEHRT, and make CEHRT less valuable and more burdensome for eligible hospitals and eligible providers to use."
|
||||
```
|
||||
|
||||
同时在报告里要求ONC90天内提交一份报告,分析一下目前信息阻塞问题的严重程度,要有个大概的厂商、医疗机构的数目以及解决问题的方案。
|
||||
|
||||
### 信息化厂商和医院都是信息阻塞的罪魁祸首
|
||||
|
||||
这里就是上面 ONC 根据国会的要求提交的报告,具体内容请参考:https://www.isharkfly.com/t/onc/15498
|
||||
|
||||
在这份报告中指出:
|
||||
|
||||
1、医院或厂商通过收费来控制转诊和加强自己的市场占有率
|
||||
A common charge is that some hospitals or health systems engage in information blocking to control referrals and enhance
|
||||
their market dominance
|
||||
|
||||
2、厂商反馈 原因很多啦 比如说HIPAA 但作业中指出都是借口 和HIPAA压根没多大关联
|
||||
It has been reported to ONC that privacy and security laws are cited in circumstances in which they do not in fact
|
||||
impose restrictions
|
||||
|
||||
作业中给出的解决方案:
|
||||
|
||||
1、Strengthen in-the-field surveillance of ONC certified health IT tools, which was proposed in the certification
|
||||
requirements accompanying the Stage 3 Meaningful Use rule
|
||||
2、Constrain standards and implementation specifications
|
||||
3、Promote better transparency in certified health IT products and services that would "make developers more responsive
|
||||
to customer demands and help ameliorate market distortions" that lead to vendor information blocking
|
||||
4、Establish governance rules deterring information blocking, which the report notes is addressed in ONC's
|
||||
interoperability roadmap
|
||||
5、Work with the U.S. Department of Health and Human Services Office for Civil Rights to ensure healthcare stakeholders
|
||||
understand HIPAA privacy and security standards, particularly those related to information sharing
|
||||
6、Coordinate with the HHS Office of Inspector General and the Centers for Medicare & Medicaid Services on information
|
||||
blocking as it relates to physician self-referral and the federal anti-kickback statute
|
||||
7、Refer illegal business practices to law enforcement agencies
|
||||
8、Work with CMS to provide incentives for interoperability while simultaneously discouraging information blocking
|
||||
9、Promote competition and innovation in health IT, which the Federal Trade Commission recommended in its comments on the
|
||||
interoperability roadmap
|
||||
|
||||
但看了总结就知道 美帝也是各种部门互相扯皮呀,这种东西往后10年看有起色不。
|
||||
|
||||
当我们看到这篇文章的时候已经是 2024 年了,在 FHIR 的推进下,各种工作其实也是在有条件的进行中。
|
||||
|
||||
我们认为这里面推动阻力最大的莫过于 EPIC 了。
|
||||
|
||||
```
|
||||
"While important, these actions alone will not provide a complete solution to the information blocking problem," the report's authors say. "A comprehensive approach will require overcoming significant gaps in current knowledge, programs and authorities that limit the ability of ONC and other federal agencies to effectively target, deter and remedy this conduct, even though it violates public policy and frustrates congressional intent.
|
||||
```
|
||||
|
||||
### 口水仗
|
||||
|
||||
有关 EPIC 和 CommonWell 的口水战在 2015 年就开打了(http://www.healthcareitnews.com/news/epic-vs-commonwell-showdown)。
|
||||
|
||||
Senate HELP Committee Tuesday 2015年3月17日的组委会例行会议上,
|
||||
在听证会的问答环节,参议员Senator Tammy Baldwin, D-Wisconsin问 为什么Epic 没有参加 CommonWell Health Alliance
|
||||
Epic 的主管互操作性的头Peter DeVault说了如下一段话,引发了CommonWell Health Alliance的反击:
|
||||
|
||||
```
|
||||
"When we were approached by them and asked to join, we were told that it would be multiple millions of dollars for us to join and that we would have to sign an NDA.To us, the only reasons to have an NDA are if they're going to tell you something that otherwise they wouldn't want people to know" - which he said could include the possibility they may sell data downstream or wanted to ensure there were no intellectual property conflicts.That lack of transparency didn't sit well with us
|
||||
```
|
||||
|
||||
同时还不饶人的嘲讽 你丫们只是嘴上说说 雷声大雨点小。
|
||||
|
||||
CommonWell至今成立2年,目前只涵盖了1000个医生 和Epic的care Everywhere的10万医生简直高下立判
|
||||
|
||||
```
|
||||
DeVault also underscored CommonWell's low participant numbers in its interoperability project so far – which he called an "aspiring network," noting a stark difference when compared to Epic's Care Everywhere network.
|
||||
```
|
||||
|
||||
CommonWell联盟随后在Healthcare IT News发表了联合声明:
|
||||
|
||||
```
|
||||
We are committed to openness and transparency," the statement read. "Accordingly we publish our services and use case specifications, along with our nominal membership and service fees on our website for everyone to see.
|
||||
```
|
||||
|
||||
那么Epic要入会 大概要每年缴纳多少钱呢 根据目前CommonWell会员费和服务费用标准,结合Epic2014年的年收入18亿美元,要掏
|
||||
|
||||
125万美元annual subscription fee和 $50,000 to $90,000 in annual membership dues 。
|
||||
|
||||
就是 2015-03-18 日 athenahealth CEO Jonathan Bush 在 twitter上对 Epic 的 CEO Judith R. Faulkner 进行了高调嘲讽。
|
||||
|
||||

|
||||
|
||||
Cerner —— 行业老二也发话了
|
||||
|
||||
```
|
||||
His "rhetoric is a slap in the face to many parties working to advance interoperability," according to a statement released by Cerner officials shortly after the committee hearing. "It was discouraging to hear more potshots and false statements when it's clear there is real work to be done. We're committed to CommonWell as a practical, market-led way to achieve meaningful interoperability
|
||||
```
|
||||
|
||||
梗在这里 2013年 HIMSS 上 Epic 和 CommonWell 就有口角。
|
||||
|
||||
```
|
||||
At that HIMSS13 announcement, athenahealth CEO Jonathan Bush 说 大家都可以加入哟
|
||||
|
||||
emphasized that anyone was invited to CommonWell – even a vendor of "epic proportions."
|
||||
|
||||
In a subsequent interview, Healthcare IT News asked McKesson CEO John Hammergren whether that invitation was dangled only because the founding companies suspected Epic wouldn't bite.
|
||||
|
||||
"We'd like them to bite! We want them to bite," said Hammergren. "I'm hopeful that they will see it the same way we see it."
|
||||
```
|
||||
|
||||
但 Epic CEO说 完全不知情,这帮人居然想背后地里阴我们,手够黑的啊。
|
||||
|
||||
```
|
||||
But Epic CEO Judy Faulkner noted that her company wasn't asked to join before the announcement. "We did not know about it. We were not invited," Faulkner told Bloomberg back in 2013. "It appears on the surface to be used as a competitive weapon, and that's just wrong. It's wrong for the country."
|
||||
```
|
||||
|
||||
对于行业内愈演愈烈的竞争所引发这场闹剧,围观群众也有话说:
|
||||
1、各位看官和Epic签合同要慎重啊 且要是Epic-to-non-Epic能达到Epic-to-Epic 的90%的功能,"哥就表演吃翔"
|
||||
2、路人乙嘲讽到Epic到底是如何腆着脸皮说all of our systems can talk to each other
|
||||
3、入会费是不是有点多
|
||||
4、Epic does not need to join CommonWell. CommonWell needs to join Epic.
|
||||
5、CommonWell sounds like a group of union thugs who want to strong-arm their way into other vendors' businesses
|
||||
6、CommonWell or is it CommonHell? Later seems to be more appropriate.此人称Epic很好合作 方案也性价比高Stop creating
|
||||
mindless standards organizations with a scheme to collect additional revenues from licensing. Healthcare organizations
|
||||
dole out enough on their EMRs to these vendors and they don't need these vendors charging nickel and dime on every petty
|
||||
thing that gives patients control of their health information
|
||||
"我深深的表示赞同"
|
||||
7、It just doesn't seem right that a private company pulling down $1.8B in revenue should be able to dictate
|
||||
interoperability. The government needs to step in and make sure all of these companies play well in the sandbox. Greed
|
||||
stands in the way of a national clinical data repository that researchers could use to find treatments and cures for
|
||||
diseases that have plagued us for decades.
|
||||
问题不存在一个厂商上 此人观点有理
|
||||
8、Joining CommonWell doesn't seem like a great business opportunity if after two years they only have 1000 doctors live
|
||||
on it. Epic seems to understand the fundamentals of sharing patient data if they have 100,000 doctors on their version.
|
||||
My guess is that CommonWell is floundering and they want Epic in there to help them out. If they can also take some digs
|
||||
at Epic for not joining in the meantime - all the better in their mind.
|
||||
|
||||
The healthcare market will drive the need for interoperability. I don't think getting the government involved will help
|
||||
anything.
|
||||
|
||||
9、What would be interesting to know is how many of Epic's 100,000 physicians are using a product other than something in
|
||||
the Epic family.
|
||||
Epic excels at interoperability between their own products, but what is their track record when connecting to someone
|
||||
outside the family, so to speak? Their numbers may be impressive, I don't know. But I do know that the huge challenge
|
||||
CommonWell has is interoperability across disparate vendors and products.
|
||||
10、It seems to me that CommonWell is primarily a marketing "gimmick". Aids and standards for inter-operability e.g.
|
||||
LOINC, CLSI standards, and other accepted nomenclatures have existed in the marketplace for some time. We probably have
|
||||
enough standards but many vendors simply pay "lip service" to them. Such a "collaboration" among competitors may be a "
|
||||
surface phenomenon" with relatively little substance.
|
||||
|
||||
11、对第10条的回复 CommonWell is a response to Epic's market share and market power by vendors that heretofore did not
|
||||
feel compelled to cooperate with each other on data exchange. Epic dramatically dominates the large HCDO/ Academic
|
||||
Medical Center market and is viewed as almost unstoppable. As Epic conquers the large market, it will target the
|
||||
mid-size market - probably taking advantage of a cloud service at some point in time. This probably best explains why
|
||||
Epic doesn't want to join CommonWell - they understand the strategic alignment and competitive response that CommonWell
|
||||
represents.
|
||||
12、It does seem a bit childish to see these types of exchanges between behemoths of the industry. However, I do wonder
|
||||
why Epic would have to sign an NDA to participate in a joint effort to share and propagate openess.
|
||||
|
||||
### Epic 投降了
|
||||
|
||||
Epic CEO Judy Faulkner 在每年度最盛大HIT行业会展,也就是 2015 年的 HIMSS15 大会上宣布,直到2020年之前咱大EPIC是不会再收大伙钱了。
|
||||
|
||||
其实athenahealth和Cerner这俩货也是不久之前宣布他们也不收费。
|
||||
|
||||
https://www.healthcareitnews.com/news/epic-latest-drop-fees-data-exchange#:~:text=%2Dbased%20health%20IT%20giant%20Epic,the%20Milwaukee%20Business%20Journal%20reports.
|
||||
|
||||
群众观点:
|
||||
1、up-front predictable cost and a pay-per-use model两种付费模式的区别而已,钱总是会出的
|
||||
2、市场的不成熟导致没有有效的激励方式来促使信息的无缝免费流动。而能因为厂商收取服务费用就认为是某个厂商作恶。要解决的是到底谁来掏钱的问题
|
||||
3、不额外收钱的话,,软件的成本、维护费咨询费必然要上涨,羊毛出在羊身上
|
||||
http://www.healthcareitnews.com/news/epic-latest-drop-fees-data-exchange
|
||||
|
||||
### 思考
|
||||
|
||||
国内最早喊互操作性的应该是李包罗老爷子了,从最初引入这样的概念至今大概也有10来个年头了,不管是学术界还是工业界,这些年来沿着的一条路是说想要给复杂的医疗领域定义出一种通用的one-fit-all的能够描述整个医疗领域的模型,
|
||||
进而演化出一种可以用于不同系统间交互数据的通用格式和统一的医疗术语,也就是所谓的互操作性标准。
|
||||
|
||||
这些年也有人在提学习型的医疗信息化系统的建设,提精准医疗,大喊互联网医疗的口号,但这些目标的实现都离不开数据,离不开鲜活的在不同系统间流动的数据,就像阿里、京东、腾讯、amazon一样,没有各部门间数据的无缝整合,
|
||||
它们是不能提供大家每天都在享受的这些服务的。
|
||||
|
||||
近几年不管是google还是豌豆荚,都在说一个“应用内搜索”的东西,说白了,就是想把接入各自平台的系统的数据格式标准化,这样子就可以点开具体的应用来搜索查询信息,但似乎也没有什么进展,
|
||||
对于如日中天的互联网应用来讲,对于宇宙第一的google来讲尚且很难突破的东西,反过来看医疗行业,业务只会更复杂,业务系统的成熟度只会更低,似乎互操作性的口号,
|
||||
我们喊得太早了,能从美帝、互联网厂商身上学到的是,未来势必在国内的HIT圈要成长出一两家如Epic这样的公司,在自己封闭的平台中,
|
||||
实现各级医疗机构的信息无缝流通,只有这样的巨无霸,通过自己所收集的患者全生命周期的数据链,利用医疗大数据的应用打造出优质的医疗服务来服务大众,但有没有其他实现互操作性的路径呢?
|
||||
|
||||
Epic与IBM watson的合作 是否预示着实现互操作性的另一条路
|
||||
智能的解析各种异构的数据源中的数据 https://www.healthcareitnews.com/news/epic-watson-work-interoperability 。
|
||||
|
||||
**API 能否拯救 HIT 的相关探讨**
|
||||
针对有关内容的探讨,我们收集了一些内容,请访问下面的链接。
|
||||
|
||||
* http://geekdoctor.blogspot.nl/2014/12/kindling-fhir.html
|
||||
* http://xmlmodeling.com/2014/12/jason-argonauts/
|
||||
* http://xmlmodeling.com/2014/10/jason-task-force-final-report/
|
||||
* http://argonautwiki.hl7.org/index.php?title=Main_Page
|
||||
* https://www.healthwise.org/blog/apps-apis-positive-step-for-patients.aspx
|
||||
|
||||
## 中国数据互联互通
|
||||
相对美国有关医疗系统的扯皮来看,我们国家的医疗系统起步比较晚,没有技术负担,相对美国来说,我们的医疗系统发展更加迅速和智能化。
|
||||
|
||||
### OMAHA 联盟
|
||||
浙江数字医疗卫生技术研究院(简称“数研院”,imit)是中国首家致力于数字与信息化技术在医疗卫生健康服务领域研发与应用的专业性非营利研究机构(NPO/NGO)。
|
||||
53
docs/fhir/introduction/toreader.md
Normal file
@ -0,0 +1,53 @@
|
||||
# 对 FHIR 的认识
|
||||
|
||||
互联网医疗在过去的一年里如火如荼,希望大家能够一起来汉化和开发FHIR相关的产品。
|
||||
|
||||
[FHIR – Fast Health Interoperable Resources](https://hl7.org/fhir/) – 是由HL7创建的新一代标准框架.FHIR 整合了 HL7 V2,V3 和 CDA
|
||||
的优点,同时利用了最新的Web标准,紧紧围绕着 implementability 可实现性。
|
||||
|
||||
FHIR 解决方案是基于一些称之为“资源”的模块化组件的. 这些资源可以很容易的组装进生产系统中,以已有方案的一小部分成本来解决实际的临床和管理上存在的问题。
|
||||
|
||||
FHIR 适用于多种场景– 智能手机APP、云平台上的通信、基于EHR的数据共享、大型医疗机构内服务器通信和其他。
|
||||
|
||||
大多数在HIT这个行业浸淫略久的人都听到过HL7的字眼,HIT 行业的标准不外乎有2个目的,交互共享数据(HL7
|
||||
V2消息,V3消息,CDA,X12,共享文档规范诸如此类),表达医疗行业的知识(
|
||||
各类术语字典,数据集数据元标准,Ardensyntax,CDSC,GELLO诸如此类)
|
||||
,而FHIR应该归属于第一类,与它的前辈不同的是,它抛弃了既往顺着发展了10多年,乃至于20年的那块田(
|
||||
封闭又自恃过高,怎么说这点呢,所有的标准文件都有自己独特的脱离了整个软件行业的编辑器生成,这些模型也不能为其他通用型软件所读取,最可恨的是没有配套的各种开源库开放给大家试错,降低学习成本,恶心的是居然个破标准还要收费)
|
||||
,也就是在上世纪90年代末XML在整个软件领域刮起一阵风,到处都在说系统集成时应运而生的V3消息,CDA等,毫无疑问它们都是为不同厂家的不同系统之间交换数据而生的,而它们的下场都很惨,用现在的话说,都不够敏捷,学习成本过高,迭代也不够快。
|
||||
|
||||
在 FHIR 卷土重来的时候就把基调定好了,思想上这次要全面拥抱互联网技术,用通用的互联网技术来做原来没有成功的事情,仍然还是想实现医疗健康领域数据的无缝流动,打通整个数据闭环。
|
||||
|
||||
它的诱人之处我认为有如下几点:
|
||||
|
||||
|
||||
1、过去的很多年,美国人造了各种各样的标准,国际友人也造了各式各样的轮子来解决上面的问题,最近的2-3年里很多人抛出了这样一个问题,能不能用同一种模型,经过适当的演化就能表达医疗数据(
|
||||
电子病历、健康档案、个人健康记录),又能表达医学知识(临床指南类决策支持用的知识,质控指标类的知识)
|
||||
,就目前FHIR发展的现状来看,这是一个还不错的选择。有很多这方面的尝试,美国的ONC最近也在这件事上砸了些钱希望能推动的更快一些。
|
||||
|
||||
2、拥抱互联网技术。卫生部这几年在推的区域平台、医院平台的技术点在我看来离现如今的互联网技术太远了,作为已经被抛弃的SOAP流的SOA架构的残留物,着实没听到在BAT等企业有何应用,最近几年在人人学Amazon的同事,新浪、京东等一批国内企业都在推一个叫open
|
||||
API 或者是restful api或者叫HTTP API的东东,以此来解决各自内部千千万产品间、产品内部的数据流动的问题,简而言之就是以一种方式圈定某个领域的业务对象,每种对象都使用同样的方法来实现一些功能,类比到厨艺的话,就是说约定好如何区分食材,每种食材都有哪些烹饪方法,这样子整个医疗领域就大约有100-200种资源(
|
||||
最小的信息单元,当然这里面的粒度的拿捏很是讲究),用到的“烹饪方法”就是HTTP协议定义好的(诸如put/post/get等)。
|
||||
|
||||
数据本身的表达格式也从原来V2 V3单纯的EDI格式、XML格式演化到了目前比较流行的JSON,以后或许还会演化出其他更为适合的方式。
|
||||
|
||||
这件事情一方面降低了学习认知整个标准的门槛,另一方面即使不使用它所规定的格式,顺着这样的思路,你也能解决一些问题。
|
||||
这里的问题不单单是之前它的老前辈(v2\v3\cda)所更care的产品与产品间的数据交换数据共享,你也可以借此实现产品内部的功能(京东的李大学总裁就介绍过它们在这方面的一些探索和实践),比如面临的移动端和PC端开发时功能复用的问题。
|
||||
|
||||
当然也有人会问,这东西能作为数据的存储模型来用么,这个问题是HL7 V3 RIM CDA所没能很好的解决的问题,它们的抽象程度太高了,但时代变了,Nosql数据库现在已经有很多可供选择,如果你要使用关系型数据库的话,也有一些这方面的探索可供参考。
|
||||
|
||||
3、尽管国内目前关注度不够,但在著名的代码托管平台Github上已经有大量的各种编程语言(java c# dephi javascipt swift等)
|
||||
、各种平台可用的一些开源代码,有适合PC端的,也有适合移动端的,这是很喜人的。
|
||||
|
||||
医疗领域的信息化是非常有前途的方向,但无奈的是北美的医疗信息化和病历方面的处理被深度绑定在 EPIC 这个公司上。
|
||||
|
||||
这个公司使用的技术已经算是非常古老的技术了,还在使用 M 语言。这个非关系数据库诞生在 R 数据库设计之前,目前这个这个公司在标榜说自己是非常先进的非关系型数据库。
|
||||
说实话,经过一些研究发现,这个数据库实在是无法和现在的开放数据环境进行匹配,对比当前使用比较多的 NoSQL 数据库来看,这个数据库也实在太封闭了。
|
||||
|
||||
不管怎么 FHIR 的出现,为医疗系统中的数据互联互通提供了一个新的发展方向,对推动相关行业的发展还是有很多好处的。
|
||||
|
||||
|
||||
## 联系我们
|
||||
访问: https://fhir.isharkfly.com/#/CONTACT 页面中的内容来和我们取得联系。
|
||||
|
||||
推荐访问社区,并在社区中留下您的足迹。
|
||||
14
docs/fhir/naming_conventions.md
Normal file
@ -0,0 +1,14 @@
|
||||
# Naming Conventions
|
||||
In simple terms, a naming convention refers to a framework used for naming your files in a specific way.
|
||||
|
||||
## Classes
|
||||
Class names should be nouns, in mixed cases with the first letter of each internal word capitalized. Interfaces names should also be capitalized just like class names.
|
||||
|
||||
## Methods
|
||||
Methods should be verbs, in mixed case with the first letter lowercase and with the first letter of each internal word capitalized.
|
||||
|
||||
## Variables
|
||||
Variable names should not start with underscore _ or dollar sign $ characters, even though both are allowed.
|
||||
|
||||
## Packages
|
||||
The prefix of a unique package name is always written in all-lowercase ASCII letters and should be one of the top-level domain names, like com, edu, gov, mil, net, org.
|
||||
27
docs/index.md
Normal file
@ -0,0 +1,27 @@
|
||||
---
|
||||
# https://vitepress.dev/reference/default-theme-home-page
|
||||
layout: home
|
||||
|
||||
hero:
|
||||
name: "iSharkFly Health 文档"
|
||||
text: "Docs"
|
||||
tagline: 欢迎来到 iSharkFly Health 文档
|
||||
actions:
|
||||
- theme: brand
|
||||
text: mumps
|
||||
link: /mumps/index
|
||||
- theme: alt
|
||||
text: FHIR
|
||||
link: /fhir
|
||||
|
||||
features:
|
||||
- title: iSharkFly 文档项目
|
||||
details: Lorem ipsum dolor sit amet, consectetur adipiscing elit
|
||||
- title: 构建框架
|
||||
details: Lorem ipsum dolor sit amet, consectetur adipiscing elit
|
||||
- title: 快速导航
|
||||
details: 针对不同内容的网站,请参考本页面底部的快速导航链接。
|
||||
---
|
||||
|
||||
---
|
||||
<!--@include: CONTACT.md -->
|
||||
|
Before Width: | Height: | Size: 9.9 KiB |
@ -1,51 +0,0 @@
|
||||
# 面试问题和经验文档
|
||||
|
||||
在应聘技术岗位的时候,通常会要求你进行一些算法和基础知识的考核。因计算机的知识比较复杂概念也非常多,这就给应聘者带来很大的困惑,应该怎么去做?
|
||||
|
||||
同时面试官很多时候也是突击某个问题,然后拿着这个问题来问应聘者。结果就导致了很多问题非常刁钻古怪,甚至有时候你根本就不可能在实际开发中遇到。
|
||||
|
||||
不管怎么样,这种面试方式至少目前来说是一种趋势,所以我们尽量收集一些技术岗的面试经验供大家参考。
|
||||
|
||||

|
||||
|
||||
因为 MD 文档格式的限制,所以我们在这里只放一个索引并且维护这个索引,有关的具体内容,请通过索引访问我们的社区进行查看,我们也非常欢迎您参与讨论,
|
||||
您可以在社区注册后进行讨论。
|
||||
|
||||
## CS 基础
|
||||
|
||||
如果你有比较好的 CS 基础,那么下面的内容肯对你来说可能就太基础了。
|
||||
|
||||
如果你没有 CS 基础,但是想转成 CS ,并且需要进行一些面试,下面的这些内容也许能帮你想想盒子外面有什么(Thinking outside the
|
||||
box),顺便能够过一下 CS 的原理和概念。
|
||||
|
||||
* [为什么要转码](https://www.isharkfly.com/t/topic/13891)
|
||||
*
|
||||
|
||||
## 面试问题和经验索引
|
||||
|
||||
在这里我们希望按照年份进行一些分开,这样能够帮助大家尽量区分时间,同时我们的排序是按照倒序排列的。
|
||||
|
||||
最新的内容在最前面(按照时间倒序排序)。
|
||||
|
||||
### 2023
|
||||
|
||||
* [题目有点太简单了,不知道怎么选了](https://www.isharkfly.com/t/topic/14588)
|
||||
* [Java 乘等赋值运算](https://www.isharkfly.com/t/java/14590)
|
||||
* [如何用 Java 找到字符串中的元音](https://www.isharkfly.com/t/java/14841)
|
||||
|
||||
### 2021
|
||||
|
||||
* [一次谈不上有点内卷的美东某金融公司面试](https://www.isharkfly.com/t/topic/13820)
|
||||
* [美东某 IoT 公司技术流程第一轮沟通就挂了](https://www.isharkfly.com/t/iot/13815)
|
||||
* [2021 年美东地区 IoT 公司的一次失败面试](https://www.isharkfly.com/t/2021-iot/13791)
|
||||
* [2021 年一次比较奇葩的 AWS 面试](https://www.isharkfly.com/t/2021-aws/13788)
|
||||
* [2021 疫情期间美国公司技术岗的面试流程](https://www.isharkfly.com/t/topic/13463)
|
||||
* [从拒绝到被拒绝](https://www.isharkfly.com/t/topic/13462)
|
||||
* [从一个工作到一个工作](https://www.isharkfly.com/t/topic/13461)
|
||||
* [北美亚特兰大一金融服务公司面试总结](https://www.isharkfly.com/t/topic/13453)
|
||||
* [北美一工作搜索引擎公司技术岗面经](https://www.isharkfly.com/t/topic/13451)
|
||||
* [一房地产数据服务初创公司的面经](https://www.isharkfly.com/t/topic/13441)
|
||||
|
||||
### 2019
|
||||
|
||||
* [IT 技术岗位 2019 年北美求职流水账](https://www.isharkfly.com/t/it-2019/13433)
|
||||
|
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 32 KiB |
96
docs/mumps/index.md
Normal file
@ -0,0 +1,96 @@
|
||||
# M[UMPS] 参考 (Reference)
|
||||
|
||||
M 语言的参考很乱,到目前为止也没有找到非常多的有效文件。
|
||||
|
||||
在这个页面中,我们对网络上能收集到的文档和资料进行归档,以便于大家快速下载。
|
||||
|
||||
# M Programming Language
|
||||
|
||||
MUMPS (M) is a high performance transaction processing key–value database with integrated programming language.
|
||||
|
||||
__M history__
|
||||
https://en.wikipedia.org/wiki/MUMPS
|
||||
|
||||
M syntax
|
||||
https://en.wikipedia.org/wiki/MUMPS_syntax
|
||||
|
||||
M standard
|
||||
http://71.174.62.16/Demo/AnnoStd
|
||||
|
||||
M language guide
|
||||
https://www.cs.uni.edu/~okane/source/MUMPS-MDH/MumpsUsersGuide.pdf
|
||||
https://www.cs.uni.edu/~okane/source/MUMPS-MDH/MumpsTutorial.pdf
|
||||
|
||||
M language forum
|
||||
https://groups.google.com/g/comp.lang.mumps
|
||||
|
||||
M pocket guide
|
||||
http://vistaexpertise.net/bookstore/1995-standard-mumps-pocket-guide/1995-standard-mumps-pocket-guide.pdf
|
||||
|
||||
M example code
|
||||
https://github.com/programarivm/mumps-examples
|
||||
http://71.174.62.16/Demo/AnnoStd?Frame=Main&Page=a100006
|
||||
|
||||
M books
|
||||
https://www.amazon.com/Mumps-Programming-Language-Kevin-OKane-ebook/dp/B00MZIMA1M
|
||||
|
||||
M training
|
||||
https://www.pioneerdatasys.com/site/train/m2s.html
|
||||
|
||||
M utilities
|
||||
https://www.hardhats.org/tools/MUtilframe.html
|
||||
|
||||
M blogs
|
||||
https://www.datasciencecentral.com/mumps-the-most-important-database-you-probably-never-heard-of
|
||||
https://www.elys.com/blog/mumps-the-arcane-database-language-behind-our-electronic-medical-records
|
||||
|
||||
M: Vista Programming
|
||||
https://www.hardhats.org/tools/vpe/vpe_db.html
|
||||
http://www.vistapedia.net/index.php/MUMPS_Overview
|
||||
http://www.vistapedia.net/index.php/Introduction_To_Programming_VistA_with_MUMPS
|
||||
http://www.vistapedia.net/index.php/VistA_Database_Globals
|
||||
http://www.vistapedia.net/index.php/Object_Oriented_Programming_with_M
|
||||
|
||||
## M implementations
|
||||
|
||||
__Reference standard mumps (RSM)__
|
||||
https://gitlab.com/Reference-Standard-M/rsm
|
||||
|
||||
__YottaDB__
|
||||
https://gitlab.com/YottaDB
|
||||
https://yottadb.com/product/get-started/
|
||||
https://docs.yottadb.com/ProgrammersGuide/devcycle.html#overview-of-the-program-development-cycle
|
||||
https://yottadb.com/connect-microsoft-analytics-and-business-intelligence-tools-to-octo/
|
||||
|
||||
### JSR
|
||||
|
||||
https://mumps-dev.github.io/jsr/
|
||||
|
||||
### MUMPS Tutorials
|
||||
|
||||
[Mumps 语言有关多层次和维度的程序员工具包指南(The Multi-Dimensional and Hierarchical Database Toolkit Programmer’s Guide)](https://www.isharkfly.com/t/the-multi-dimensional-and-hierarchical-database-toolkit-programmers-guide/16033)
|
||||
[Mumps 语言快速基本概述(A Quick Overview of the Basics of the Mumps Language)](https://www.isharkfly.com/t/mumps/16037)
|
||||
[Mumps 程序语言解释器编译器和 C++ 类库用户指南](https://www.isharkfly.com/t/mumps-c/16038)
|
||||
[Mumps 语言标准指南 - 1995 年版](https://www.isharkfly.com/t/mumps-1995/16039)
|
||||
[Mumps 语言开发标准 2020 年草案](https://www.isharkfly.com/t/mumps-2020/16040)
|
||||
|
||||
https://www.cs.uni.edu/~okane/index.html
|
||||
https://www.cs.uni.edu/~okane/mumps.html
|
||||
https://www.cs.uni.edu/~okane/youtube.html#mumps
|
||||
https://youtube.com/playlist?list=PLmMgHNtOIstYpwQRy5btu-P-Gl90IsjPM
|
||||
|
||||
### Hacker News
|
||||
|
||||
Introduction to the Mumps Language
|
||||
https://news.ycombinator.com/item?id=16309237
|
||||
https://news.ycombinator.com/item?id=13859961
|
||||
|
||||
### Daily WTF
|
||||
|
||||
https://thedailywtf.com/articles/MUMPS-Madness
|
||||
https://thedailywtf.com/articles/A_Case_of_the_MUMPS
|
||||
https://robtweed.wordpress.com/2012/10/21/a-case-of-the-mumps/
|
||||
|
||||
### M Developer gits
|
||||
|
||||
https://github.com/robtweed
|
||||
@ -1,222 +0,0 @@
|
||||
# Protocol Buffers 文档
|
||||
|
||||
Protocol Buffers 相关文档的内容。
|
||||
|
||||

|
||||
|
||||
## Protocol Buffers 简介
|
||||
如果你在互联网上搜索的话,你可能会看到下面的说明文字。
|
||||
|
||||
Google Protocol Buffer( 简称 Protobuf) 是 Google 公司内部的混合语言数据标准,目前已经正在使用的有超过 48,162 种报文格式定义和超过 12,183 个 .proto 文件。
|
||||
|
||||
他们用于 RPC 系统和持续数据存储系统。
|
||||
|
||||
Protocol Buffers 是一种轻便高效的结构化数据存储格式,可以用于结构化数据串行化,或者说序列化。
|
||||
|
||||
它很适合做数据存储或 RPC 数据交换格式。可用于通讯协议、数据存储等领域的语言无关、平台无关、可扩展的序列化结构数据格式。
|
||||
|
||||
目前提供了 C++、Java、Python 三种语言的 API。
|
||||
|
||||
|
||||
我们是在实际的数据处理的时候,需要使用 JSON 来序列化数据,但是又考虑到 JSON 在传输的时候数据过大,同时还有很多并不需要的垃圾文件。
|
||||
我们才考虑到了 Protocol Buffer 提供的功能。
|
||||
|
||||

|
||||
|
||||
|
||||
# Protocol Buffers 开发者指南
|
||||
|
||||
欢迎来到 protocol buffers 的开发者指南。protocol buffers 是一个语言中立,平台中立针对通讯协议,数据存储和其他领域中对结构化数据进行序列化的扩展方法。
|
||||
|
||||
本文档主要针对的是 Java,C++ 或 Python 的开发人员希望在开发的应用程序中使用 Protocol Buffers。这个有关 Protocol Buffers 摘要性的介绍将会告诉你如何开始使用 Protocol Buffers。
|
||||
如果你希望更加深入的了解有关 Protocol Buffers 的内容,你可以进入 tutorials 或者 protocol buffer encoding 页面来详细了解。
|
||||
|
||||
有关 API 的参考文档,请参考页面:reference documentation 这里提供了所有这 3 种语言的参考,同时也针对 .proto language 和 style 提供相关的指南。
|
||||
|
||||
## 什么是 Protocol Buffers
|
||||
Protocol buffers 是对结构化数据序列化的一个灵活,高效,自动化工具 —— 你可以将 Protocol buffers 想象成 XML,但是体积更小,更快也更加简单。
|
||||
|
||||
你可以自己定义你的结构化数据,然后你可以使用特定的代码生成工具来非常容易对你的结构化数据进行读取和写入。这些数据的读取和写入可以是一系列的数据流和使用不同的计算机程序语言。
|
||||
你甚至可以在不对已经部署的程序进行破坏的情况下更新你的数据结构。
|
||||
|
||||
## Protocol Buffers 是如何进行工作的
|
||||
你需要制定你希望如何将你的数据进行序列化。你是通过 proto 文件来定义你的消息结构化数据的。
|
||||
|
||||
每一 protocol buffer message 是一个小的信息记录逻辑,这个消息中包含有一系列的名字,变量对照序列。
|
||||
|
||||
下面是一些基本的.proto 文件,这些文件中定义了一个消息,这个消息包含有一个 person 信息:
|
||||
|
||||
```
|
||||
message Person {
|
||||
required string name = 1;
|
||||
required int32 id = 2;
|
||||
optional string email = 3;
|
||||
|
||||
enum PhoneType {
|
||||
MOBILE = 0;
|
||||
HOME = 1;
|
||||
WORK = 2;
|
||||
}
|
||||
|
||||
message PhoneNumber {
|
||||
required string number = 1;
|
||||
optional PhoneType type = 2 [default = HOME];
|
||||
}
|
||||
|
||||
repeated PhoneNumber phone = 4;
|
||||
}
|
||||
```
|
||||
|
||||
通过上面你可以看到这个消息的格式非常简单—— 每一个消息类型都有一个或者多个唯一进行编号的字段,每一个字段包含有一个名字和变量类型。
|
||||
|
||||
变量可以为数字(整形或者浮点型)(numbers),布尔类型(booleans),字符串(strings),原生二进制(raw bytes)甚至其他的 protocol buffer 消息类型,能够允许你分级的结构化你的数据。
|
||||
|
||||
你可以将字段指定为可选字段(optional fields),必须字段(required fields)和重复字段(repeated fields)。你可以从下面的 Protocol Buffer Language Guide 页面中找到更多有关 .proto 的定义。
|
||||
|
||||
一旦你成功定义了你的消息,你可以针对你使用的语言使用你定义的 .proto 来运行 protocol buffer 编译器(protocol buffer compiler)来生成数据访问类。
|
||||
|
||||
针对每一个字段,在数据访问类中提供了简单的访问方法(例如 name() 和 set_name())和序列化到原生 2 进制数据和从原生 2 进制数据反序列化的方法。
|
||||
|
||||
针对上面的定义,如果你现在使用的是 C++ 语言的话,当你把消息定义进行编译后,你将会得到一个称为 Person 的类。对数据进行序列化和从序列化的数据中(protocol buffer 消息)重新获得 Person 数据。
|
||||
|
||||
然后你可以写一些类似 Person person; 的代码。
|
||||
|
||||
```cpp
|
||||
Person person;
|
||||
person.set_name("John Doe");
|
||||
person.set_id(1234);
|
||||
person.set_email("jdoe@example.com");
|
||||
fstream output("myfile", ios::out | ios::binary);
|
||||
person.SerializeToOstream(&output);
|
||||
```
|
||||
|
||||
随后,你可以对消息进行读取:
|
||||
|
||||
```cpp
|
||||
fstream input("myfile", ios::in | ios::binary);
|
||||
Person person;
|
||||
person.ParseFromIstream(&input);
|
||||
cout << "Name: " << person.name() << endl;
|
||||
cout << "E-mail: " << person.email() << endl;
|
||||
```
|
||||
|
||||
你可以向你的消息中添加新的字段而不会损坏老的消息。这是因为在老的消息处理中,针对新的字段是完全忽略掉的。因此,如果你在你的通讯协议中使用 protocol buffers 为数据结构的话,
|
||||
你可以对你的协议和消息进行扩展而不需要担心老的代码没有办法编译通过,或者损坏老的代码。
|
||||
|
||||
你可以访问 API Reference section 页面中的内容来了解完整 protocol buffer 代码的生成和使用。
|
||||
|
||||
你也可以在 Protocol Buffer Encoding 页面中了解更多protocol buffer 消息是如何进行编码的。
|
||||
|
||||
## 为什么不使用 XML
|
||||
针对 XML 来说 Protocol Buffers 具有更多的优势来对序列化结构数据。
|
||||
|
||||
* 更加简单
|
||||
* 小于 XML 3 到 10 倍
|
||||
* 快于 XML 20 到 100 倍
|
||||
* 松耦合
|
||||
* 使用程序工具来创建数据访问类,使数访问类更加简单
|
||||
* 假设,你需要讲 person 这个数据进行定义,在 XML 你需要使用:
|
||||
|
||||
```xml
|
||||
<person>
|
||||
<name>John Doe</name>
|
||||
<email>jdoe@example.com</email>
|
||||
</person>
|
||||
```
|
||||
来进行定义。
|
||||
|
||||
在 Protocol Buffers 中针对上面的消息文本化(text format)后显示为:
|
||||
|
||||
```
|
||||
# Textual representation of a protocol buffer.
|
||||
# This is *not* the binary format used on the wire.
|
||||
person {
|
||||
name: "John Doe"
|
||||
email: "jdoe@example.com"
|
||||
}
|
||||
```
|
||||
|
||||
当上面的消息被编码为 Protocol Buffer 二进制格式(binary format)上面的文字可能小于 28 bytes,并且可能需要 100-200 纳秒(nanoseconds)来进行处理。
|
||||
|
||||
我们将上面转换为可以人为读取的目的主要是为进行调试和编辑。
|
||||
|
||||
如果你使用 XML 的话,上面的信息至少需要 69 bytes (你需要删除所有的空格),同时你需要 5,000-10,000 纳秒(nanoseconds)来进行处理。
|
||||
|
||||
同时,对 protocol buffer 进行操作也是非常容易的:
|
||||
|
||||
```cpp
|
||||
cout << "Name: " << person.name() << endl;
|
||||
cout << "E-mail: " << person.email() << endl;
|
||||
```
|
||||
|
||||
如果使用的是 XML 的话,你需要进行下面的操作:
|
||||
|
||||
```cpp
|
||||
cout << "Name: "
|
||||
<< person.getElementsByTagName("name")->item(0)->innerText()
|
||||
<< endl;
|
||||
cout << "E-mail: "
|
||||
<< person.getElementsByTagName("email")->item(0)->innerText()
|
||||
<< endl;
|
||||
```
|
||||
|
||||
但是,protocol buffers 并不是任何时候都会比 XML 好。例如,针对基于文本的标记语言(例如,XML),protocol buffers 就不是一个很好的选项,
|
||||
因为你不能使用 protocol buffer 更好的在文档中进行交换。更主要的是 HTML 是人类可以阅读和编辑的。protocol buffer 也不是不可以人为的读取,但是针对原生的 protocol buffer 格式是没有办法人为进行读取和编辑的。
|
||||
|
||||
XML 与 HTML 一样,在某种程度上是一种自我描述数据。protocol buffer 只针对你在 .proto 文件中描述的内容进行表达。
|
||||
|
||||
## 看起来像一个解决方案,我应该如何开始呢
|
||||
Download the package – 这包中含有针对 Java, Python, 和 C++ protocol buffer 编译器源代码,和你需要进行 I/O 和测试的类。希望对你的编译器进行编译和构建,请参考代码中的 README 文件。
|
||||
|
||||
一旦你完成了所有的设置,请参考 tutorial 页面中的内容来选择你需要的语言——这个能够帮助你使用 protocol buffer 创建一个简单的应用程序。
|
||||
|
||||
## 介绍 proto3
|
||||
在我们最新的 version 3 发行版 中推出了新的语言版本 —— Protocol Buffers language version 3(另称 proto3),在这个版本中针对我们已经存在的语言版本(proto2)使用了一些新的特性。
|
||||
|
||||
Proto3 简化了 protocol buffer 语言,使其更加容易使用并且能够支持更多的语言:我们当前发行的 proto3 能够让你创建 Java, C++, Python, Java Lite, Ruby, JavaScript, Objective-C, and C#。
|
||||
|
||||
另外你也可以通过使用 Go protoc 插件来用 proto3 创建 Go 代码,这个插件你可以到 golang/protobuf Github 中下载到。更多的语言还在逐步进行支持中。
|
||||
|
||||
请注意,这 2 个版本的 API 并不是完全兼容的。为了照顾还在使用老版本的用户,我们将会在新的 protocol buffers 发行中同时支持老的版本。
|
||||
|
||||
你可以在下面的发行日志(release notes)查看 2 个版本的主要不同。有关 proto3 的句法,请参考 Proto3 Language Guide 中的内容,针对 proto3 的完整文档还没有编写完成,将会随后推出。
|
||||
|
||||
看起来 proto2 和 proto3 可能会产生一些混淆,这是因为原始的开源 protocol buffers 实际上是 Google 内部语言的第二个版本,同时我们的开源版本也是从 v2.0.0 开始的。
|
||||
|
||||
简单来说就是 proto 最开始的版本是 Google 内部使用的,在 proto 第二个版本的时候,Google 决定进行开源了,所以开源的 proto 是从 proto2 开始的。
|
||||
|
||||
## 一个简短的历史
|
||||
Protocol buffers 最开始是在 Google 内部进行开发的,用于处理在索引服务器上请求/响应(request/response)的协议。
|
||||
|
||||
在 Protocol buffers 之前,针对请求和响应,使用的是 marshalling/unmarshalling,这个能够支持一系列的协议。但是结果看起来却是非常的难看,例如:
|
||||
|
||||
```
|
||||
if (version == 3) {
|
||||
...
|
||||
} else if (version > 4) {
|
||||
if (version == 5) {
|
||||
...
|
||||
}
|
||||
...
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
明确格式化的的协议也使新版本的协议更加难以推出,这是因为开发者必须能够了解老协议在服务器之间是如何进行处理的,同时也需要了解新的协议。只有对新老协议都有所了解后才能逐步使用新的协议替换老的协议。
|
||||
|
||||
Protocol buffers 被用来设计解决上面的很多问题:
|
||||
|
||||
* 新的字段比较能够容易的进行定义,中级服务器不需要对数据进行检查,直接对数据进行处理,同时也可以直接传输数据而不需要了解数据是如何进行定义的。
|
||||
* 格式使用自描述,能够更加容易支持更多的语言(C++,Java 等)。
|
||||
|
||||
但是,用户还是需要手动书写他们自己的处理diam。
|
||||
|
||||
作为系统的进化来说,它获得了许多其他的特性和用途:
|
||||
|
||||
* 自动生成序列化和反序列化代码而避免手动书写这些代码。
|
||||
* 除了开始使用短期RPC(远程过程调用)请求,人们开始使用 protocol buffers 作为高效的自描述结构化数据格式(主要针对数据短期存在,例如在 Bigtable)。
|
||||
* 服务器RPC接口开始被声明为协议文件的一部分,协议编译器生成根类,用户可以通过服务器接口的实现和重载它们。
|
||||
|
||||
Protocol buffers 在 Google 中成为针对数据的通用语言—— 随着时间的流逝,在 Google 内部已经有超过 348,952 .proto 文件被定义。这些被用在 RPC 系统和存储系统中存储数据。
|
||||
|
||||
[Annotation(注解)](installation.md ':include')
|
||||
@ -1,40 +0,0 @@
|
||||
# Protocol Buffers 安装
|
||||
本文主要介绍 protobuf 编译器在 Windows 下的安装。
|
||||
|
||||
## 下载编译器
|
||||
访问 https://github.com/protocolbuffers/protobuf/releases/ 链接然后针对不同的操作系统下载最新的编译器版本。
|
||||
|
||||

|
||||
|
||||
下载完成后到本地计算机上找到这个文件并且解压。
|
||||
|
||||
## 解压文件
|
||||
然后将下载的压缩文件解压到 D:\Dkits\protobuf 文件夹中。
|
||||
|
||||
当然你也可以解压到不同的文件夹中。
|
||||
|
||||

|
||||
|
||||
解压后的文件夹目录如下。
|
||||
|
||||
## 设置 PATH
|
||||
当完成下面解压后,你可以将文件所在的 bin 目录中设置到 PATH 里面。
|
||||
|
||||

|
||||
|
||||
上面就是设置好的 PATH 目录。
|
||||
|
||||
然后保存退出。
|
||||
|
||||
## 校验安装
|
||||
在命令行工具中,运行命令:
|
||||
|
||||
`protoc --version`
|
||||
|
||||
如果能够看到版本输出的话,就说明你的 protoc 已经被正确的配置到操作系统中了。
|
||||
|
||||

|
||||
|
||||
如上图,我们能看到正确的版本输出。
|
||||
|
||||
延伸阅读和参与讨论,请访问:[Protobuf 编译器 Windows 安装方法](https://www.ossez.com/t/protobuf-windows/13864)
|
||||
90
docs/python-tutorials/.gitignore
vendored
@ -1,90 +0,0 @@
|
||||
# Byte-compiled / optimized / DLL files
|
||||
__pycache__/
|
||||
*.py[cod]
|
||||
*$py.class
|
||||
|
||||
# C extensions
|
||||
*.so
|
||||
|
||||
# Distribution / packaging
|
||||
.Python
|
||||
env/
|
||||
build/
|
||||
develop-eggs/
|
||||
dist/
|
||||
downloads/
|
||||
eggs/
|
||||
.eggs/
|
||||
lib/
|
||||
lib64/
|
||||
parts/
|
||||
sdist/
|
||||
var/
|
||||
*.egg-info/
|
||||
.installed.cfg
|
||||
*.egg
|
||||
|
||||
# PyInstaller
|
||||
# Usually these files are written by a python script from a template
|
||||
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
||||
*.manifest
|
||||
*.spec
|
||||
|
||||
# Installer logs
|
||||
pip-log.txt
|
||||
pip-delete-this-directory.txt
|
||||
|
||||
# Unit test / coverage reports
|
||||
htmlcov/
|
||||
.tox/
|
||||
.coverage
|
||||
.coverage.*
|
||||
.cache
|
||||
nosetests.xml
|
||||
coverage.xml
|
||||
*,cover
|
||||
.hypothesis/
|
||||
|
||||
# Translations
|
||||
*.mo
|
||||
*.pot
|
||||
|
||||
# Django stuff:
|
||||
*.log
|
||||
local_settings.py
|
||||
|
||||
# Flask stuff:
|
||||
instance/
|
||||
.webassets-cache
|
||||
|
||||
# Scrapy stuff:
|
||||
.scrapy
|
||||
|
||||
# Sphinx documentation
|
||||
docs/_build/
|
||||
|
||||
# PyBuilder
|
||||
target/
|
||||
|
||||
# IPython Notebook
|
||||
.ipynb_checkpoints
|
||||
|
||||
# pyenv
|
||||
.python-version
|
||||
|
||||
# celery beat schedule file
|
||||
celerybeat-schedule
|
||||
|
||||
# dotenv
|
||||
.env
|
||||
|
||||
# virtualenv
|
||||
.venv/
|
||||
venv/
|
||||
ENV/
|
||||
|
||||
# Spyder project settings
|
||||
.spyderproject
|
||||
|
||||
# Rope project settings
|
||||
.ropeproject
|
||||
@ -1,9 +0,0 @@
|
||||
Copyright (c) 2020, Yucheng Hu
|
||||
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||
|
||||
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
||||
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
@ -1 +0,0 @@
|
||||
include LICENSE
|
||||
@ -1,5 +0,0 @@
|
||||
init:
|
||||
pip install -r requirements.txt
|
||||
|
||||
test:
|
||||
nosetests tests
|
||||
@ -1,12 +0,0 @@
|
||||
Python Tutorials 仓库
|
||||
=====================
|
||||
|
||||
This simple project is an example repo for Python projects.
|
||||
|
||||
`查看更多 <https://github.com/ossez-com/python-tutorials>`_
|
||||
|
||||
`官方结构的说明 <http://www.kennethreitz.org/essays/repository-structure-and-python>`_
|
||||
|
||||
---------------
|
||||
|
||||
If you want to learn more about ``setup.py`` files, check out `this repository <https://github.com/kennethreitz/setup.py>`_.
|
||||
@ -1,153 +0,0 @@
|
||||
# Makefile for Sphinx documentation
|
||||
#
|
||||
|
||||
# You can set these variables from the command line.
|
||||
SPHINXOPTS =
|
||||
SPHINXBUILD = sphinx-build
|
||||
PAPER =
|
||||
BUILDDIR = _build
|
||||
|
||||
# Internal variables.
|
||||
PAPEROPT_a4 = -D latex_paper_size=a4
|
||||
PAPEROPT_letter = -D latex_paper_size=letter
|
||||
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
|
||||
# the i18n builder cannot share the environment and doctrees with the others
|
||||
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
|
||||
|
||||
.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext
|
||||
|
||||
help:
|
||||
@echo "Please use \`make <target>' where <target> is one of"
|
||||
@echo " html to make standalone HTML files"
|
||||
@echo " dirhtml to make HTML files named index.html in directories"
|
||||
@echo " singlehtml to make a single large HTML file"
|
||||
@echo " pickle to make pickle files"
|
||||
@echo " json to make JSON files"
|
||||
@echo " htmlhelp to make HTML files and a HTML help project"
|
||||
@echo " qthelp to make HTML files and a qthelp project"
|
||||
@echo " devhelp to make HTML files and a Devhelp project"
|
||||
@echo " epub to make an epub"
|
||||
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
|
||||
@echo " latexpdf to make LaTeX files and run them through pdflatex"
|
||||
@echo " text to make text files"
|
||||
@echo " man to make manual pages"
|
||||
@echo " texinfo to make Texinfo files"
|
||||
@echo " info to make Texinfo files and run them through makeinfo"
|
||||
@echo " gettext to make PO message catalogs"
|
||||
@echo " changes to make an overview of all changed/added/deprecated items"
|
||||
@echo " linkcheck to check all external links for integrity"
|
||||
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
|
||||
|
||||
clean:
|
||||
-rm -rf $(BUILDDIR)/*
|
||||
|
||||
html:
|
||||
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
|
||||
@echo
|
||||
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
|
||||
|
||||
dirhtml:
|
||||
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
|
||||
@echo
|
||||
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
|
||||
|
||||
singlehtml:
|
||||
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
|
||||
@echo
|
||||
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
|
||||
|
||||
pickle:
|
||||
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
|
||||
@echo
|
||||
@echo "Build finished; now you can process the pickle files."
|
||||
|
||||
json:
|
||||
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
|
||||
@echo
|
||||
@echo "Build finished; now you can process the JSON files."
|
||||
|
||||
htmlhelp:
|
||||
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
|
||||
@echo
|
||||
@echo "Build finished; now you can run HTML Help Workshop with the" \
|
||||
".hhp project file in $(BUILDDIR)/htmlhelp."
|
||||
|
||||
qthelp:
|
||||
$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
|
||||
@echo
|
||||
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
|
||||
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
|
||||
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/sample.qhcp"
|
||||
@echo "To view the help file:"
|
||||
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/sample.qhc"
|
||||
|
||||
devhelp:
|
||||
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
|
||||
@echo
|
||||
@echo "Build finished."
|
||||
@echo "To view the help file:"
|
||||
@echo "# mkdir -p $$HOME/.local/share/devhelp/sample"
|
||||
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/sample"
|
||||
@echo "# devhelp"
|
||||
|
||||
epub:
|
||||
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
|
||||
@echo
|
||||
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
|
||||
|
||||
latex:
|
||||
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
|
||||
@echo
|
||||
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
|
||||
@echo "Run \`make' in that directory to run these through (pdf)latex" \
|
||||
"(use \`make latexpdf' here to do that automatically)."
|
||||
|
||||
latexpdf:
|
||||
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
|
||||
@echo "Running LaTeX files through pdflatex..."
|
||||
$(MAKE) -C $(BUILDDIR)/latex all-pdf
|
||||
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
|
||||
|
||||
text:
|
||||
$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
|
||||
@echo
|
||||
@echo "Build finished. The text files are in $(BUILDDIR)/text."
|
||||
|
||||
man:
|
||||
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
|
||||
@echo
|
||||
@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
|
||||
|
||||
texinfo:
|
||||
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
|
||||
@echo
|
||||
@echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
|
||||
@echo "Run \`make' in that directory to run these through makeinfo" \
|
||||
"(use \`make info' here to do that automatically)."
|
||||
|
||||
info:
|
||||
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
|
||||
@echo "Running Texinfo files through makeinfo..."
|
||||
make -C $(BUILDDIR)/texinfo info
|
||||
@echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
|
||||
|
||||
gettext:
|
||||
$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
|
||||
@echo
|
||||
@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
|
||||
|
||||
changes:
|
||||
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
|
||||
@echo
|
||||
@echo "The overview file is in $(BUILDDIR)/changes."
|
||||
|
||||
linkcheck:
|
||||
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
|
||||
@echo
|
||||
@echo "Link check complete; look for any errors in the above output " \
|
||||
"or in $(BUILDDIR)/linkcheck/output.txt."
|
||||
|
||||
doctest:
|
||||
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
|
||||
@echo "Testing of doctests in the sources finished, look at the " \
|
||||
"results in $(BUILDDIR)/doctest/output.txt."
|
||||
@ -1,242 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
# sample documentation build configuration file, created by
|
||||
# sphinx-quickstart on Mon Apr 16 21:22:43 2012.
|
||||
#
|
||||
# This file is execfile()d with the current directory set to its containing dir.
|
||||
#
|
||||
# Note that not all possible configuration values are present in this
|
||||
# autogenerated file.
|
||||
#
|
||||
# All configuration values have a default; values that are commented out
|
||||
# serve to show the default.
|
||||
|
||||
import sys, os
|
||||
|
||||
# If extensions (or modules to document with autodoc) are in another directory,
|
||||
# add these directories to sys.path here. If the directory is relative to the
|
||||
# documentation root, use os.path.abspath to make it absolute, like shown here.
|
||||
#sys.path.insert(0, os.path.abspath('.'))
|
||||
|
||||
# -- General configuration -----------------------------------------------------
|
||||
|
||||
# If your documentation needs a minimal Sphinx version, state it here.
|
||||
#needs_sphinx = '1.0'
|
||||
|
||||
# Add any Sphinx extension module names here, as strings. They can be extensions
|
||||
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
|
||||
extensions = []
|
||||
|
||||
# Add any paths that contain templates here, relative to this directory.
|
||||
templates_path = ['_templates']
|
||||
|
||||
# The suffix of source filenames.
|
||||
source_suffix = '.rst'
|
||||
|
||||
# The encoding of source files.
|
||||
#source_encoding = 'utf-8-sig'
|
||||
|
||||
# The master toctree document.
|
||||
master_doc = 'index'
|
||||
|
||||
# General information about the project.
|
||||
project = u'sample'
|
||||
copyright = u'2020, YuCheng Hu'
|
||||
|
||||
# The version info for the project you're documenting, acts as replacement for
|
||||
# |version| and |release|, also used in various other places throughout the
|
||||
# built documents.
|
||||
#
|
||||
# The short X.Y version.
|
||||
version = 'v0.0.1'
|
||||
# The full version, including alpha/beta/rc tags.
|
||||
release = 'v0.0.1'
|
||||
|
||||
# The language for content autogenerated by Sphinx. Refer to documentation
|
||||
# for a list of supported languages.
|
||||
#language = None
|
||||
|
||||
# There are two options for replacing |today|: either, you set today to some
|
||||
# non-false value, then it is used:
|
||||
#today = ''
|
||||
# Else, today_fmt is used as the format for a strftime call.
|
||||
#today_fmt = '%B %d, %Y'
|
||||
|
||||
# List of patterns, relative to source directory, that match files and
|
||||
# directories to ignore when looking for source files.
|
||||
exclude_patterns = ['_build']
|
||||
|
||||
# The reST default role (used for this markup: `text`) to use for all documents.
|
||||
#default_role = None
|
||||
|
||||
# If true, '()' will be appended to :func: etc. cross-reference text.
|
||||
#add_function_parentheses = True
|
||||
|
||||
# If true, the current module name will be prepended to all description
|
||||
# unit titles (such as .. function::).
|
||||
#add_module_names = True
|
||||
|
||||
# If true, sectionauthor and moduleauthor directives will be shown in the
|
||||
# output. They are ignored by default.
|
||||
#show_authors = False
|
||||
|
||||
# The name of the Pygments (syntax highlighting) style to use.
|
||||
pygments_style = 'sphinx'
|
||||
|
||||
# A list of ignored prefixes for module index sorting.
|
||||
#modindex_common_prefix = []
|
||||
|
||||
|
||||
# -- Options for HTML output ---------------------------------------------------
|
||||
|
||||
# The theme to use for HTML and HTML Help pages. See the documentation for
|
||||
# a list of builtin themes.
|
||||
html_theme = 'default'
|
||||
|
||||
# Theme options are theme-specific and customize the look and feel of a theme
|
||||
# further. For a list of options available for each theme, see the
|
||||
# documentation.
|
||||
#html_theme_options = {}
|
||||
|
||||
# Add any paths that contain custom themes here, relative to this directory.
|
||||
#html_theme_path = []
|
||||
|
||||
# The name for this set of Sphinx documents. If None, it defaults to
|
||||
# "<project> v<release> documentation".
|
||||
#html_title = None
|
||||
|
||||
# A shorter title for the navigation bar. Default is the same as html_title.
|
||||
#html_short_title = None
|
||||
|
||||
# The name of an image file (relative to this directory) to place at the top
|
||||
# of the sidebar.
|
||||
#html_logo = None
|
||||
|
||||
# The name of an image file (within the static path) to use as favicon of the
|
||||
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
|
||||
# pixels large.
|
||||
#html_favicon = None
|
||||
|
||||
# Add any paths that contain custom static files (such as style sheets) here,
|
||||
# relative to this directory. They are copied after the builtin static files,
|
||||
# so a file named "default.css" will overwrite the builtin "default.css".
|
||||
html_static_path = ['_static']
|
||||
|
||||
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
|
||||
# using the given strftime format.
|
||||
#html_last_updated_fmt = '%b %d, %Y'
|
||||
|
||||
# If true, SmartyPants will be used to convert quotes and dashes to
|
||||
# typographically correct entities.
|
||||
#html_use_smartypants = True
|
||||
|
||||
# Custom sidebar templates, maps document names to template names.
|
||||
#html_sidebars = {}
|
||||
|
||||
# Additional templates that should be rendered to pages, maps page names to
|
||||
# template names.
|
||||
#html_additional_pages = {}
|
||||
|
||||
# If false, no module index is generated.
|
||||
#html_domain_indices = True
|
||||
|
||||
# If false, no index is generated.
|
||||
#html_use_index = True
|
||||
|
||||
# If true, the index is split into individual pages for each letter.
|
||||
#html_split_index = False
|
||||
|
||||
# If true, links to the reST sources are added to the pages.
|
||||
#html_show_sourcelink = True
|
||||
|
||||
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
|
||||
#html_show_sphinx = True
|
||||
|
||||
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
|
||||
#html_show_copyright = True
|
||||
|
||||
# If true, an OpenSearch description file will be output, and all pages will
|
||||
# contain a <link> tag referring to it. The value of this option must be the
|
||||
# base URL from which the finished HTML is served.
|
||||
#html_use_opensearch = ''
|
||||
|
||||
# This is the file name suffix for HTML files (e.g. ".xhtml").
|
||||
#html_file_suffix = None
|
||||
|
||||
# Output file base name for HTML help builder.
|
||||
htmlhelp_basename = 'sampledoc'
|
||||
|
||||
|
||||
# -- Options for LaTeX output --------------------------------------------------
|
||||
|
||||
latex_elements = {
|
||||
# The paper size ('letterpaper' or 'a4paper').
|
||||
#'papersize': 'letterpaper',
|
||||
|
||||
# The font size ('10pt', '11pt' or '12pt').
|
||||
#'pointsize': '10pt',
|
||||
|
||||
# Additional stuff for the LaTeX preamble.
|
||||
#'preamble': '',
|
||||
}
|
||||
|
||||
# Grouping the document tree into LaTeX files. List of tuples
|
||||
# (source start file, target name, title, author, documentclass [howto/manual]).
|
||||
latex_documents = [
|
||||
('index', 'sample.tex', u'sample Documentation',
|
||||
u'Kenneth Reitz', 'manual'),
|
||||
]
|
||||
|
||||
# The name of an image file (relative to this directory) to place at the top of
|
||||
# the title page.
|
||||
#latex_logo = None
|
||||
|
||||
# For "manual" documents, if this is true, then toplevel headings are parts,
|
||||
# not chapters.
|
||||
#latex_use_parts = False
|
||||
|
||||
# If true, show page references after internal links.
|
||||
#latex_show_pagerefs = False
|
||||
|
||||
# If true, show URL addresses after external links.
|
||||
#latex_show_urls = False
|
||||
|
||||
# Documents to append as an appendix to all manuals.
|
||||
#latex_appendices = []
|
||||
|
||||
# If false, no module index is generated.
|
||||
#latex_domain_indices = True
|
||||
|
||||
|
||||
# -- Options for manual page output --------------------------------------------
|
||||
|
||||
# One entry per manual page. List of tuples
|
||||
# (source start file, name, description, authors, manual section).
|
||||
man_pages = [
|
||||
('index', 'sample', u'sample Documentation',
|
||||
[u'Kenneth Reitz'], 1)
|
||||
]
|
||||
|
||||
# If true, show URL addresses after external links.
|
||||
#man_show_urls = False
|
||||
|
||||
|
||||
# -- Options for Texinfo output ------------------------------------------------
|
||||
|
||||
# Grouping the document tree into Texinfo files. List of tuples
|
||||
# (source start file, target name, title, author,
|
||||
# dir menu entry, description, category)
|
||||
texinfo_documents = [
|
||||
('index', 'sample', u'sample Documentation',
|
||||
u'Kenneth Reitz', 'sample', 'One line description of project.',
|
||||
'Miscellaneous'),
|
||||
]
|
||||
|
||||
# Documents to append as an appendix to all manuals.
|
||||
#texinfo_appendices = []
|
||||
|
||||
# If false, no module index is generated.
|
||||
#texinfo_domain_indices = True
|
||||
|
||||
# How to display URL addresses: 'footnote', 'no', or 'inline'.
|
||||
#texinfo_show_urls = 'footnote'
|
||||
@ -1,22 +0,0 @@
|
||||
.. sample documentation master file, created by
|
||||
sphinx-quickstart on Mon Apr 16 21:22:43 2012.
|
||||
You can adapt this file completely to your liking, but it should at least
|
||||
contain the root `toctree` directive.
|
||||
|
||||
欢迎来到 Python 示例项目文档
|
||||
============================
|
||||
|
||||
Contents:
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
|
||||
|
||||
|
||||
Indices and tables
|
||||
==================
|
||||
|
||||
* :ref:`genindex`
|
||||
* :ref:`modindex`
|
||||
* :ref:`search`
|
||||
|
||||
@ -1,190 +0,0 @@
|
||||
@ECHO OFF
|
||||
|
||||
REM Command file for Sphinx documentation
|
||||
|
||||
if "%SPHINXBUILD%" == "" (
|
||||
set SPHINXBUILD=sphinx-build
|
||||
)
|
||||
set BUILDDIR=_build
|
||||
set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% .
|
||||
set I18NSPHINXOPTS=%SPHINXOPTS% .
|
||||
if NOT "%PAPER%" == "" (
|
||||
set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS%
|
||||
set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS%
|
||||
)
|
||||
|
||||
if "%1" == "" goto help
|
||||
|
||||
if "%1" == "help" (
|
||||
:help
|
||||
echo.Please use `make ^<target^>` where ^<target^> is one of
|
||||
echo. html to make standalone HTML files
|
||||
echo. dirhtml to make HTML files named index.html in directories
|
||||
echo. singlehtml to make a single large HTML file
|
||||
echo. pickle to make pickle files
|
||||
echo. json to make JSON files
|
||||
echo. htmlhelp to make HTML files and a HTML help project
|
||||
echo. qthelp to make HTML files and a qthelp project
|
||||
echo. devhelp to make HTML files and a Devhelp project
|
||||
echo. epub to make an epub
|
||||
echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter
|
||||
echo. text to make text files
|
||||
echo. man to make manual pages
|
||||
echo. texinfo to make Texinfo files
|
||||
echo. gettext to make PO message catalogs
|
||||
echo. changes to make an overview over all changed/added/deprecated items
|
||||
echo. linkcheck to check all external links for integrity
|
||||
echo. doctest to run all doctests embedded in the documentation if enabled
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "clean" (
|
||||
for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i
|
||||
del /q /s %BUILDDIR%\*
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "html" (
|
||||
%SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished. The HTML pages are in %BUILDDIR%/html.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "dirhtml" (
|
||||
%SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "singlehtml" (
|
||||
%SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "pickle" (
|
||||
%SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished; now you can process the pickle files.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "json" (
|
||||
%SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished; now you can process the JSON files.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "htmlhelp" (
|
||||
%SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished; now you can run HTML Help Workshop with the ^
|
||||
.hhp project file in %BUILDDIR%/htmlhelp.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "qthelp" (
|
||||
%SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished; now you can run "qcollectiongenerator" with the ^
|
||||
.qhcp project file in %BUILDDIR%/qthelp, like this:
|
||||
echo.^> qcollectiongenerator %BUILDDIR%\qthelp\sample.qhcp
|
||||
echo.To view the help file:
|
||||
echo.^> assistant -collectionFile %BUILDDIR%\qthelp\sample.ghc
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "devhelp" (
|
||||
%SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "epub" (
|
||||
%SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished. The epub file is in %BUILDDIR%/epub.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "latex" (
|
||||
%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished; the LaTeX files are in %BUILDDIR%/latex.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "text" (
|
||||
%SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished. The text files are in %BUILDDIR%/text.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "man" (
|
||||
%SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished. The manual pages are in %BUILDDIR%/man.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "texinfo" (
|
||||
%SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "gettext" (
|
||||
%SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Build finished. The message catalogs are in %BUILDDIR%/locale.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "changes" (
|
||||
%SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.The overview file is in %BUILDDIR%/changes.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "linkcheck" (
|
||||
%SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Link check complete; look for any errors in the above output ^
|
||||
or in %BUILDDIR%/linkcheck/output.txt.
|
||||
goto end
|
||||
)
|
||||
|
||||
if "%1" == "doctest" (
|
||||
%SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest
|
||||
if errorlevel 1 exit /b 1
|
||||
echo.
|
||||
echo.Testing of doctests in the sources finished, look at the ^
|
||||
results in %BUILDDIR%/doctest/output.txt.
|
||||
goto end
|
||||
)
|
||||
|
||||
:end
|
||||
@ -1 +0,0 @@
|
||||
yfinance==0.1.54
|
||||
@ -1,23 +0,0 @@
|
||||
# for n in range(2, 10):
|
||||
# for x in range(2, n):
|
||||
# if n % x == 0:
|
||||
# print(n, 'equals', x, '*', n // x)
|
||||
# break
|
||||
# else:
|
||||
# # loop fell through without finding a factor
|
||||
# print(n, 'is a prime number')
|
||||
#
|
||||
# #
|
||||
# for num in range(2, 10):
|
||||
# if num % 2 == 0:
|
||||
# print("Found an even number", num)
|
||||
# continue
|
||||
# print("Found a number", num)
|
||||
|
||||
# alphabet = ["A", "B", "C"]
|
||||
# for x in alphabet:
|
||||
# print(x)
|
||||
|
||||
strOssez = "ossez.com"
|
||||
for x in strOssez:
|
||||
print(x)
|
||||
@ -1 +0,0 @@
|
||||
from .core import hmm
|
||||
@ -1,12 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from . import helpers
|
||||
|
||||
def get_hmm():
|
||||
"""Get a thought."""
|
||||
return 'hmmm...'
|
||||
|
||||
|
||||
def hmm():
|
||||
"""Contemplation..."""
|
||||
if helpers.get_answer():
|
||||
print(get_hmm())
|
||||
@ -1,7 +0,0 @@
|
||||
def get_answer():
|
||||
"""Get an answer."""
|
||||
|
||||
return True
|
||||
|
||||
|
||||
print("Hello Python")
|
||||
@ -1,25 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Learn more: https://github.com/kennethreitz/setup.py
|
||||
|
||||
from setuptools import setup, find_packages
|
||||
|
||||
|
||||
with open('README.rst') as f:
|
||||
readme = f.read()
|
||||
|
||||
with open('LICENSE') as f:
|
||||
license = f.read()
|
||||
|
||||
setup(
|
||||
name='sample',
|
||||
version='0.1.0',
|
||||
description='Sample Package Python Tutorials',
|
||||
long_description=readme,
|
||||
author='Kenneth Reitz',
|
||||
author_email='me@kennethreitz.com',
|
||||
url='https://github.com/kennethreitz/samplemod',
|
||||
license=license,
|
||||
packages=find_packages(exclude=('tests', 'docs'))
|
||||
)
|
||||
|
||||
@ -1,7 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import sys
|
||||
import os
|
||||
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
|
||||
|
||||
import sample
|
||||
@ -1,16 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from .context import sample
|
||||
|
||||
import unittest
|
||||
|
||||
|
||||
class AdvancedTestSuite(unittest.TestCase):
|
||||
"""Advanced test cases."""
|
||||
|
||||
def test_thoughts(self):
|
||||
self.assertIsNone(sample.hmm())
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
@ -1,16 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from .context import sample
|
||||
|
||||
import unittest
|
||||
|
||||
|
||||
class BasicTestSuite(unittest.TestCase):
|
||||
"""Basic test cases."""
|
||||
|
||||
def test_absolute_truth_and_meaning(self):
|
||||
assert True
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
@ -1,16 +0,0 @@
|
||||
from decimal import Decimal, ROUND_HALF_UP, Context
|
||||
|
||||
import yfinance as yf
|
||||
|
||||
msft = yf.Ticker("MSFT")
|
||||
msft.info
|
||||
|
||||
print(msft.dividends)
|
||||
|
||||
# print(round(2.3, 2))
|
||||
# print(round(2.45, 1))
|
||||
# print(round(2.675, 2))
|
||||
#
|
||||
# print(Decimal(1.325))
|
||||
#
|
||||
# print(Context(prec=3, rounding=ROUND_HALF_UP).create_decimal('2.675'))
|
||||