def get_clean_worklist(self): """ Generates a clean worklist """ worklist_item = Dataset() worklist_item.StudyInstanceUID = generate_uid(prefix='1.2.840.113619.2.391.6789.', entropy_srcs=[_create_random_ascii_string(10), _create_random_ascii_string(10)]) worklist_item.Modality = 'US' worklist_item.SpecificCharacterSet = self._specific_charset worklist_item.AccessionNumber = '123' worklist_item.PatientBirthDate = '19901015' worklist_item.PatientName = 'Clean^Exam' worklist_item.PatientID = _create_random_ascii_string(64) worklist_item.IssuerOfPatientID = 'Issuer of patient id: Bob' worklist_item.PatientWeight = str(100.0) worklist_item.PatientSize = str(2.1) worklist_item.AdmissionID = 'Admission id 3' worklist_item.RequestedProcedureID = 'Step id 2' worklist_item.RequestedProcedureDescription = 'Step description Clean Exam' otherPatientIdsSq = [Dataset(), Dataset()] for otherPatientId in otherPatientIdsSq: otherPatientId.PatientID = 'Bob123' otherPatientId.IssuerOfPatientID = 'Issuer of patient id: Arne' otherPatientId.TypeOfPatientID = 'TEXT' worklist_item.OtherPatientIDsSequence = otherPatientIdsSq step = Dataset() step.ScheduledPerformingPhysicianName = 'Ola Nordmann' step.ScheduledProcedureStepStartDate = '20201224' step.ScheduledProcedureStepStartTime = '121212' step.ScheduledProcedureStepDescription = 'Scheduled procedure step description ' step.CommentsOnTheScheduledProcedureStep = 'Scheduled step comments ' worklist_item.ScheduledProcedureStepSequence = [step] return worklist_item
def get_random_worklist(self): """ Generate a random worklist """ worklist_item = Dataset() worklist_item.StudyInstanceUID = generate_uid(prefix='1.2.840.113619.2.391.6789.', entropy_srcs=[_random_unicode_string(10, _get_random_language_string()), _random_unicode_string(10, _get_random_language_string())]) worklist_item.Modality = 'US' worklist_item.SpecificCharacterSet = self._specific_charset worklist_item.CurrentPatientLocation = _extend_with_random_to_length('', self._fault_provider. _get_random_string_length(64), self._fault_provider._return_None_string) worklist_item.AccessionNumber = _random_unicode_string(16, _get_random_language_string()) worklist_item.PatientBirthDate = _random_dicom_date_after_1900() worklist_item.PatientName = self._get_person_name() worklist_item.PatientID = _extend_with_random_to_length('', self._fault_provider. _get_random_string_length(64), self._fault_provider._return_None_string) self._fault_provider._sleep_random() #Possible delay worklist_item.IssuerOfPatientID = _extend_with_random_to_length('', self._fault_provider. _get_random_string_length(64), self._fault_provider._return_None_string) worklist_item.PatientWeight = str(random.uniform(10.0, 150.0))[:16] worklist_item.PatientSize = str(random.uniform(1.0, 2.5))[:16] worklist_item.AdmissionID = _extend_with_random_to_length('', self._fault_provider. _get_random_string_length(64), self._fault_provider._return_None_string) worklist_item.RequestedProcedureID = _extend_with_random_to_length('', self._fault_provider. _get_random_string_length(16), self._fault_provider._return_None_string) worklist_item.RequestedProcedureDescription = _extend_with_random_to_length('', self._fault_provider. _get_random_string_length(64), self._fault_provider._return_None_string) worklist_item.ReferringPhysicianName = self._get_person_name() otherPatientIdsSq = [Dataset(), Dataset()] for otherPatientId in otherPatientIdsSq: otherPatientId.PatientID = _extend_with_random_to_length('', self._fault_provider. _get_random_string_length(64), self._fault_provider._return_None_string) otherPatientId.IssuerOfPatientID = _extend_with_random_to_length('', self._fault_provider. _get_random_string_length(64), self._fault_provider._return_None_string) otherPatientId.TypeOfPatientID = 'TEXT' worklist_item.OtherPatientIDsSequence = otherPatientIdsSq step = Dataset() step.ScheduledPerformingPhysicianName = self._get_person_name() step.ScheduledProcedureStepStartDate = _random_dicom_date_after_1900() step.ScheduledProcedureStepStartTime = _random_dicom_time() step.ScheduledProcedureStepDescription = _extend_with_random_to_length('', self._fault_provider. _get_random_string_length(64), self._fault_provider._return_None_string) step.CommentsOnTheScheduledProcedureStep = _extend_with_random_to_length('', self._fault_provider. _get_random_string_length(10240), self._fault_provider._return_None_string) worklist_item.ScheduledProcedureStepSequence = [step] return worklist_item