Skip to content

adithya/pockethealth

Repository files navigation

PocketHealth Back-End Challange

Overview

As described in the challenge instruction, this project exposes an API that allows users to perform three actions:

  • Upload DICOM Files
  • Retrieve DICOM Header Attributes based on DICOM tags
  • Convert DICOM files into a PNG

Development

Required Dependencies

Getting Started

  1. Clone the project
git clone https://github.com/adithya/pockethealth.git
  1. Run the project
go run main.go
  1. Verify API is running

Endpoint GET /GetVersion

Request:

curl --request GET \
  --url http://localhost:8080/GetVersion

Response:

0.1

API Docs

You choose to run the API calls through the command line, or using the repo's Insomnia collection.

After uploading the image using the POST endpoint, you will recieve a GUID in response, this GUID is the {id} that is used for subsequent API requests.

Upload a DICOM File

Endpoint POST /dicom

Request:

curl --request POST \
  --header 'content-type: multipart/form-data' \
  -F dicomFile=@0001.dcm \
  --url http://localhost:8080/dicom

Response:

0c4be1b0-4f0b-40ca-8d9c-5a141860b652

Get a PNG for a DICOM File

Endpoint GET /dicom/{id}/image?format=png

Request:

curl --request GET \
  --url "http://localhost:8080/dicom/0c4be1b0-4f0b-40ca-8d9c-5a141860b652/image?format=png" \
  --output file.png

Response:

PNG image that will look similar to this:

Note There is a known issue with the github.com/suyashkumar/dicom library that causes the PNG images to appear as black on MacOS. You may need to open the image in preview and go to Tools -> Adjust Color and play around with the sliders to see the actual image contents.

Get a DICOM Header Attribute for DICOM file based on header tag

Endpoint GET /dicom/{id}/headerAttribute?tag=(0010,0010)

Request:

curl --request GET \
  --url "http://localhost:8080/dicom/0c4be1b0-4f0b-40ca-8d9c-5a141860b652/headerAttribute?tag=(0010,0010)"

Response:

[NAYYAR^HARSH]

Next Steps

  • Implement workaround to resolve issue with github.com/suyashkumar/dicom library that makes valid PNGs to appear as a completely black image
  • Implement real object storage
  • Add users and access control to ensure users can only access their own dicom files
  • Add better error logging and monitoring

About

PocketHealth Back-End Challange

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages