Skip to content

Commit

Permalink
fix: replace http to config FHIRSERVER_HTTP
Browse files Browse the repository at this point in the history
fix: add FHIRSERVER_HTTP in config to prevent 301
  • Loading branch information
Chinlinlee committed Oct 5, 2021
1 parent f999810 commit 6a38ccc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
8 changes: 6 additions & 2 deletions api/dicom-web/stow/controller/postSTOW.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,12 @@ async function dicom2FHIR(data) {

async function dicomEndpoint2MongoDB(data) {
return new Promise((resolve, reject) => {
let port = process.env.FHIRSERVER_PORT || "";
port = (port) ? `:${port}` : "";
let options =
{
method: "PUT",
url: `http://${process.env.FHIRSERVER_HOST}:${process.env.SERVER_PORT}/api/fhir/Endpoint/${data.id}`,
url: `${process.env.FHIRSERVER_HTTP}://${process.env.FHIRSERVER_HOST}${port}/api/fhir/Endpoint/${data.id}`,
json: true,
body: data
}
Expand All @@ -65,9 +67,11 @@ async function dicomEndpoint2MongoDB(data) {

async function dicomPatient2MongoDB(data) {
return new Promise(async (resolve) => {
let port = process.env.FHIRSERVER_PORT || "";
port = (port) ? `:${port}` : "";
let patient = DCM2Patient.DCMJson2Patient(data);
let Insert_Patient_options = {
url: `http://${process.env.FHIRSERVER_HOST}:${process.env.SERVER_PORT}/api/fhir/Patient/${patient.id}`,
url: `${process.env.FHIRSERVER_HTTP}://${process.env.FHIRSERVER_HOST}${port}/api/fhir/Patient/${patient.id}`,
method: "PUT",
json: true,
body: patient
Expand Down
1 change: 1 addition & 0 deletions build_raccoon/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ DICOMWEB_HOST = "localhost"
DICOMWEB_PORT = 80
DICOMWEB_API = "dicom-web"
FHIRSERVER_HTTP="http"
FHIRSERVER_APIPATH = "api/fhir"
FHIRSERVER_HOST = "localhost"
FHIRSERVER_PORT = 80
Expand Down

0 comments on commit 6a38ccc

Please sign in to comment.