Skip to content

Commit

Permalink
fix: #6
Browse files Browse the repository at this point in the history
- Update `study.modality` and `dicomJson.00080061`
after storing the instance to Mongodb
- Fix the `ImagingStudy.modality` type
> The type is array of codingSchema
- Fix the `ImgagingStudy.endpoint` type
> The type is array of refSchema
> The line 453 in `postSTOW.js`
- Remove read value of 00080061 and set `study.modality`
in `DICOM2FHIRImagingStudy.js` file
> The 00080061 may not present in DICOM instance,
> it is calculate from DB and use for querying
- Remove calculate modalities in study when querying
> The value modalities in study is updated post storing
> It already in DB,
> we can send objects directly without calculating modalities in study
  • Loading branch information
Chinlinlee committed May 18, 2022
1 parent 35ad7c9 commit ba3a620
Show file tree
Hide file tree
Showing 4 changed files with 410 additions and 224 deletions.
30 changes: 1 addition & 29 deletions api/dicom-web/controller/qido-rs.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,35 +89,7 @@ async function getStudyDicomJson(iQuery , iParam = "" , limit , skip) {
let docs = await mongoFunc.findFilterFields('ImagingStudy', iQuery, retStudyLevel, limit, skip);
let retDocs = [];
for (let i = 0; i < docs.length; i++) {
let dicomJsonItem = docs[i]._doc.dicomJson;
let modalitiesInStudyDoc = await mongodb.dicomMetadata.aggregate([
{
$match :
{
studyUID: dicomJsonItem["0020000D"].Value[0]
}
},
{
$unwind: "$00080060.Value"
},
{
$group: {
_id : "$studyUID",
modalitiesInStudy:
{
$addToSet: "$00080060.Value"
}
}
}
]);
if (modalitiesInStudyDoc.length > 0 ) {
let modalitiesInStudy = {
vr: "CS" ,
Value: [...modalitiesInStudyDoc[0].modalitiesInStudy]
}
_.set(dicomJsonItem, "00080061", modalitiesInStudy);
}
retDocs.push(dicomJsonItem);
retDocs.push(docs[i]._doc.dicomJson);
}
result.data = retDocs;
result.status = true;
Expand Down
Loading

0 comments on commit ba3a620

Please sign in to comment.