-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- The sync fhir is part of the plugin and is not within the scope of dicom - so we move it to plugin folder
- Loading branch information
1 parent
071ad0e
commit d3c0045
Showing
9 changed files
with
92 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 20 additions & 9 deletions
29
...ler/STOW-RS/service/dicom-fhir.service.js → ...ns/syncToFhirServer/dicom-fhir.service.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
require("./mongoose/syncFHIRLog"); | ||
const path = require("path"); | ||
const fs = require("fs"); | ||
const { DicomFhirService } = require("./dicom-fhir.service"); | ||
let pluginConfigFile = path.join(__dirname, "../config.template.js"); | ||
|
||
if (fs.existsSync(path.join(__dirname, "../config.js"))) pluginConfigFile = path.join(__dirname, "../config.js"); | ||
|
||
const { pluginsConfig } = require(pluginConfigFile); | ||
|
||
/** | ||
* | ||
* @param {import("express").Request} req | ||
* @param {import("express").Response} res | ||
* @returns | ||
*/ | ||
module.exports = async function (req, res) { | ||
if (!pluginsConfig?.syncToFhirServer?.enable) return; | ||
|
||
setImmediate(async () => { | ||
for (let i = 0; i < res.locals.storeInfos.length; i++) { | ||
/** @type { import("./storeInfo").StoreInfo } */ | ||
let storeInfo = res.locals.storeInfos[i]; | ||
let dicomFhirService = new DicomFhirService(req, storeInfo.dicomJsonModel); | ||
await dicomFhirService.initDicomFhirConverter(); | ||
await dicomFhirService.postDicomToFhirServerAndStoreLog(); | ||
} | ||
}); | ||
|
||
}; |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import type { DicomJsonModel } from "@models/DICOM/dicom-json-model" | ||
import type { DicomFileSaveInfo } from "@root/utils/typeDef/STOW-RS/STOW-RS" | ||
|
||
export type StoreInfo = { | ||
dicomFileSaveInfo: DicomFileSaveInfo, | ||
dicomJsonModel: DicomJsonModel | ||
} |