What exactly are the conditions for DICOM Type 1C or 2C key attributes? - dicom

I am trying to understand DICOM modality worklist information model and its associated matching and return key attributes. In the DICOM specs (DICOM PS3.4 2022d - Service Class Specifications -> K.6.1.2.2 Modality Worklist Attributes) some return key types have the value 1C which according to the specification are treated as Type 1 attributes if a "certain condition" is met. Some of the conditions for these type of attributes are clearly written on the specification but some are not clear to me.
For example according to the specification Scheduled Procedure Step Description (0040,0007) is of type 1C with a remark that "Either Scheduled Procedure Step Description (0040,0007) or the Scheduled Protocol Code Sequence (0040,0008) or both shall be supported by the SCP". By the same token, Scheduled Protocol Code Sequence (0040,0008) is also of type 1C in this information model with the same remark as Scheduled Procedure Step Description.
So my understanding on the type of these 2 attributes is the "certain condition" is if either of the two have a value then the other one will not be required or in other words if one doesn't have a value then the other will be required to have a value (the "certain condition" being the absence of a value in one of these attributes acting as a condition for the other to be required). Is my interpretation correct or am I missing it?

As mentioned, a 1C or 2C type for a DICOM tag in a DICOM IOD (Information Object Description) means that the tag is mandatory if a certain condition is fulfilled. In the case of 1C, the tag must also have a value in this case (similar to type 1). All data element types are described in the DICOM standard, PS3.5.
The conditions are described in the remark section of the respective tag in a free format, but these descriptions mostly follow certain patterns. Unfortunately, there is no formal definition of the condition format, so it cannot be parsed automatically reliably. Nevertheless, certain phrases are used in most condition descriptions.
In your case, the condition is:
Either the Scheduled Procedure Step Description (0040,0007) or the Scheduled Protocol Code Sequence (0040,0008) or both shall be supported by the SCP.
The pattern: Either the <Tag name> (xxxx,xxxx) or the <tag name> (xxxx,xxxx) or both shall be <something>, where <something> can be "present", "absent", "supported" or similar, appears several times in the standard, as do other phrases. It means what the original poster has already guessed: that it is mandatory that at least one of both tags must be present (and have a value in the case of 1C).
The fact that the described tag itself is part of that description is not uncommon and probably also due to the fact that the authors of the standard try to use standard phrases (at least that is what I suppose they do).
Sidenote:
The reason why I'm fairly familiar with the phrases used in these conditions is that I have tried to parse these conditions automatically from the available DocBook version of the DICOM standard (as I'm sure others also have). As I wrote, this is not reliable though.

Related

How to depict index of elements of ordered collection in UML diagrams?

I want to depict the index of elements of an ordered collection in an UML object diagram.
The only information I was able to find in the UML Spec 2.5.1 was in the part about semantics of associations 11.5.3.1.
When one or more ends of the Association are ordered, links carry ordering information in addition to their end values.
But either there is no guidance regarding the notation of such ordering information or I just didn't find it. I think I have seen a colon followed by the index in some tools. I wonder if there is a consensus or reference about how to depict indices on the links?
EDIT:
Although the existing answer is already holistic, let me add some clarification and context. As the first sentence already stated, I want to use this explicit information in an object diagram (maybe the parenthesis were confusing, I removed them). The object diagrams are used as part of test case sepcifications to communicate the object structure of the input, expected result and actual result. To that regard, the order of objects in a collection may play a role, e.g., imagine a test case specification for the correct implementation of the specification of a sorting algorithm.
I did not specify the kind of collection on purpose as I do not see how that would influence the answer as long as the collection is ordered. Typically, a sequence/list would come to my mind.
I do not need OCL in this case but I appreciate the answer taking that into consideration as formulating constraints on the order of collection elements is closely related.
UML
There is nothing foreseen for representing the index of an ordered collection in UML. In section 7.5.3.2 it is defined that ordering makes sense in relation to elements with multiplicity:
If the MultiplicityElement is specified as ordered (i.e., isOrdered is true), then the collection of values in an instantiation of this Element is ordered. This ordering implies that there is a mapping from positive integers to the elements of the collection of values. If a MultiplicityElement is not multivalued, then the value for isOrdered has no semantic effect.
The positive integer that is mapped correspond to what you'd call an index. But nothing is defined in the UML specs: Not even if the index should start at 0, at 1 or at any arbitrary value. It's not even said that the indexes have to be consecutive.
The UML specs explain in the same section, that the semantics of the ordered collections depend also on the unicity of their elements:
isOrdered isUnique Collection Type
false true Set
true true OrderedSet
false false Bag
true false Sequence
Unfortunately, the OrderedSet and Sequence are not defined in the UML specifications.
The only case where the ordering is defined more precisely is for properties defined as derived unions (section 9.5.3):
then the ordering of the union is defined by evaluating the subsetting properties in the order in which they appear in the result of allAttributes() and concatenating the results.
Conclusion: ¨There is no way to define what the order is (e.g. link the order to some properties), and nothing is foreseen to refer to the indexes in the ordering.
OCL
The OCL language is a companion of UML. it is used to write more formal and precise constraints. It defines some more semantics for collections:
The OrderedSet is a Set, the elements of which are ordered. It contains no duplicates. OrderedSet is itself an instance of the metatype OrderedSetType.
An OrderedSet is not a subtype of Set, neither a subtype of Sequence. The common supertype of Sets and OrderedSets is Collection.
A sequence is a collection where the elements are ordered. An element may be part of a sequence more than once. Sequence is itself an instance of the metatype SequenceType.
Sequence is not a subtype of Bag. The common supertype of Sequence and Bag is Collection.
OCL uses the notion of index in several operations available for Sequence and OrderedSet:
The expression at(i) identifies the i-the element
The expression indexOf(v) returns the index of the element v
The expression first() returns the first element, being understood that its index is 1
The expression last() reutrns the last element, being udnerstood that its index correspond to the size of the collection.
These expressions are related to ordered collections and are not defined for unordered collections such as sets and bags.
Conclusion you can use indexes in UML constraints by using OCL and even relate them with the help of constraints an order to properties
Edit: More about object diagrams
Object diagram represents instances of objects. The association lines between these objects hence representthe “links” mentioned in your quote.
While a notation exists to specify values of object properties, nothing is defined for the links:
Pragmatically, you could just number the end of the link (there should be no confusion with multiplicity since it’s a link and not an association). If you fear some confusion, you may prefix the number with an informal # or Nr. .
Alternatively, if you have to stay 100% compliant, you may put the order information in a note symbol.
Reading section 9.8.4 page 126, and considering the use of = to specifiy values within instances, I think that it could be argued that order=1 would be valid, since the only value that is not already defined for the link through the instances at both ends are the ordering information.

How to generate unique DICOM UID?

I am working on DICOM gated (PET) data.
I would like to artificially create a DICOM image series which includes gated data. I am inquiring on the increment values of SOPInstanceUID which labels each image slice in each phase or gate.
These have different values for each slice in a gate and are incremented between gates but I can't find out the logic to how this value is chosen.
Is there a reference to where and how these values are written?
Multiple algorithms to generate DICOM UID are explained in this answer with their drawbacks.
As per DICOM specifications, all UIDs including SOPInstanceUID in question should be unique. This is irrelevant to what data (gated PET data or other) you are working on.
Following is from specifications:
2017a Part 5 - Data Structures and Encoding (9 Unique Identifiers (UIDs))
Unique Identifiers (UIDs) provide the capability to uniquely identify a wide variety of items. They guarantee uniqueness across multiple countries, sites, vendors and equipment. Different classes of objects, instance of objects and information entities can be distinguished from one another across the DICOM universe of discourse irrespective of any semantic context.
UID consists of two parts:
Organization root:
This part of UID ensures the uniqueness across organizations. There are service providers who offer this for free. Medical Connections is the one I am aware about. You can contact them to get the one for free.
Suffix:
Further, you should generate suffix in such a way that it guarantees uniqueness inside your organization.
Following are the general rules for DICOM UID:
Total length must be <= 64 characters, including the stops
Must contain only digits 0-9 and full stops
Each numeric "component" (between stops) must be a valid and unambiguous integer number, and so must not have a leading zero (unless the whole component is zero)
Must be guaranteed to be unique - this means:
It must be derived from a proper official root under your sole control.
It must not be created by appending digits (however special you consider the combination!) to someone else's UID.
In particular, series UIDs for secondary capture images, KIN objects etc. must not be created as derivatives of the Study UID (unless you own that root!)
Related to the above, there is no expectation or requirement that the Study UID, Series UID and Instance UID for images should be derived from the same root (though in practice, Series UID and Instance UID normally are, as both must be generated internally by the equipment which generates the images)
Date and Time are useful for generating UIDs, but only if:
Each machine has a unique root (normally your company UID root + a machine specific suffix such as a serial number
If it is possible for UIDs to be generated at > 1 per second, then a sequential counter should also be used
if on a multi-threaded machine, then the thread ID or a properly interlocked counter are needed to prevent 2 applications or 2 threads in the same application from generating identical UIDs simultaneously.
Do not use time on its own - it is too easy to end up with a leading zero 0 - e.g. 20060724.093017 use instead 20060724093017
Same can be found in specifications.
Following example is from DICOM Specifications to generate UID. Please note that this is Informative section.
2017a Part 5 - Data Structures and Encoding (B Creating a Privately Defined Unique Identifier (Informative))
B.1 Organizationally Derived UID:
The following example presents a particular choice made by a specific
organization in defining its suffix to guarantee uniqueness of a SOP
Instance UID.
"1.2.840.xxxxx.3.152.235.2.12.187636473"
In this example, the root is:
1 Identifies ISO
2 Identifies ANSI Member Body
840 Country code of a specific Member Body (U.S. for ANSI)
xxxxx Identifies a specific Organization.(assigned by ANSI)
In this example the first two components of the suffix relate to the
identification of the device:
3 Manufacturer defined device type
152 Manufacturer defined serial number
The remaining four components of the suffix relate to the
identification of the image:
235 Study number
2 Series number
12 Image number
187636473 Encoded date and time stamp of image acquisition
In this example, the organization has chosen these components to
guarantee uniqueness. Other organizations may choose an entirely
different series of components to uniquely identify its images. For
example it may have been perfectly valid to omit the Study Number,
Series Number and Image Number if the time stamp had a sufficient
precision to ensure that no two images might have the same date and
time stamp. Because of the flexibility allowed by the DICOM Standard
in creating organizationally derived UIDs, implementations should not
depend on any assumed structure of UIDs and should not attempt to
parse UIDs to extract the semantics of some of its components.
There is one more way mentioned in specifications
2017a Part 5 - Data Structures and Encoding (B Creating a Privately Defined Unique Identifier (Informative))
B.2 UUID Derived UID:
UID may be constructed from the root "2.25." followed by a decimal representation of a Universally Unique Identifier (UUID). That decimal representation treats the 128 bit UUID as an integer, and may thus be up to 39 digits long (leading zeros must be suppressed).
A UUID derived UID may be appropriate for dynamically created UIDs, such as SOP Instance UIDs, but is usually not appropriate for UIDs determined during application software design, such as private SOP Class or Transfer Syntax UIDs, or Implementation Class UIDs.

How to specified multiple attributes in the findscu command

All, Forgive me I am a newbie in the DICOM world. I tried to learn the DCMTk tools to talk with PACS server. But didn't found much tutorial or sample in the internet to know enough about it .Currently I just have the offical document to read.
I just tried the findscu.exe to test c-find command .
I remembered C-Find would return what specified in the request message. for example. If I only specifed the condition Patient Name ='abc' then the reponse would return only attribute Patient Name. Nothing else.( If it is not right . Please correct me.)
So I want to know how to return all the attribute of response DICOM.
Thanks.
How to specified multiple attributes in the findscu command.
Just specify multiple --key (-k) options on the command line. Alternatively, you could also use a "query file" as described in the man page.
So I want to know how to return all the attribute of response DICOM.
Then, you have to specify all attributes (keys) you are interested in. That's how C-FIND works.
By the way, if you are querying a PACS (Query/Retrieve SCP), then you also have to specify the Query/Retrieve Level (0008,0052), e.g. "PATIENT".
Currently I just have the offical document to read.
If you think that the examples in the man page of the findscu tool are not sufficient (and you are actually querying a PACS), this HOWTO might be useful too.
It is totally legal to send a request with Patient Name information only and the PACS will return all matching datasets.
Each dataset should at least contain all mandatory fields like Date of Birth, Patient ID, and so on, depending on the Query Level.
What information is returned by the PACS system on each Query Level should be specified in the DICOM Conformance Statement of the vendor. I would recommend to take a look at this to know, how to set up a valid query to get the information you need and/or if the information is provided by the PACS system.
It is best to include the Unique key and Required Key Attributes in the request attribute list. Also, include the optional attributes (if supported by SCP) when you wish server to return values for them. Please refer to DICOM Standard PS 3.4 section C.2 and C.3 detail information on Query/Retrieve service. List of attribute and type (Unique, Required, Optional) is listed section C.6.1.1.2 (Patient Level), C.6.1.1.3 (Study Level) and so on.

Biztalk Cross Reference Implementation

We have a situation where the value in the source system (Gender) will need to be mapped to a different value in the destination system.
Example Value Lists
Source
M
F
Destination
Male
Female
This is a very useful feature and combined with the database utilization we have decided to implement this for all the list values. Our issue arises when we attempt to utilize this for value lists which have multiple source values to a single destination value.
Example Complex Value list
Source
Adopt Mother
Adopt Father
Legal Guardian
Step Mother
Step Father
Destination
Adopted Mother
Adopted Mother
Other
The system error's with unique key constraints preventing us from mapping the legal Guardian/Step Mother and Step Father to "Other" in the destination message. All examples I've found refer to simple value lists and don't seem to refer to the complex value example mentioned above. Does anyone know if this can be implemented with cross-reference or is this something that we have to create some customized code for.
Use the Value Cross Referencing (It’s a many-to-one mapping) instead of the ID Cross Referencing (It’s a one-to-one mapping). You also get a performance benefit due to Value Cross Referencing uses caching.
See Difference between Value & Id Cross references quoted below (with minor spelling corrections).
I spent some time to know the differences between “id” and “value”
cross referencing and I was able to get the below points which I
thought of worth sharing.
At a high level, these two concepts will look similar. But they
operate with few differences.
Value Cross Referencing
These cannot me modified during run-time.
This occurs between app types.
This cross-referencing is commonly between enumeration fields.
This uses caching mechanism. After any changes in database, we have to restart the corresponding host instances to see the changes.
It’s a many-to-one mapping.
The mapping is guaranteed in only one direction.
When you want to use them for the reverse mapping for a value which is mapped to multiple inputs, the first value stored in the xref
tables is fetched.
The below mapping is allowed. So in this case , the reverse mapping may not give the expected output.
Apple – Fruit
Banana – Fruit
Grape – Fruit
We have to use the GetCommonValue & GetApplicationValue functoids in the maps
Id Cross Referencing
These may be set at run-time. Set Common ID functoid is used for this.
This occurs between appinstance types.
This cross-referencing is commonly between entity unique identifiers.
In this, we will hit the database for every call.
It’s a one-to-one mapping.
The mapping is guaranteed in both directions.
Reverse mapping is always in synch with the initial mapping.
The above mapping is not allowed allowed and are restricted by constraints on the Id cross reference tables.
Apple – Fruit
Banana – Fruit
Grape – Fruit
We have to use the GetCommonId & GetApplicationId functoids in the maps

Count number of digital signatures?

I have a form that allows for multiple signatures. I would like for the form to count the number of signatures and display text if under 3 signatures (as a warning).
How can this be done? I assume the solution would be some sort of VB code.
I found this post but seems to only be a boolean regarding a signature. I've also tried adding a rule on say a Button, but "Conditions" seem very limited. I could pick the signature control, but things like "is not present" or "is blank" doesn't seem to appropriately pick up if there are any signatures or not. I can't find any conditions that correctly detect signatures.
Note this is being filled out on the web. Details on my form setup:
InfoPath 2010 pushed to a Sharepoint site
Section created w/ Digital Signatures enabled for it
"All the signatures are independent" option is used
I did try sum() on the signature control, but it returned NaN
Per this MSDN article, I tried some VBcode but I haven't been able to get the syntax working. I've tried things like <signature_control_name>.Count
In your data source you should have two signatures groups, one nested within the other. All signatures are stored as nodes within the inner most group as Signature nodes.
If you are using script/managed code, you should be able to grab the inner node and then do a count on the number of Signature nodes within it.
I am not sure of a way to do that using just IP rules since there is no actual node there until a signature is applied (IP won't validate the rule and let you save it).

Resources