Exemplo n.º 1
0
 /**
  * @param list
  * @return a single String value, null if cannot be obtained
  */
 private static String getView(AttributeList list) {
   String view = null;
   CodedSequenceItem csiViewCodeSequence =
       CodedSequenceItem.getSingleCodedSequenceItemOrNull(list, TagFromName.ViewCodeSequence);
   if (csiViewCodeSequence != null) {
     // view = decipherSNOMEDCodeSequence(csiViewCodeSequence,standardViewCodes);
     view =
         MammoDemographicAndTechniqueAnnotations.getViewAbbreviationFromViewCodeSequenceAttributes(
             csiViewCodeSequence.getAttributeList());
   }
   // System.err.println("getView(): view="+view);
   return view;
 }
Exemplo n.º 2
0
 /**
  * Test if the coded concept name of the content item matches the specified code value and coding
  * scheme designator.
  *
  * <p>This is more robust than checking code meaning, which may have synomyms, and there is no
  * need to also test code meaning.
  *
  * @param csdWanted
  * @param cvWanted
  * @return true if matches
  */
 public boolean contentItemNameMatchesCodeValueAndCodingSchemeDesignator(
     String cvWanted, String csdWanted) {
   boolean isMatch = false;
   if (conceptName != null) {
     String csd = conceptName.getCodingSchemeDesignator();
     String cv = conceptName.getCodeValue();
     if (csd != null
         && csd.trim().equals(csdWanted.trim())
         && cv != null
         && cv.trim().equals(cvWanted.trim())) {
       isMatch = true;
     }
   }
   return isMatch;
 }
Exemplo n.º 3
0
 private void extractContentItemWithValueCommonAttributes() {
   valueType =
       Attribute.getSingleStringValueOrNull(
           list,
           TagFromName
               .ValueType); // NB. Use null rather than default "" to make symmetric with de novo
                            // constructor
   conceptName =
       CodedSequenceItem.getSingleCodedSequenceItemOrNull(
           list, TagFromName.ConceptNameCodeSequence);
 }
Exemplo n.º 4
0
 /**
  * Construct a content item of a specified type and relationship, creating a new {@link
  * com.pixelmed.dicom.AttributeList AttributeList}, and add it as a child of the specified parent.
  *
  * <p>The constructor is protected. Instances of specific types of content items should normally
  * be created by using the {@link com.pixelmed.dicom.ContentItemFactory ContentItemFactory}.
  *
  * @param p the parent
  * @param valueType
  * @param relationshipType added only if not null or zero length
  * @param conceptName
  * @throws DicomException
  */
 protected ContentItemWithValue(
     ContentItem p, String valueType, String relationshipType, CodedSequenceItem conceptName)
     throws DicomException {
   super(p, relationshipType);
   this.valueType = valueType;
   {
     Attribute a = new CodeStringAttribute(TagFromName.ValueType);
     a.addValue(valueType);
     list.put(a);
   }
   this.conceptName = conceptName;
   if (conceptName != null) {
     SequenceAttribute a = new SequenceAttribute(TagFromName.ConceptNameCodeSequence);
     a.addItem(conceptName.getAttributeList());
     list.put(a);
   }
 }
Exemplo n.º 5
0
 /**
  * Get a human-readable string representation of the content item.
  *
  * @return the string representation of the content item
  */
 public String toString() {
   return (relationshipType == null ? "" : relationshipType)
       + ": "
       + (valueType == null || valueType.length() == 0 ? "" : (valueType + ": "))
       + (conceptName == null ? "" : conceptName.getCodeMeaning());
 }
Exemplo n.º 6
0
 /**
  * Get the value of the coding scheme designator of the Concept Name as a string, if present and
  * applicable.
  *
  * @return the coding scheme designator of the Concept Name, or an empty string
  */
 public String getConceptNameCodingSchemeDesignator() {
   return conceptName == null ? "" : conceptName.getCodingSchemeDesignator();
 }
Exemplo n.º 7
0
 /**
  * Get the value of the code value of the Concept Name as a string, if present and applicable.
  *
  * @return the code value of the Concept Name, or an empty string
  */
 public String getConceptNameCodeValue() {
   return conceptName == null ? "" : conceptName.getCodeValue();
 }
Exemplo n.º 8
0
 /**
  * Get the value of the code meaning of the Concept Name as a string, if present and applicable.
  *
  * @return the code meaning of the Concept Name, or an empty string
  */
 public String getConceptNameCodeMeaning() {
   return conceptName == null ? "" : conceptName.getCodeMeaning();
 }