kemenkesri / satusehat-mediator-client-php
通过互操作中介加速 SATUSEHAT 实现的库
v1.0.1
2024-09-04 04:48 UTC
Requires
- php: ^5.5 || ^7.4 || ^8.0
- ext-curl: *
- ext-json: *
- ext-mbstring: *
- dcarbone/php-fhir-generated: ^2.0 || ^3.0
- guzzlehttp/guzzle: ^6.5
- guzzlehttp/psr7: ^1.7 || ^2.0
- kamermans/guzzle-oauth2-subscriber: ^1.0 || ^1.1
Requires (Dev)
- brainmaestro/composer-git-hooks: ^2.8 || ^3.0
- friendsofphp/php-cs-fixer: ^2.19 || ^3.5
- laravel/tinker: ^1.0 || ^2.9
- phpunit/phpunit: ^5.7 || ^8.0 || ^9.0
- dev-main
- v1.0.1
- v1.0.0
- dev-feat/adjustment-mediator-form
- dev-feat/tb-fase234
- dev-main-5.6
- dev-feat/hardcoded-generate-token
- dev-feat/fhir-service-request
- dev-feat/fhir-resource-api
- dev-feat/create-permohonan
- dev-feat/mediator-form
- dev-release
- dev-fix/submit-response
- dev-initial-commit
- dev-feat/send-data-to-mediator
This package is auto-updated.
Last update: 2024-09-04 15:42:53 UTC
README
此 API 的规格是使用 SATUSEHAT 互操作中介 的示例,专门用于加快和简化电子病历(RME)数据在卫生信息系统(医院、社区卫生服务中心、诊所、实验室等)与 SATUSEHAT 平台之间的互操作性过程。SATUSEHAT 互操作中介提供了从 HL7 FHIR 格式简化而来的自定义格式,作为 RME 系统与 SATUSEHAT 以及国家级卫生信息系统之间的中介。
此 PHP 包由 Swagger Codegen 项目自动生成
要求
PHP 7.4 及以上
安装与使用
Composer
要使用 Composer 安装绑定,请将以下内容添加到 composer.json
{
"repositories": [
{
"type": "git",
"url": "https://github.com/kemenkesri/satusehat-mediator-client-php.git"
}
],
"require": {
"kemenkesri/satusehat-mediator-client-php": "*@dev"
}
}
然后运行 composer install
手动安装
下载文件并包含 autoload.php
require_once('/path/to/satusehat-mediator-client-php/vendor/autoload.php');
测试
要运行单元测试
composer install
./vendor/bin/phpunit
入门指南
请遵循 安装过程,然后运行以下命令
获取患者信息
<?php use Mediator\SatuSehat\Lib\Client\Api\PatientApi; use Mediator\SatuSehat\Lib\Client\Configuration; use Mediator\SatuSehat\Lib\Client\Model\GetPatientRequest; use Mediator\SatuSehat\Lib\Client\OAuthClient; require_once(__DIR__ . '/vendor/autoload.php'); $bearerToken = 'ABCD'; Configuration::setConfigurationConstant( 'development', [ 'authUrl' => 'https://api-satusehat-stg.dto.kemkes.go.id/oauth2/v1/accesstoken', 'tokenUrl' => 'https://api-satusehat-stg.dto.kemkes.go.id/oauth2/v1/refreshtoken', 'baseUrl' => 'https://mediator-satusehat.kemkes.go.id/api-dev/satusehat/rme/v1.0', // 'clientId' => $clientId, // 'clientSecret' => $clientSecret, 'bearerToken' => $bearerToken, ] ); $apiInstance = new PatientApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. // This is optional, `GuzzleHttp\Client` will be used as default. new OAuthClient(Configuration::getDefaultConfiguration('development')) ); $body = new GetPatientRequest(); try { $result = $apiInstance->patientPost($body); print_r($result); } catch (Exception $e) { echo 'Exception when calling PatientApi->patientPost: ', $e->getMessage(), PHP_EOL; } ?>
提交 RME 数据
<?php use Mediator\SatuSehat\Lib\Client\Api\SubmitDataApi; use Mediator\SatuSehat\Lib\Client\Configuration; use Mediator\SatuSehat\Lib\Client\Model\SubmitRequest; use Mediator\SatuSehat\Lib\Client\OAuthClient; require_once(__DIR__ . '/vendor/autoload.php'); $bearerToken = 'ABCD'; Configuration::setConfigurationConstant( 'development', [ 'authUrl' => 'https://api-satusehat-stg.dto.kemkes.go.id/oauth2/v1/accesstoken', 'tokenUrl' => 'https://api-satusehat-stg.dto.kemkes.go.id/oauth2/v1/refreshtoken', 'baseUrl' => 'https://mediator-satusehat.kemkes.go.id/api-dev/satusehat/rme/v1.0', // 'clientId' => $clientId, // 'clientSecret' => $clientSecret, 'bearerToken' => $bearerToken, ] ); $apiInstance = new Mediator\SatuSehat\Lib\Client\Api\SubmitDataApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. // This is optional, `GuzzleHttp\Client` will be used as default. new OAuthClient(Configuration::getDefaultConfiguration('development')) ); $body = new SubmitRequest( "profile" => [ "TB" ], "organization_id" => "100011961", "location_id" => "ef011065-38c9-46f8-9c35-d1fe68966a3e", "practitioner_nik" => "N10000001", "patient" => [ "nik" => "3515120000000000", "name" => "ABCD", "birthDate" => "2019-10-25", "address" => [ [ "use" => "temp", // temp = alamat domisili, home = alamat ktp "country" => "id", "province" => "35", // kode depdagri 2 digit untuk provinsi "city" => "3578", // kode depdagri 4 digit untuk kab/kota "district" => "357801", // kode depdagri 6 digit untuk kecamatan "village" => "3578011002", // kode depdagri 10 digit untuk kelurahan/desa "rt" => "", "rw" => "", "postal_code" => "-", "line" => ["alamat jalan dan informasi lainnya"] ] ], ], "tb_suspect" => [ "tgl_daftar" => "2024-05-24", "asal_rujukan_id" => "3", "fasyankes_id" => "1000119617", "jenis_fasyankes_id" => "1", "terduga_tb_id" => "1", "terduga_ro_id" => null, "tipe_pasien_id" => "1", "status_dm_id" => "1", "status_hiv_id" => "3" ], "encounter" => [ "encounter_id" => "83ef7e32-64f3-40a7-87c4-3cc59d44b4c6", "local_id" => "2024-05-24 09:27:26.405593+07", "classification" => "AMB", "period_start" => "2024-05-24T09:28:01+07:00", "period_in_progress" => "2024-05-24T09:58:01+07:00", "period_end" => "2024-05-24T10:58:01+07:00" ], "condition" => [ [ "id" => "2a073abe-1b17-441d-885c-206e8b966f5c", "code_condition" => "Z10" ] ] ); try { $result = $apiInstance->syncPost($body); print_r($result); } catch (Exception $e) { echo 'Exception when calling SubmitDataApi->syncPost: ', $e->getMessage(), PHP_EOL; } ?>
API 端点文档
所有 URI 都相对于 https://mediator-satusehat.kemkes.go.id/api-dev/satusehat/rme/v1.0
模型文档
- ApiError
- CarePlan
- Composition
- Condition
- DiagnosticReport
- DocumentStatus
- Encounter
- EpisodeOfCare
- GetPatientRequest
- GetPatientResponse
- Immunization
- Location
- MediatorResourceBasic
- Medication
- MedicationIngredient
- MedicationStatement
- Observation
- ObservationComponent
- Patient
- PatientBasic
- Procedure
- QuestionnaireResponse
- SatuSehatResponse
- ServiceRequest
- Specimen
- SubmitRequest
- SubmitResponse
- TbConfirm
- TbSuspect
授权文档
satusehat_auth
- 类型: OAuth
- 流程: accessCode
- 授权 URL: https://api-satusehat-stg.dto.kemkes.go.id/oauth2/v1
- 作用域:
satusehat_bearer
- 类型: HTTP Bearer 认证