VaccinationProfile PHP Client
This page describes how to use the vaccination-profile PHP library to work with the VaccinationProfile nomenclature.
The nomenclature overview is available here: Overview.
Library Capabilities
The vaccination-profile library lets you:
- retrieve a health condition nomenclature that can influence vaccination recommendations;
- display a health profile entry form;
- encode and display a health profile.
Prerequisites
- The Composer tool must be installed;
- An authentication token must be provided by Syadem (contact developers@mesvaccins.net to obtain an authentication token);
- PHP 7.4 or later.
Usage
Initialization
You must first initialize the library. During initialization, the latest version of the nomenclature is downloaded.
$vaccination_profile = Syadem\VaccinationProfile\Container::init();
This operation is expensive and should be done only once. Keep the library instance in a global cache.
Displaying a Health Profile Condition
$nuva = Syadem\VaccinationProfile\Container::init();
echo $nuva->getConditions()->find("2427485e-907c-4241-83c8-939237010ca2")->getName->getEn();
// => Immunocompromised person in the patient's entourage
Installation
To install the vaccination-profile library, first add the Syadem repository to composer.json. The repository URL is provided by Syadem.
composer config repositories.syadem composer \
<SYADEM_COMPOSER_REPOSITORY_URL>
Then configure your authentication token:
composer config gitlab-token.gitlab.mesvaccins.net <username> <token>
Finally, install the library:
composer require syadem/vaccination-profile