/// <summary> </summary> /// <param name="context"></param> protected override void DoWork(CodeActivityContext context) { string localStatus = "FAILED"; ActivityStatus.Set(context, localStatus); string sSpatialRegistrationObjectType = ""; int nPatientID = 0; string sManfacturer = ""; string sModel = ""; string sSoftwareVersion = ""; string sModality = ""; string _dcmInstanceId = UnitId.Get(context); int nDcmInstanceId = Convert.ToInt32(_dcmInstanceId); context.GetExtension <CompositionContainer>().SatisfyImportsOnce(this); try { _processSpatialRegistrationObject.RetrieveSpatialRegistrationDetails(nDcmInstanceId, ref nPatientID, ref sManfacturer, ref sModel, ref sSoftwareVersion, ref sModality, ref sSpatialRegistrationObjectType); if (nPatientID > 0) { localStatus = "SUCCESS"; } SpatialRegistrationObjectType.Set(context, sSpatialRegistrationObjectType); PatientID.Set(context, nPatientID); Manufacturer.Set(context, sManfacturer); Model.Set(context, sModel); SoftwareVersion.Set(context, sSoftwareVersion); Modality.Set(context, sModality); ActivityStatus.Set(context, localStatus); } catch (Exception e) { ActivityStatus.Set(context, localStatus); } }