• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

openthc/api: Proposal for Common Data Models and APIs for Cannabis Software

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

openthc/api

开源软件地址:

https://github.com/openthc/api

开源编程语言:

PHP 65.8%

开源软件介绍:

OpenTHC Common API

Provides a common reference and API end-point specification for implementing Cannabis Data Systems.

The world of cannabis regulatory compliance is complex and large. There are hundreds of vendors, each with a common goal but without an API, partial API, or have implemented a unique flavor. The goal of this interface is to provide a basis for data interoperability.

It's our hope that others in the cannabis industry could adopt, in whole or in part, some of the concepts and designs published here. Open Issues, submit PRs, etc and we can build the future we all want to see.

A Common Data Model

An important first step for bringing the industry together is to start talking in with common terms, a second is a common interface.

The OpenTHC API Specification aims to define core parts of this data model and suggested interfaces. The API and data-models are defined in the openapi directory. There are definitions of base-data (ie: lab-metric-type, product-type in etc. Both are defined with YAML.

Some scripts for processing that YAML into other flavours (JSON, CSV, SQL) are in bin. But, YAML is so easy, one can quickly process with their preferred tools.

A Common Interface

The OpenTHC API Module provides a method for reading/writing to a compatible system. A set of standard base data models for objects in the cannabis industry.

This API was heavily influenced by the Open API Initiative and the Data Transfer Project

We provide some base data examples and JSON schema.

Documentation

The documentation has been created using a combination of Asciidoc and OpenAPI.

Asciidoc is in doc and the OpenAPI sources are in openapi

./make.sh docs

JSON Schema

A JSON Schema is published for all the objects in this system, they are located in ./webroot/pub/json-schema These files are constructed from the YAML documentation in ./swagger Sample objects are provided in ./json-sample

./make.sh docs-openapi

Core Data

There is a bunch of "core" data for this industry, Company, Company_Type, License, License_Type, Product_Type, Variety and Laboratory Metrics. Included in the ./etc directory are pre-populated yaml files describing these common objects. Usage of common, unique identifiers for data-fields we all care about will improve interoperablity.

System Data

In the Core data there is a subset of System data, the Company, Contact, License, License_Type and Product_Type and Lab_Metric records.

License Configuration Data

These objects are defined and specific to each Company or License in the system. Includes: Product, Variety, Section, Vehicle (although, Section and Vehicle only exist for backwards compatibility)

License Operational Data

  • Crop / Plant
  • Inventory Lot
  • Lab Sample / Lab Result

Testing

Run the unit tests in ./test

./make.sh test

You could also use Prism for running a mock interface.

Dependencies

This thing depends on Asciidoc/Asciidoctor (Python, Ruby) and some build scripts (JS, PHP, Ruby). Just review the make.sh script for the latest information.

See Also




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap