Exemplo n.º 1
0
 private void checkUPSPerformedProcedure(Dataset rqData) throws DcmServiceException {
   DcmElement sq = rqData.get(Tags.UPSPerformedProcedureSeq);
   if (sq == null || sq.isEmpty()) return;
   int n = sq.countItems();
   if (n > 1)
     throw new DcmServiceException(
         Status.InvalidAttributeValue,
         errorMessage("More than 1 item of Attribute: ", Tags.UPSPerformedProcedureSeq));
   Dataset item = sq.getItem();
   checkActualHumanPerformers(item);
   checkCodeItem(
       item, ItemCount.MULTIPLE, Tags.PerformedStationNameCodeSeq, Tags.UPSPerformedProcedureSeq);
   checkCodeItem(
       item, ItemCount.MULTIPLE, Tags.PerformedStationClassCodeSeq, Tags.UPSPerformedProcedureSeq);
   checkCodeItem(
       item,
       ItemCount.MULTIPLE,
       Tags.PerformedStationGeographicLocationCodeSeq,
       Tags.UPSPerformedProcedureSeq);
   checkCodeItem(
       item,
       ItemCount.MULTIPLE,
       Tags.PerformedProcessingApplicationsCodeSeq,
       Tags.UPSPerformedProcedureSeq);
   checkCodeItem(
       item, ItemCount.SINGLE, Tags.PerformedWorkitemCodeSeq, Tags.UPSPerformedProcedureSeq);
   checkContentItem(item, Tags.PerformedProcessingParametersSeq, Tags.UPSPerformedProcedureSeq);
   checkImageSOPInstanceAndSourceReference(
       item, Tags.OutputInformationSeq, Tags.UPSPerformedProcedureSeq);
 }
Exemplo n.º 2
0
 private static void checkContentItem(Dataset rqData, int tag, int... sqTags)
     throws DcmServiceException {
   DcmElement sq = rqData.get(tag);
   if (sq == null || sq.isEmpty()) return;
   int[] sqTags1 = cat(sqTags, tag);
   for (int i = 0, n = sq.countItems(); i < n; i++) {
     Dataset item = sq.getItem(i);
     type1(item, Tags.ValueType, sqTags1);
     type1(item, Tags.ConceptNameCodeSeq, sqTags1);
     checkCodeItem(item, ItemCount.SINGLE, Tags.ConceptNameCodeSeq, sqTags1);
     String valueType = item.getString(Tags.ValueType);
     if (valueType.equals("DATETIME")) type1(item, Tags.DateTime, sqTags1);
     else if (valueType.equals("DATE")) type1(item, Tags.Date, sqTags1);
     else if (valueType.equals("TIME")) type1(item, Tags.Time, sqTags1);
     else if (valueType.equals("PNAME")) type1(item, Tags.PersonName, sqTags1);
     else if (valueType.equals("UIDREF")) type1(item, Tags.UID, sqTags1);
     else if (valueType.equals("TEXT")) type1(item, Tags.TextValue, sqTags1);
     else if (valueType.equals("CODE")) {
       type1(item, Tags.ConceptCodeSeq, sqTags1);
       checkCodeItem(item, ItemCount.SINGLE, Tags.ConceptCodeSeq, sqTags1);
     } else if (valueType.equals("NUMERIC")) {
       type1(item, Tags.NumericValue, sqTags1);
       type1(item, Tags.MeasurementUnitsCodeSeq, sqTags1);
       checkCodeItem(item, ItemCount.SINGLE, Tags.MeasurementUnitsCodeSeq, sqTags1);
     } else
       throw new DcmServiceException(
           Status.InvalidAttributeValue,
           errorMessage("Invalid Value Type: " + valueType + " ", Tags.ValueType, sqTags1));
   }
 }
Exemplo n.º 3
0
 private void checkUPSProgressInformation(Dataset rqData) throws DcmServiceException {
   DcmElement sq = rqData.get(Tags.UPSProgressInformationSeq);
   if (sq == null || sq.isEmpty()) return;
   int n = sq.countItems();
   if (n > 1)
     throw new DcmServiceException(
         Status.InvalidAttributeValue,
         errorMessage("More than 1 item of Attribute: ", Tags.UPSProgressInformationSeq));
   Dataset item = sq.getItem();
   checkUPSCommunicationsURI(item);
   checkCodeItem(
       item,
       ItemCount.MULTIPLE,
       Tags.UPSDiscontinuationReasonCodeSeq,
       Tags.UPSProgressInformationSeq);
 }
Exemplo n.º 4
0
 private static void checkCodeItem(Dataset rqData, ItemCount itemCount, int tag, int... sqTags)
     throws DcmServiceException {
   DcmElement sq = rqData.get(tag);
   if (sq == null || sq.isEmpty()) return;
   int n = sq.countItems();
   if (itemCount == ItemCount.SINGLE && n > 1)
     throw new DcmServiceException(
         Status.InvalidAttributeValue,
         errorMessage("More than 1 item of Attribute: ", tag, sqTags));
   int[] sqTags1 = cat(sqTags, tag);
   for (int i = 0; i < n; i++) {
     Dataset item = sq.getItem(i);
     type1(item, Tags.CodeValue, sqTags1);
     type1(item, Tags.CodingSchemeDesignator, sqTags1);
     type1(item, Tags.CodeMeaning, sqTags1);
   }
 }