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
- Golang (>1.13)
- Clone the project
git clone https://github.com/adithya/pockethealth.git
- Run the project
go run main.go
- Verify API is running
Endpoint GET /GetVersion
Request:
curl --request GET \
--url http://localhost:8080/GetVersion
Response:
0.1
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.
Endpoint POST /dicom
Request:
curl --request POST \
--header 'content-type: multipart/form-data' \
-F [email protected] \
--url http://localhost:8080/dicom
Response:
0c4be1b0-4f0b-40ca-8d9c-5a141860b652
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.
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]
- 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