wcia-analytes-tool
Consumes OpenTHC Lab Metrics and WCIA Analytes, and produces diff objects and docs for use in WA State interop.
version 0.9.8
Getting Started
Prep
-
Load the storage area with the OpenTHC Lab Metrics.
Clone the https://github.com/openthc/api.git repository and copy itsetc/lab-metric
folder to this repository'sstorage/
folder (i.e.,storage/lab-metric
). -
Load the storage area with the WCIA analytes json files. Clone the https://github.com/conflabs/wcia-analytes.git repository and copy its
json/
folder to this repository'sstorage/
folder (i.e.,storage/json
). -
From the CLI, run
php makeOpenTHCResource.php
to create the OpenTHC Json Resource.
It is saved to the storage dir.
Find Missing OpenTHC Lab Metrics
From the CLI, run php makeNotInWciaList.php
to create a list of OpenTHC lab metrics that are not in the WCIA list.
Convert Missing OpenTHC Lab Metrics to WCIA Analytes
From the CLI, run php makeNewWciaAnalytes.php
to create a list of new WCIA analytes from the OpenTHC lab metrics list.
Find Missing WCIA Analytes
From the CLI, run php makeNotInOpenThcList.php
to create a list of WCIA analytes that are not in the OpenTHC list.
Convert Missing WCIA Analytes to OpenTHC Lab Metrics
From the CLI, run php makeNewOpenThcLabMetrics.php
to create a list of new OpenTHC stubs from the WCIA analytes list.
Create Documents
From the CLI, run php makeMarkDown.php
to create a series of mark down docs in the storage/docs
folder.
Unit Tests
The tests/
folder is a reflection of the src/
folder, but containing Unit Test classes. Run the unit tests from the CLI, like so: php vendor/bin/phpunit tests/
.
Static Analysis
This project uses PHPStan for static analysis, and at a default level of 5
. Run the analyser from the CLI like so, vendor/bin/phpstan analyse --level 5 src
.
Docker
For simple, reproducible server environments, I've included a Dockerfile for creating a quick CLI environment with which to run these scripts.
Docker Build
docker build -f Dockerfile -t wcia/analytes-generator:latest .
Docker Run CLI
docker run -it --rm -v $PWD:/srv wcia/analytes-generator:latest bash
Docker Run Unit Tests
docker run -it --rm -v $PWD:/srv wcia/analytes-generator:latest php vendor/bin/phpunit tests/
Docker Run Static Analysis
docker run -it --rm -v $PWD:/srv wcia/analytes-generator:latest vendor/bin/phpstan analyse --level 5 src