public SystemConfigurationController(IAuthenticationService authenticationService, IGridConfigService gridConfigService, IDiagnosticService diagnosticService, ISystemConfigurationService systemConfigurationService) : base(authenticationService, diagnosticService, systemConfigurationService) { _systemConfigurationService = systemConfigurationService; _gridConfigService = gridConfigService; }
/// <summary> /// Validate the message /// </summary> internal static void Validate(IMessage message, ISystemConfigurationService config, List <IResultDetail> dtls, IServiceProvider context) { // Structure validation PipeParser pp = new PipeParser() { ValidationContext = new DefaultValidation() }; try { pp.Encode(message); } catch (Exception e) { dtls.Add(new ValidationResultDetail(ResultDetailType.Error, e.Message, e)); } // Validation of sending application try { Terser msgTerser = new Terser(message); object obj = msgTerser.getSegment("MSH") as NHapi.Model.V25.Segment.MSH; if (obj != null) { var msh = obj as NHapi.Model.V25.Segment.MSH; var domainId = new ComponentUtility() { Context = context }.CreateDomainIdentifier(msh.SendingApplication, dtls); if (!config.IsRegisteredDevice(domainId)) { dtls.Add(new UnrecognizedSenderResultDetail(domainId)); } } else { obj = msgTerser.getSegment("MSH") as NHapi.Model.V231.Segment.MSH; if (obj != null) { var msh = obj as NHapi.Model.V231.Segment.MSH; var domainId = new ComponentUtility() { Context = context }.CreateDomainIdentifier(msh.SendingApplication, dtls); if (!config.IsRegisteredDevice(domainId)) { dtls.Add(new UnrecognizedSenderResultDetail(domainId)); } } else { dtls.Add(new MandatoryElementMissingResultDetail(ResultDetailType.Error, "Missing MSH", "MSH")); } } } catch (Exception e) { dtls.Add(new ResultDetail(ResultDetailType.Error, e.Message, e)); } }
/// <summary> /// Enrich the registration event /// </summary> internal void EnrichRegistrationEvent(IDbConnection conn, IDbTransaction tx, RegistrationEvent hsrEvent) { decimal tryDec; ISystemConfigurationService configService = ApplicationContext.ConfigurationService; // Create a query based on the person Person subject = hsrEvent.FindComponent(HealthServiceRecordSiteRoleType.SubjectOf) as Person; if (subject.AlternateIdentifiers.Exists(o => o.Domain == configService.OidRegistrar.GetOid(ClientRegistryOids.CLIENT_CRID).Oid)) { subject = new Person() { AlternateIdentifiers = new List <DomainIdentifier>(subject.AlternateIdentifiers.FindAll(o => o.Domain == configService.OidRegistrar.GetOid(ClientRegistryOids.CLIENT_CRID).Oid)), Status = StatusType.Normal } } ; else if (subject.AlternateIdentifiers.Exists(o => o is AuthorityAssignedDomainIdentifier)) { subject = new Person() { AlternateIdentifiers = new List <DomainIdentifier>(subject.AlternateIdentifiers.FindAll(o => o is AuthorityAssignedDomainIdentifier)), Status = StatusType.Normal } } ; else { subject = new Person() { AlternateIdentifiers = new List <DomainIdentifier>(subject.AlternateIdentifiers), Status = StatusType.Normal } }; QueryEvent query = new QueryEvent(); RegistrationEvent evt = new RegistrationEvent(); query.Add(evt, "SUBJ", HealthServiceRecordSiteRoleType.SubjectOf, null); evt.Status = StatusType.Active | StatusType.Obsolete; evt.Add(subject, "SUBJ", HealthServiceRecordSiteRoleType.SubjectOf, null); query.Add(new QueryParameters() { MatchingAlgorithm = MatchAlgorithm.Exact, MatchStrength = MatchStrength.Exact }, "FLTR", HealthServiceRecordSiteRoleType.FilterOf, null); var tRecordIds = QueryRecord(query); if (tRecordIds.Length != 1) { throw new MissingPrimaryKeyException(ApplicationContext.LocaleService.GetString("DBCF004")); } else if (tRecordIds[0].Domain != configService.OidRegistrar.GetOid(ClientRegistryOids.REGISTRATION_EVENT).Oid) { throw new MissingPrimaryKeyException(ApplicationContext.LocaleService.GetString("DBCF005")); } tryDec = Decimal.Parse(tRecordIds[0].Identifier); hsrEvent.AlternateIdentifier = tRecordIds[0]; }
/// <summary> /// Persists the item /// </summary> public MARC.HI.EHRS.SVC.Core.DataTypes.VersionedDomainIdentifier Persist(System.Data.IDbConnection conn, System.Data.IDbTransaction tx, System.ComponentModel.IComponent data, bool isUpdate) { ISystemConfigurationService configSvc = ApplicationContext.ConfigurationService; //ApplicationContext.Current.GetService(typeof(ISystemConfigurationService)) as ISystemConfigurationService; // In order to persist we first must get the id of the hsr var componentRef = data as HealthServiceRecordComponentRef; if (componentRef.AlternateIdentifier.Domain.Equals(configSvc.OidRegistrar.GetOid(ClientRegistryOids.REGISTRATION_EVENT).Oid)) { componentRef.Id = Decimal.Parse(componentRef.AlternateIdentifier.Identifier); } else { throw new ConstraintException("Referenced record cannot be found in this repository"); } // Link the records if the record is a hard link if (!(componentRef.Site as HealthServiceRecordSite).IsSymbolic) { LinkHSRRecord(conn, tx, componentRef); } return(new MARC.HI.EHRS.SVC.Core.DataTypes.VersionedDomainIdentifier() { Domain = ClientRegistryOids.EVENT_OID, Identifier = componentRef.Id.ToString() }); }
/// <summary> /// De-persist the MI /// </summary> public System.ComponentModel.IComponent DePersist(System.Data.IDbConnection conn, decimal identifier, System.ComponentModel.IContainer container, HealthServiceRecordSiteRoleType?roleType, bool loadFast) { // De-persist the masking record ISystemConfigurationService sysConfig = ApplicationContext.ConfigurationService; // Load the observation event MaskingIndicator retVal = new MaskingIndicator(); using (IDbCommand cmd = DbUtil.CreateCommandStoredProc(conn, null)) { cmd.CommandText = "get_psn_msk_ind"; cmd.Parameters.Add(DbUtil.CreateParameterIn(cmd, "msk_id_in", DbType.Decimal, identifier)); // Execute the reader using (IDataReader rdr = cmd.ExecuteReader()) { if (rdr.Read()) { retVal.MaskingCode = new MARC.HI.EHRS.SVC.Core.DataTypes.CodeValue(Convert.ToString(rdr["msk_cs"])); } } // Append to the container if (container is Person) { (container as Person).Add(retVal, Guid.NewGuid().ToString(), MARC.HI.EHRS.SVC.Core.ComponentModel.HealthServiceRecordSiteRoleType.FilterOf, null); } } return(retVal); }
/// <summary> /// Create custodial data from either a RepositoryDevice or a HealthcareParticipant /// </summary> private Everest.RMIM.UV.NE2008.MFMI_MT700701UV01.Custodian CreateCustodian(RegistrationEvent registrationEvent, TargetConfiguration configuration) { ISystemConfigurationService sysConfig = this.Context.GetService(typeof(ISystemConfigurationService)) as ISystemConfigurationService; var subject = registrationEvent.FindComponent(SVC.Core.ComponentModel.HealthServiceRecordSiteRoleType.SubjectOf) as Person; var iiSet = new List <II>(CreateIISet(subject.AlternateIdentifiers)); iiSet.RemoveAll(ii => !configuration.NotificationDomain.Exists(o => o.Domain.Equals(ii.Root))); var oidData = sysConfig.OidRegistrar.FindData(iiSet[0].Root); if (oidData == null) { throw new InvalidOperationException("Cannot find notification settings for " + oidData); } var retVal = new Everest.RMIM.UV.NE2008.MFMI_MT700701UV01.Custodian( new Everest.RMIM.UV.NE2008.COCT_MT090003UV01.AssignedEntity() ); // Device retVal.AssignedEntity.SetAssignedPrincipalChoiceList( new Everest.RMIM.UV.NE2008.COCT_MT090303UV01.Device( SET <II> .CreateSET(new II(oidData.Attributes.Find(o => o.Key == "CustodialDeviceId").Value ?? oidData.Oid)), null, oidData.Attributes.Find(o => o.Key == "CustodialDeviceName").Value ?? oidData.Description ) ); retVal.AssignedEntity.Id = SET <II> .CreateSET(new II(oidData.Oid)); return(retVal); }
/// <summary> /// Handle HL7 message /// </summary> /// <param name="e"></param> /// <returns></returns> public NHapi.Base.Model.IMessage HandleMessage(HL7.TransportProtocol.Hl7MessageReceivedEventArgs e) { ISystemConfigurationService config = this.Context.GetService(typeof(ISystemConfigurationService)) as ISystemConfigurationService; ILocalizationService locale = this.Context.GetService(typeof(ILocalizationService)) as ILocalizationService; // Get the message type IMessage response = null; if (e.Message.Version == "2.5") { // Get the MSH segment var msh = e.Message.GetStructure("MSH") as MSH; switch (msh.MessageType.TriggerEvent.Value) { case "Q22": response = HandlePdqQuery(e.Message as QBP_Q21, e); break; default: response = MessageUtil.CreateNack(e.Message, "AR", "201", locale.GetString("HL7201"), config); break; } } // response still null? if (response == null) { response = MessageUtil.CreateNack(e.Message, "AR", "203", locale.GetString("HL7203"), config); } return(response); }
public void VisualiseSchemaAsMap_returns_viewcontroller_with_mapdefaultzoom_as_from_systemconfiguration_service() { //arrange IList <FilterCriteria> filter = null; DataSetSchema schema = null; var ds = new DataSet(); ds.Tables.Add(ReturnDataTable(null, 0)); //table1 ds.Tables.Add(ReturnDataTable(null, 1)); //table2 ds.Tables.Add(ReturnDataTable(null, 0)); //table3 var mock = new Mock <IDataSetDetailSqlRepo>(); mock.Setup(x => x.ExecuteQueryVisualiseSchemaMap(_repositoryDataSetDetail.DbConnectionString, null, null)).Returns(ds); _sqlRepo = mock.Object; var mock2 = new Mock <ISystemConfigurationService>(); mock2.Setup(x => x.GetSystemConfigurations()).Returns(new SystemConfigurationObject() { MapDefaultZoom = "3" }); _systemConfigurationService = mock2.Object; var sut = new DataSetDetailService(_systemConfigurationService, _repositoryDataSetDetail, _dataSetSchemaService, _sqlRepo, _sqlColumnTextFormatter); //act var result = sut.VisualiseSchemaAsMap(filter, schema); //assert Assert.AreEqual(3, result.MapDefaultZoom); //cleanup _sqlRepo = null; _systemConfigurationService = null; }
/// <summary> /// Handle message /// </summary> public NHapi.Base.Model.IMessage HandleMessage(HL7.TransportProtocol.Hl7MessageReceivedEventArgs e) { // Get the config service ISystemConfigurationService config = Context.GetService(typeof(ISystemConfigurationService)) as ISystemConfigurationService; return(MessageUtil.CreateNack(e.Message, "AR", "200", "Unsupported message type", config)); }
public void TestInit() { // ObjectFactory.Initialize( //x => //{ // x.For<IUnitOfWorkFactory>().Use<MemoryUnitOfWorkFactory>(); // x.For(typeof(IRepository<>)).Use(typeof(MemoryRepository<>)); // x.For<ICategoryService>().Use<CategoryService>(); // x.For<ISystemConfigurationService>().Use<SystemConfigurationService>(); // x.For<>() //} //); //var mock2 = new Mock<ICategoryService>(); //_categoryService = mock2.Object; var mock3 = new Mock <ISystemConfigurationService>(); mock3.Setup(x => x.GetSystemConfigurations()).Returns(new SystemConfigurationObject()); _systemConfigurationService = mock3.Object; _mockResponseBase = new Mock <HttpResponseBase>(); _mockHttpContextBase = new Mock <HttpContextBase>(); }
public WildlifeClassController(IWildlifeCategoryService wildlifeCategoryService, ILogService logService, ISystemConfigurationService systemConfigurationService) { _wildlifeCategoryService = wildlifeCategoryService; _logService = logService; _systemConfigurationService = systemConfigurationService; }
public SystemConfigurationController(ILog log, ISystemConfigurationService systemConfigurationService, IFeatureService featureService, ILocalizationService localizationService, IUserService userService, ISiteService siteService) : base(log, localizationService, userService, siteService) { this.log = log; this.systemConfigurationService = systemConfigurationService; this.featureService = featureService; }
public TemplateController(ITemplateService templateService, ILogService logService, ISystemConfigurationService systemConfigurationService, IArticleAttachService articleAttachService) { _templateService = templateService; _logService = logService; _systemConfigurationService = systemConfigurationService; _articleAttachService = articleAttachService; }
public RouteController(IRouteService routeService, ILogService logService, ISystemConfigurationService systemConfigurationService, IRouteViewSpotService routeViewSpotService) { _routeService = routeService; _routeViewSpotService = routeViewSpotService; _logService = logService; _systemConfigurationService = systemConfigurationService; }
/// <summary> /// Persist the specified data /// </summary> public VersionedDomainIdentifier Persist(IDbConnection conn, IDbTransaction tx, System.ComponentModel.IComponent data, bool isUpdate) { ISystemConfigurationService configServce = ApplicationContext.ConfigurationService; //ApplicationContext.Current.GetService(typeof(ISystemConfigurationService)) as ISystemConfigurationService; // First, we must determine if we're going to be performing an update or a put RegistrationEvent hsr = data as RegistrationEvent; try { // Does this record have an identifier that is valid? if (hsr.AlternateIdentifier != null && !hsr.AlternateIdentifier.Domain.Equals(configServce.OidRegistrar.GetOid(ClientRegistryOids.REGISTRATION_EVENT).Oid)) { throw new InvalidOperationException(String.Format("Could not find an identifier for the event that falls in the custodian domain '{0}'", configServce.OidRegistrar.GetOid(ClientRegistryOids.REGISTRATION_EVENT).Oid)); } else if (hsr.AlternateIdentifier != null) { hsr.Id = Decimal.Parse(hsr.AlternateIdentifier.Identifier); } else if (isUpdate && hsr.Site == null) { throw new ArgumentException("Cannot update an event that is not identified"); } // Is there a parent that we can grab a language code from var parent = DbUtil.GetRegistrationEvent(data); // Default language code hsr.LanguageCode = hsr.LanguageCode ?? (parent != null ? parent.LanguageCode : configServce.JurisdictionData.DefaultLanguageCode); // Create an HSR event if this is not one if (!isUpdate || hsr.AlternateIdentifier == null) { hsr.AlternateIdentifier = CreateHSRRecord(conn, tx, hsr); hsr.Id = Convert.ToDecimal(hsr.AlternateIdentifier.Identifier); hsr.VersionIdentifier = Convert.ToDecimal(hsr.AlternateIdentifier.Version); // Is there any sort of linkage we need to create if (hsr.Site != null && hsr.Site.Container != null && !(hsr.Site as HealthServiceRecordSite).IsSymbolic) { LinkHSRRecord(conn, tx, hsr); } } else { hsr.VersionIdentifier = CreateHSRVersion(conn, tx, hsr); hsr.AlternateIdentifier.Version = hsr.VersionIdentifier.ToString(); } DbUtil.PersistComponents(conn, tx, isUpdate, this, hsr); } catch (Exception ex) { Trace.TraceError(ex.ToString()); throw; } return(hsr.AlternateIdentifier); }
/// <summary> /// Create and initialize an instance of the LoginController class. /// </summary> /// <param name="log"></param> /// <param name="authenticationService"></param> /// <param name="systemConfigurationService"></param> /// <param name="messageService"></param> /// <param name="localizationService"></param> /// <param name="userService"></param> /// <param name="siteService"></param> public LoginController(ILog log, IAuthenticationService authenticationService, ISystemConfigurationService systemConfigurationService, IMessageService messageService, ILocalizationService localizationService, IUserService userService, ISiteService siteService) : base(log, localizationService, userService, siteService) { this.log = log; this.authenticationService = authenticationService; this.messageService = messageService; this.systemConfigurationService = systemConfigurationService; }
/// <summary> /// Get container /// </summary> public IContainer GetContainer(MARC.HI.EHRS.SVC.Core.DataTypes.VersionedDomainIdentifier containerId, bool loadFast) { // Get the persister that will handle the HealthServiceRecord type var persister = m_persisters.Values.FirstOrDefault(o => o is IQueryComponentPersister && (o as IQueryComponentPersister).ComponentTypeOid == containerId.Domain); if (persister == null) { persister = GetPersister(typeof(RegistrationEvent)); } ISystemConfigurationService configService = Context.GetService(typeof(ISystemConfigurationService)) as ISystemConfigurationService; DbUtil.ClearPersistedCache(); if (persister != null) { IDbConnection conn = null; try { conn = DatabasePersistenceService.ReadOnlyConnectionManager.GetConnection(); // Is the record something that we have access to? //if (containerId.Domain != null && !containerId.Domain.Equals(configService.OidRegistrar.GetOid(ClientRegistryOids.REGISTRATION_EVENT).Oid)) // throw new ArgumentException(String.Format("The record OID '{0}' cannot be retrieved by this repository, expecting OID '{1}'", // containerId.Domain, configService.OidRegistrar.GetOid(ClientRegistryOids.REGISTRATION_EVENT).Oid)); if (persister == null) { throw new ArgumentException(String.Format("The record type OID '{0}' cannot be retrieved by this repository", containerId.Domain)); } decimal tryDec = default(decimal); if (Decimal.TryParse(containerId.Identifier, out tryDec)) { return(persister.DePersist(conn, tryDec, null, null, loadFast) as IContainer); } else { throw new ArgumentException(String.Format("The identifier '{0}' is not a valid identifier for this repository", containerId.Identifier)); } } finally { if (conn != null) { DatabasePersistenceService.ConnectionManager.ReleaseConnection(conn); } } } else { Trace.TraceError("Can't find a persistence handler for type '{0}'", containerId.Domain); throw new DataException("Can't persist type HealthServiceRecordEvent"); } }
public DownloadController(IDataSetSchemaService dataSetSchemaService, IDataSetDetailService dataSetDetailService, ICategoryService categoryService, ISystemConfigurationService systemConfigurationService) : base(systemConfigurationService, categoryService) { _dataSetSchemaService = dataSetSchemaService; _dataSetDetailService = dataSetDetailService; _categoryService = categoryService; }
public WildlifeManagerController(IWildlifeManagerService wildlifeManagerService, ILogService logService, ISystemConfigurationService systemConfigurationService, IArticleAttachService articleAttachService, IWildlifeContentService wildlifeContentService) { _wildlifeManagerService = wildlifeManagerService; _logService = logService; _systemConfigurationService = systemConfigurationService; _articleAttachService = articleAttachService; _wildlifeContentService = wildlifeContentService; }
public PublicityController(IPublicityContentService publicityContentService, ILogService logService, IPublicityTypesService publicityTypesService, IPublicityCategoryService publicityCategoryService, ISystemConfigurationService systemConfigurationService, IArticleAttachService articleAttachService) { _PublicityContentService = publicityContentService; _logService = logService; _publicityTypesService = publicityTypesService; _publicityCategoryService = publicityCategoryService; _systemConfigurationService = systemConfigurationService; _articleAttachService = articleAttachService; }
public ArticleCategoryController(IArticleCategoryService articleCategoryService, ILogService logService, ISystemConfigurationService systemConfigurationService, IArticleAttachService articleAttachService, IArticleArticleCategoryService articleArticleCategoryService) { _articleCategoryService = articleCategoryService; _logService = logService; _systemConfigurationService = systemConfigurationService; _articleAttachService = articleAttachService; _articleArticleCategoryService = articleArticleCategoryService; }
public void TestInit() { var mock = new Mock <ISystemConfigurationService>(); mock.Setup(x => x.GetSystemConfigurations()).Returns(new SystemConfigurationObject()); mock.Setup(x => x.AppSettingsInt("DefaultGraphPageSize")).Returns(10); mock.Setup(x => x.AppSettingsInt("DefaultViewPageSize")).Returns(103); _sysConfigService = mock.Object; }
/// <summary> /// Create an HSR record /// </summary> private VersionedDomainIdentifier CreateHSRRecord(IDbConnection conn, IDbTransaction tx, ChangeSummary hsr) { IDbCommand cmd = DbUtil.CreateCommandStoredProc(conn, tx); cmd.CommandText = "crt_hsr"; // Get the terminology service ISystemConfigurationService iscs = ApplicationContext.ConfigurationService; //ApplicationContext.Current.GetService(typeof(ISystemConfigurationService)) as ISystemConfigurationService; // Parameters // classifier = 0x400 = Change Summary cmd.Parameters.Add(DbUtil.CreateParameterIn(cmd, "hsr_cls_in", DbType.Decimal, RegistrationEventType.ComponentEvent | RegistrationEventType.Revise)); // event type code cmd.Parameters.Add(DbUtil.CreateParameterIn(cmd, "evt_typ_cd_id_in", DbType.Decimal, DbUtil.CreateCodedValue(conn, tx, hsr.ChangeType))); // refuted indicator cmd.Parameters.Add(DbUtil.CreateParameterIn(cmd, "refuted_ind_in", DbType.Boolean, false)); decimal?efftTimeId = null; if (hsr.EffectiveTime != null) { efftTimeId = DbUtil.CreateTimeset(conn, tx, hsr.EffectiveTime); } cmd.Parameters.Add(DbUtil.CreateParameterIn(cmd, "efft_ts_set_id_in", DbType.Decimal, efftTimeId == null ? (object)DBNull.Value : efftTimeId.Value)); // status code cmd.Parameters.Add(DbUtil.CreateParameterIn(cmd, "status_cs_in", DbType.Decimal, hsr.Status == null ? (object)DBNull.Value : (int)hsr.Status)); // authored time cmd.Parameters.Add(DbUtil.CreateParameterIn(cmd, "aut_utc_in", DbType.DateTime, hsr.Timestamp == default(DateTime) ? (object)DBNull.Value : hsr.Timestamp)); // language code cmd.Parameters.Add(DbUtil.CreateParameterIn(cmd, "lang_cs_in", DbType.String, hsr.LanguageCode)); // Execute the command IDataReader resultRdr = cmd.ExecuteReader(); try { // Create the return value VersionedDomainIdentifier id = new VersionedDomainIdentifier(); if (!resultRdr.Read()) { return(null); } id.Version = Convert.ToString(resultRdr["VRSN_ID"]); id.Identifier = Convert.ToString(resultRdr["ID"]); id.Domain = iscs.OidRegistrar.GetOid(ClientRegistryOids.EVENT_OID).Oid; return(id); } finally { resultRdr.Close(); } }
public ViewSpotController(IViewSpotService viewSpotService, ILogService logService, ISystemConfigurationService systemConfigurationService, IArticleAttachService articleAttachService, IViewSpotContentService ViewSpotContentService, IRouteViewSpotService routeViewSpotService) { _viewSpotService = viewSpotService; _logService = logService; _systemConfigurationService = systemConfigurationService; _articleAttachService = articleAttachService; _viewSpotContentService = ViewSpotContentService; _routeViewSpotService = routeViewSpotService; }
public BaseController(ISystemConfigurationService systemConfigurationService, ICategoryService categoryService) { _systemConfigurationService = systemConfigurationService; _categoryService = categoryService; if (_systemConfigurationService != null) { ViewBag.CouncilTitle = _systemConfigurationService.GetSystemConfigurations().CouncilName;//ConfigurationManager.AppSettings["CouncilName"]; ViewBag.CouncilUrl = _systemConfigurationService.GetSystemConfigurations().CouncilUrl; ViewBag.AnalyticsTrackingRef = _systemConfigurationService.GetSystemConfigurations().AnalyticsTrackingRef; } }
public DataSetDetailService(ISystemConfigurationService systemConfigurationService , IRepository <DataSetDetail> repository , IDataSetSchemaService dataSetSchemaService , IDataSetDetailSqlRepo dataSetDetailSqlRepo, ISqlOrderByColumnAndDirectionFormatter sqlOrderByTextFormatter) { _systemConfigurationService = systemConfigurationService; _repository = repository; _dataSetSchemaService = dataSetSchemaService; _dataSetDetailSqlRepo = dataSetDetailSqlRepo; _sqlOrderByTextFormatter = sqlOrderByTextFormatter; }
public RoleController(IRoleService roleService, ILogService logService, ISystemConfigurationService systemConfigurationService, INavgationService navgationService, IArticleCategoryService articleCategoryService, IActionService actionService, IUserRoleService userRoleService) { _navgationService = navgationService; _roleService = roleService; _logService = logService; _systemConfigurationService = systemConfigurationService; _articleCategoryService = articleCategoryService; _actionService = actionService; _userRoleService = userRoleService; }
/// <summary> /// Notify the operation /// </summary> public void Notify(NotificationQueueWorkItem workItem) { // configuration service ISystemConfigurationService config = this.Context.GetService(typeof(ISystemConfigurationService)) as ISystemConfigurationService; ILocalizationService locale = this.Context.GetService(typeof(ILocalizationService)) as ILocalizationService; // Common message bits we need to update IMessage notificationMessage = null; MSH msh = null; PID pid = null; EVN evn = null; PV1 pv1 = null; // Identify the work item action switch (workItem.Action) { case MARC.HI.EHRS.CR.Notification.PixPdq.Configuration.ActionType.Create: case MARC.HI.EHRS.CR.Notification.PixPdq.Configuration.ActionType.DuplicatesResolved: case MARC.HI.EHRS.CR.Notification.PixPdq.Configuration.ActionType.Update: { ADT_A05 message = new ADT_A05(); msh = message.MSH; pid = message.PID; evn = message.EVN; pv1 = message.PV1; notificationMessage = message; msh.MessageType.TriggerEvent.Value = "A31"; break; } } // Populate the MSH header first this.UpdateMSH(msh, config); // Populate the EVN segment evn.EventTypeCode.Value = workItem.Event.Mode.ToString(); evn.RecordedDateTime.Time.Value = (TS)workItem.Event.Timestamp; // Populate the PID segment Person subject = workItem.Event.FindComponent(SVC.Core.ComponentModel.HealthServiceRecordSiteRoleType.SubjectOf) as Person; this.UpdatePID(subject, pid, config); pv1.PatientClass.Value = "N"; // Send var queueItem = new Hl7MessageQueue.MessageQueueWorkItem(this.Target, notificationMessage); if (!queueItem.TrySend()) { Trace.TraceWarning(locale.GetString("NTFW005")); Hl7MessageQueue.Current.EnqueueMessageItem(queueItem); } }
public void TestInit() { _mockResponseBase = new Mock <HttpResponseBase>(); _mockRequestBase = new Mock <HttpRequestBase>(); _mockHttpContextBase = new Mock <HttpContextBase>(); var mock2 = new Mock <ICategoryService>(); _categoryService = mock2.Object; var mock3 = new Mock <ISystemConfigurationService>(); mock3.Setup(x => x.GetSystemConfigurations()).Returns(new SystemConfigurationObject()); _systemConfigurationService = mock3.Object; }
public UserAuthorizationService( ISystemConfigurationService configurationService, IHttpContextAccessor httpContextAccessor, IUserService userService, IIdentityManager identityManager, IDateTimeProvider dateTimeProvider) { _configurationService = configurationService; _httpContextAccessor = httpContextAccessor; _userService = userService; _identityManager = identityManager; _dateTimeProvider = dateTimeProvider; }
public SchemaController(IEsdFunctionService esdFunctionService, IDataShareSchemaImportService dataShareSchemaImportService, IDataSetSchemaService dataSetSchemaService, IDataSetSchemaColumnService dataSetSchemaColumnService, ICategoryService categoryService, ISystemConfigurationService systemConfigurationService) : base(systemConfigurationService, categoryService) { _esdFunctionService = esdFunctionService; _dataShareSchemaImportService = dataShareSchemaImportService; _dataSetSchemaService = dataSetSchemaService; _dataSetSchemaColumnService = dataSetSchemaColumnService; _categoryService = categoryService; }
public static DataTable AppendBody(this DataTable table, ISystemConfigurationService systemConfigurationService) { var bodyName = String.Format("'{0}'", systemConfigurationService.GetSystemConfigurations().CouncilName); var bodyUri = String.Format("'{0}'", systemConfigurationService.GetSystemConfigurations().CouncilUri); table = table ?? new DataTable(); var colBody = table.Columns.Add("PublisherLabel", typeof(String), bodyName); colBody.SetOrdinal(0); var colUri = table.Columns.Add("PublisherURI", typeof(String), bodyUri); colUri.SetOrdinal(1); return(table); }