/// <summary> /// Update a CX /// </summary> private void UpdateCX(SVC.Core.DataTypes.DomainIdentifier altId, NHapi.Model.V231.Datatype.CX cx, ISystemConfigurationService config) { // Get oid data var oidData = config.OidRegistrar.FindData(altId.Domain); cx.AssigningAuthority.UniversalID.Value = altId.Domain ?? (oidData == null ? null : oidData.Oid); cx.AssigningAuthority.UniversalIDType.Value = "ISO"; cx.AssigningAuthority.NamespaceID.Value = altId.AssigningAuthority ?? (oidData == null ? null : oidData.Attributes.Find(o => o.Key.Equals("AssigningAuthorityName")).Value); cx.ID.Value = altId.Identifier; }
/// <summary> /// True if registered device /// </summary> public bool IsRegisteredDevice(SVC.Core.DataTypes.DomainIdentifier deviceId) { switch (deviceId.AssigningAuthority) { case "TEST_HARNESS": case "TEST_HARNESS_A": case "TEST_HARNESS_B": case "NID_AUTH": return(true); } return(false); }
/// <summary> /// Update a CX instance /// </summary> public void UpdateCX(SVC.Core.DataTypes.DomainIdentifier altId, NHapi.Model.V25.Datatype.CX cx) { // Get oid data var oidData = this.m_config.OidRegistrar.FindData(altId.Domain); cx.AssigningAuthority.UniversalID.Value = altId.Domain ?? (oidData == null ? null : oidData.Oid); cx.AssigningAuthority.UniversalIDType.Value = "ISO"; cx.AssigningAuthority.NamespaceID.Value = oidData == null ? altId.AssigningAuthority : oidData.Attributes.Find(o => o.Key.Equals("AssigningAuthorityName")).Value; cx.IDNumber.Value = altId.Identifier; if (cx.AssigningAuthority.UniversalID.Value == this.m_config.OidRegistrar.GetOid("CR_CID").Oid) // AA { cx.IdentifierTypeCode.Value = "PI"; } else { cx.IdentifierTypeCode.Value = "PT"; } }
/// <summary> /// Find a participant based on an external identifier /// </summary> /// <param name="identifier"></param> /// <returns></returns> public SVC.Core.ComponentModel.Components.HealthcareParticipant FindParticipant(SVC.Core.DataTypes.DomainIdentifier identifier) { HealthcareParticipantPersister persister = new HealthcareParticipantPersister(); // HACK: I norder to work around Client Registry Hack ApplicationContext.CurrentContext = Context; // First we want to find the appropriate helper IDbConnection conn = DatabasePersistenceService.ReadOnlyConnectionManager.GetConnection(); try { return(persister.GetProvider(conn, null, identifier)); } finally { DatabasePersistenceService.ConnectionManager.ReleaseConnection(conn); } }