Exemplo n.º 1
0
 public void setAttributes(DicomObject attrs) {
   AttributeFilter filter = AttributeFilter.getSeriesAttributeFilter();
   this.seriesInstanceUID = attrs.getString(Tag.SeriesInstanceUID);
   this.seriesNumber = attrs.getString(Tag.SeriesNumber, "");
   this.seriesDescription =
       filter.toUpperCase(attrs.getString(Tag.SeriesDescription, ""), Tag.SeriesDescription);
   this.modality = filter.toUpperCase(attrs.getString(Tag.Modality, ""), Tag.Modality);
   this.institutionalDepartmentName =
       filter.toUpperCase(
           attrs.getString(Tag.InstitutionalDepartmentName, ""), Tag.InstitutionalDepartmentName);
   this.institutionName =
       filter.toUpperCase(attrs.getString(Tag.InstitutionName, ""), Tag.InstitutionName);
   this.stationName = filter.toUpperCase(attrs.getString(Tag.StationName, ""), Tag.StationName);
   String srcAET = attrs.getString(attrs.resolveTag(PrivateTag.CallingAET, PrivateTag.CreatorID));
   if (srcAET != null && srcAET.trim().length() > 1) this.sourceAET = srcAET;
   this.bodyPartExamined =
       filter.toUpperCase(attrs.getString(Tag.BodyPartExamined, ""), Tag.BodyPartExamined);
   this.laterality = filter.toUpperCase(attrs.getString(Tag.Laterality, ""), Tag.Laterality);
   PersonName pn = new PersonName(attrs.getString(Tag.PerformingPhysicianName));
   this.performingPhysicianName =
       pn.componentGroupString(PersonName.SINGLE_BYTE, false).toUpperCase();
   this.performingPhysicianIdeographicName =
       pn.componentGroupString(PersonName.IDEOGRAPHIC, false);
   this.performingPhysicianPhoneticName = pn.componentGroupString(PersonName.PHONETIC, false);
   if (AttributeFilter.isSoundexEnabled()) {
     this.performingPhysicianFamilyNameSoundex =
         AttributeFilter.toSoundex(pn, PersonName.FAMILY, "*");
     this.performingPhysicianGivenNameSoundex =
         AttributeFilter.toSoundex(pn, PersonName.GIVEN, "*");
   }
   this.performedProcedureStepStartDateTime =
       attrs.getDate(Tag.PerformedProcedureStepStartDate, Tag.PerformedProcedureStepStartTime);
   this.performedProcedureStepInstanceUID =
       attrs.getString(
           new int[] {
             Tag.ReferencedPerformedProcedureStepSequence, 0, Tag.ReferencedSOPInstanceUID
           });
   int[] fieldTags = filter.getFieldTags();
   for (int i = 0; i < fieldTags.length; i++) {
     try {
       setField(filter.getField(fieldTags[i]), attrs.getString(fieldTags[i], ""));
     } catch (Exception e) {
       throw new ConfigurationException(e);
     }
   }
   this.encodedAttributes =
       DicomObjectUtils.encode(filter.filter(attrs), filter.getTransferSyntaxUID());
 }
Exemplo n.º 2
0
 public DicomObject getAttributes(boolean cfindrsp) {
   DicomObject dataset = DicomObjectUtils.decode(encodedAttributes);
   if (cfindrsp) {
     dataset.putInt(Tag.NumberOfSeriesRelatedInstances, VR.IS, numberOfSeriesRelatedInstances);
     if (fileSetUID != null && fileSetID != null) {
       dataset.putString(Tag.StorageMediaFileSetUID, VR.UI, fileSetUID);
       dataset.putString(Tag.StorageMediaFileSetID, VR.SH, fileSetID);
     }
     if (retrieveAETs != null || externalRetrieveAET != null) {
       dataset.putString(
           Tag.RetrieveAETitle,
           VR.AE,
           externalRetrieveAET == null
               ? retrieveAETs
               : retrieveAETs == null
                   ? externalRetrieveAET
                   : retrieveAETs + '\\' + externalRetrieveAET);
     }
     dataset.putString(Tag.InstanceAvailability, VR.CS, availability.name());
   }
   return dataset;
 }