定制 druc/xdt-parser 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

druc/xdt-parser

Composer 安装命令:

composer require druc/xdt-parser

包简介

Parse German healthcare data interchange formats GDT, LDT and BDT

README 文档

README

Latest Version on Packagist Software License Build Status Coverage Status Quality Score Total Downloads

Php parser for German healthcare data interchange formats GDT, LDT and BDT.

Install

Via Composer

$ composer require druc/xdt-parser

Usage

<?php
use Druc\XdtParser\XdtParser;

// Create instance
$this->parser = XdtParser::make(
    file_get_contents(__DIR__ . '/data/sample.ldt'), // file contents 
    ['id' => '8316', 'observation' => '6220'] // field mapping
);

// Get first value matching the id field
$this->parser->first('id'); // --> '123'

// Get all values matching the observation field
$this->parser->find('observation'); // --> ['observation 1', 'observation 2'];

// Also works with the xdt code
$this->parser->first('8316'); // --> '123'
$this->parser->find('6220'); // --> ['observation 1', 'observation 2'];

// Get mapped values
$this->parser->getMapped(); // -> ['id' => 123, 'observation' => ['observation 1', 'observation 2']];

// Add extra field mapping
$this->parser->addFieldsMap(['my_value' => '3213']);

// Remove fields
$this->parser->removeFields(['id']);

// Get all values (mapped and unkown/unmapped values)
$this->parser->all(); // -> ['3213' => 'unkown code value', 'id' => 123, 'observation' => ['observation 1', 'observation 2']];

// Get field key
$this->parser->getKey('observation'); // -> 6220 if the mapping contains 'observation' => '6220'

// Get field name
$this->parser->getFieldName('6220'); // -> `observation` if the mapping contains 'observation' => '6220'

// Get xdtRows
$this->parser->getXdtRows(); // will return an array with the unparsed rows of your content: ['0346220Dies ist ein zweizeiliger', '0143102Frank']

// Parse single string
$this->parser->parseSingle('0346220Dies ist ein zweizeiliger'); // -> ['length' => 32, field = '6220', 'value' => 'Dies ist ein zweizeiliger'];

Change log

Please see CHANGELOG for more information on what has changed recently.

Testing

$ composer test

Contributing

Please see CONTRIBUTING and CODE_OF_CONDUCT for details.

Security

If you discover any security related issues, please email druc@pinsmile.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 346
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 7
  • 点击次数: 4
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 7
  • Watchers: 2
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-09-03

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固