File tree Expand file tree Collapse file tree 3 files changed +19
-2
lines changed
Expand file tree Collapse file tree 3 files changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -78,8 +78,13 @@ def series(self): # lazy creation of series objects
7878
7979 @property
8080 def last_update (self ):
81- return from_orthanc_datetime (self .info . last_update )
81+ return from_orthanc_datetime (self ._api_client . studies . get_json ( self . orthanc_id ). get ( 'LastUpdate' ) )
8282
8383 @property
8484 def labels (self ):
85- return self .info .labels
85+ return self .info .labels
86+
87+ @property
88+ def is_stable (self ):
89+ return bool (self ._api_client .studies .get_json (self .orthanc_id ).get ('IsStable' ))
90+
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ services:
88 VERBOSE_ENABLED : " true"
99 ORTHANC__DICOM_AET : ORTHANCA
1010 ORTHANC__NAME : orthanc-a-for-python-api-client-tests
11+ ORTHANC__STABLE_AGE : " 2"
1112 ORTHANC__REGISTERED_USERS : |
1213 {"test": "test"}
1314 ORTHANC__DICOM_MODALITIES : |
Original file line number Diff line number Diff line change @@ -137,6 +137,15 @@ def test_study(self):
137137 study_id = self .oa .instances .get_parent_study_id (instances_ids [0 ])
138138
139139 study = self .oa .studies .get (study_id )
140+ self .assertFalse (study .is_stable )
141+ last_update_1 = study .last_update
142+ time .sleep (4 ) # wait the study to be stable
143+ self .assertTrue (study .is_stable )
144+
145+ self .oa .upload_file (here / "stimuli/CT_small.dcm" )
146+ last_update_2 = study .last_update
147+ self .assertNotEqual (last_update_1 , last_update_2 )
148+
140149 self .assertEqual ("1CT1" , study .patient_main_dicom_tags .get ('PatientID' ))
141150 self .assertEqual ("e+1" , study .main_dicom_tags .get ('StudyDescription' ))
142151 self .assertEqual ('1.3.6.1.4.1.5962.1.2.1.20040119072730.12322' , study .dicom_id )
@@ -158,6 +167,8 @@ def test_study(self):
158167 self .assertTrue (os .path .exists (file .name ))
159168 self .assertTrue (os .path .getsize (file .name ) > 0 )
160169
170+
171+
161172 def test_series (self ):
162173 self .oa .delete_all_content ()
163174 instances_ids = self .oa .upload_file (here / "stimuli/CT_small.dcm" )
You can’t perform that action at this time.
0 commit comments