本文整理汇总了C#中IPersistenceContext类的典型用法代码示例。如果您正苦于以下问题:C# IPersistenceContext类的具体用法?C# IPersistenceContext怎么用?C# IPersistenceContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IPersistenceContext类属于命名空间,在下文中一共展示了IPersistenceContext类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Capture
protected override OperationData Capture(IServiceOperationRecorderContext recorderContext, IPersistenceContext persistenceContext)
{
var request = (WorklistItemTextQueryRequest) recorderContext.Request;
return request.UseAdvancedSearch ?
new SearchOperationData(Operations.WorklistSearch, request.SearchFields)
: new SearchOperationData(Operations.WorklistSearch, request.TextQuery);
}
示例2: LoadRequestAttributes
/// <summary>
/// Load the values for the sequence <see cref="DicomTags.RequestAttributesSequence"/>
/// into a response message for a specific series.
/// </summary>
/// <param name="read">The connection to use to read the values.</param>
/// <param name="response">The message to add the values into.</param>
/// <param name="row">The <see cref="Series"/> entity to load the related <see cref="RequestAttributes"/> entity for.</param>
private static void LoadRequestAttributes(IPersistenceContext read, DicomMessageBase response, Series row)
{
var select = read.GetBroker<IRequestAttributesEntityBroker>();
var criteria = new RequestAttributesSelectCriteria();
criteria.SeriesKey.EqualTo(row.GetKey());
IList<RequestAttributes> list = select.Find(criteria);
if (list.Count == 0)
{
response.DataSet[DicomTags.RequestAttributesSequence].SetNullValue();
return;
}
foreach (RequestAttributes request in list)
{
var item = new DicomSequenceItem();
item[DicomTags.ScheduledProcedureStepId].SetStringValue(request.ScheduledProcedureStepId);
item[DicomTags.RequestedProcedureId].SetStringValue(request.RequestedProcedureId);
response.DataSet[DicomTags.RequestAttributesSequence].AddSequenceItem(item);
}
}
示例3: LoadPreferredSyntaxes
/// <summary>
/// Load a list of preferred SOP Classes and Transfer Syntaxes for a Device.
/// </summary>
/// <param name="read">A read context to read from the database.</param>
public void LoadPreferredSyntaxes(IPersistenceContext read)
{
var select = read.GetBroker<IDevicePreferredTransferSyntaxEntityBroker>();
// Setup the select parameters.
var criteria = new DevicePreferredTransferSyntaxSelectCriteria();
criteria.DeviceKey.EqualTo(_remoteDevice.GetKey());
IList<DevicePreferredTransferSyntax> list = select.Find(criteria);
// Translate the list returned into the database into a list that is supported by the Storage SCU Component
var sopList = new List<SupportedSop>();
foreach (DevicePreferredTransferSyntax preferred in list)
{
var sop = new SupportedSop
{
SopClass = SopClass.GetSopClass(preferred.GetServerSopClass().SopClassUid)
};
sop.AddSyntax(TransferSyntax.GetTransferSyntax(preferred.GetServerTransferSyntax().Uid));
sopList.Add(sop);
}
SetPreferredSyntaxList(sopList);
}
示例4: ReconnectRelatedPatientInformation
/// <summary>
/// All pertinent data other than the Profiles gets copied from otherPatient to thisPatient
/// </summary>
/// <param name="thisPatient"></param>
/// <param name="otherPatient"></param>
/// <param name="context"></param>
static private void ReconnectRelatedPatientInformation(Patient thisPatient, Patient otherPatient, IPersistenceContext context)
{
foreach (PatientNote note in otherPatient.Notes)
{
thisPatient.AddNote(note);
}
OrderSearchCriteria orderCriteria = new OrderSearchCriteria();
orderCriteria.Patient.EqualTo(otherPatient);
IList<Order> otherOrders = context.GetBroker<IOrderBroker>().Find(orderCriteria);
foreach (Order order in otherOrders)
{
order.Patient = thisPatient;
}
VisitSearchCriteria visitCriteria = new VisitSearchCriteria();
visitCriteria.Patient.EqualTo(otherPatient);
IList<Visit> otherVisits = context.GetBroker<IVisitBroker>().Find(visitCriteria);
foreach (Visit visit in otherVisits)
{
visit.Patient = thisPatient;
}
// TODO: delete the otherPatient
}
示例5: CreateWorklistItemSummary
public ReportingWorklistItemSummary CreateWorklistItemSummary(ReportingWorklistItem domainItem, IPersistenceContext context)
{
PersonNameAssembler assembler = new PersonNameAssembler();
return new ReportingWorklistItemSummary(
domainItem.ProcedureStepRef,
domainItem.ProcedureRef,
domainItem.OrderRef,
domainItem.PatientRef,
domainItem.PatientProfileRef,
domainItem.ReportRef,
new MrnAssembler().CreateMrnDetail(domainItem.Mrn),
assembler.CreatePersonNameDetail(domainItem.PatientName),
domainItem.AccessionNumber,
EnumUtils.GetEnumValueInfo(domainItem.OrderPriority, context),
EnumUtils.GetEnumValueInfo(domainItem.PatientClass),
domainItem.DiagnosticServiceName,
domainItem.ProcedureName,
domainItem.ProcedurePortable,
domainItem.HasErrors,
EnumUtils.GetEnumValueInfo(domainItem.ProcedureLaterality, context),
domainItem.ProcedureStepName,
domainItem.Time,
domainItem.ActivityStatus.HasValue ? EnumUtils.GetEnumValueInfo(domainItem.ActivityStatus.Value, context) : null,
domainItem.ReportPartIndex
);
}
示例6: Capture
protected override OperationData Capture(IServiceOperationRecorderContext recorderContext, IPersistenceContext persistenceContext)
{
var response = (LoadPatientProfileForEditResponse)recorderContext.Response;
var patientProfile = persistenceContext.Load<PatientProfile>(response.PatientProfileRef, EntityLoadFlags.None);
return new OperationData(Operations.OpenForUpdate, patientProfile);
}
示例7: ModelloContabileService
public ModelloContabileService(IRipartizioneSpeseService ripartizioneSpeseService, IUtenzaService utenzaService, IPersistenceContext persistenceContext, IDaoFactory daoFactory)
{
_ripartizioneSpeseService = ripartizioneSpeseService;
_utenzaService = utenzaService;
_persistenceContext = persistenceContext;
_daoFactory = daoFactory;
}
示例8: CreateReportSummary
public ReportSummary CreateReportSummary(Procedure rp, Report report, IPersistenceContext context)
{
ReportSummary summary = new ReportSummary();
ProcedureAssembler rpAssembler = new ProcedureAssembler();
if (report != null)
{
summary.ReportRef = report.GetRef();
summary.ReportStatus = EnumUtils.GetEnumValueInfo(report.Status, context);
// use all procedures attached to report
summary.Procedures = CollectionUtils.Map<Procedure, ProcedureSummary>(report.Procedures,
delegate(Procedure p) { return rpAssembler.CreateProcedureSummary(p, context); });
}
else
{
// use supplied procedure
summary.Procedures = CollectionUtils.Map<Procedure, ProcedureSummary>(new Procedure[] { rp },
delegate(Procedure p) { return rpAssembler.CreateProcedureSummary(p, context); });
}
Order order = rp.Order;
summary.VisitNumber = new VisitAssembler().CreateVisitNumberDetail(order.Visit.VisitNumber);
summary.AccessionNumber = order.AccessionNumber;
summary.DiagnosticServiceName = order.DiagnosticService.Name;
return summary;
}
示例9: UpdateProcedureType
public void UpdateProcedureType(ProcedureType procType, ProcedureTypeDetail detail, IPersistenceContext context)
{
procType.Id = detail.Id;
procType.Name = detail.Name;
procType.BaseType = detail.CustomProcedurePlan && detail.BaseType != null
? context.Load<ProcedureType>(detail.BaseType.ProcedureTypeRef, EntityLoadFlags.Proxy)
: null;
procType.DefaultDuration = detail.DefaultDuration;
procType.Deactivated = detail.Deactivated;
try
{
if(detail.CustomProcedurePlan)
{
procType.Plan = new ProcedurePlan(detail.PlanXml);
}
else
{
var modality = context.Load<Modality>(detail.DefaultModality.ModalityRef);
procType.Plan = ProcedurePlan.CreateDefaultPlan(detail.Name, modality);
}
}
catch (XmlException e)
{
throw new RequestValidationException(string.Format("Procedure plan XML is invalid: {0}", e.Message));
}
}
示例10: ImportazioneDocumentiBolletteService
public ImportazioneDocumentiBolletteService(IUtenzaCsvRepository utenzaCsvRepository, IUtenzaDocumentoService utenzaDocumentoService, IPersistenceContext persistenceContext, IFileSystem fileSystem)
{
_utenzaDocumentoService = utenzaDocumentoService;
_fileSystem = fileSystem;
_utenzaCsvRepository = utenzaCsvRepository;
_persistenceContext = persistenceContext;
}
示例11: CreateReportDetail
public ReportDetail CreateReportDetail(Report report, bool includeCancelledParts, IPersistenceContext context)
{
ReportDetail detail = new ReportDetail();
detail.ReportRef = report.GetRef();
detail.ReportStatus = EnumUtils.GetEnumValueInfo(report.Status, context);
ProcedureAssembler rpAssembler = new ProcedureAssembler();
detail.Procedures = CollectionUtils.Map<Procedure, ProcedureDetail>(report.Procedures,
delegate(Procedure p)
{
return rpAssembler.CreateProcedureDetail(
p,
delegate(ProcedureStep ps) { return ps.Is<ReportingProcedureStep>(); }, // only Reporting steps are relevant
false, // exclude protocols
context);
});
List<ReportPartDetail> parts = CollectionUtils.Map<ReportPart, ReportPartDetail>(report.Parts,
delegate(ReportPart part) { return CreateReportPartDetail(part, context); });
detail.Parts = includeCancelledParts ? parts :
CollectionUtils.Select(parts,
delegate(ReportPartDetail rpp)
{
return rpp.Status.Code.Equals(ReportPartStatus.X.ToString()) == false;
});
return detail;
}
示例12: CreateSysAdminUser
private static void CreateSysAdminUser(AuthorityGroup adminGroup, SetupCommandLine cmdLine, IPersistenceContext context, TextWriter log)
{
try
{
// create the sa user, if doesn't already exist
IUserBroker userBroker = context.GetBroker<IUserBroker>();
UserSearchCriteria where = new UserSearchCriteria();
where.UserName.EqualTo(cmdLine.SysAdminUserName);
userBroker.FindOne(where);
log.WriteLine(string.Format("User '{0}' already exists.", cmdLine.SysAdminUserName));
}
catch (EntityNotFoundException)
{
HashedSet<AuthorityGroup> groups = new HashedSet<AuthorityGroup>
{
adminGroup
};
// create sa user using initial password, set to expire never
User saUser = User.CreateNewUser(
new UserInfo(cmdLine.SysAdminUserName, cmdLine.SysAdminDisplayName, null, null, null),
Password.CreatePassword(cmdLine.SysAdminInitialPassword, null),
groups);
context.Lock(saUser, DirtyState.New);
}
}
示例13: UpdateExternalPractitioner
public void UpdateExternalPractitioner(ExternalPractitionerDetail detail, ExternalPractitioner prac, IPersistenceContext context)
{
// validate that only one contact point is specified as default
var defaultPoints = CollectionUtils.Select(detail.ContactPoints, cp => cp.IsDefaultContactPoint);
if(defaultPoints.Count > 1)
throw new RequestValidationException(SR.ExceptionOneDefaultContactPoint);
var assembler = new PersonNameAssembler();
assembler.UpdatePersonName(detail.Name, prac.Name);
prac.LicenseNumber = detail.LicenseNumber;
prac.BillingNumber = detail.BillingNumber;
prac.MarkDeactivated(detail.Deactivated);
// update contact points collection
var syncHelper = new CollectionSynchronizeHelper<ExternalPractitionerContactPoint, ExternalPractitionerContactPointDetail>(
delegate (ExternalPractitionerContactPoint cp, ExternalPractitionerContactPointDetail cpDetail)
{
// ignore version in this comparison - deal with this issue in the update delegate
return cp.GetRef().Equals(cpDetail.ContactPointRef, true);
},
delegate (ExternalPractitionerContactPointDetail cpDetail, ICollection<ExternalPractitionerContactPoint> cps)
{
// create a new contact point
var cp = new ExternalPractitionerContactPoint(prac);
UpdateExternalPractitionerContactPoint(cpDetail, cp, context);
cps.Add(cp);
},
(cp, cpDetail, cps) => UpdateExternalPractitionerContactPoint(cpDetail, cp, context),
(cp, cps) => cps.Remove(cp));
syncHelper.Synchronize(prac.ContactPoints, detail.ContactPoints);
ExtendedPropertyUtils.Update(prac.ExtendedProperties, detail.ExtendedProperties);
}
示例14: CreateModalityPerformedProcedureStepDetail
public ModalityPerformedProcedureStepDetail CreateModalityPerformedProcedureStepDetail(ModalityPerformedProcedureStep mpps, IPersistenceContext context)
{
var assembler = new ModalityProcedureStepAssembler();
// include the details of each MPS in the mpps summary
var mpsDetails = CollectionUtils.Map(mpps.Activities,
(ProcedureStep mps) => assembler.CreateProcedureStepSummary(mps.As<ModalityProcedureStep>(), context));
var dicomSeriesAssembler = new DicomSeriesAssembler();
var dicomSeries = dicomSeriesAssembler.GetDicomSeriesDetails(mpps.DicomSeries);
StaffSummary mppsPerformer = null;
var performer = mpps.Performer as ProcedureStepPerformer;
if (performer != null)
{
var staffAssembler = new StaffAssembler();
mppsPerformer = staffAssembler.CreateStaffSummary(performer.Staff, context);
}
return new ModalityPerformedProcedureStepDetail(
mpps.GetRef(),
EnumUtils.GetEnumValueInfo(mpps.State, context),
mpps.StartTime,
mpps.EndTime,
mppsPerformer,
mpsDetails,
dicomSeries,
ExtendedPropertyUtils.Copy(mpps.ExtendedProperties));
}
示例15: Execute
public void Execute(ReportPart reportPart, IPersistenceContext context)
{
if (_enabled == false)
return;
LogicalHL7Event.ReportPublished.EnqueueEvents(reportPart.Report);
}