How does matching work for SOP Class UID in C-Find (Query/Retrieve)? - dicom

I am confused about the role of SOP Class UID in QR Query C-Find.
In the C-Find request can I have SOP Class UID (0008,0016) empty?
In that case, supposed the query was on the IMAGE level, should that field be then populated in each response with the SOP Class UID of that image?
My experience with DCMTK is that it does not populate that field in C-Find response. But I am not sure if this is according to the standard, or a problem in DCMTK or elsewhere in my code which uses DCMTK QR.

You are asking about C-FIND request/response in Query/Retrieve Information Model.
With reference to Table C.6-4. Composite Object Instance Level Keys for the Patient Root Query/Retrieve Information Model in specifications, SOP Class UID is marked [O-Optional].
PS3.4 2021a - Service Class Specifications - C.6.1.1.5 Composite Object Instance Level
In the table:
R = Required (SCP must return value)
U = Unique Identifier (SCU must include this key in query; SCP must support match and return)
O = Optional (SCU may pass empty attribute to request a value. SCP may return value if supported; not mandatory)
But, the important is the note section at the bottom of the table:
Note
SOP Class UID (0008,0016) is an optional key, but it is strongly recommended that it always be returned by all SCPs, if matching is requested.
Although it is optional, specifications strongly recommend to return it.
This is same for IMAGE level with both PATIENT ROOT and STUDY ROOT.
C.6.2.1.4 Composite Object Instance Level
Attributes for the Composite Object Instance Level of the Study Root Query/Retrieve Information Model are the same as the Attributes for the Composite Object Instance Level of the Patient Root Query/Retrieve Information Model described in Section C.6.1.1.5.
PS3.4 2021a - Service Class Specifications - C.6.2.1.4 Composite Object Instance Level
Please refer to this article for simple explanation.
Now, let us answer your questions. I am answering in context of IMAGE level as you are asking about SOP Class UID.
In the C-Find request can I have SOP Class UID (0008,0016) empty?
Yes; you can have any attribute (other than marked U) empty. Attributes marked R are always returned by SCP.
should that field be then populated in each response with the SOP Class UID of that image?
As mentioned above, this is optional. SCP may or may not populate (return) this attribute.

The SOP Instance UID is a mandatory return key for the Query SCP in an IMAGE-Level request. It must not be present in any request on any other level (PATIENT, STUDY, SERIES). The SOP Class UID is optional, but it is usually supported by an SCP. In many places in the Standard SOP Class- and Instance UID form a pair that uniquely identifies the object, and here the SOP Class UID is a required attribute.
So not supporting it would significantly reduce the use scenarios for the SCP.
Since the background of querying for SOP Instance UID is usually: "Please give me a list of images belonging to this particular patient, study and series", it is very common to send it empty with the request. This instructs the SCP to fill in this attribute in its responses.

The documentation of DCMTK's Query/Retrieve SCP "dcmqrscp" does not list SOP Class UID (0008,0016) for the IMAGE level. Please note that support for this attribute is not required as others already explained.

Related

Why does Container.CreateItemAsync have a partitionKey parameter?

With regards to the partitionKey parameter, the docs for Container.CreateItemAsync says:
PartitionKey for the item. If not specified will be populated by extracting from {T}
It is true, when left as null the API works and uses the partition key in the provided document model. However, the reverse does not work -- if I do not provide a partition key in the model (no property at all so that a field is not even serialized), but I provide the parameter, I get this error:
PartitionKey extracted from document doesn't match the one specified in the header
So there is never a case where I am not required to provide the partition key in the model, but I can optionally provide it as a parameter.
Then why have the parameter at all?
It maybe helpful if you're going through the source code.
When it calls public abstract Task<ItemResponse> CreateItemAsync() method, the implemented method public async Task<ItemResponse> CreateItemAsync() is actually executed.
Inside that method, you can see it uses private async Task ExtractPartitionKeyAndProcessItemStreamAsync() method to process partitionKey like below:
If user specifies a partitionKey, it will check the value is valid or not, then decide to use the partitionKey or not. The code is here.
If user does not specify a partitionkey, this code will be executed to automatically fetch it from model. The code is here.
So in short, the answer is that the parameter here is for someone who wants to specify a custom partitionKey(but should be valid, the source code will check it), and does not want to automatically extract partitionKey from model.

In Corda, what should `PartyAndReference.reference` be set to?

When defining a FungibleAsset in Corda, you need to provide an issuer reference in the form of a PartyAndReference.
PartyAndReference is a combination of:
party: AbstractParty, the on-ledger identity of the party issuing the asset
reference: OpaqueBytes
What should this reference: OpaqueBytes field be set to?
The JavaDocs state that the reference field is supposed to represent "something being stored or issued by a party e.g. in a vault or (more likely) on their normal ledger".
However, if two FungibleAsset states have different reference fields but are otherwise completely identical, they are no longer considered fungible. This is because there is no logic provided for combining the different reference fields into a single combined reference field.
This feature will likely be redesigned in the future. In the short-run, I'd advise setting this field to a dummy value shared across all of the fungible assets you issue, such as OpaqueBytes.of(0).

API-PLATFORM - model with object serialized to string at endpoint

I faced the problem with generating React components with api-platform-generate-crud.
Model has property that is object email.
I have serializer that make my email object a string.
API endpoint is serving string.
It works for GET & POST.
When I try to generate React components error message is
TypeError: Cannot read property '0' of undefined
Looking deeper into it, looks like that generator still see my email as object not a string.
Any idea how I can force API to 'see' email property as string not object ?
The data model you define is authoritative. Types in the Hydra documentation reflect the ones in PHP classes.
Here, the email property is of type object. If you set the related data as a string somewhere, you don't respect this contract anymore. The Hydra documentation is not in sync with the returned data.
You can change the type of the email property in the Hydra documentation by decorating the api_platform.hydra.normalizer.documentation service.
But I would recommend to keep the PHP classes' structure of your entities as close as possible of the structure exposed through the API.
Your classes should reflect the output of the API. You can use custom data providers to deal with more complex data structure (ex: ORM entities) before hydrating the structure to expose.

How to write OCL contraint

I am new to OCL, I am using papyrus on eclipse luna 4.4.2
I have a class diagram named CLIENT with the constraint {all attributes are out of scope} a second class named Customer with the constraint {all attributes are mandatory} and another class call Address having an attribute provenance with the constraint {provenance shall be mandatory}
How should I write the OCL constraint that suit the formal language?
will also like to know how to verify the correctness of the syntax?
In case of an collection it checks for non-emptiness and otherwise for an attribute it checks for non-null.
context Address inv: self.provenance->notEmpty()
For the other classes you have to do this for every attribute. If you want to do this for every attribute with one invariant you have to formulate them on the metamodel.

HttpServletRequest getting request parameters separated by # instead of?

I am trying to get the Query String Parameters in the controller from the following URL using javax.servlet.http.HttpServletRequest object:
http://example.com:8080/OAuthClient/oauth-callback#access_token=something&expires_in=1209600&username=abcuser
It does not work because it is separated by # instead of ?
Hence it works if I change the request to http://example.com:8080/OAuthClient/oauth-callback?access_token=something&expires_in=1209600&username=abcuser
Is there a way to work around this problem? I have to make it work with # separated query parameters. which property will contain the data after oauth-callback?
Those aren't query parameters. They're the fragment of the URI - and that isn't sent to the server at all. It can only be used client-side.
From RFC 3986:
A fragment identifier component is indicated by the presence of a number sign ("#") character and terminated by the end of the URI.
... and (emphasis mine)
Fragment identifiers have a special role in information retrieval
systems as the primary form of client-side indirect referencing,
allowing an author to specifically identify aspects of an existing
resource that are only indirectly provided by the resource owner. As
such, the fragment identifier is not used in the scheme-specific
processing of a URI; instead, the fragment identifier is separated
from the rest of the URI prior to a dereference, and thus the
identifying information within the fragment itself is dereferenced
solely by the user agent, regardless of the URI scheme.

Resources