-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Develop to Master merge #100
base: master
Are you sure you want to change the base?
Conversation
Fixed Database issue with GitHub Actions
Adds database interface
`POSTGRES_HOST_AUTH_METHOD: trust` allows all connections to be established without needing the password. Removing this before I forget about it.
Refactors codebase + fixes double processing
Feat crosswalk
…anc-TMI into feat-crosswalk
Feat crosswalk
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It works, and is good.. but I think a few of these things should be addressed before merging to master. Most are fine as is.
<project version="4"> | ||
<component name="ProjectModuleManager"> | ||
<modules> | ||
<module fileurl="file://$PROJECT_DIR$/.idea/Orthanc-TMI.iml" filepath="$PROJECT_DIR$/.idea/Orthanc-TMI.iml" /> | ||
<module fileurl="file://$PROJECT_DIR$/.idea/Orthanc_TMI.iml" filepath="$PROJECT_DIR$/.idea/Orthanc_TMI.iml" /> | ||
</modules> | ||
</component> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure how any .idea/
files got in. I thought the directory was ignored in .gitignore.
We should delete this file and any others in there.
|
||
ADD ./setup-environment.sh ./setup-environment.sh | ||
RUN dos2unix ./setup-environment.sh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
surely there is a better solution
"DataAnon": { | ||
"HardlinksUseHashBins" : true, | ||
"Hardlinks": { | ||
"/by-study-date/": "0008,0020", | ||
"/by-pid/": "0010,0020", | ||
"/by-dob/": "0010,0030" | ||
}, | ||
"DateTruncation": { | ||
"default": "YYYYMM01", | ||
"0010,0030": "YYY0MM01" | ||
}, | ||
"Filter": { | ||
"blacklist": [ | ||
"0010" | ||
], | ||
"whitelist": [ | ||
"0010,0030" | ||
] | ||
} | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would have been nice to move into its own config file. Then we could have detected it's presence and created a default file if missing.
static void Emplace(const void* instance_data, std::string md5, size_t size); | ||
static void Emplace(const void* instance_data, std::string uuid); | ||
static void Emplace(const void* instance_data, const DicomFile& file); | ||
static bool Emplace(std::string md5); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These in particular really need better names.. I think. I think?
#pragma once | ||
/* | ||
#include <mutex> | ||
#include <atomic> | ||
#include <queue> | ||
#include <condition_variable> | ||
#include <functional> | ||
|
||
class JobQueue { | ||
private: | ||
std::atomic_bool keep_running; | ||
std::atomic_bool has_work; | ||
std::condition_variable cv; | ||
std::mutex queue_lock; | ||
std::queue<std::function<void()>> jqueue; | ||
// this class is the only thing that can instantiate itself now | ||
JobQueue(){} | ||
public: | ||
static JobQueue& GetInstance(); | ||
void AddJob(std::function<void()> job); | ||
void Process(); | ||
void Stop(); | ||
}; | ||
/**/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These two files should be deleted before merging to master
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually 3 (.h .cpp, and the unit test .cpp)
db_init_job = std::thread([](){ | ||
std::this_thread::sleep_for(std::chrono::seconds(2)); | ||
if(!DBInterface::Initialize()){ | ||
std::cerr << "DB Initialize job failed. Terminating.." << std::endl; | ||
std::abort(); // abnormal termination | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be documented. It's there because Orthanc's tables haven't yet initialized (potentially) yet and so we can't initialize ours yet. But we need it to initialize from our plugin initialize function, so we spawn a thread with a delay. A comment should explain this
@@ -0,0 +1,241 @@ | |||
CREATE TABLE IF NOT EXISTS crosswalk ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In an ideal world, we break this file up into smaller portions and load those files instead of copy pasting the code in this file as string in numerous locations.
//#define UNIT_TEST | ||
#include <core.h> | ||
#include <functional> | ||
|
||
extern fs::path GetProjRoot(); | ||
extern void TestWithDicomFiles(std::function<void(const fs::path&)> test); | ||
namespace uuid { | ||
extern std::string generate_uuid_v4(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this function is used. It should be removed if that's the case.
Merge develop to master