Coercion is the process of manipulating DICOM tags during the incoming DICOM C-STORE to the OnePacs Gateway. Coercion rules are defined as XSL transformations in <OPG_HOME>\server\default\conf\dcm4chee-ae\cstorerq.xsl. In order for the forwarded instances to include the changes in the coercion rules, one of the following must be done. The StoreSCP must be modified to set CoerceBeforeWrite to true. Alternatively, to leave the incoming files as-is and coerce the outbound instances, the <OPG_HOME>\server\default\conf\dcm4chee-ae\out-cstorerq.xsl file can be modified. The following XSL in the dataset element would overwrite tag ( The following XSL could be added to the "dataset" element in the cstorerq.xsl file to place the called AE title into tag (0032,1021): The following XSL could be added to the "dataset" element in the cstorerq.xsl file to place the calling AE title in tag (0032,1021): It's possible to use DICOM coercion to make more advanced manipulation of DICOM tags. Please make sure you completely understand coercion rules and facility distribution rules before making custom DICOM coercion changes.Coercion Basics
Applying coerced tags to instances forwarded to the cloud
Save the DICOM coercion changes to the instances before they are written to disk
Coerce the outbound instances with the coerced values from the database
0008,0050
) with the value of the same tag in the database.Modify outbound coercion in out-cstorerq.xsl
<attr tag=
"00080050"
vr=
"SH"
>
<xsl:value-of select=
"attr[@tag='00080050']"
/>
</attr>
Example: Fixing illegal DICOM tag (0028,0008) "Number of Frames" with value of -1
<xsl:if test="attr[@tag='00280008']=-1">
<attr tag="00280008" vr="IS">1</attr>
</xsl:if>
Example: Called AE Title
<attr tag="00321021" vr="AE">
<xsl:value-of select="$called"/>
</attr>
Example: Calling AE Title
<attr tag="00321021" vr="AE">
<xsl:value-of select="$calling"/>
</attr>
Other tags, more complex rules