Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create architecture diagram for the trigger-code-reference #2334

Merged
merged 4 commits into from
Aug 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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:/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
Loading