108 lines
2.9 KiB
Markdown
108 lines
2.9 KiB
Markdown
# dicom-iso
|
|
|
|
This repo is a Go service for downloading DICOM studies from PACS, building ISO files, and relaying studies to a CD publisher.
|
|
|
|
It replaces the old PHP scripts, which are now kept in `legacy/` only for reference.
|
|
|
|
## What is in the repo
|
|
- `main.go` and `internal/`: the Go application
|
|
- `pkg/`: lower-level helpers
|
|
- `config.example.yaml`: config template
|
|
- `docs/`: project notes
|
|
- `legacy/`: old PHP scripts and raw reference files
|
|
|
|
## Important constraints
|
|
- no secrets in the repo
|
|
- no outbound internet in the build environment
|
|
- restricted package sources
|
|
|
|
## Runtime dependencies
|
|
The service needs:
|
|
- DCMTK binaries
|
|
- PACS access
|
|
- patient API access
|
|
- CD publisher access
|
|
- MicroDicom files
|
|
- writable temp storage
|
|
|
|
Large runtime assets are intentionally not stored in git.
|
|
Use the setup scripts in `scripts/` to stage local copies in ignored directories.
|
|
|
|
## Setup
|
|
Before running the service, make sure the VM has:
|
|
- Go installed, if you are building on that machine
|
|
- DCMTK binaries available
|
|
- MicroDicom files in a real directory
|
|
- network access to PACS, the patient API, and the CD publisher
|
|
- a writable temp directory
|
|
|
|
Stage local runtime assets if needed:
|
|
|
|
```bash
|
|
scripts/setup-dcmtk.sh --source-dir /path/to/dcmtk/bin
|
|
scripts/setup-microdicom.sh --source-dir /path/to/microdicom
|
|
```
|
|
|
|
Or download your hosted release assets directly:
|
|
|
|
```bash
|
|
scripts/setup-dcmtk.sh --archive-url https://<gitea-host>/<owner>/<repo>/releases/download/<tag>/dcmtk-bin.tar.gz
|
|
scripts/setup-microdicom.sh --archive-url https://<gitea-host>/<owner>/<repo>/releases/download/<tag>/microdicom.zip
|
|
```
|
|
|
|
Example:
|
|
|
|
```bash
|
|
scripts/setup-dcmtk.sh --archive-url https://devone.aplikasi.web.id/gitea/farrel/dicom-iso/releases/download/1/dcmtk-bin.tar.gz
|
|
scripts/setup-microdicom.sh --archive-url https://devone.aplikasi.web.id/gitea/farrel/dicom-iso/releases/download/1/microdicom.zip
|
|
```
|
|
|
|
Create a local config file from the template:
|
|
|
|
```bash
|
|
cp config.example.yaml config.yaml
|
|
```
|
|
|
|
Then adjust the paths, hosts, ports, and tokens for your environment.
|
|
For local staging via the setup scripts, point config at `.local/dcmtk-bin/` and `.local/microdicom/`.
|
|
|
|
## Build
|
|
A normal Go build is enough in a friendly environment:
|
|
|
|
```bash
|
|
go build -o mkiso-server .
|
|
```
|
|
|
|
In production, the build must follow your approved offline package path.
|
|
This repo should not depend on live public downloads during a restricted build.
|
|
|
|
## Run
|
|
You can run the service directly:
|
|
|
|
```bash
|
|
./mkiso-server
|
|
```
|
|
|
|
Or pass a config path explicitly:
|
|
|
|
```bash
|
|
./mkiso-server /path/to/config.yaml
|
|
```
|
|
|
|
By default, the app looks for `./config.yaml`.
|
|
|
|
## Health check
|
|
After startup, check:
|
|
|
|
```bash
|
|
curl http://127.0.0.1:8080/api/health
|
|
```
|
|
|
|
## Config
|
|
Use `config.example.yaml` as the starting point.
|
|
Keep real `config.yaml` local and untracked.
|
|
|
|
## More notes
|
|
- VM deployment: `docs/deployment-vm.md`
|
|
- nginx example: `docs/reverse-proxy-nginx.md`
|