Skip to content

Commit

Permalink
fix: cannot store DICOM file that missing date
Browse files Browse the repository at this point in the history
- Default set to Date.now() is incorrect that can not
cast to ISO date format
- Using moment to create date of now
  • Loading branch information
Chinlinlee committed Jun 29, 2022
1 parent 2fb8983 commit 489631e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions api/dicom-web/stow/controller/postSTOW.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,8 @@ async function convertDICOMFileToJSONModule(filename) {
started_date =
dcm2jsonV8.dcmString(dicomJson, "00080020") +
dcm2jsonV8.dcmString(dicomJson, "00080030");
if (!started_date) started_date = Date.now();
started_date = moment(started_date, "YYYYMMDDhhmmss").toISOString();
if (!started_date) started_date = moment().toISOString();
else started_date = moment(started_date, "YYYYMMDDhhmmss").toISOString();
let started_date_split = started_date.split("-");
let year = started_date_split[0];
let month = started_date_split[1];
Expand Down

0 comments on commit 489631e

Please sign in to comment.