|
@@ -66,18 +66,24 @@ const _saveStudy = async(dataSet, hospitalId, patient_key) => {
|
|
const where = { studyuid, 'patient_id': patient_key }
|
|
const where = { studyuid, 'patient_id': patient_key }
|
|
// const where = {studyuid, 'patient_id': patient_key, 'institution_id': hospitalId}
|
|
// const where = {studyuid, 'patient_id': patient_key, 'institution_id': hospitalId}
|
|
let old = await Study.findOne({ where })
|
|
let old = await Study.findOne({ where })
|
|
|
|
+ let studydate = dataSet.string(studyTag.studyDate)
|
|
|
|
+ if (!studydate || (studydate + '').length < 8) {
|
|
|
|
+ studydate = formatTime()
|
|
|
|
+ }
|
|
if (old) {
|
|
if (old) {
|
|
- if (modality && ignoreModalities.indexOf(old.modality) != -1 && ignoreModalities.indexOf(modality) == -1) {
|
|
|
|
|
|
+ if (old.studydate !== studydate) {
|
|
|
|
+ old.studydate = studydate
|
|
|
|
+ }
|
|
|
|
+ if (old.modality !== modality && ignoreModalities.indexOf(modality) == -1) {
|
|
old.modality = modality
|
|
old.modality = modality
|
|
- await old.save()
|
|
|
|
}
|
|
}
|
|
|
|
+ await old.save();
|
|
|
|
+ // if (modality && ignoreModalities.indexOf(old.modality) != -1 && ignoreModalities.indexOf(modality) == -1) {
|
|
|
|
+ // old.modality = modality
|
|
|
|
+ // await old.save()
|
|
|
|
+ // }
|
|
return old;
|
|
return old;
|
|
}
|
|
}
|
|
-
|
|
|
|
- let studydate = dataSet.string(studyTag.studyDate)
|
|
|
|
- if (!studydate || (studydate + '').length < 8) {
|
|
|
|
- studydate = formatTime()
|
|
|
|
- }
|
|
|
|
const studyid = dataSet.string(studyTag.studyId)
|
|
const studyid = dataSet.string(studyTag.studyId)
|
|
const accession_num = dataSet.string(studyTag.accessionNumber)
|
|
const accession_num = dataSet.string(studyTag.accessionNumber)
|
|
const patient_age = dataSet.string(studyTag.patientAge)
|
|
const patient_age = dataSet.string(studyTag.patientAge)
|