Summary of the invention
The problem to be solved in the present invention is to provide a kind of data auto-deleted method based on DICOM, the method is applied in Medical Devices, and doctor, when deleting medical data, there will not be the situation of leaking and deleting or deleting by mistake.
For solving the problem, the invention provides a kind of data auto-deleted method based on DICOM, comprising the following steps:
Step 1, detects disk space capacity, if disk free space is less than the first threshold values, performs step 2, otherwise system continues normal operation;
Step 2, accessing database, searches the data record meeting deletion condition, the store path of data file in disk that the data record found described in acquisition is corresponding;
Step 3, according to the store path obtained, performs deletion action to the data file be stored in disk;
Step 4, detects disk space capacity again, if disk free space capacity is greater than the second threshold values, then and end data deletion action, otherwise return execution step 2.
Further, before described step 1, further comprising the steps of: the cycle automatically detecting disk space capacity is set; In described step 1, according to the cycle pre-set, periodic detection disk space capacity.
Further, in described step 2, described in search in the step of the data record meeting deletion condition, further comprising the steps:
Step 21, in described database, every bar data record comprises multiple field, searches the data record with the first field according to field information in the data list of the first storage level;
Step 22, in described database, every bar data record has uniquely tagged symbol, to comprise the marker character of the data record of the first field as external key, stores in the data list of level search the data record comprising the second field second;
Step 23, using the described marker character comprising the data record of the second field as external key, stores in the data list of level the 3rd and searches all data records.
Further, between described step 22 and described step 23, further comprising the steps of:
The all data records comprising the second field found were sorted according to the time;
Search storage time the earliest one and comprise the data record of the second field.
Further, after described step 3, further comprising the steps of: deletion action is performed to the data record of the deletion condition that meets of searching acquisition.
Further, after described step 3, further comprising the steps of: to send data by Information to user and delete information.
Technical solution of the present invention contrast prior art has following beneficial effect: the data auto-deleted method based on DICOM provided by the invention, according to search strategy accessing database, search the data record comprising specific field, and obtain the store path of data file corresponding to this data record in disk, after finding data file, deletion action is carried out to it, meet Medical Devices and data are not deleted by mistake, does not leak the requirement of deleting; In addition, pre-configured disk space is reserved threshold values and is automatically detected the cycle of disk, and when disk free space is not enough, system will start data delete program automatically, logarithm factually time delete.
Embodiment
For enabling above-mentioned purpose of the present invention, feature and advantage become apparent more, are described in detail the specific embodiment of the present invention below in conjunction with drawings and Examples.
Fig. 1 is the process flow diagram of the data auto-deleted method based on DICOM of the present invention.Please refer to Fig. 1, the described data auto-deleted method based on DICOM, comprises the following steps:
Step 1, detects disk space capacity, if disk free space is less than pre-set threshold value, performs step 2, otherwise system continues normal operation;
Step 2, accessing database, searches the data record meeting deletion condition, the store path of data file in disk that the data record found described in acquisition is corresponding;
Step 3, according to the store path obtained, performs deletion action to the data file be stored in disk;
Step 4, detects disk space capacity again, if disk free space is greater than the second threshold values, then and end data deletion action, otherwise return execution step 2.
As described in step 1, detect disk space capacity, if disk free space is less than pre-set threshold value, perform step 2, otherwise system continues normal operation.
Detect the disk space capacity of store data file, if disk free space is greater than pre-set threshold value, detection of end; If disk free space is less than pre-set threshold value, then start the automatic delete program of data; Preferably, pre-set the cycle detecting disk space capacity, according to the cycle pre-set, system at regular intervals detects disk space capacity.
As described in step 2, accessing database, searches the data record meeting deletion condition, find described in acquisition the store path of data file in disk corresponding to data record.
Data record stores in a database according to DICOM accumulation layer level structure, and accessing database, according to search strategy, successively searches, and just can find the data record meeting deletion condition.Described search strategy comprises the following steps: in described database, every bar data record comprises multiple field, searches the data record comprising the first field according to field information in the data list of the first storage level; In described database, every bar data record has uniquely tagged symbol, to comprise the marker character of the data record of the first field as external key, stores in the data list of level search the data record comprising the second field second; To comprise the marker character of the data record of the second field as external key, store in the data list of level the 3rd and search all data records.In this step, to comprise the marker character of the data record of the first field as external key, search the data record comprising the second field in the data list of the second storage level after, all data records comprising the second field found can also be sorted according to the time; Find wherein storage time the earliest one to comprise the data record of the second field, then the deletion action as described in step 3 is performed to this data record.
As described in step 3, according to the store path obtained, deletion action is performed to the data file be stored in disk.
What store in database is only data records, data file corresponding to every bar data record is actual to be stored in disk, after finding the data record meeting erasure request in a database, the store path information of data file in disk corresponding to this data record comprised in every bar data record, finds corresponding data file and performs deletion action in disk.After deleting the data file in disk, the data record in delete database corresponding to these data files.In addition, after deletion action is performed to the data file on disk and the data record in database, data can also be sent by the Information of user interface to user and delete information, so that user understands data in time delete information.
For understanding embodiments of the present invention better, below in conjunction with specific embodiment, the principle of work of technical solution of the present invention based on the data auto-deleted method of DICOM is described in detail.
Embodiment one
Detect the disk space capacity of store data file, namely can detect after system boot, also can pre-set sense cycle, system automatic periodic detection disk space capacity.Arrange the first threshold values of disk free space as required, if disk free space is less than the first threshold values, system will start data delete program, otherwise system continues normal operation.
After system start-up data delete program, be first accessing database, search the data record comprising specific field.Store level first and search the data record comprising " completing inspection " field.Then using a marker character comprising the data record of " completing inspection " field as external key, store in the data list of level second and search the data record comprising " protection " field.It should be noted that, for the medical data base based on DICOM accumulation layer level structure, when generating data record, for every bar data record arranges uniquely tagged symbol, all data records of next level associated by this data record can be found according to the marker character of a data record.When first stores in level, when comprising more than one of the data record of " completing inspection " field, respectively using the marker character of pieces of data record as external key, store in the data list of level second and search the data record comprising " protection " field.Store in all data records of level search acquisition second and search the data record comprising " protection " field; then sort according to the time; find wherein storage time a data record the earliest; last using the marker character of this data record as external key, store in the data list of level the 3rd and search all data records.Store in the pieces of data record of level the search acquisition the 3rd and include the store path information of the data file corresponding with it in disk, obtain the store path of data file corresponding to these data records in disk.Then, according to the store path obtained, deletion action is performed to these data files be stored in disk.While performing deletion action to the data in disk, the data record corresponding in a database to deleted data file is also deleted.According to the search strategy of technical solution of the present invention, successively search the data record meeting erasure request in a database, and then in disk, find corresponding data file and perform deletion action, avoid and occur that the generation of the situation of deleting is deleted by mistake and leaked to data file.
After a deletion action is carried out to the data file of searching acquisition, again detect disk space capacity.If disk free space is greater than the second threshold values, then accessing database again, searches the data record comprising specific field as previously mentioned, and performs deletion action to the data file be stored in disk of its correspondence.Circulation like this, until disk free space is no longer greater than the second threshold values, then terminates this secondary data deletion action.In addition, data delete beginning, data are deleted and terminated and these information of disk space size before and after data deletion, can be sent by message hurdle to user interface, understand data in magnetic disk deletion situation in real time to facilitate user.
In sum, data auto-deleted method based on DICOM provided by the invention, pre-set the reserved threshold values of disk space and automatically detect the cycle of disk, according to the storage organization feature of medical data when generating the data record in database, for every bar data record arranges uniquely tagged symbol, then successively search according to search strategy the store path information of data file in disk obtaining satisfied deletion condition, delete in real time, meet in medical diagnostic equipment and do not delete by mistake, do not leak the requirement of deleting.
Although the present invention discloses as above with preferred embodiment; so itself and be not used to limit the present invention, any those skilled in the art, without departing from the spirit and scope of the present invention; when doing a little amendment and perfect, therefore protection scope of the present invention is when being as the criterion of defining with claims.