public static Collection<AimImagingObservationCharacteristic> parseImgObsCharacteristics( Document document, GeneralSeries generalSeries) { Collection<AimImagingObservationCharacteristic> results = new ArrayList<AimImagingObservationCharacteristic>(); // ns1:ImagingObservationCharacteristic NodeList imagingObservationCharacteristics = document.getElementsByTagNameNS(AIM_NS, "ImagingObservationCharacteristic"); for (int i = 0; i < imagingObservationCharacteristics.getLength(); i++) { Element imagingObservationCharacteristicElement = (Element) imagingObservationCharacteristics.item(i); String codeMeaning = imagingObservationCharacteristicElement.getAttribute("codeMeaning"); String codeValue = imagingObservationCharacteristicElement.getAttribute("codeValue"); String codingSchemeDesignator = imagingObservationCharacteristicElement.getAttribute("codingSchemeDesignator"); AimImagingObservationCharacteristic imagingObservationCharacteristic = new AimImagingObservationCharacteristic(); imagingObservationCharacteristic.setCodeMeaningName(codeMeaning); imagingObservationCharacteristic.setCodeSchemaDesignator(codingSchemeDesignator); imagingObservationCharacteristic.setCodeValue(codeValue); imagingObservationCharacteristic.setGeneralSeries(generalSeries); imagingObservationCharacteristic.setSeriesPKId(generalSeries.getId()); Set<AimQuantification> quantifications = parseQuantifications( imagingObservationCharacteristicElement, imagingObservationCharacteristic); imagingObservationCharacteristic.setAimQuantificationCollection(quantifications); results.add(imagingObservationCharacteristic); } return results; }
private List<CustomSeriesDTO> convertHibernateObjectToCustomSeriesDTO(List<GeneralSeries> daos) { List<CustomSeriesDTO> returnList = new ArrayList<CustomSeriesDTO>(); if (daos != null) { for (int i = 0; i < daos.size(); i++) { CustomSeriesDTO sd = new CustomSeriesDTO(); GeneralSeries gs = (GeneralSeries) (daos.get(i)); sd.setAnnotationsFlag(gs.getAnnotationsFlag() == null ? false : gs.getAnnotationsFlag()); sd.setAnnotationsSize(gs.getAnnotationTotalSize()); sd.setDescription(gs.getSeriesDesc()); sd.setModality(gs.getModality()); sd.setNumberImages(gs.getImageCount()); sd.setPatientId(gs.getPatientId()); sd.setSeriesUID(gs.getSeriesInstanceUID()); sd.setStudyUid(gs.getStudy().getStudyInstanceUID()); sd.setStudyPkId(gs.getStudy().getId()); sd.setProject(gs.getStudy().getPatient().getDataProvenance().getProject()); sd.setSecurityGroup(gs.getSecurityGroup()); returnList.add(sd); } } return returnList; }