try to add priors to ohif
This commit is contained in:
+21
-3
@@ -423,7 +423,7 @@ class Case(models.Model, AuthorMixin, QuestionMixin):
|
||||
examinations = [series.get_examination() for series in self.series.all()]
|
||||
return f"{self.pk}:{self.title} {'/'.join([str(c) for c in self.condition.all()])} [{', '.join(examinations)}]"
|
||||
|
||||
def get_case_dicom_json(self, case_title_as_patient_name=True):
|
||||
def get_case_dicom_json(self, case_title_as_patient_name=True, priors=None):
|
||||
series_json = []
|
||||
for series in self.series.all():
|
||||
series_json.append(series.get_series_dicom_json())
|
||||
@@ -432,7 +432,7 @@ class Case(models.Model, AuthorMixin, QuestionMixin):
|
||||
if case_title_as_patient_name:
|
||||
patient_name = self.title
|
||||
|
||||
return {
|
||||
studies_json = {
|
||||
"studies": [
|
||||
{
|
||||
"StudyInstanceUID": "1.3.6.1.4.1.14519.5.2.1.6279.6001.298806137288633453246975630178",
|
||||
@@ -446,8 +446,26 @@ class Case(models.Model, AuthorMixin, QuestionMixin):
|
||||
"series": series_json,
|
||||
}
|
||||
]
|
||||
|
||||
}
|
||||
pass
|
||||
|
||||
if priors is not None:
|
||||
for prior in priors:
|
||||
studies_json["studies"].append(
|
||||
{
|
||||
"StudyInstanceUID": "1.3.6.1.4.1.14519.5.2.1.6279.6001.298806137288633453246975630177",
|
||||
"StudyDate": "20000101",
|
||||
"StudyTime": "",
|
||||
"PatientName": patient_name,
|
||||
"PatientID": "LIDC-IDRI-0001",
|
||||
"AccessionNumber": "",
|
||||
"PatientAge": "",
|
||||
"PatientSex": "",
|
||||
"series": prior.prior_case.get_series_dicom_json(),
|
||||
}
|
||||
)
|
||||
|
||||
return studies_json
|
||||
|
||||
def get_viva_details(self):
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user