public Date getDocumentAddedDate() { Date date = metaData.getDate(Tag.ContentDate); Date time = metaData.getDate(Tag.ContentTime); if (date != null && time != null) { return DateUtils.toDateTime(date, time); } else if (date != null) { return date; } return null; }
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()); }