/// <summary> </summary> /// <param name="context"></param> protected override void DoWork(CodeActivityContext context) { string localStatus = "FAILED"; string _dcmInstanceId = UnitId.Get(context); int nDcmInstanceId = Convert.ToInt32(_dcmInstanceId); IList <string> sourceFrameOfReferenceUid = SourceFrameOfReferenceUID.Get(context); string targetFrameOfReferenceUid = TargetFrameOfReferenceUID.Get(context); IList <IList <double> > transformationMatrix = TransformationMatrix.Get(context); IList <int> planningImageIdValues = PlanningImageIdValues.Get(context); IList <int> verificationImageIdValues = VerificationImageIdValues.Get(context); IList <string> planningImageSopInstanceUidValues = PlanningImageSopInstanceValues.Get(context); IList <string> verificationImageSopInstanceUidValues = VerificationImageSopInstanceValues.Get(context); IList <string> planningFrameOfReferenceUidValues = PlanningImageFrameOfReferenceUidValues.Get(context); string spatialRegistrationObjectType = SpatialRegistrationObjectType.Get(context); string siteID = SiteID.Get(context); IList <decimal> dOffsetValues = new List <decimal>(6); int nOffsetId = 0; int nSiteID = 0; int nPatientID = 0; if (siteID.Length > 0) { nSiteID = Convert.ToInt32(siteID); } context.GetExtension <CompositionContainer>().SatisfyImportsOnce(this); bool result = _processSpatialRegistrationObject.PrepAndCreateOffsetRecords( nDcmInstanceId, spatialRegistrationObjectType, planningImageIdValues, verificationImageIdValues, planningImageSopInstanceUidValues, verificationImageSopInstanceUidValues, planningFrameOfReferenceUidValues, sourceFrameOfReferenceUid, targetFrameOfReferenceUid, transformationMatrix, nSiteID, ref nPatientID, ref nOffsetId, ref dOffsetValues); if (result) { localStatus = "SUCCESS"; } PatientID.Set(context, nPatientID.ToString()); OffsetID.Set(context, nOffsetId.ToString()); SroProcessedResult.Set(context, result); OffsetValues.Set(context, dOffsetValues); ActivityStatus.Set(context, localStatus); }
/// <summary> </summary> /// <param name="context"></param> protected override void DoWork(CodeActivityContext context) { string localStatus = "FAILED"; bool status = SroProcessedResult.Get(context); string patientId = PatientID.Get(context); string siteId = SiteID.Get(context); IList <string> referencedImageSopInstanceValues = PlanningImageSopInstanceValues.Get(context); IList <string> verificationImageSopInstanceValues = VerificationImageSopInstanceValues.Get(context); IList <decimal> offsetValues = OffsetValues.Get(context); context.GetExtension <CompositionContainer>().SatisfyImportsOnce(this); bool result = _processSpatialRegistrationObject.SendSroProcessedMessage(status, Convert.ToInt32(patientId), Convert.ToInt32(siteId), referencedImageSopInstanceValues, verificationImageSopInstanceValues, offsetValues); if (result) { localStatus = "SUCCESS"; } ActivityStatus.Set(context, localStatus); }