Skip to content

Commit

Permalink
Create architecture diagram for the trigger-code-reference (#2334)
Browse files Browse the repository at this point in the history
* use json array form to solve buildx warning about shell interpretation and OS signal handling

* move description -> README; container build/tests passed locally

* add tcr arc diagram
  • Loading branch information
robertmitchellv authored Aug 7, 2024
1 parent c021ebd commit dc43eec
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 8 deletions.
4 changes: 2 additions & 2 deletions containers/trigger-code-reference/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ RUN pip install -r requirements.txt
COPY ./app /code/app
COPY ./assets /code/assets
COPY ./seed-scripts /code/seed-scripts
COPY ./description.md /code/description.md
COPY ./README.md /code/README.md

EXPOSE 8080
CMD uvicorn app.main:app --host 0.0.0.0 --port 8080
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8080"]
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
## Getting Started with the DIBBs Trigger Code Reference Service
## Getting Started with the DIBBs Trigger Code Reference Service

### Introduction

The DIBBs Trigger Code Reference (TCR) service offers a REST API devoted to querying and enriching SNOMED condition code analysis. This service stores condition codes and their associated value sets, which users can query and insert into supplied FHIR bundles as tagged extensions for future path parsing.

### Running the Trigger Code Reference Service

You can run the TCR using Docker. another OCI container runtime (e.g., Podman), or directly from the Python source code.
You can run the TCR using Docker. another OCI container runtime (e.g., Podman), or directly from the Python source code.

#### Running with Docker (Recommended)

To run the trigger code reference with Docker, follow these steps.

1. Confirm that you have Docker installed by running docker -v. If you don't see a response similar to what's shown below, follow [these instructions](https://docs.docker.com/get-docker/) to install Docker.
1. Confirm that you have Docker installed by running docker -v. If you don't see a response similar to what's shown below, follow [these instructions](https://docs.docker.com/get-docker/) to install Docker.

```
❯ docker -v
Expand All @@ -26,7 +26,7 @@ Congratulations, the TCR should now be running on `localhost:8080`!

#### Running from Python Source Code

We recommend running the TCR from a container, but if that isn't feasible for a given use case, you can also run the service directly from Python using the steps below.
We recommend running the TCR from a container, but if that isn't feasible for a given use case, you can also run the service directly from Python using the steps below.

1. Ensure that both Git and Python 3.10 or higher are installed.
2. Clone the PHDI repository with `git clone https://github.com/CDCgov/phdi`.
Expand All @@ -47,4 +47,42 @@ To build the Docker image for the trigger code reference from source instead of

### The API

When viewing these docs from the `/redoc` endpoint on a running instance of the TCR or the DIBBs website, detailed documentation on the API will be available below.
When viewing these docs from the `/redoc` endpoint on a running instance of the TCR or the DIBBs website, detailed documentation on the API will be available below.

### Architecture Diagram

```mermaid
flowchart LR
subgraph requests["Requests"]
direction TB
subgraph GET["fas:fa-download <code>GET</code>"]
hc["<code>/</code>\n(Health Check)"]
getValueSets["<code>/get-value-sets</code>\n(Get Value Sets for Condition)"]
end
subgraph POST["fas:fa-upload <code>POST</code>"]
stampConditionExtensions["<code>/stamp-condition-extensions</code>\n(Stamp Condition Extensions)"]
end
end
subgraph service[REST API Service]
direction TB
subgraph container["fab:fa-docker container"]
tcr["fab:fa-python <code>trigger-code-reference<br>HTTP:8080/</code>"]
db["fas:fa-database SQLite DB"]
end
end
subgraph response["Responses"]
subgraph JSON["fa:fa-file-alt <code>JSON</code>"]
rsp-hc["fa:fa-file-code <code>OK</code> fa:fa-thumbs-up"]
rsp-getValueSets["fa:fa-file-code Value Sets"]
rsp-stampConditionExtensions["fa:fa-file-code Stamped Bundle"]
end
end
hc -.-> tcr -.-> rsp-hc
getValueSets -.-> tcr -.-> rsp-getValueSets
stampConditionExtensions ==> tcr ==> rsp-stampConditionExtensions
tcr --> db
```
2 changes: 1 addition & 1 deletion containers/trigger-code-reference/app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
app = BaseService(
service_name="Trigger Code Reference",
service_path="/trigger-code-reference",
description_path=Path(__file__).parent.parent / "description.md",
description_path=Path(__file__).parent.parent / "README.md",
openapi_url="/trigger-code-reference/openapi.json",
).start()

Expand Down

0 comments on commit dc43eec

Please sign in to comment.