USE [master]
GO


IF NOT EXISTS(SELECT * FROM sys.databases WHERE name = '$(dbName)' )
BEGIN
    CREATE DATABASE $(dbName);
END
GO

USE $(dbName)
GO


ALTER DATABASE [$(dbName)] SET ANSI_NULL_DEFAULT OFF 
GO
ALTER DATABASE [$(dbName)] SET ANSI_NULLS OFF 
GO
ALTER DATABASE [$(dbName)] SET ANSI_PADDING OFF 
GO
ALTER DATABASE [$(dbName)] SET ANSI_WARNINGS OFF 
GO
ALTER DATABASE [$(dbName)] SET ARITHABORT OFF 
GO
ALTER DATABASE [$(dbName)] SET AUTO_CLOSE OFF 
GO
ALTER DATABASE [$(dbName)] SET AUTO_SHRINK OFF 
GO
ALTER DATABASE [$(dbName)] SET AUTO_UPDATE_STATISTICS ON 
GO
ALTER DATABASE [$(dbName)] SET CURSOR_CLOSE_ON_COMMIT OFF 
GO
ALTER DATABASE [$(dbName)] SET CURSOR_DEFAULT  GLOBAL 
GO
ALTER DATABASE [$(dbName)] SET CONCAT_NULL_YIELDS_NULL OFF 
GO
ALTER DATABASE [$(dbName)] SET NUMERIC_ROUNDABORT OFF 
GO
ALTER DATABASE [$(dbName)] SET QUOTED_IDENTIFIER OFF 
GO
ALTER DATABASE [$(dbName)] SET RECURSIVE_TRIGGERS OFF 
GO
ALTER DATABASE [$(dbName)] SET  ENABLE_BROKER 
GO
ALTER DATABASE [$(dbName)] SET AUTO_UPDATE_STATISTICS_ASYNC OFF 
GO
ALTER DATABASE [$(dbName)] SET DATE_CORRELATION_OPTIMIZATION OFF 
GO
ALTER DATABASE [$(dbName)] SET TRUSTWORTHY OFF 
GO
ALTER DATABASE [$(dbName)] SET ALLOW_SNAPSHOT_ISOLATION OFF 
GO
ALTER DATABASE [$(dbName)] SET PARAMETERIZATION SIMPLE 
GO
ALTER DATABASE [$(dbName)] SET READ_COMMITTED_SNAPSHOT OFF 
GO
ALTER DATABASE [$(dbName)] SET HONOR_BROKER_PRIORITY OFF 
GO
ALTER DATABASE [$(dbName)] SET RECOVERY FULL 
GO
ALTER DATABASE [$(dbName)] SET  MULTI_USER 
GO
ALTER DATABASE [$(dbName)] SET PAGE_VERIFY CHECKSUM  
GO
ALTER DATABASE [$(dbName)] SET DB_CHAINING OFF 
GO
ALTER DATABASE [$(dbName)] SET FILESTREAM( NON_TRANSACTED_ACCESS = OFF ) 
GO
ALTER DATABASE [$(dbName)] SET TARGET_RECOVERY_TIME = 60 SECONDS 
GO
ALTER DATABASE [$(dbName)] SET DELAYED_DURABILITY = DISABLED 
GO
EXEC sys.sp_db_vardecimal_storage_format N'$(dbName)', N'ON'
GO
ALTER DATABASE [$(dbName)] SET QUERY_STORE = OFF
GO
USE [$(dbName)]
GO
ALTER DATABASE SCOPED CONFIGURATION SET LEGACY_CARDINALITY_ESTIMATION = OFF;
GO
ALTER DATABASE SCOPED CONFIGURATION SET MAXDOP = 0;
GO
ALTER DATABASE SCOPED CONFIGURATION SET PARAMETER_SNIFFING = ON;
GO
ALTER DATABASE SCOPED CONFIGURATION SET QUERY_OPTIMIZER_HOTFIXES = OFF;
GO
USE [$(dbName)]
GO
/****** Object:  UserDefinedFunction [dbo].[fn_diagramobjects]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE FUNCTION [dbo].[fn_diagramobjects]() 
	RETURNS int
	WITH EXECUTE AS N'dbo'
	AS
	BEGIN
		declare @id_upgraddiagrams		int
		declare @id_sysdiagrams			int
		declare @id_helpdiagrams		int
		declare @id_helpdiagramdefinition	int
		declare @id_creatediagram	int
		declare @id_renamediagram	int
		declare @id_alterdiagram 	int 
		declare @id_dropdiagram		int
		declare @InstalledObjects	int

		select @InstalledObjects = 0

		select 	@id_upgraddiagrams = object_id(N'dbo.sp_upgraddiagrams'),
			@id_sysdiagrams = object_id(N'dbo.sysdiagrams'),
			@id_helpdiagrams = object_id(N'dbo.sp_helpdiagrams'),
			@id_helpdiagramdefinition = object_id(N'dbo.sp_helpdiagramdefinition'),
			@id_creatediagram = object_id(N'dbo.sp_creatediagram'),
			@id_renamediagram = object_id(N'dbo.sp_renamediagram'),
			@id_alterdiagram = object_id(N'dbo.sp_alterdiagram'), 
			@id_dropdiagram = object_id(N'dbo.sp_dropdiagram')

		if @id_upgraddiagrams is not null
			select @InstalledObjects = @InstalledObjects + 1
		if @id_sysdiagrams is not null
			select @InstalledObjects = @InstalledObjects + 2
		if @id_helpdiagrams is not null
			select @InstalledObjects = @InstalledObjects + 4
		if @id_helpdiagramdefinition is not null
			select @InstalledObjects = @InstalledObjects + 8
		if @id_creatediagram is not null
			select @InstalledObjects = @InstalledObjects + 16
		if @id_renamediagram is not null
			select @InstalledObjects = @InstalledObjects + 32
		if @id_alterdiagram  is not null
			select @InstalledObjects = @InstalledObjects + 64
		if @id_dropdiagram is not null
			select @InstalledObjects = @InstalledObjects + 128
		
		return @InstalledObjects 
	END
GO
/****** Object:  Table [dbo].[ReadModule]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ReadModule](
	[Id] [uniqueidentifier] NOT NULL,
	[SubjectId] [uniqueidentifier] NOT NULL,
	[ModuleType] [int] NOT NULL,
	[ModuleName] [nvarchar](100) NOT NULL,
	[IsUrgent] [bit] NULL,
	[SubjectVisitId] [uniqueidentifier] NOT NULL,
	[Status] [int] NOT NULL,
	[CreateTime] [datetime2](7) NOT NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
	[ReadingPeriodSetId] [uniqueidentifier] NULL,
	[LastVisitIdSetId] [uniqueidentifier] NULL,
	[ReadModuleId] [uniqueidentifier] NULL,
	[ReadingSetType] [int] NOT NULL,
	[TrialId] [uniqueidentifier] NULL,
	[ReadingStatus] [int] NOT NULL,
	[TrialReadingCriterionId] [uniqueidentifier] NOT NULL,
	[UpdateUserId] [uniqueidentifier] NOT NULL,
	[UpdateTime] [datetime2](7) NOT NULL,
	[IsDeleted] [bit] NOT NULL,
	[DeletedTime] [datetime2](7) NULL,
	[DeleteUserId] [uniqueidentifier] NULL,
 CONSTRAINT [PK__ReadModu__3214EC0764BCEE5F] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[ReadingQuestionCriterionTrial]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ReadingQuestionCriterionTrial](
	[Id] [uniqueidentifier] NOT NULL,
	[TrialId] [uniqueidentifier] NOT NULL,
	[ReadingQuestionCriterionSystemId] [uniqueidentifier] NULL,
	[CriterionName] [nvarchar](200) NOT NULL,
	[IsEnable] [bit] NOT NULL,
	[CreateTime] [datetime2](7) NOT NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
	[IsConfirm] [bit] NOT NULL,
	[IsCompleteConfig] [bit] NOT NULL,
	[ShowOrder] [int] NOT NULL,
	[FormType] [int] NOT NULL,
	[DigitPlaces] [int] NULL,
	[EvaluationResult] [nvarchar](500) NOT NULL,
	[EvaluationReason] [nvarchar](300) NOT NULL,
	[IsShowDetail] [bit] NOT NULL,
	[SynchronizeTime] [datetime2](7) NOT NULL,
	[SynchronizeOriginalTime] [datetime2](7) NULL,
	[Description] [nvarchar](300) NULL,
	[GlobalUpdateType] [nvarchar](200) NULL,
	[CriterionType] [int] NOT NULL,
	[ImagePlatform] [int] NOT NULL,
	[ReadingTool] [int] NULL,
	[ReadingTaskViewEnum] [int] NOT NULL,
	[IsReadingShowSubjectInfo] [bit] NOT NULL,
	[IsReadingShowPreviousResults] [bit] NOT NULL,
	[ArbitrationRule] [int] NOT NULL,
	[ReadingType] [int] NOT NULL,
	[IsGlobalReading] [bit] NOT NULL,
	[IsArbitrationReading] [bit] NOT NULL,
	[IsOncologyReading] [bit] NOT NULL,
	[IsReadingTaskViewInOrder] [bit] NOT NULL,
	[TaskAllocateObjEnum] [int] NOT NULL,
	[IsFollowGlobalVisitAutoAssign] [bit] NOT NULL,
	[IsFollowVisitAutoAssign] [bit] NOT NULL,
	[IsFollowJudgeTaskAutoAssign] [bit] NOT NULL,
	[FollowJudgeTaskAutoAssignDefaultState] [int] NOT NULL,
	[FollowVisitAutoAssignDefaultState] [int] NOT NULL,
	[FollowGlobalVisitAutoAssignDefaultState] [int] NOT NULL,
	[ReadingInfoSignTime] [datetime2](7) NULL,
	[IsConfirmMedicineQuestion] [bit] NOT NULL,
	[IsMustGlobalReading] [bit] NOT NULL,
	[IseCRFShowInDicomReading] [bit] NOT NULL,
	[IsReadingPeriod] [bit] NOT NULL,
	[IsSigned] [bit] NOT NULL,
 CONSTRAINT [PK__ReadingQ__3214EC0701F64167] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[TrialSite]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[TrialSite](
	[Id] [uniqueidentifier] NOT NULL,
	[UpdateUserId] [uniqueidentifier] NOT NULL,
	[IsDeleted] [bit] NOT NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
	[DeletedTime] [datetime] NULL,
	[TrialId] [uniqueidentifier] NOT NULL,
	[TrialSiteCode] [nvarchar](255) NULL,
	[TrialSiteAliasName] [nvarchar](255) NOT NULL,
	[SiteId] [uniqueidentifier] NOT NULL,
	[UpdateTime] [datetime] NOT NULL,
	[CreateTime] [datetime] NOT NULL,
	[DeleteUserId] [uniqueidentifier] NULL,
 CONSTRAINT [PK_TrialSite] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[Site]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Site](
	[Id] [uniqueidentifier] NOT NULL,
	[ContactName] [nvarchar](200) NOT NULL,
	[CreateTime] [datetime] NOT NULL,
	[HospitalId] [uniqueidentifier] NULL,
	[Country] [nvarchar](200) NOT NULL,
	[City] [nvarchar](200) NOT NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
	[DirectorPhone] [nvarchar](200) NOT NULL,
	[UpdateTime] [datetime] NOT NULL,
	[State] [int] NOT NULL,
	[SiteCode] [nvarchar](500) NOT NULL,
	[UpdateUserId] [uniqueidentifier] NOT NULL,
	[Address] [nvarchar](255) NOT NULL,
	[DirectorName] [nvarchar](200) NOT NULL,
	[UniqueCode] [nvarchar](255) NOT NULL,
	[ContactPhone] [nvarchar](200) NOT NULL,
	[SiteName] [nvarchar](500) NOT NULL,
	[AliasName] [nvarchar](255) NOT NULL,
	[Code] [int] NOT NULL,
	[TestName] [nvarchar](255) NOT NULL,
	[Province] [nvarchar](100) NOT NULL,
 CONSTRAINT [PK_ResearchCenter] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[VisitTask]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[VisitTask](
	[Id] [uniqueidentifier] NOT NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
	[CreateTime] [datetime] NOT NULL,
	[UpdateTime] [datetime] NOT NULL,
	[UpdateUserId] [uniqueidentifier] NOT NULL,
	[TaskName] [varchar](255) NOT NULL,
	[TaskBlindName] [varchar](255) NOT NULL,
	[TaskAllocationState] [int] NOT NULL,
	[ReadingCategory] [int] NOT NULL,
	[AllocateTime] [datetime] NULL,
	[SubjectId] [uniqueidentifier] NOT NULL,
	[Code] [int] NOT NULL,
	[TaskCode] [varchar](255) NOT NULL,
	[IsUrgent] [bit] NOT NULL,
	[ArmEnum] [int] NOT NULL,
	[DoctorUserId] [uniqueidentifier] NULL,
	[TrialId] [uniqueidentifier] NOT NULL,
	[JudgeVisitTaskId] [uniqueidentifier] NULL,
	[ReadingTaskState] [int] NOT NULL,
	[SignTime] [datetime] NULL,
	[SuggesteFinishedTime] [datetime] NULL,
	[SourceSubjectVisitId] [uniqueidentifier] NULL,
	[SouceReadModuleId] [uniqueidentifier] NULL,
	[IsJudgeTaskReturn] [bit] NOT NULL,
	[JudgeResultTaskId] [uniqueidentifier] NULL,
	[JudgeResultRemark] [nvarchar](200) NULL,
	[TaskState] [int] NOT NULL,
	[IsReReadingCreate] [bit] NOT NULL,
	[ReReadingApplyState] [int] NOT NULL,
	[IsAnalysisCreate] [bit] NOT NULL,
	[VisitTaskNum] [decimal](18, 3) NOT NULL,
	[TaskConsistentRuleId] [uniqueidentifier] NULL,
	[BlindSubjectCode] [nvarchar](255) NOT NULL,
	[BlindTrialSiteCode] [nvarchar](255) NOT NULL,
	[IsAnalysisDiffToOriginalData] [bit] NULL,
	[ConsistentAnalysisOriginalTaskId] [uniqueidentifier] NULL,
	[FirstReadingTime] [datetime2](7) NULL,
	[IsSelfAnalysis] [bit] NULL,
	[IsGlobalHaveUpdate] [bit] NULL,
	[JudgeResultImagePath] [nvarchar](max) NOT NULL,
	[IsPMSetBack] [bit] NOT NULL,
	[TrialReadingCriterionId] [uniqueidentifier] NOT NULL,
	[IsReadClinicalData] [bit] NOT NULL,
	[IsClinicalDataSign] [bit] NOT NULL,
	[IsNeedClinicalDataSign] [bit] NOT NULL,
	[IsFrontTaskNeedSignButNotSign] [bit] NOT NULL,
	[RelatedVisitTaskIds] [nvarchar](max) NOT NULL,
	[PastResultTaskIds] [nvarchar](max) NOT NULL,
	[IsGroupDiffArm1] [bit] NULL,
	[IsGroupDiffArm2] [bit] NULL,
	[TaskUrgentType] [int] NULL,
	[TaskUrgentRemake] [nvarchar](200) NOT NULL,
	[IsCanEditUrgentState] [bit] NOT NULL,
 CONSTRAINT [PK__TaskAllo__3214EC07AB0C4BEE_copy1] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
/****** Object:  Table [dbo].[Subject]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Subject](
	[Id] [uniqueidentifier] NOT NULL,
	[LastName] [nvarchar](100) NOT NULL,
	[StudyCount] [int] NOT NULL,
	[DeletedTime] [datetime] NULL,
	[BirthDate] [datetime] NULL,
	[FirstGiveMedicineTime] [datetime] NULL,
	[IsMissingImages] [bit] NOT NULL,
	[MedicalNo] [nvarchar](100) NOT NULL,
	[ShortName] [nvarchar](255) NULL,
	[Reason] [text] NOT NULL,
	[SiteId] [uniqueidentifier] NOT NULL,
	[FinalSubjectVisitId] [uniqueidentifier] NULL,
	[Height] [nvarchar](255) NULL,
	[Code] [nvarchar](100) NOT NULL,
	[Age] [int] NULL,
	[Modalities] [varchar](200) NOT NULL,
	[SignDate] [datetime] NULL,
	[UpdateTime] [datetime] NOT NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
	[Sex] [nvarchar](100) NULL,
	[LatestSubjectVisitId] [uniqueidentifier] NULL,
	[IsEnrollmentConfirm] [bit] NOT NULL,
	[DeleteUserId] [uniqueidentifier] NULL,
	[Weight] [nvarchar](100) NULL,
	[OutEnrollmentTime] [datetime] NULL,
	[CreateTime] [datetime] NOT NULL,
	[FirstName] [nvarchar](100) NOT NULL,
	[IsUrgent] [bit] NOT NULL,
	[Status] [int] NOT NULL,
	[VisitOverTime] [datetime] NULL,
	[UpdateUserId] [uniqueidentifier] NOT NULL,
	[IsDeleted] [bit] NOT NULL,
	[TrialId] [uniqueidentifier] NOT NULL,
	[IsEnrollment] [bit] NOT NULL,
	[IsAssignDoctorUser] [bit] NOT NULL,
	[IsReReadingOrBackInfluenceAnalysis] [bit] NOT NULL,
 CONSTRAINT [PK__Clinical__3214EC07442B18F2] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
/****** Object:  Table [dbo].[SubjectVisit]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[SubjectVisit](
	[Id] [uniqueidentifier] NOT NULL,
	[ReviewAuditTime] [datetime] NULL,
	[SubjectId] [uniqueidentifier] NOT NULL,
	[IsCheckBack] [bit] NULL,
	[IsTake] [bit] NOT NULL,
	[EarliestScanDate] [datetime] NULL,
	[VisitWindowLeft] [int] NULL,
	[IsQCConfirmedReupload] [bit] NOT NULL,
	[IsUrgent] [bit] NOT NULL,
	[PreliminaryAuditUserId] [uniqueidentifier] NULL,
	[ForwardUserId] [uniqueidentifier] NULL,
	[IsLostVisit] [bit] NOT NULL,
	[VisitNum] [decimal](18, 1) NOT NULL,
	[IsFinalVisit] [bit] NOT NULL,
	[SVSTDTC] [datetime] NULL,
	[AuditState] [int] NOT NULL,
	[VisitName] [nvarchar](200) NOT NULL,
	[ForwardTime] [datetime] NULL,
	[TrialId] [uniqueidentifier] NOT NULL,
	[BlindName] [nvarchar](255) NOT NULL,
	[IsBaseLine] [bit] NOT NULL,
	[CreateTime] [datetime] NOT NULL,
	[IsDeleted] [bit] NOT NULL,
	[CheckTime] [datetime] NULL,
	[InPlan] [bit] NOT NULL,
	[ClinicalDataSignUserId] [uniqueidentifier] NULL,
	[CheckState] [int] NOT NULL,
	[VisitWindowRight] [int] NULL,
	[SubmitState] [int] NOT NULL,
	[PreliminaryAuditTime] [datetime] NULL,
	[IsConfirmedClinicalData] [bit] NULL,
	[VisitStageId] [uniqueidentifier] NULL,
	[CheckPassedTime] [datetime] NULL,
	[SVENDTC] [datetime] NULL,
	[SubmitTime] [datetime] NULL,
	[ReviewAuditUserId] [uniqueidentifier] NULL,
	[SiteId] [uniqueidentifier] NULL,
	[ManualPassReason] [nvarchar](200) NULL,
	[CurrentActionUserId] [uniqueidentifier] NULL,
	[AnonymousVisitName] [nvarchar](100) NOT NULL,
	[UpdateUserId] [uniqueidentifier] NOT NULL,
	[CheckChallengeState] [int] NOT NULL,
	[DeletedTime] [datetime] NULL,
	[LatestScanDate] [datetime] NULL,
	[ChallengeState] [int] NULL,
	[CheckResult] [nvarchar](1024) NULL,
	[VisitExecuted] [int] NOT NULL,
	[ClinicalDataSignTime] [datetime] NULL,
	[CloseTheReason] [nvarchar](200) NULL,
	[CurrentActionUserExpireTime] [datetime] NULL,
	[UpdateTime] [datetime] NOT NULL,
	[PDState] [int] NULL,
	[DeleteUserId] [uniqueidentifier] NULL,
	[SVUPDES] [nvarchar](500) NULL,
	[ForwardState] [int] NULL,
	[IsEnrollmentConfirm] [bit] NOT NULL,
	[VisitDay] [int] NULL,
	[OutPlanPreviousVisitId] [uniqueidentifier] NULL,
	[RequestBackState] [int] NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
	[Auditor] [uniqueidentifier] NULL,
	[CheckUserId] [uniqueidentifier] NULL,
	[IsVisitTaskGenerated] [bit] NOT NULL,
	[ReadingStatus] [int] NOT NULL,
	[IsPMBackOrReReading] [bit] NOT NULL,
	[SubmitUserId] [uniqueidentifier] NULL,
	[CheckBackTime] [datetime] NULL,
 CONSTRAINT [PK_VisitPoint_1] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[Trial]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Trial](
	[Id] [uniqueidentifier] NOT NULL,
	[QCQuestionConfirmedUserId] [uniqueidentifier] NULL,
	[CheckPassText] [varchar](255) NULL,
	[IsNoticeSubjectCodeRule] [bit] NULL,
	[TrialSiteSurveyUserRoles ] [nvarchar](255) NOT NULL,
	[TimePointsPerPatient] [decimal](18, 2) NOT NULL,
	[DeleteUserId] [uniqueidentifier] NULL,
	[IsCRAAuditClinicalInformation] [bit] NULL,
	[TrialEnrollStatus] [int] NOT NULL,
	[UpdateUserId] [uniqueidentifier] NOT NULL,
	[ReviewAuditReuploadText] [varchar](500) NULL,
	[IsSubjectSexView] [bit] NOT NULL,
	[ExperimentName] [nvarchar](255) NULL,
	[ProjectCycle] [nvarchar](500) NOT NULL,
	[MessageFromClientName] [varchar](200) NOT NULL,
	[PlanVisitCount] [int] NOT NULL,
	[ReviewProtocol] [varchar](500) NOT NULL,
	[IsImageExport] [bit] NULL,
	[IsEnrollementQualificationConfirm] [bit] NULL,
	[ImageQCSignText] [nvarchar](255) NULL,
	[IsQCQuestionConfirmed] [bit] NOT NULL,
	[SubjectCodeRule] [varchar](255) NULL,
	[AuditText] [varchar](500) NULL,
	[IsSubjectExpeditedView] [bit] NOT NULL,
	[TrialStatusStr] [nvarchar](500) NOT NULL,
	[VisitPlanConfirmed] [bit] NOT NULL,
	[ReviewModeId] [uniqueidentifier] NOT NULL,
	[PlanSubjectCount] [int] NOT NULL,
	[IndicationTypeId] [uniqueidentifier] NULL,
	[IsTrialProcessConfirmed] [bit] NOT NULL,
	[OutEnrollmentVisitName] [nvarchar](255) NULL,
	[Modalitys] [nvarchar](255) NULL,
	[IsImageReplicationAcrossTrial] [bit] NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
	[IsHaveFirstGiveMedicineDate] [bit] NULL,
	[TrialCode] [nvarchar](100) NOT NULL,
	[CROId] [uniqueidentifier] NOT NULL,
	[IsPDProgressView] [bit] NULL,
	[TrialSiteSurveyEquipmentType] [nvarchar](255) NOT NULL,
	[GRRReviewers] [int] NOT NULL,
	[IsUrgent] [bit] NOT NULL,
	[ChangeDefalutDays] [int] NOT NULL,
	[PreliminaryAuditReuploadText] [varchar](500) NULL,
	[UpdateTime] [datetime] NOT NULL,
	[Indication] [nvarchar](512) NOT NULL,
	[MainResearchUnit] [nvarchar](255) NULL,
	[SponsorId] [uniqueidentifier] NOT NULL,
	[Expedited] [int] NOT NULL,
	[PlanSiteCount] [int] NOT NULL,
	[TrialType] [int] NULL,
	[DocumentConfirmSignText] [nvarchar](500) NULL,
	[IsSubjectSecondCodeView] [bit] NOT NULL,
	[QCQuestionConfirmedTime] [datetime] NULL,
	[IsVerifyVisitImageDate] [bit] NULL,
	[IsTrialStart] [bit] NOT NULL,
	[Note] [nvarchar](max) NOT NULL,
	[PhaseId] [uniqueidentifier] NULL,
	[MessageFromClient] [varchar](500) NOT NULL,
	[Code] [int] NULL,
	[IsTrialUrgentConfirmed] [bit] NOT NULL,
	[QCProcessEnum] [int] NULL,
	[ChallengeTypes] [nvarchar](255) NOT NULL,
	[DeletedTime] [datetime] NULL,
	[ResearchProgramNo] [nvarchar](255) NULL,
	[IsHaveSubjectAge] [bit] NULL,
	[ReadingMode] [int] NOT NULL,
	[CreateTime] [datetime] NOT NULL,
	[TrialFinishedTime] [datetime] NULL,
	[DeclarationTypeId] [uniqueidentifier] NULL,
	[TotalReviewers] [int] NOT NULL,
	[ReviewProtocolName] [varchar](200) NOT NULL,
	[DigitPlaces] [int] NULL,
	[IsImageConsistencyVerification] [bit] NULL,
	[BodyPartTypes] [nvarchar](255) NOT NULL,
	[CheckBackText] [varchar](255) NULL,
	[IsDeleted] [bit] NOT NULL,
	[HeadPI] [nvarchar](255) NULL,
	[ExpectedPatients] [int] NOT NULL,
	[AttendedReviewerType] [int] NOT NULL,
	[ClinicalInformationTransmissionEnum] [int] NULL,
	[IsTrialBasicLogicConfirmed] [bit] NOT NULL,
	[TrialFinishTime] [datetime2](7) NULL,
	[TaskAllocateObjEnum] [int] NOT NULL,
	[FollowVisitAutoAssignDefaultState] [int] NOT NULL,
	[IsFollowVisitAutoAssign] [bit] NOT NULL,
	[IsFollowGlobalVisitAutoAssign] [bit] NOT NULL,
	[FollowGlobalVisitAutoAssignDefaultState] [int] NOT NULL,
	[IsFollowJudgeTaskAutoAssign] [bit] NOT NULL,
	[FollowJudgeTaskAutoAssignDefaultState] [int] NOT NULL,
	[SyncClinicalDataTime] [datetime2](7) NULL,
	[IsImageIabeled] [bit] NOT NULL,
	[BlindBaseLineName] [nvarchar](255) NOT NULL,
	[BlindFollowUpPrefix] [nvarchar](255) NOT NULL,
	[EmailFromEmail] [nvarchar](255) NOT NULL,
	[EmailFromName] [nvarchar](255) NOT NULL,
	[EmailAuthorizationCode] [nvarchar](255) NOT NULL,
	[EmailSMTPServerAddress] [nvarchar](255) NOT NULL,
	[EmailSMTPServerPort] [int] NULL,
	[IsConfigureEmail] [bit] NOT NULL,
 CONSTRAINT [PK_Trial] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
/****** Object:  View [dbo].[ReadModuleView]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[ReadModuleView] AS select  

sv.TrialId TrialId,    --项目ID
sv.VisitName Name,
sv.Id Id,              --ID
iif(sv.InPlan=1,0,1 ) ModuleType,  --
sv.IsUrgent,                  --是否加急
sv.Id SubjectVisitId,         --访视ID
sv.VisitName SubjectVisitName, --访视名称

CASE sv.ReadingStatus 
WHEN 0 THEN 0 
WHEN 1 THEN 1 
WHEN 2 THEN 2
ELSE  iif(( select count(1) from VisitTask where SourceSubjectVisitId=sv.Id and ReadingTaskState=2 and TaskState=0 and ReadingCategory!=4 and IsAnalysisCreate =0 and TrialReadingCriterionId =rqct.Id)=rqct.ReadingType,
5,iif(( select count(1) from VisitTask where SourceSubjectVisitId=sv.Id and TaskAllocationState =2  and TaskState=0 and ReadingCategory!=4 and IsAnalysisCreate =0 and TrialReadingCriterionId =rqct.Id)=rqct.ReadingType,
4,3
)
) END 

  ReadingStatus ,   --状态
sv.CreateTime,                  --创建时间
s.Code SubjectCode,
site.SiteCode,
ts.TrialSiteCode ,
   sv.VisitNum,
   CONVERT(bit,sv.IsFinalVisit) IsFinalVisit ,
   sv.OutPlanPreviousVisitId,
   outPlansv.VisitName OutPlanPreviousVisitName,
    null CutOffVisitId,
	 null CutOffVisitName,
	
   site.Id SiteId,
   CONVERT(bit,1)  IsVisit ,
   sv.PDState,
    CONVERT(bit,sv.IsEnrollmentConfirm) IsEnrollmentConfirm,
   s.Id  SubjectId,
   null ReadModuleId,
	null  ReadModuleName,
	sv.IsBaseLine,
	rqct.Id TrialReadingCriterionId,
	 rqct.CriterionName	 CriterionName
from SubjectVisit  sv inner join Subject s on sv.SubjectId=s.Id and  sv.IsDeleted !=1 and  s.IsDeleted !=1
left join SubjectVisit outPlansv on sv.OutPlanPreviousVisitId=outPlansv.Id
left join Site site on s.SiteId=site.Id
left join TrialSite ts on  ts.TrialId=sv.TrialId and ts.SiteId=site.Id
left join  SubjectVisit finalVisit on finalVisit.SubjectId=s.Id and finalVisit.IsFinalVisit=1
left join Trial on sv.TrialId=Trial.Id
left join ReadingQuestionCriterionTrial rqct on Trial.Id=rqct.TrialId and rqct.IsConfirm=1
where (sv.VisitNum<=finalVisit.VisitNum or finalVisit.VisitNum is null)
and sv.IsLostVisit=0
 union all 

select  
sv.TrialId,
rm.ModuleName Name,
rm.Id,
rm.ModuleType,
sv.IsUrgent,                  --是否加急
sv.Id SubjectVisitId,         --访视ID
sv.VisitName SubjectVisitName, --访视名称
CASE sv.ReadingStatus 
WHEN 0 THEN 0 
WHEN 1 THEN 1 
WHEN 2 THEN 2
ELSE  iif(( select count(1) from VisitTask where SouceReadModuleId=rm.Id and ReadingTaskState=2 and TaskState=0 and ReadingCategory!=4 and IsAnalysisCreate =0 and TrialReadingCriterionId =rqct.Id)=rqct.ReadingType,
5,iif(( select count(1) from VisitTask where SouceReadModuleId=rm.Id and TaskAllocationState =2  and TaskState=0 and ReadingCategory!=4 and IsAnalysisCreate =0 and TrialReadingCriterionId =rqct.Id)=rqct.ReadingType,
4,3
)
) END 

  ReadingStatus ,   --状态
	  rm.CreateTime,
	  s.Code SubjectCode,
	  site.SiteCode,
	  ts.TrialSiteCode ,
	  sv.VisitNum,
       CONVERT(bit,0) IsFinalVisit,
	  null OutPlanPreviousVisitId,
	  null OutPlanPreviousVisitName,
	  sv.Id CutOffVisitId,
	  sv.VisitName CutOffVisitName,
	
	  site.Id SiteId,
     CONVERT(bit,0)   IsVisit ,
      sv.PDState,
       CONVERT(bit,0) IsEnrollmentConfirm,
      s.Id  SubjectId,
	  rm.ReadModuleId,
	  lastrm.ModuleName ReadModuleName,
	     CONVERT(bit,0) IsBaseLine,
		 rm.TrialReadingCriterionId,
		 rqct.CriterionName
from ReadModule rm
left join SubjectVisit sv on  rm.SubjectVisitId=sv.Id and sv.IsDeleted !=1
left join  Subject s on rm.SubjectId=s.Id
left join Site site on s.SiteId=site.Id
left join TrialSite ts on  ts.TrialId=sv.TrialId and ts.SiteId=site.Id
left join ReadModule lastrm on rm.ReadModuleId=lastrm.Id
left join Trial on rm.TrialId=Trial.Id
left join ReadingQuestionCriterionTrial rqct on rm.TrialReadingCriterionId=rqct.Id
where rm.IsDeleted =0
GO
/****** Object:  Table [dbo].[Attachment]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Attachment](
	[Id] [uniqueidentifier] NOT NULL,
	[Code] [nvarchar](100) NOT NULL,
	[Type] [nvarchar](100) NOT NULL,
	[CreateTime] [datetime] NOT NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
	[ExpiryDate] [datetime] NULL,
	[IsOfficial] [bit] NOT NULL,
	[FileName] [nvarchar](200) NOT NULL,
	[Path] [nvarchar](512) NOT NULL,
	[Language] [int] NOT NULL,
	[DoctorId] [uniqueidentifier] NOT NULL,
 CONSTRAINT [PK_DoctorAttachment] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[CheckChallengeDialog]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[CheckChallengeDialog](
	[Id] [uniqueidentifier] NOT NULL,
	[UserTypeEnum] [int] NOT NULL,
	[TalkContent] [text] NOT NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
	[CreateTime] [datetime] NOT NULL,
	[CreateUser] [nvarchar](255) NOT NULL,
	[SubjectVisitId] [uniqueidentifier] NOT NULL,
	[IsCRCNeedReply] [bit] NULL,
	[ParamInfo] [nvarchar](max) NULL,
 CONSTRAINT [PK_QADialog_copy1] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
/****** Object:  Table [dbo].[ClinicalDataSystemSet]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ClinicalDataSystemSet](
	[Id] [uniqueidentifier] NOT NULL,
	[ClinicalDataSetName] [nvarchar](50) NOT NULL,
	[ClinicalDataLevel] [int] NOT NULL,
	[ClinicalUploadType] [int] NOT NULL,
	[CreateTime] [datetime2](7) NOT NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
	[IsEnable] [bit] NOT NULL,
	[ClinicalDataSetEnum] [int] NOT NULL,
	[UploadRole] [int] NOT NULL,
	[FileName] [nvarchar](200) NOT NULL,
	[Path] [nvarchar](2000) NOT NULL,
	[CriterionEnumListStr] [nvarchar](512) NOT NULL,
 CONSTRAINT [PK__Clinical__3214EC073E1EB410] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[ClinicalDataTrialSet]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ClinicalDataTrialSet](
	[Id] [uniqueidentifier] NOT NULL,
	[TrialId] [uniqueidentifier] NOT NULL,
	[ClinicalDataSetName] [nvarchar](50) NOT NULL,
	[ClinicalDataLevel] [int] NOT NULL,
	[ClinicalUploadType] [int] NOT NULL,
	[CreateTime] [datetime2](7) NOT NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
	[SystemClinicalDataSetId] [uniqueidentifier] NULL,
	[IsConfirm] [bit] NOT NULL,
	[UploadRole] [int] NOT NULL,
	[FileName] [nvarchar](200) NOT NULL,
	[Path] [nvarchar](2000) NOT NULL,
	[CriterionEnumListStr] [nvarchar](512) NOT NULL,
 CONSTRAINT [PK__Clinical__3214EC07DCFB23C0] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[CommonDocument]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[CommonDocument](
	[Id] [uniqueidentifier] NOT NULL,
	[ModuleTypeId] [uniqueidentifier] NULL,
	[Path] [nvarchar](200) NOT NULL,
	[UpdateTime] [datetime] NOT NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
	[Name] [nvarchar](200) NOT NULL,
	[IsDeleted] [bit] NOT NULL,
	[DeleteUserId] [uniqueidentifier] NULL,
	[FileTypeId] [uniqueidentifier] NULL,
	[UpdateUserId] [uniqueidentifier] NOT NULL,
	[CreateTime] [datetime] NOT NULL,
	[Code] [nvarchar](255) NOT NULL,
	[Description] [varchar](255) NOT NULL,
	[DeletedTime] [datetime] NULL,
	[CriterionTypeEnum] [int] NULL,
	[FileTypeEnum] [int] NOT NULL,
	[BusinessScenarioEnum] [int] NOT NULL,
 CONSTRAINT [PK__ImageAcq__3214EC0734E8D562_copy2_copy1_copy1] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[ConsistencyCheckFile]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ConsistencyCheckFile](
	[Id] [uniqueidentifier] NOT NULL,
	[FileName] [nvarchar](200) NULL,
	[FilePath] [nvarchar](500) NULL,
	[RelativePath] [nvarchar](200) NULL,
	[CreateUserId] [uniqueidentifier] NULL,
	[CreateTime] [datetime2](7) NULL,
	[TrialId] [uniqueidentifier] NULL,
 CONSTRAINT [PK__Consiste__3214EC0757E94509] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[CriterionNidus]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[CriterionNidus](
	[Id] [uniqueidentifier] NOT NULL,
	[CriterionId] [uniqueidentifier] NOT NULL,
	[CreateTime] [datetime2](7) NOT NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
	[LesionType] [int] NOT NULL,
	[OrganType] [int] NOT NULL,
	[IsSystemCriterion] [bit] NOT NULL,
 CONSTRAINT [PK__Criterio__3214EC0730FE0E01] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[CROCompany]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[CROCompany](
	[Id] [uniqueidentifier] NOT NULL,
	[UpdateTime] [datetime] NOT NULL,
	[CreateTime] [datetime] NOT NULL,
	[CROName] [nvarchar](200) NOT NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
	[CROCode] [nvarchar](200) NOT NULL,
	[UpdateUserId] [uniqueidentifier] NOT NULL,
	[CRONameCN] [nvarchar](255) NOT NULL,
 CONSTRAINT [PK_CROCompany] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[DataInspection]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[DataInspection](
	[Id] [uniqueidentifier] NOT NULL,
	[Reason] [varchar](255) NULL,
	[CreateUserName] [nvarchar](100) NULL,
	[ModuleTypeId] [uniqueidentifier] NULL,
	[JsonDetail] [text] NOT NULL,
	[OptTypeId] [uniqueidentifier] NULL,
	[ParentId] [uniqueidentifier] NULL,
	[Identification] [nvarchar](100) NULL,
	[IsSign] [bit] NULL,
	[IsFrontAdd] [bit] NULL,
	[SiteId] [uniqueidentifier] NULL,
	[SignId] [uniqueidentifier] NULL,
	[LastJsonDetail] [text] NULL,
	[CreateTime] [datetime] NOT NULL,
	[SubjectId] [uniqueidentifier] NULL,
	[IP] [varchar](255) NULL,
	[VisitStageId] [uniqueidentifier] NULL,
	[GeneralId] [uniqueidentifier] NULL,
	[TrialId] [uniqueidentifier] NULL,
	[ChildrenTypeId] [uniqueidentifier] NULL,
	[RoleName] [nvarchar](100) NULL,
	[ObjectTypeId] [uniqueidentifier] NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
	[SubjectVisitId] [uniqueidentifier] NULL,
	[BatchId] [uniqueidentifier] NULL,
	[ObjectRelationParentId] [uniqueidentifier] NULL,
	[ObjectRelationParentId2] [uniqueidentifier] NULL,
	[EntityName] [nvarchar](255) NOT NULL,
	[CreateUserRealName] [nvarchar](255) NULL,
	[TrialReadingCriterionId] [uniqueidentifier] NULL,
	[DoctorUserId] [uniqueidentifier] NULL,
	[ObjectRelationParentId3] [uniqueidentifier] NULL,
	[VisitTaskId] [uniqueidentifier] NULL,
 CONSTRAINT [PK_Dictionary_copy1_copy1] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
/****** Object:  Table [dbo].[DicomInstance]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[DicomInstance](
	[SopInstanceUid] [varchar](200) NOT NULL,
	[SliceLocation] [int] NOT NULL,
	[NumberOfFrames] [int] NULL,
	[SeriesId] [uniqueidentifier] NOT NULL,
	[CPIStatus] [bit] NOT NULL,
	[FrameOfReferenceUID] [varchar](500) NULL,
	[UpdateUserId] [uniqueidentifier] NOT NULL,
	[ImageRows] [int] NOT NULL,
	[WindowCenter] [nvarchar](100) NULL,
	[SiteId] [uniqueidentifier] NOT NULL,
	[Id] [uniqueidentifier] NOT NULL,
	[InstanceNumber] [int] NOT NULL,
	[PixelSpacing] [nvarchar](100) NULL,
	[Anonymize] [bit] NOT NULL,
	[StudyInstanceUid] [varchar](200) NOT NULL,
	[UpdateTime] [datetime] NOT NULL,
	[ImagerPixelSpacing] [nvarchar](100) NULL,
	[SliceThickness] [nvarchar](100) NULL,
	[SeriesInstanceUid] [varchar](200) NOT NULL,
	[CreateTime] [datetime] NOT NULL,
	[SubjectId] [uniqueidentifier] NOT NULL,
	[StudyId] [uniqueidentifier] NOT NULL,
	[InstanceTime] [datetime] NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
	[SubjectVisitId] [uniqueidentifier] NOT NULL,
	[ImageColumns] [int] NOT NULL,
	[WindowWidth] [nvarchar](100) NULL,
	[TrialId] [uniqueidentifier] NOT NULL,
	[SeqId] [uniqueidentifier] NOT NULL,
	[Path] [nvarchar](max) NOT NULL,
 CONSTRAINT [PK_DicomInstance] PRIMARY KEY CLUSTERED 
(
	[SeqId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
/****** Object:  Table [dbo].[DicomSeries]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[DicomSeries](
	[BodyPartForEdit] [nvarchar](255) NOT NULL,
	[SubjectId] [uniqueidentifier] NOT NULL,
	[CreateTime] [datetime] NOT NULL,
	[SeriesInstanceUid] [nvarchar](200) NOT NULL,
	[TriggerTime] [varchar](250) NULL,
	[ImagePositionPatient] [varchar](250) NULL,
	[UpdateUserId] [uniqueidentifier] NOT NULL,
	[Modality] [varchar](200) NOT NULL,
	[ImagerPixelSpacing] [varchar](250) NULL,
	[DeleteUserId] [uniqueidentifier] NULL,
	[SliceThickness] [nvarchar](250) NOT NULL,
	[UpdateTime] [datetime] NOT NULL,
	[SiteId] [uniqueidentifier] NOT NULL,
	[BodyPartExamined] [varchar](250) NULL,
	[Id] [uniqueidentifier] NOT NULL,
	[InstanceCount] [int] NOT NULL,
	[AcquisitionNumber] [varchar](250) NULL,
	[TrialId] [uniqueidentifier] NOT NULL,
	[ImageOrientationPatient] [varchar](250) NULL,
	[SeqId] [uniqueidentifier] NOT NULL,
	[SeriesTime] [datetime] NULL,
	[IsDeleted] [bit] NULL,
	[ProtocolName] [varchar](500) NULL,
	[SubjectVisitId] [uniqueidentifier] NOT NULL,
	[StudyInstanceUid] [nvarchar](200) NOT NULL,
	[SeriesNumber] [int] NOT NULL,
	[IsReading] [bit] NULL,
	[SequenceName] [varchar](250) NULL,
	[StudyId] [uniqueidentifier] NOT NULL,
	[Description] [nvarchar](500) NOT NULL,
	[AcquisitionTime] [varchar](250) NULL,
	[DeletedTime] [datetime] NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
 CONSTRAINT [PK_Series] PRIMARY KEY CLUSTERED 
(
	[SeqId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[DicomStudy]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[DicomStudy](
	[AcquisitionTime] [nvarchar](50) NULL,
	[Id] [uniqueidentifier] NOT NULL,
	[DeletedTime] [datetime] NULL,
	[PatientSex] [nvarchar](50) NOT NULL,
	[SubjectId] [uniqueidentifier] NOT NULL,
	[TriggerTime] [nvarchar](50) NULL,
	[Uploader] [nvarchar](255) NOT NULL,
	[CheckPassed] [bit] NOT NULL,
	[Comment] [nvarchar](1024) NOT NULL,
	[Status] [int] NOT NULL,
	[InstitutionName] [nvarchar](50) NOT NULL,
	[QAComment] [nvarchar](1024) NOT NULL,
	[DeadlineTime] [datetime] NULL,
	[BodyPartForEdit] [nvarchar](255) NOT NULL,
	[CheckResult] [nvarchar](255) NOT NULL,
	[Modalities] [nvarchar](100) NOT NULL,
	[PatientId] [nvarchar](100) NOT NULL,
	[TrialId] [uniqueidentifier] NOT NULL,
	[UpdateUserId] [uniqueidentifier] NOT NULL,
	[DeleteUserId] [uniqueidentifier] NULL,
	[PatientAge] [nvarchar](50) NOT NULL,
	[SeriesCount] [int] NOT NULL,
	[SubjectVisitId] [uniqueidentifier] NOT NULL,
	[StudyId] [nvarchar](50) NULL,
	[UpdateTime] [datetime] NOT NULL,
	[InstanceCount] [int] NOT NULL,
	[StudyInstanceUid] [nvarchar](500) NOT NULL,
	[AccessionNumber] [nvarchar](50) NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
	[IsDeleted] [bit] NOT NULL,
	[Description] [nvarchar](1000) NOT NULL,
	[PatientName] [nvarchar](50) NOT NULL,
	[AcquisitionNumber] [nvarchar](50) NULL,
	[SiteId] [uniqueidentifier] NOT NULL,
	[CreateTime] [datetime] NOT NULL,
	[IsDoubleReview] [bit] NOT NULL,
	[StudyCode] [nvarchar](100) NOT NULL,
	[BodyPartExamined] [nvarchar](512) NOT NULL,
	[PatientBirthDate] [nvarchar](50) NULL,
	[UploadedTime] [datetime] NULL,
	[SeqId] [uniqueidentifier] NOT NULL,
	[Code] [int] NULL,
	[StudyTime] [datetime] NULL,
	[ModalityForEdit] [nvarchar](255) NOT NULL,
 CONSTRAINT [PK_StudyGuid] PRIMARY KEY CLUSTERED 
(
	[SeqId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[Dictionary]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Dictionary](
	[Id] [uniqueidentifier] NOT NULL,
	[ParentId] [uniqueidentifier] NULL,
	[Code] [nvarchar](255) NOT NULL,
	[Value] [nvarchar](100) NOT NULL,
	[ValueCN] [nvarchar](100) NOT NULL,
	[ConfigTypeId] [uniqueidentifier] NULL,
	[IsEnable] [bit] NOT NULL,
	[Description] [nvarchar](512) NOT NULL,
	[ShowOrder] [int] NOT NULL,
	[IsConfig] [bit] NOT NULL,
	[ChildGroup] [nvarchar](100) NULL,
	[ChildCodeEnum] [int] NOT NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
	[CreateTime] [datetime] NOT NULL,
	[UpdateTime] [datetime] NOT NULL,
	[UpdateUserId] [uniqueidentifier] NOT NULL,
	[KeyName] [nvarchar](100) NOT NULL,
	[DataTypeEnum] [int] NOT NULL,
 CONSTRAINT [PK_Dictionary] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[Doctor]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Doctor](
	[Id] [uniqueidentifier] NOT NULL,
	[ActivelyReading] [bit] NOT NULL,
	[Code] [int] NULL,
	[Phone] [nvarchar](100) NOT NULL,
	[GCP] [int] NOT NULL,
	[DepartmentId] [uniqueidentifier] NOT NULL,
	[HospitalOtherCN] [nvarchar](200) NOT NULL,
	[PositionOtherCN] [nvarchar](100) NOT NULL,
	[AdminComment] [text] NOT NULL,
	[FirstName] [nvarchar](100) NOT NULL,
	[Nation] [int] NOT NULL,
	[CreateTime] [datetime] NOT NULL,
	[EMail] [nvarchar](100) NOT NULL,
	[SpecialityId] [uniqueidentifier] NOT NULL,
	[SubspecialityOther] [nvarchar](100) NOT NULL,
	[ReviewStatus] [int] NOT NULL,
	[RankId] [uniqueidentifier] NOT NULL,
	[OtherClinicalExperienceCN] [text] NOT NULL,
	[LastName] [nvarchar](100) NOT NULL,
	[WeChat] [nvarchar](100) NOT NULL,
	[AuditTime] [datetime] NULL,
	[HospitalId] [uniqueidentifier] NOT NULL,
	[SubspecialityOtherCN] [nvarchar](100) NOT NULL,
	[PhotoPath] [nvarchar](300) NOT NULL,
	[PositionId] [uniqueidentifier] NOT NULL,
	[Password] [nvarchar](100) NOT NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
	[ReadingTypeOther] [nvarchar](100) NOT NULL,
	[PositionOther] [nvarchar](100) NOT NULL,
	[ResumePath] [nvarchar](512) NOT NULL,
	[ChineseName] [nvarchar](100) NOT NULL,
	[LastLoginTime] [datetime] NULL,
	[SpecialityOther] [nvarchar](100) NOT NULL,
	[RankOther] [nvarchar](100) NOT NULL,
	[CooperateStatus] [int] NOT NULL,
	[AcceptingNewTrial] [bit] NOT NULL,
	[GCPId] [uniqueidentifier] NOT NULL,
	[DepartmentOther] [nvarchar](100) NOT NULL,
	[UpdateTime] [datetime] NOT NULL,
	[HospitalOther] [nvarchar](100) NOT NULL,
	[RankOtherCN] [nvarchar](100) NOT NULL,
	[ResumeStatus] [int] NOT NULL,
	[UpdateUserId] [uniqueidentifier] NOT NULL,
	[OrganizationId] [uniqueidentifier] NOT NULL,
	[Sex] [int] NOT NULL,
	[DepartmentOtherCN] [nvarchar](100) NOT NULL,
	[ReadingTypeOtherCN] [nvarchar](100) NOT NULL,
	[OtherClinicalExperience] [text] NOT NULL,
	[ReviewerCode] [nvarchar](100) NULL,
	[Introduction] [nvarchar](1000) NOT NULL,
	[AuditUserId] [uniqueidentifier] NOT NULL,
	[SpecialityOtherCN] [nvarchar](100) NOT NULL,
	[OtherSkills] [nvarchar](512) NOT NULL,
	[IsVirtual] [bit] NOT NULL,
	[BlindName] [nvarchar](255) NOT NULL,
	[Physician] [nvarchar](255) NOT NULL,
	[PhysicianCN] [nvarchar](255) NOT NULL,
	[BlindNameCN] [nvarchar](255) NOT NULL,
	[BlindPublications] [text] NOT NULL,
	[PhysicianId] [uniqueidentifier] NULL,
 CONSTRAINT [PK_Doctor_1] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
/****** Object:  Table [dbo].[DoctorCriterionFile]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[DoctorCriterionFile](
	[Id] [uniqueidentifier] NOT NULL,
	[FileName] [nvarchar](200) NOT NULL,
	[FilePath] [nvarchar](2000) NOT NULL,
	[CriterionType] [int] NOT NULL,
	[DoctorId] [uniqueidentifier] NOT NULL,
	[Remark] [nvarchar](100) NOT NULL,
	[FileType] [int] NOT NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
	[CreateTime] [datetime] NOT NULL,
	[IsEnable] [bit] NOT NULL,
	[TrialId] [uniqueidentifier] NULL,
	[TrialReadingCriterionId] [uniqueidentifier] NULL,
	[CriterionName] [nvarchar](255) NOT NULL
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[DoctorDictionary]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[DoctorDictionary](
	[Id] [uniqueidentifier] NOT NULL,
	[DictionaryId] [uniqueidentifier] NOT NULL,
	[KeyName] [nvarchar](100) NOT NULL,
	[DoctorId] [uniqueidentifier] NOT NULL,
 CONSTRAINT [PK_DoctorDictionary] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[DoctorPayInformation]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[DoctorPayInformation](
	[Id] [uniqueidentifier] NOT NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
	[RankId] [uniqueidentifier] NOT NULL,
	[IDCard] [varchar](100) NOT NULL,
	[UpdateUserId] [uniqueidentifier] NOT NULL,
	[CreateTime] [datetime] NOT NULL,
	[BankName] [nvarchar](200) NOT NULL,
	[DoctorNameInBank] [varchar](200) NOT NULL,
	[UpdateTime] [datetime] NOT NULL,
	[DoctorId] [uniqueidentifier] NOT NULL,
	[Additional] [decimal](18, 2) NOT NULL,
	[BankCardNumber] [varchar](100) NOT NULL,
 CONSTRAINT [PK_DoctorPayInfomation] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[DoctorWorkload]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[DoctorWorkload](
	[Id] [uniqueidentifier] NOT NULL,
	[AdjudicationIn48H] [int] NOT NULL,
	[UpdateUserId] [uniqueidentifier] NOT NULL,
	[TrialId] [uniqueidentifier] NOT NULL,
	[TimepointIn48H] [int] NOT NULL,
	[CreateUserType] [int] NOT NULL,
	[IsLock] [bit] NOT NULL,
	[RefresherTraining] [int] NOT NULL,
	[YearMonth] [nvarchar](100) NOT NULL,
	[DataFrom] [int] NOT NULL,
	[CreateTime] [datetime] NOT NULL,
	[Downtime] [int] NOT NULL,
	[TimepointIn24H] [int] NOT NULL,
	[Training] [int] NOT NULL,
	[AdjudicationIn24H] [int] NOT NULL,
	[UpdateTime] [datetime] NOT NULL,
	[DoctorId] [uniqueidentifier] NOT NULL,
	[Adjudication] [int] NOT NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
	[Global] [int] NOT NULL,
	[Timepoint] [int] NOT NULL,
	[WorkTime] [datetime] NULL,
 CONSTRAINT [PK_DoctorWorkload] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[Education]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Education](
	[Id] [uniqueidentifier] NOT NULL,
	[Degree] [nvarchar](100) NOT NULL,
	[Country] [nvarchar](100) NOT NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
	[MajorCN] [nvarchar](100) NOT NULL,
	[DoctorId] [uniqueidentifier] NOT NULL,
	[ProvinceCN] [nvarchar](100) NOT NULL,
	[UpdateTime] [datetime] NOT NULL,
	[BeginDate] [date] NULL,
	[CreateTime] [datetime] NOT NULL,
	[DegreeCN] [nvarchar](100) NOT NULL,
	[CountryCN] [nvarchar](100) NOT NULL,
	[ShowOrder] [int] NOT NULL,
	[Organization] [nvarchar](100) NOT NULL,
	[City] [nvarchar](100) NOT NULL,
	[UpdateUserId] [uniqueidentifier] NOT NULL,
	[OrganizationCN] [nvarchar](100) NOT NULL,
	[CityCN] [nvarchar](100) NOT NULL,
	[Major] [nvarchar](100) NOT NULL,
	[Province] [nvarchar](100) NOT NULL,
	[EndDate] [date] NULL,
 CONSTRAINT [PK_Education] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[EmailNoticeConfig]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[EmailNoticeConfig](
	[Id] [uniqueidentifier] NOT NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
	[IsUrgent] [bit] NOT NULL,
	[IsEnable] [bit] NOT NULL,
	[Code] [nvarchar](255) NOT NULL,
	[UpdateUserId] [uniqueidentifier] NOT NULL,
	[IsReturnRequired] [bit] NOT NULL,
	[UpdateTime] [datetime] NOT NULL,
	[CreateTime] [datetime] NOT NULL,
	[IsAutoSend] [bit] NOT NULL,
	[IsDeleted] [bit] NOT NULL,
	[IsDistinguishCriteria] [bit] NOT NULL,
	[DeletedTime] [datetime] NULL,
	[DeleteUserId] [uniqueidentifier] NULL,
	[BusinessScenarioEnum] [int] NOT NULL,
 CONSTRAINT [PK_IntoGroup_copy1] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[Enroll]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Enroll](
	[Id] [uniqueidentifier] NOT NULL,
	[Downtime] [int] NULL,
	[EnrollStatus] [int] NOT NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
	[Adjudication48H] [int] NULL,
	[OutEnrollTime] [datetime] NULL,
	[EnrollTime] [datetime] NULL,
	[RefresherTraining] [int] NULL,
	[Adjudication24H] [int] NULL,
	[DoctorId] [uniqueidentifier] NULL,
	[UpdateTime] [datetime] NOT NULL,
	[Timepoint24H] [int] NULL,
	[AttachmentId] [uniqueidentifier] NULL,
	[Adjudication] [int] NULL,
	[AdjustmentMultiple] [money] NULL,
	[Timepoint] [int] NULL,
	[Global] [int] NULL,
	[TrialId] [uniqueidentifier] NOT NULL,
	[UpdateUserId] [uniqueidentifier] NOT NULL,
	[CreateTime] [datetime] NOT NULL,
	[Timepoint48H] [int] NULL,
	[ReviewerReadingType] [int] NOT NULL,
	[Memo] [nvarchar](500) NOT NULL,
	[Training] [int] NULL,
	[DoctorTrialState] [int] NOT NULL,
	[DoctorUserId] [uniqueidentifier] NULL,
 CONSTRAINT [PK_IntoGroup] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[EnrollDetail]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[EnrollDetail](
	[Id] [uniqueidentifier] NOT NULL,
	[EnrollId] [uniqueidentifier] NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
	[OptUserType] [int] NOT NULL,
	[Memo] [nvarchar](512) NOT NULL,
	[TrialId] [uniqueidentifier] NOT NULL,
	[EnrollStatus] [int] NOT NULL,
	[CreateTime] [datetime] NOT NULL,
	[TrialDetailId] [uniqueidentifier] NOT NULL,
	[DoctorId] [uniqueidentifier] NOT NULL,
 CONSTRAINT [PK_IntoGroupDetail] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[EnrollReadingCategory]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[EnrollReadingCategory](
	[Id] [uniqueidentifier] NOT NULL,
	[EnrollId] [uniqueidentifier] NOT NULL,
	[ReadingCategory] [int] NOT NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
	[CreateTime] [datetime] NOT NULL,
	[TrialReadingCriterionId] [uniqueidentifier] NOT NULL,
 CONSTRAINT [PK__EnrollRe__3214EC07927A1E1B] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[EntityAudit]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[EntityAudit](
	[Id] [uniqueidentifier] NOT NULL,
	[AlterId] [uniqueidentifier] NOT NULL,
	[CreateTime] [datetime] NOT NULL,
	[State] [int] NOT NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
	[SaveChangesAuditId] [uniqueidentifier] NOT NULL,
	[CreateUser] [nvarchar](100) NOT NULL,
	[AuditMessage] [nvarchar](max) NOT NULL,
 CONSTRAINT [PK__EntityAu__3214EC070C8BF621] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
/****** Object:  Table [dbo].[ExchangeRate]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ExchangeRate](
	[Id] [uniqueidentifier] NOT NULL,
	[YearMonth] [nvarchar](100) NOT NULL,
	[CreateTime] [datetime] NOT NULL,
	[UpdateUserId] [uniqueidentifier] NOT NULL,
	[UpdateTime] [datetime] NOT NULL,
	[Rate] [decimal](18, 2) NOT NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
 CONSTRAINT [PK_ExchangeRate] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[FrontAuditConfig]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[FrontAuditConfig](
	[Id] [uniqueidentifier] NOT NULL,
	[UpdateTime] [datetime] NOT NULL,
	[IsJoinPlan] [bit] NULL,
	[DictionaryCode] [nvarchar](100) NULL,
	[ParentId] [uniqueidentifier] NULL,
	[IsShowParent] [int] NOT NULL,
	[IsHaveSign] [bit] NULL,
	[ForeignKeyValue] [nvarchar](100) NULL,
	[ModuleTypeId] [uniqueidentifier] NULL,
	[CreateTime] [datetime] NOT NULL,
	[IsHaveReason] [bit] NULL,
	[ObjectTypeId] [uniqueidentifier] NULL,
	[Value] [nvarchar](100) NULL,
	[OptTypeId ] [uniqueidentifier] NULL,
	[DataType] [nvarchar](100) NULL,
	[UpdateUserId] [uniqueidentifier] NOT NULL,
	[IsEnable] [bit] NULL,
	[Identification] [nvarchar](100) NULL,
	[ForeignKeyText] [nvarchar](500) NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
	[IsFinish] [bit] NULL,
	[DictionaryType] [nvarchar](100) NULL,
	[ConfigType] [nvarchar](100) NULL,
	[ValueCN] [nvarchar](100) NULL,
	[Code] [nvarchar](255) NULL,
	[ForeignKeyTableName] [nvarchar](100) NULL,
	[Sort] [int] NULL,
	[InterfaceName] [nvarchar](100) NULL,
	[Description] [nvarchar](512) NULL,
	[DateType] [nvarchar](100) NULL,
	[EnumType] [nvarchar](100) NULL,
	[ChildrenTypeId] [uniqueidentifier] NULL,
	[TableConfigJsonStr] [text] NOT NULL,
	[UrlConfigJsonStr] [text] NOT NULL,
	[ChildDataValue] [nvarchar](100) NULL,
	[ChildDataLabel] [nvarchar](100) NULL,
	[IsShowByTrialConfig] [bit] NULL,
	[TrialConfigRelyFieldName] [nvarchar](100) NULL,
	[DictionaryKey] [nvarchar](100) NULL,
	[IsConfig] [bit] NULL,
	[IsSpecialType] [bit] NULL,
 CONSTRAINT [PK_Dictionary_copy3] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
/****** Object:  Table [dbo].[Hospital]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Hospital](
	[Id] [uniqueidentifier] NOT NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
	[City] [nvarchar](200) NOT NULL,
	[CountryCN] [nvarchar](200) NOT NULL,
	[CityCN] [nvarchar](200) NOT NULL,
	[HospitalName] [nvarchar](200) NOT NULL,
	[Province] [nvarchar](200) NOT NULL,
	[UpdateTime] [datetime] NOT NULL,
	[UniversityAffiliatedCN] [nvarchar](200) NOT NULL,
	[Country] [nvarchar](200) NOT NULL,
	[HospitalNameCN] [nvarchar](200) NOT NULL,
	[ProvinceCN] [nvarchar](200) NOT NULL,
	[UpdateUserId] [uniqueidentifier] NOT NULL,
	[UniversityAffiliated] [nvarchar](200) NOT NULL,
	[CreateTime] [datetime] NOT NULL,
	[SiteId] [uniqueidentifier] NULL,
 CONSTRAINT [PK_Org] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[ImageShare]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ImageShare](
	[Id] [uniqueidentifier] NOT NULL,
	[StudyId] [uniqueidentifier] NOT NULL,
	[TrialId] [uniqueidentifier] NOT NULL,
	[SiteId] [uniqueidentifier] NOT NULL,
	[PassWord] [nvarchar](255) NOT NULL,
	[ExpireTime] [datetime] NOT NULL,
	[SubjectId] [uniqueidentifier] NOT NULL,
 CONSTRAINT [PK__ImageSha__3214EC07DE38F513] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[Menu]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Menu](
	[Id] [uniqueidentifier] NOT NULL,
	[Path] [nvarchar](500) NOT NULL,
	[IsEnable] [bit] NOT NULL,
	[ApiPath] [nvarchar](255) NOT NULL,
	[Meta] [nvarchar](255) NULL,
	[MenuType] [varchar](255) NULL,
	[IsDisplay] [bit] NOT NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
	[Redirect] [nvarchar](255) NOT NULL,
	[Note] [text] NOT NULL,
	[MenuIcon] [nvarchar](255) NULL,
	[UpdateTime] [datetime] NOT NULL,
	[Component] [nvarchar](100) NOT NULL,
	[ParentId] [uniqueidentifier] NOT NULL,
	[IsInTabDisplay] [bit] NULL,
	[IsExternalLink] [bit] NOT NULL,
	[MenuName] [nvarchar](200) NOT NULL,
	[UpdateUserId] [uniqueidentifier] NOT NULL,
	[PermissionStr] [nvarchar](255) NOT NULL,
	[IsCache] [bit] NOT NULL,
	[CreateTime] [datetime] NOT NULL,
	[ShowOrder] [int] NOT NULL,
	[LanguageMark] [nvarchar](255) NOT NULL,
 CONSTRAINT [PK_MenuFunction] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
/****** Object:  Table [dbo].[NoneDicomStudy]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[NoneDicomStudy](
	[Id] [uniqueidentifier] NOT NULL,
	[UpdateUserId] [uniqueidentifier] NOT NULL,
	[CreateTime] [datetime] NOT NULL,
	[StudyCode] [nvarchar](255) NOT NULL,
	[TrialId] [uniqueidentifier] NOT NULL,
	[ImageDate] [datetime] NOT NULL,
	[SubjectVisitId] [uniqueidentifier] NOT NULL,
	[Description] [varchar](255) NULL,
	[BodyPart] [varchar](255) NOT NULL,
	[Code] [int] NOT NULL,
	[SiteId] [uniqueidentifier] NOT NULL,
	[UpdateTime] [datetime] NOT NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
	[SubjectId] [uniqueidentifier] NOT NULL,
	[Modality] [varchar](255) NOT NULL,
	[UploadVideoTime] [datetime] NULL,
	[VideoName] [nvarchar](255) NOT NULL,
	[VideoUrl] [nvarchar](255) NOT NULL,
	[VideoObjectName] [nvarchar](255) NOT NULL,
	[FileCount] [int] NOT NULL,
 CONSTRAINT [PK__NoneDico__3214EC073D9344CD_copy1] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[NoneDicomStudyFile]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[NoneDicomStudyFile](
	[Id] [uniqueidentifier] NOT NULL,
	[NoneDicomStudyId] [uniqueidentifier] NOT NULL,
	[CreateTime] [datetime] NOT NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
	[Path] [varchar](1024) NOT NULL,
	[FileName] [varchar](255) NOT NULL,
 CONSTRAINT [PK__NoneDico__3214EC073D9344CD] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[OrganInfo]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[OrganInfo](
	[Id] [uniqueidentifier] NOT NULL,
	[PartEN] [nvarchar](64) NOT NULL,
	[Part] [nvarchar](64) NOT NULL,
	[TULOC] [nvarchar](64) NULL,
	[TULOCEN] [nvarchar](64) NOT NULL,
	[TULAT] [nvarchar](64) NULL,
	[TULATEN] [nvarchar](64) NOT NULL,
	[CreateTime] [datetime2](7) NOT NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
	[Remark] [nvarchar](64) NULL,
	[IsLymphNodes] [int] NOT NULL,
	[SystemCriterionId] [uniqueidentifier] NOT NULL,
	[OrganType] [int] NOT NULL,
	[IsCanEditPosition] [bit] NOT NULL,
	[Classification] [nvarchar](50) NOT NULL,
	[ClassificationEN] [nvarchar](50) NOT NULL,
	[ShowOrder] [int] NOT NULL,
 CONSTRAINT [PK__OrganInf__3214EC07BF7F678D] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[OrganTrialInfo]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[OrganTrialInfo](
	[Id] [uniqueidentifier] NOT NULL,
	[OrganInfoId] [uniqueidentifier] NOT NULL,
	[TrialId] [uniqueidentifier] NOT NULL,
	[CreateTime] [datetime2](7) NOT NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
	[IsEnable] [bit] NOT NULL,
	[OrganType] [int] NULL,
	[TrialCriterionId] [uniqueidentifier] NOT NULL,
 CONSTRAINT [PK_OrganTrialInfo] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[Payment]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Payment](
	[Id] [uniqueidentifier] NOT NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
	[PaymentCNY] [decimal](18, 4) NOT NULL,
	[ActuallyPaidCNY] [decimal](18, 4) NOT NULL,
	[AdjustmentCNY] [decimal](18, 4) NOT NULL,
	[TaxCNY] [decimal](18, 4) NOT NULL,
	[CalculateUser] [nvarchar](100) NOT NULL,
	[AdjustmentUSD] [decimal](18, 2) NOT NULL,
	[UpdateTime] [datetime] NOT NULL,
	[IsLock] [bit] NOT NULL,
	[ExchangeRate] [decimal](18, 2) NOT NULL,
	[Note] [nvarchar](500) NOT NULL,
	[DoctorId] [uniqueidentifier] NOT NULL,
	[YearMonth] [nvarchar](100) NOT NULL,
	[BankTransferCNY] [decimal](18, 4) NOT NULL,
	[UpdateUserId] [uniqueidentifier] NOT NULL,
	[PaymentUSD] [decimal](18, 2) NOT NULL,
	[YearMonthDate] [datetime] NOT NULL,
	[CalculateTime] [datetime] NULL,
	[CreateTime] [datetime] NOT NULL,
 CONSTRAINT [PK_CostStatistics] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[PaymentAdjustment]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[PaymentAdjustment](
	[Id] [uniqueidentifier] NOT NULL,
	[YearMonth] [nvarchar](100) NOT NULL,
	[AdjustmentCNY] [decimal](18, 4) NOT NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
	[ReviewerId] [uniqueidentifier] NOT NULL,
	[UpdateTime] [datetime] NOT NULL,
	[IsLock] [bit] NOT NULL,
	[ExchangeRate] [decimal](18, 2) NOT NULL,
	[CreateTime] [datetime] NOT NULL,
	[YearMonthDate] [smalldatetime] NOT NULL,
	[TrialId] [uniqueidentifier] NOT NULL,
	[UpdateUserId] [uniqueidentifier] NOT NULL,
	[AdjustmentUSD] [decimal](18, 2) NOT NULL,
	[Note] [nvarchar](500) NOT NULL,
 CONSTRAINT [PK_CostAdjustment] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[PaymentDetail]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[PaymentDetail](
	[Id] [uniqueidentifier] NOT NULL,
	[ExchangeRate] [decimal](18, 2) NOT NULL,
	[UpdateTime] [datetime] NOT NULL,
	[TrialCode] [nvarchar](100) NOT NULL,
	[PaymentCNY] [decimal](18, 4) NOT NULL,
	[PaymentId] [uniqueidentifier] NOT NULL,
	[Count] [int] NOT NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
	[TrialId] [uniqueidentifier] NOT NULL,
	[TrialAdditional] [decimal](18, 2) NOT NULL,
	[PaymentUSD] [decimal](18, 2) NOT NULL,
	[DoctorId] [uniqueidentifier] NOT NULL,
	[PersonalAdditional] [decimal](18, 2) NOT NULL,
	[ShowCodeOrder] [int] NOT NULL,
	[PaymentType] [nvarchar](100) NOT NULL,
	[ShowTypeOrder] [int] NOT NULL,
	[CreateTime] [datetime] NOT NULL,
	[YearMonth] [nvarchar](100) NOT NULL,
	[UpdateUserId] [uniqueidentifier] NOT NULL,
	[BasePrice] [decimal](18, 2) NOT NULL,
 CONSTRAINT [PK_CostStatisticsDetail] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[Postgraduate]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Postgraduate](
	[Id] [uniqueidentifier] NOT NULL,
	[CountryCN] [nvarchar](100) NOT NULL,
	[MajorCN] [nvarchar](100) NOT NULL,
	[DoctorId] [uniqueidentifier] NOT NULL,
	[City] [nvarchar](200) NOT NULL,
	[Training] [nvarchar](200) NOT NULL,
	[School] [nvarchar](100) NOT NULL,
	[SchoolCN] [nvarchar](100) NOT NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
	[TrainingCN] [nvarchar](100) NOT NULL,
	[Hospital] [nvarchar](100) NOT NULL,
	[BeginDate] [date] NULL,
	[CityCN] [nvarchar](100) NOT NULL,
	[EndDate] [date] NULL,
	[Province] [nvarchar](100) NOT NULL,
	[UpdateTime] [datetime] NOT NULL,
	[ProvinceCN] [nvarchar](100) NOT NULL,
	[UpdateUserId] [uniqueidentifier] NOT NULL,
	[HospitalCN] [nvarchar](100) NOT NULL,
	[CreateTime] [datetime] NOT NULL,
	[Country] [nvarchar](100) NOT NULL,
	[Major] [nvarchar](100) NOT NULL,
 CONSTRAINT [PK_DoctorContinueLearning_1] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[PreviousHistory]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[PreviousHistory](
	[Id] [uniqueidentifier] NOT NULL,
	[Path] [nvarchar](255) NULL,
	[CreateUser] [varchar](255) NOT NULL,
	[IsPD] [int] NOT NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
	[SubjectVisitId] [uniqueidentifier] NOT NULL,
	[FileName] [nvarchar](255) NULL,
	[StartTime] [datetime] NULL,
	[EndTime] [datetime] NULL,
	[CreateTime] [datetime] NOT NULL,
	[Position] [nvarchar](255) NOT NULL,
	[IsSubjectLevel] [bit] NOT NULL,
	[ClinicalDataTrialSetId] [uniqueidentifier] NOT NULL,
 CONSTRAINT [PK__Previous__3214EC071B63BD83] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[PreviousOther]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[PreviousOther](
	[Id] [uniqueidentifier] NOT NULL,
	[StartTime] [datetime] NULL,
	[FileName] [nvarchar](255) NULL,
	[SubjectVisitId] [uniqueidentifier] NOT NULL,
	[CreateTime] [datetime] NOT NULL,
	[TreatmentType] [nvarchar](255) NOT NULL,
	[IsSubjectLevel] [bit] NOT NULL,
	[EndTime] [datetime] NULL,
	[IsPD] [bit] NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
	[CreateUser] [varchar](255) NOT NULL,
	[Path] [nvarchar](255) NULL,
	[ClinicalDataTrialSetId] [uniqueidentifier] NOT NULL,
 CONSTRAINT [PK__Previous__3214EC071B63BD83_copy2] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[PreviousPDF]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[PreviousPDF](
	[Id] [uniqueidentifier] NOT NULL,
	[CreateTime] [datetime] NOT NULL,
	[Path] [nvarchar](512) NOT NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
	[FileName] [nvarchar](255) NOT NULL,
	[SubjectVisitId] [uniqueidentifier] NOT NULL,
	[IsVisist] [bit] NULL,
	[ClinicalLevel] [int] NULL,
	[DataType] [int] NULL,
	[UploadType] [int] NULL,
	[TrialId] [uniqueidentifier] NULL,
	[SubjectId] [uniqueidentifier] NULL,
 CONSTRAINT [PK__Previous__3214EC071B63BD83_copy3] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[PreviousSurgery]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[PreviousSurgery](
	[Id] [uniqueidentifier] NOT NULL,
	[OperationName] [nvarchar](255) NOT NULL,
	[IsSubjectLevel] [bit] NOT NULL,
	[CreateUser] [varchar](255) NOT NULL,
	[SubjectVisitId] [uniqueidentifier] NOT NULL,
	[FileName] [nvarchar](255) NULL,
	[CreateTime] [datetime] NOT NULL,
	[Path] [nvarchar](255) NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
	[OperationTime] [datetime] NULL,
	[ClinicalDataTrialSetId] [uniqueidentifier] NOT NULL,
 CONSTRAINT [PK__Previous__3214EC071B63BD83_copy1] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[QCChallenge]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[QCChallenge](
	[Id] [uniqueidentifier] NOT NULL,
	[ClosedTime] [datetime] NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
	[IsClosed] [bit] NULL,
	[LatestReplyUserId] [uniqueidentifier] NULL,
	[ReUploader] [nvarchar](255) NOT NULL,
	[ActionContent] [nvarchar](2048) NULL,
	[CreateUser] [varchar](255) NULL,
	[ClosedUser] [varchar](255) NULL,
	[Content] [nvarchar](2048) NOT NULL,
	[ReUploadedTime] [datetime] NULL,
	[ChallengeCode] [nvarchar](50) NULL,
	[ReuploadEnum] [int] NULL,
	[SubjectVisitId] [uniqueidentifier] NOT NULL,
	[QCProcessEnum] [int] NOT NULL,
	[ReUploadUserId] [uniqueidentifier] NULL,
	[CreateTime] [datetime] NOT NULL,
	[LatestMsgTime] [datetime] NULL,
	[TrialId] [uniqueidentifier] NULL,
	[DeadlineTime] [datetime] NULL,
	[ChallengeType] [varchar](2048) NULL,
	[CloseResonEnum] [int] NOT NULL,
	[CurrentQCEnum] [int] NULL,
	[Note] [varchar](2048) NOT NULL,
	[UserTypeEnum] [int] NOT NULL,
	[Code] [int] NULL,
 CONSTRAINT [PK_ImageChallenge] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[QCChallengeDialog]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[QCChallengeDialog](
	[Id] [uniqueidentifier] NOT NULL,
	[CreateUser] [nvarchar](255) NOT NULL,
	[TalkContent] [varchar](500) NOT NULL,
	[QCChallengeId] [uniqueidentifier] NOT NULL,
	[UserTypeEnum] [int] NOT NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
	[SubjectVisitId] [uniqueidentifier] NOT NULL,
	[CreateTime] [datetime] NOT NULL,
 CONSTRAINT [PK_QADialog] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[QCQuestion]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[QCQuestion](
	[Id] [uniqueidentifier] NOT NULL,
	[Type] [varchar](255) NOT NULL,
	[ParentTriggerValue] [varchar](255) NOT NULL,
	[QuestionName] [varchar](255) NOT NULL,
	[IsRequired] [bit] NOT NULL,
	[CreateTime] [datetime] NOT NULL,
	[ShowOrder] [int] NOT NULL,
	[ParentId] [uniqueidentifier] NULL,
	[UpdateTime] [datetime] NOT NULL,
	[TypeValue] [varchar](255) NOT NULL,
	[UpdateUserId] [uniqueidentifier] NOT NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
	[IsEnable] [bit] NOT NULL,
 CONSTRAINT [PK__TrialQCQ__3214EC079E774F9D_copy1] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[RankPrice]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[RankPrice](
	[Id] [uniqueidentifier] NOT NULL,
	[Training] [decimal](18, 2) NOT NULL,
	[TimepointIn24H] [decimal](18, 2) NOT NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
	[AdjudicationIn24H] [decimal](18, 2) NOT NULL,
	[TimepointIn48H] [decimal](18, 2) NOT NULL,
	[ShowOrder] [int] NOT NULL,
	[AdjudicationIn48H] [decimal](18, 2) NOT NULL,
	[RankName] [nvarchar](200) NOT NULL,
	[Timepoint] [decimal](18, 2) NOT NULL,
	[UpdateTime] [datetime] NOT NULL,
	[RefresherTraining] [decimal](18, 2) NOT NULL,
	[Downtime] [decimal](18, 2) NOT NULL,
	[CreateTime] [datetime] NOT NULL,
	[Adjudication] [decimal](18, 2) NOT NULL,
	[UpdateUserId] [uniqueidentifier] NOT NULL,
	[Global] [decimal](18, 2) NOT NULL,
 CONSTRAINT [PK_RankPrice] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[ReadingClinicalData]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ReadingClinicalData](
	[Id] [uniqueidentifier] NOT NULL,
	[TrialId] [uniqueidentifier] NOT NULL,
	[ReadingId] [uniqueidentifier] NOT NULL,
	[SubjectId] [uniqueidentifier] NOT NULL,
	[ClinicalDataTrialSetId] [uniqueidentifier] NULL,
	[IsVisit] [bit] NOT NULL,
	[CreateTime] [datetime2](7) NOT NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
	[IsSign] [bit] NOT NULL,
	[IsBlind] [bit] NULL,
	[IsComplete] [bit] NULL,
	[ReadingClinicalDataState] [int] NOT NULL,
	[FileCount] [int] NOT NULL,
 CONSTRAINT [PK_ReadingClinicalData] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[ReadingClinicalDataPDF]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ReadingClinicalDataPDF](
	[Id] [uniqueidentifier] NOT NULL,
	[ReadingClinicalDataId] [uniqueidentifier] NOT NULL,
	[CreateTime] [datetime2](7) NOT NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
	[FileName] [nvarchar](500) NOT NULL,
	[Path] [nvarchar](1000) NOT NULL,
 CONSTRAINT [PK_ReadingClinicalDataPDF] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[ReadingCriterionDictionary]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ReadingCriterionDictionary](
	[Id] [uniqueidentifier] NOT NULL,
	[CriterionId] [uniqueidentifier] NOT NULL,
	[DictionaryId] [uniqueidentifier] NOT NULL,
	[CreateTime] [datetime2](7) NOT NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
	[IsSystemCriterion] [bit] NOT NULL,
	[ParentCode] [nvarchar](50) NOT NULL,
	[IsBaseLineUse] [bit] NOT NULL,
	[IsFollowVisitUse] [bit] NOT NULL,
 CONSTRAINT [PK__TrialCon__3214EC0712039501] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[ReadingCriterionPage]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ReadingCriterionPage](
	[Id] [uniqueidentifier] NOT NULL,
	[TrialId] [uniqueidentifier] NOT NULL,
	[PageName] [nvarchar](50) NOT NULL,
	[IsEnable] [bit] NOT NULL,
	[CreateTime] [datetime2](7) NOT NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
	[ReadingQuestionCriterionTrialId] [uniqueidentifier] NOT NULL,
	[IsPublicPage] [bit] NOT NULL,
	[ShowOrder] [int] NOT NULL,
 CONSTRAINT [PK_ReadingCriterionPage] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[ReadingGlobalTaskInfo]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ReadingGlobalTaskInfo](
	[Id] [uniqueidentifier] NOT NULL,
	[GlobalTaskId] [uniqueidentifier] NOT NULL,
	[TaskId] [uniqueidentifier] NOT NULL,
	[QuestionId] [uniqueidentifier] NULL,
	[Answer] [nvarchar](4000) NOT NULL,
	[CreateTime] [datetime2](7) NOT NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
	[TrialId] [uniqueidentifier] NOT NULL,
	[SubjectId] [uniqueidentifier] NOT NULL,
	[GlobalAnswerType] [int] NOT NULL,
 CONSTRAINT [PK_ReadingGlobalTaskInfo] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[ReadingJudgeInfo]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ReadingJudgeInfo](
	[Id] [uniqueidentifier] NOT NULL,
	[TaskIdOne] [uniqueidentifier] NOT NULL,
	[TaskIdTwo] [uniqueidentifier] NOT NULL,
	[JudgeTaskId] [uniqueidentifier] NOT NULL,
	[CreateTime] [datetime2](7) NOT NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
	[TrialId] [uniqueidentifier] NOT NULL,
	[SubjectId] [uniqueidentifier] NOT NULL,
 CONSTRAINT [PK__ReadingJ__3214EC07AD8F2A28] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[ReadingMedicalReviewDialog]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ReadingMedicalReviewDialog](
	[Id] [uniqueidentifier] NOT NULL,
	[TaskMedicalReviewId] [uniqueidentifier] NOT NULL,
	[VisitTaskId] [uniqueidentifier] NOT NULL,
	[Content] [nvarchar](2000) NOT NULL,
	[UserTypeShortName] [nvarchar](50) NOT NULL,
	[UserTypeEnumInt] [int] NOT NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
	[CreateTime] [datetime] NOT NULL,
	[IsHaveQuestion] [bit] NOT NULL,
	[Questioning] [nvarchar](500) NOT NULL,
	[AuditAdviceEnum] [int] NOT NULL,
	[DisagreeReason] [nvarchar](200) NOT NULL,
	[IsApplyHeavyReading] [bit] NULL,
	[DoctorUserIdeaEnum] [int] NOT NULL,
	[ImagePath] [nvarchar](max) NULL,
	[FileName] [nvarchar](max) NULL,
	[MedicalDialogCloseEnum] [int] NULL,
 CONSTRAINT [PK__ReadingM__3214EC072E1F874A] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
/****** Object:  Table [dbo].[ReadingMedicineQuestionAnswer]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ReadingMedicineQuestionAnswer](
	[Id] [uniqueidentifier] NOT NULL,
	[TaskMedicalReviewId] [uniqueidentifier] NOT NULL,
	[VisitTaskId] [uniqueidentifier] NOT NULL,
	[Answer] [nvarchar](200) NOT NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
	[CreateTime] [datetime] NOT NULL,
	[UpdateTime] [datetime] NOT NULL,
	[UpdateUserId] [uniqueidentifier] NOT NULL,
	[ReadingMedicineQuestionId] [uniqueidentifier] NOT NULL,
 CONSTRAINT [PK__ReadingM__3214EC07B415018D] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[ReadingMedicineSystemQuestion]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ReadingMedicineSystemQuestion](
	[Id] [uniqueidentifier] NOT NULL,
	[Type] [nvarchar](255) NOT NULL,
	[ParentTriggerValue] [nvarchar](255) NOT NULL,
	[QuestionName] [nvarchar](255) NOT NULL,
	[IsRequired] [bit] NOT NULL,
	[CreateTime] [datetime] NOT NULL,
	[ShowOrder] [int] NOT NULL,
	[ParentId] [uniqueidentifier] NULL,
	[UpdateTime] [datetime] NOT NULL,
	[TypeValue] [nvarchar](255) NOT NULL,
	[UpdateUserId] [uniqueidentifier] NOT NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
	[IsEnable] [bit] NOT NULL,
	[ReadingCategory] [int] NOT NULL,
	[CriterionTypeEnum] [int] NULL,
	[IsGeneral] [bit] NOT NULL,
 CONSTRAINT [PK__ReadingM__3214EC077588C2B1] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[ReadingMedicineTrialQuestion]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ReadingMedicineTrialQuestion](
	[Id] [uniqueidentifier] NOT NULL,
	[CreateTime] [datetime] NOT NULL,
	[Type] [nvarchar](255) NOT NULL,
	[ParentTriggerValue] [nvarchar](255) NOT NULL,
	[QuestionName] [nvarchar](255) NOT NULL,
	[UpdateUserId] [uniqueidentifier] NOT NULL,
	[TypeValue] [nvarchar](255) NOT NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
	[TrialId] [uniqueidentifier] NOT NULL,
	[UpdateTime] [datetime] NOT NULL,
	[IsEnable] [bit] NOT NULL,
	[IsRequired] [bit] NOT NULL,
	[ShowOrder] [int] NOT NULL,
	[ParentId] [uniqueidentifier] NULL,
	[IsConfirm] [bit] NOT NULL,
	[ReadingCategory] [int] NOT NULL,
	[TrialReadingCriterionId] [uniqueidentifier] NOT NULL,
 CONSTRAINT [PK_ReadingMedicineTrialQuestion] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[ReadingOncologyTaskInfo]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ReadingOncologyTaskInfo](
	[Id] [uniqueidentifier] NOT NULL,
	[OncologyTaskId] [uniqueidentifier] NOT NULL,
	[VisitTaskId] [uniqueidentifier] NOT NULL,
	[EvaluationResult] [nvarchar](100) NOT NULL,
	[EvaluationReason] [nvarchar](500) NOT NULL,
	[CreateTime] [datetime2](7) NOT NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
	[TrialId] [uniqueidentifier] NOT NULL,
	[SubjectId] [uniqueidentifier] NOT NULL,
 CONSTRAINT [PK_ReadingOncologyTaskInfo] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[ReadingPeriodPlan]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ReadingPeriodPlan](
	[Id] [uniqueidentifier] NOT NULL,
	[ReadingPeriodSetId] [uniqueidentifier] NULL,
	[SubjectVisitId] [uniqueidentifier] NULL,
	[CreateTime] [datetime2](7) NULL,
	[CreateUserId] [uniqueidentifier] NULL,
	[UpdateUserId] [uniqueidentifier] NOT NULL,
	[UpdateTime] [datetime2](7) NOT NULL,
	[IsDeleted] [bit] NOT NULL,
	[DeletedTime] [datetime2](7) NULL,
	[DeleteUserId] [uniqueidentifier] NULL,
 CONSTRAINT [PK__ReadingP__3214EC073EBB6CFB] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[ReadingPeriodSet]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ReadingPeriodSet](
	[Id] [uniqueidentifier] NOT NULL,
	[ReadingPeriodName] [nvarchar](100) NOT NULL,
	[TrialId] [uniqueidentifier] NOT NULL,
	[ReadingScope] [int] NOT NULL,
	[SiteId] [uniqueidentifier] NULL,
	[ExpirationDate] [datetime2](7) NULL,
	[ExpirationVisitNum] [decimal](18, 0) NULL,
	[IsTakeEffect] [int] NULL,
	[CreateTime] [datetime2](7) NULL,
	[CreateUserId] [uniqueidentifier] NULL,
	[VisitStageId] [uniqueidentifier] NULL,
	[ReadingSetType] [int] NOT NULL,
	[EffectOfTime] [datetime2](7) NULL,
	[IsGlobal] [bit] NOT NULL,
	[TrialReadingCriterionId] [uniqueidentifier] NOT NULL,
	[UpdateUserId] [uniqueidentifier] NOT NULL,
	[UpdateTime] [datetime2](7) NOT NULL,
	[IsDeleted] [bit] NOT NULL,
	[DeletedTime] [datetime2](7) NULL,
	[DeleteUserId] [uniqueidentifier] NULL,
 CONSTRAINT [PK__ReadingP__3214EC07584494FB] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[ReadingPeriodSite]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ReadingPeriodSite](
	[Id] [uniqueidentifier] NOT NULL,
	[ReadingPeriodSetId] [uniqueidentifier] NULL,
	[SiteId] [uniqueidentifier] NOT NULL,
	[CreateTime] [datetime2](7) NOT NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
	[TrialId] [uniqueidentifier] NOT NULL,
 CONSTRAINT [PK__ReadingP__3214EC073D2F2202] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[ReadingQuestionCriterionSystem]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ReadingQuestionCriterionSystem](
	[Id] [uniqueidentifier] NOT NULL,
	[CriterionName] [nvarchar](200) NOT NULL,
	[IsEnable] [bit] NOT NULL,
	[CreateTime] [datetime2](7) NOT NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
	[IsCompleteConfig] [bit] NOT NULL,
	[ShowOrder] [int] NOT NULL,
	[ConfirmTime] [datetime2](7) NOT NULL,
	[Description] [nvarchar](300) NULL,
	[CriterionType] [int] NOT NULL,
	[IsOncologyReading] [bit] NOT NULL,
	[IsMustGlobalReading] [bit] NOT NULL,
	[IseCRFShowInDicomReading] [bit] NOT NULL,
 CONSTRAINT [PK__ReadingQ__3214EC0797423E03] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[ReadingQuestionSystem]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ReadingQuestionSystem](
	[Id] [uniqueidentifier] NOT NULL,
	[ReadingQuestionCriterionSystemId] [uniqueidentifier] NOT NULL,
	[Type] [varchar](255) NOT NULL,
	[ParentTriggerValue] [nvarchar](4000) NOT NULL,
	[QuestionName] [varchar](255) NOT NULL,
	[IsRequired] [int] NOT NULL,
	[ShowOrder] [int] NOT NULL,
	[ParentId] [uniqueidentifier] NULL,
	[TypeValue] [varchar](255) NOT NULL,
	[IsEnable] [bit] NOT NULL,
	[CreateTime] [datetime2](7) NOT NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
	[IsJudgeQuestion] [bit] NOT NULL,
	[Remark] [nvarchar](200) NULL,
	[GroupName] [nvarchar](200) NOT NULL,
	[ImageCount] [int] NOT NULL,
	[ShowQuestion] [int] NOT NULL,
	[RelevanceId] [uniqueidentifier] NULL,
	[RelevanceValue] [nvarchar](4000) NULL,
	[MaxQuestionCount] [int] NULL,
	[LesionType] [int] NULL,
	[QuestionType] [int] NULL,
	[IsShowInDicom] [bit] NOT NULL,
	[DictionaryCode] [nvarchar](100) NULL,
	[QuestionGenre] [int] NULL,
	[ValueType] [int] NULL,
	[Unit] [int] NULL,
	[OrderMark] [nvarchar](50) NULL,
	[GlobalReadingShowType] [int] NOT NULL,
	[DefaultValue] [nvarchar](200) NOT NULL,
	[DataSource] [int] NOT NULL,
	[QuestionEnName] [nvarchar](250) NOT NULL,
	[GroupEnName] [nvarchar](255) NOT NULL,
	[LimitEdit] [int] NOT NULL,
	[MaxAnswerLength] [int] NULL,
	[FileType] [nvarchar](1000) NULL,
	[GroupId] [uniqueidentifier] NULL,
 CONSTRAINT [PK__ReadingQ__3214EC078F4C0B3E] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[ReadingQuestionTrial]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ReadingQuestionTrial](
	[Id] [uniqueidentifier] NOT NULL,
	[TrialId] [uniqueidentifier] NOT NULL,
	[ReadingQuestionCriterionTrialId] [uniqueidentifier] NOT NULL,
	[Type] [varchar](255) NOT NULL,
	[ParentTriggerValue] [nvarchar](max) NOT NULL,
	[QuestionName] [varchar](255) NOT NULL,
	[IsRequired] [int] NOT NULL,
	[ShowOrder] [int] NOT NULL,
	[ParentId] [uniqueidentifier] NULL,
	[TypeValue] [varchar](255) NOT NULL,
	[IsEnable] [bit] NOT NULL,
	[CreateTime] [datetime2](7) NOT NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
	[IsJudgeQuestion] [bit] NOT NULL,
	[Remark] [nvarchar](200) NULL,
	[GroupName] [nvarchar](200) NOT NULL,
	[ReadingQuestionSystemId] [uniqueidentifier] NULL,
	[AnswerGroup] [text] NOT NULL,
	[AnswerCombination] [text] NOT NULL,
	[JudgeType] [int] NULL,
	[SystemParentId] [uniqueidentifier] NULL,
	[ReadingCriterionPageId] [uniqueidentifier] NULL,
	[RelevanceId] [uniqueidentifier] NULL,
	[RelevanceValue] [nvarchar](max) NULL,
	[ImageCount] [int] NOT NULL,
	[ShowQuestion] [int] NOT NULL,
	[MaxQuestionCount] [int] NULL,
	[LesionType] [int] NULL,
	[QuestionType] [int] NULL,
	[IsShowInDicom] [bit] NOT NULL,
	[DictionaryCode] [nvarchar](100) NULL,
	[QuestionGenre] [int] NULL,
	[Unit] [int] NULL,
	[ValueType] [int] NULL,
	[OrderMark] [nvarchar](50) NULL,
	[GlobalReadingShowType] [int] NOT NULL,
	[DefaultValue] [nvarchar](200) NOT NULL,
	[CustomCalculateMark] [int] NULL,
	[CalculateQuestions] [text] NOT NULL,
	[DataSource] [int] NOT NULL,
	[CustomUnit] [nvarchar](50) NOT NULL,
	[LimitEdit] [int] NOT NULL,
	[QuestionEnName] [nvarchar](255) NOT NULL,
	[GroupEnName] [nvarchar](255) NOT NULL,
	[IsCopyLesions] [bit] NOT NULL,
	[MaxAnswerLength] [int] NULL,
	[FileType] [nvarchar](1000) NULL,
	[GroupId] [uniqueidentifier] NULL,
 CONSTRAINT [PK_ReadingQuestionTrial] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
/****** Object:  Table [dbo].[ReadingTableAnswerRowInfo]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ReadingTableAnswerRowInfo](
	[Id] [uniqueidentifier] NOT NULL,
	[QuestionId] [uniqueidentifier] NOT NULL,
	[VisitTaskId] [uniqueidentifier] NOT NULL,
	[TrialId] [uniqueidentifier] NOT NULL,
	[RowIndex] [decimal](18, 2) NOT NULL,
	[MeasureData] [nvarchar](max) NOT NULL,
	[CreateTime] [datetime2](7) NOT NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
	[InstanceId] [uniqueidentifier] NULL,
	[SeriesId] [uniqueidentifier] NULL,
	[IsCurrentTaskAdd] [bit] NOT NULL,
	[SplitRowId] [uniqueidentifier] NULL,
	[MergeRowId] [uniqueidentifier] NULL,
	[SplitOrMergeType] [int] NULL,
	[IsCanEditPosition] [bit] NOT NULL,
	[StudyId] [uniqueidentifier] NULL,
	[FristAddTaskNum] [decimal](18, 2) NOT NULL,
	[IsDicomReading] [bit] NOT NULL,
	[BlindName] [nvarchar](50) NOT NULL,
	[UpdateUserId] [uniqueidentifier] NOT NULL,
	[UpdateTime] [datetime2](7) NOT NULL,
	[IsDeleted] [bit] NOT NULL,
	[DeletedTime] [datetime2](7) NULL,
	[DeleteUserId] [uniqueidentifier] NULL,
	[OrderMark] [nvarchar](50) NOT NULL,
	[NumberOfFrames] [int] NULL,
	[PicturePath] [text] NOT NULL,
	[RowMark] [varchar](255) NULL,
	[OrganInfoId] [uniqueidentifier] NULL,
	[WW] [decimal](18, 2) NULL,
	[WL] [decimal](18, 2) NULL,
	[FristAddTaskId] [uniqueidentifier] NOT NULL,
 CONSTRAINT [PK__ReadingT__3214EC07A529B83D] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
/****** Object:  Table [dbo].[ReadingTableQuestionAnswer]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ReadingTableQuestionAnswer](
	[Id] [uniqueidentifier] NOT NULL,
	[QuestionId] [uniqueidentifier] NOT NULL,
	[VisitTaskId] [uniqueidentifier] NOT NULL,
	[TrialId] [uniqueidentifier] NOT NULL,
	[RowIndex] [decimal](18, 2) NOT NULL,
	[Answer] [nvarchar](max) NOT NULL,
	[CreateTime] [datetime2](7) NOT NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
	[TableQuestionId] [uniqueidentifier] NOT NULL,
	[RowId] [uniqueidentifier] NOT NULL,
	[UpdateUserId] [uniqueidentifier] NOT NULL,
	[UpdateTime] [datetime2](7) NOT NULL,
	[IsDeleted] [bit] NOT NULL,
	[DeletedTime] [datetime2](7) NULL,
	[DeleteUserId] [uniqueidentifier] NULL,
 CONSTRAINT [PK_ReadingTableQuestionAnswer] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
/****** Object:  Table [dbo].[ReadingTableQuestionSystem]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ReadingTableQuestionSystem](
	[Id] [uniqueidentifier] NOT NULL,
	[ReadingQuestionId] [uniqueidentifier] NOT NULL,
	[Type] [nvarchar](255) NOT NULL,
	[ParentId] [uniqueidentifier] NULL,
	[ParentTriggerValue] [nvarchar](4000) NOT NULL,
	[QuestionName] [nvarchar](255) NOT NULL,
	[IsRequired] [int] NOT NULL,
	[ShowOrder] [int] NOT NULL,
	[TypeValue] [nvarchar](255) NOT NULL,
	[IsEnable] [bit] NOT NULL,
	[CreateTime] [datetime2](7) NOT NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
	[Remark] [nvarchar](200) NULL,
	[RelevanceId] [uniqueidentifier] NULL,
	[RelevanceValue] [nvarchar](4000) NULL,
	[ShowQuestion] [int] NOT NULL,
	[MaxRowCount] [int] NULL,
	[DataTableName] [nvarchar](200) NULL,
	[DataTableColumn] [nvarchar](200) NULL,
	[TableQuestionType] [int] NULL,
	[DependParentId] [uniqueidentifier] NULL,
	[IsDepend] [int] NOT NULL,
	[SystemCriterionId] [uniqueidentifier] NOT NULL,
	[QuestionMark] [int] NULL,
	[DictionaryCode] [nvarchar](100) NULL,
	[ValueType] [int] NULL,
	[Unit] [int] NULL,
	[DataSource] [int] NOT NULL,
	[QuestionEnName] [nvarchar](255) NOT NULL,
	[LimitEdit] [int] NOT NULL,
	[MaxAnswerLength] [int] NULL,
	[FileType] [nvarchar](1000) NULL,
 CONSTRAINT [PK__ReadingT__3214EC07226E9378] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[ReadingTableQuestionTrial]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ReadingTableQuestionTrial](
	[Id] [uniqueidentifier] NOT NULL,
	[TrialId] [uniqueidentifier] NULL,
	[ReadingQuestionId] [uniqueidentifier] NOT NULL,
	[Type] [nvarchar](255) NOT NULL,
	[ParentId] [uniqueidentifier] NULL,
	[ParentTriggerValue] [nvarchar](4000) NOT NULL,
	[QuestionName] [nvarchar](255) NOT NULL,
	[IsRequired] [int] NOT NULL,
	[ShowOrder] [int] NOT NULL,
	[TypeValue] [nvarchar](255) NOT NULL,
	[IsEnable] [bit] NOT NULL,
	[CreateTime] [datetime2](7) NOT NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
	[Remark] [nvarchar](200) NULL,
	[RelevanceId] [uniqueidentifier] NULL,
	[RelevanceValue] [nvarchar](4000) NULL,
	[ShowQuestion] [int] NOT NULL,
	[MaxRowCount] [int] NULL,
	[DataTableName] [nvarchar](200) NULL,
	[DataTableColumn] [nvarchar](200) NULL,
	[TableQuestionType] [int] NULL,
	[DependParentId] [uniqueidentifier] NULL,
	[IsDepend] [int] NOT NULL,
	[TrialCriterionId] [uniqueidentifier] NOT NULL,
	[QuestionMark] [int] NULL,
	[DictionaryCode] [nvarchar](100) NULL,
	[ValueType] [int] NULL,
	[Unit] [int] NULL,
	[CustomCalculateMark] [int] NULL,
	[CalculateQuestions] [text] NOT NULL,
	[DataSource] [int] NOT NULL,
	[CustomUnit] [nvarchar](50) NOT NULL,
	[LimitEdit] [int] NOT NULL,
	[QuestionEnName] [nvarchar](255) NOT NULL,
	[IsCopy] [bit] NOT NULL,
	[SystemTableQuestionId] [uniqueidentifier] NULL,
	[MaxAnswerLength] [int] NULL,
	[FileType] [nvarchar](1000) NULL,
 CONSTRAINT [PK__ReadingT__3214EC07E3B94527] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
/****** Object:  Table [dbo].[ReadingTaskQuestionAnswer]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ReadingTaskQuestionAnswer](
	[Id] [uniqueidentifier] NOT NULL,
	[TrialId] [uniqueidentifier] NOT NULL,
	[SubjectId] [uniqueidentifier] NOT NULL,
	[VisitTaskId] [uniqueidentifier] NOT NULL,
	[ReadingQuestionTrialId] [uniqueidentifier] NOT NULL,
	[Answer] [nvarchar](max) NULL,
	[CreateTime] [datetime] NOT NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
	[ReadingQuestionCriterionTrialId] [uniqueidentifier] NOT NULL,
	[GlobalChangeAnswer] [nvarchar](200) NULL,
	[IsGlobalChange] [bit] NOT NULL,
 CONSTRAINT [PK__ReadingT__3214EC0719C06E31] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
/****** Object:  Table [dbo].[ReadingTaskRelation]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ReadingTaskRelation](
	[Id] [uniqueidentifier] NOT NULL,
	[TaskId] [uniqueidentifier] NOT NULL,
	[RelevanceTaskId] [uniqueidentifier] NOT NULL,
	[RelevanceType] [int] NOT NULL,
	[CreateTime] [datetime2](7) NOT NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[ResearchPublication]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ResearchPublication](
	[Id] [uniqueidentifier] NOT NULL,
	[PublicationsCN] [text] NOT NULL,
	[DoctorId] [uniqueidentifier] NOT NULL,
	[UpdateUserId] [uniqueidentifier] NOT NULL,
	[CreateTime] [datetime] NOT NULL,
	[Grants] [text] NOT NULL,
	[AwardsHonorsCN] [text] NOT NULL,
	[Publications] [text] NOT NULL,
	[UpdateTime] [datetime] NOT NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
	[ResearchCN] [text] NOT NULL,
	[GrantsCN] [text] NOT NULL,
	[AwardsHonors] [text] NOT NULL,
	[Research] [text] NOT NULL,
 CONSTRAINT [PK_DoctorScientificResearchInfo] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
/****** Object:  Table [dbo].[SaveChangesAudits]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[SaveChangesAudits](
	[Id] [uniqueidentifier] NOT NULL,
	[EndTime] [datetime2](7) NOT NULL,
	[Succeeded] [bit] NOT NULL,
	[StartTime] [datetime2](7) NOT NULL,
	[ErrorMessage] [nvarchar](100) NULL,
 CONSTRAINT [PK__SaveChan__3214EC072B221126] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[ShortcutKey]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ShortcutKey](
	[Id] [uniqueidentifier] NOT NULL,
	[Keyboardkey] [nvarchar](100) NOT NULL,
	[ShortcutKeyEnum] [int] NOT NULL,
	[ImageToolType] [int] NOT NULL,
	[CreateTime] [datetime] NOT NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
	[AltKey] [bit] NOT NULL,
	[CtrlKey] [bit] NOT NULL,
	[ShiftKey] [bit] NOT NULL,
	[MetaKey] [bit] NOT NULL,
	[UserId] [uniqueidentifier] NOT NULL,
	[Text] [nvarchar](100) NOT NULL,
	[Code] [nvarchar](100) NOT NULL
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[Sponsor]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Sponsor](
	[Id] [uniqueidentifier] NOT NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
	[CreateTime] [datetime] NOT NULL,
	[UpdateUserId] [uniqueidentifier] NOT NULL,
	[UpdateTime] [datetime] NOT NULL,
	[SponsorName] [nvarchar](200) NOT NULL,
	[SponsorNameCN] [nvarchar](255) NOT NULL,
	[SponsorCode] [nvarchar](255) NOT NULL,
 CONSTRAINT [PK_Sponsor] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[StudyMonitor]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[StudyMonitor](
	[Id] [uniqueidentifier] NOT NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
	[SiteId] [uniqueidentifier] NOT NULL,
	[UploadStartTime] [datetime] NOT NULL,
	[IsDicom] [bit] NOT NULL,
	[SubjectId] [uniqueidentifier] NOT NULL,
	[IsDicomReUpload] [bit] NOT NULL,
	[TotalMillisecondsInterval] [int] NOT NULL,
	[TrialId] [uniqueidentifier] NOT NULL,
	[UploadFinishedTime] [datetime] NULL,
	[FileCount] [int] NOT NULL,
	[UpdateTime] [datetime] NOT NULL,
	[SubjectVisitId] [uniqueidentifier] NOT NULL,
	[IP] [nvarchar](255) NOT NULL,
	[StudyId] [uniqueidentifier] NOT NULL,
	[StudyCode] [nvarchar](255) NULL,
	[FileSize] [decimal](18, 0) NOT NULL,
	[CreateTime] [datetime] NOT NULL,
	[IsSuccess] [bit] NOT NULL,
	[Note] [text] NOT NULL,
	[ArchiveFinishedTime] [datetime] NULL,
	[FailedFileCount] [int] NOT NULL,
 CONSTRAINT [PK_Dictionary_copy1] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
/****** Object:  Table [dbo].[SubjectCanceDoctor]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[SubjectCanceDoctor](
	[Id] [uniqueidentifier] NOT NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
	[CreateTime] [datetime] NOT NULL,
	[SubjectId] [uniqueidentifier] NOT NULL,
	[Note] [varchar](1024) NULL,
 CONSTRAINT [PK__TaskAllo__3214EC07AB0C4BEE_copy1_copy1_copy1] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[SubjectUser]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[SubjectUser](
	[Id] [uniqueidentifier] NOT NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
	[CreateTime] [datetime] NOT NULL,
	[UpdateTime] [datetime] NOT NULL,
	[UpdateUserId] [uniqueidentifier] NOT NULL,
	[SubjectId] [uniqueidentifier] NOT NULL,
	[DoctorUserId] [uniqueidentifier] NOT NULL,
	[AssignTime] [datetime] NULL,
	[TrialId] [uniqueidentifier] NOT NULL,
	[ArmEnum] [int] NOT NULL,
	[IsConfirmed] [bit] NOT NULL,
	[OrignalSubjectUserId] [uniqueidentifier] NULL,
	[TrialReadingCriterionId] [uniqueidentifier] NULL,
 CONSTRAINT [PK__TaskAllo__3214EC07AB0C4BEE_copy1_copy1] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[sysdiagrams]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[sysdiagrams](
	[name] [sysname] NOT NULL,
	[principal_id] [int] NOT NULL,
	[diagram_id] [int] IDENTITY(1,1) NOT NULL,
	[version] [int] NULL,
	[definition] [varbinary](max) NULL,
 CONSTRAINT [PK__sysdiagr__C2B05B6189D02403] PRIMARY KEY CLUSTERED 
(
	[diagram_id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY],
 CONSTRAINT [UK_principal_name] UNIQUE NONCLUSTERED 
(
	[principal_id] ASC,
	[name] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
/****** Object:  Table [dbo].[SystemAnonymization]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[SystemAnonymization](
	[Id] [uniqueidentifier] NOT NULL,
	[IsFixed] [bit] NOT NULL,
	[Group] [nvarchar](200) NOT NULL,
	[ReplaceValue] [nvarchar](255) NOT NULL,
	[IsAdd] [bit] NOT NULL,
	[IsEnable] [bit] NOT NULL,
	[UpdateUserId] [uniqueidentifier] NOT NULL,
	[CreateTime] [datetime] NOT NULL,
	[ValueRepresentation] [nvarchar](255) NOT NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
	[Element] [nvarchar](200) NOT NULL,
	[TagDescription] [nvarchar](200) NOT NULL,
	[TagDescriptionCN] [nvarchar](255) NOT NULL,
	[UpdateTime] [datetime] NOT NULL,
 CONSTRAINT [PK__ImageAcq__3214EC0734E8D562_copy4] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[SystemBasicData]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[SystemBasicData](
	[Id] [uniqueidentifier] NOT NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
	[IsEnable] [bit] NOT NULL,
	[BasicDataTypeEnum] [int] NOT NULL,
	[Description] [nvarchar](512) NOT NULL,
	[ParentId] [uniqueidentifier] NULL,
	[Name] [nvarchar](100) NOT NULL,
	[UpdateUserId] [uniqueidentifier] NOT NULL,
	[Code] [nvarchar](512) NOT NULL,
	[CreateTime] [datetime] NOT NULL,
	[ValueCN] [nvarchar](512) NOT NULL,
	[ShowOrder] [int] NOT NULL,
	[Value] [nvarchar](512) NOT NULL,
	[UpdateTime] [datetime] NOT NULL,
 CONSTRAINT [PK_Dictionary_copy2] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[SystemCriterionDictionaryCode]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[SystemCriterionDictionaryCode](
	[Id] [uniqueidentifier] NOT NULL,
	[SystemCriterionId] [uniqueidentifier] NOT NULL,
	[Code] [nvarchar](50) NOT NULL,
	[CreateTime] [datetime2](7) NOT NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
 CONSTRAINT [PK__SystemCr__3214EC073DF8E80E] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[SystemDocConfirmedUser]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[SystemDocConfirmedUser](
	[Id] [uniqueidentifier] NOT NULL,
	[SignText] [nvarchar](512) NOT NULL,
	[ConfirmTime] [datetime] NULL,
	[ConfirmUserId] [uniqueidentifier] NOT NULL,
	[SystemDocumentId] [uniqueidentifier] NOT NULL,
	[SignFirstViewTime] [datetime] NULL,
	[IsDeleted] [bit] NOT NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
	[CreateTime] [datetime] NOT NULL,
	[DeleteUserId] [uniqueidentifier] NULL,
	[DeletedTime] [datetime] NULL,
 CONSTRAINT [PK__ImageAcq__3214EC0734E8D562_copy2_copy1_copy1_copy1_copy1_copy1] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[SystemDocNeedConfirmedUserType]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[SystemDocNeedConfirmedUserType](
	[Id] [uniqueidentifier] NOT NULL,
	[SystemDocumentId] [uniqueidentifier] NOT NULL,
	[NeedConfirmUserTypeId] [uniqueidentifier] NOT NULL,
 CONSTRAINT [PK__ImageAcq__3214EC0734E8D562_copy2_copy1_copy1_copy1_copy2] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[SystemDocument]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[SystemDocument](
	[Id] [uniqueidentifier] NOT NULL,
	[SignViewMinimumMinutes] [int] NULL,
	[CreateTime] [datetime] NOT NULL,
	[UpdateUserId] [uniqueidentifier] NOT NULL,
	[DeleteUserId] [uniqueidentifier] NULL,
	[Type] [nvarchar](200) NOT NULL,
	[Name] [nvarchar](200) NOT NULL,
	[IsDeleted] [bit] NOT NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
	[DeletedTime] [datetime] NULL,
	[Path] [nvarchar](200) NOT NULL,
	[FileTypeId] [uniqueidentifier] NULL,
	[UpdateTime] [datetime] NOT NULL,
 CONSTRAINT [PK__ImageAcq__3214EC0734E8D562_copy2] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[SystemNotice]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[SystemNotice](
	[Id] [uniqueidentifier] NOT NULL,
	[EndDate] [datetime] NULL,
	[UpdateTime] [datetime] NOT NULL,
	[NoticeModeEnum] [int] NOT NULL,
	[NoticeTypeEnum] [int] NOT NULL,
	[NoticeStateEnum] [int] NOT NULL,
	[CreateTime] [datetime] NOT NULL,
	[UpdateUserId] [uniqueidentifier] NOT NULL,
	[FileName] [nvarchar](255) NOT NULL,
	[ApplicableProjectEnum] [int] NOT NULL,
	[PublishedTime] [datetime] NULL,
	[NoticeLevelEnum] [int] NOT NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
	[Path] [nvarchar](255) NOT NULL,
	[StartDate] [datetime] NULL,
	[PublishedUserId] [uniqueidentifier] NULL,
	[NoticeContent] [text] NOT NULL,
 CONSTRAINT [PK_Dictionary_copy2_copy1] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
/****** Object:  Table [dbo].[SystemNoticeUserRead]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[SystemNoticeUserRead](
	[Id] [uniqueidentifier] NOT NULL,
	[CreateTime] [datetime] NOT NULL,
	[SystemNoticeId] [uniqueidentifier] NOT NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
 CONSTRAINT [PK_Dictionary_copy2_copy1_copy1_copy1] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[SystemNoticeUserType]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[SystemNoticeUserType](
	[Id] [uniqueidentifier] NOT NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
	[SystemNoticeId] [uniqueidentifier] NOT NULL,
	[UserTypeId] [uniqueidentifier] NOT NULL,
	[CreateTime] [datetime] NOT NULL,
 CONSTRAINT [PK_Dictionary_copy2_copy1_copy1] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[TaskAllocationRule]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[TaskAllocationRule](
	[Id] [uniqueidentifier] NOT NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
	[CreateTime] [datetime] NOT NULL,
	[UpdateTime] [datetime] NOT NULL,
	[UpdateUserId] [uniqueidentifier] NOT NULL,
	[PlanReadingRatio] [int] NOT NULL,
	[DoctorUserId] [uniqueidentifier] NOT NULL,
	[IsEnable] [bit] NOT NULL,
	[Note] [nvarchar](255) NOT NULL,
	[TrialId] [uniqueidentifier] NOT NULL,
	[IsJudgeDoctor] [bit] NOT NULL,
	[PlanSubjectCount] [int] NOT NULL,
	[EnrollId] [uniqueidentifier] NULL,
 CONSTRAINT [PK__TaskAllo__3214EC07AB0C4BEE] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[TaskConsistentRule]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[TaskConsistentRule](
	[Id] [uniqueidentifier] NOT NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
	[CreateTime] [datetime] NOT NULL,
	[UpdateTime] [datetime] NOT NULL,
	[UpdateUserId] [uniqueidentifier] NOT NULL,
	[IsEnable] [bit] NOT NULL,
	[Note] [nvarchar](255) NOT NULL,
	[TrialId] [uniqueidentifier] NOT NULL,
	[PlanSubjectCount] [int] NOT NULL,
	[PlanVisitCount] [int] NOT NULL,
	[IntervalWeeks] [int] NOT NULL,
	[CompareDoctorUserId] [uniqueidentifier] NULL,
	[IsHaveReadingPeriod] [bit] NOT NULL,
	[IsGenerateGlobalTask] [bit] NOT NULL,
	[BlindSubjectNumberOfPlaces] [int] NOT NULL,
	[BlindTrialSiteCode] [nvarchar](255) NOT NULL,
	[IsSelfAnalysis] [bit] NOT NULL,
	[TrialReadingCriterionId] [uniqueidentifier] NOT NULL,
 CONSTRAINT [PK__TaskAllo__3214EC07AB0C4BEE_copy2_copy1] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[TaskInfluence]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[TaskInfluence](
	[Id] [uniqueidentifier] NOT NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
	[CreateTime] [datetime] NOT NULL,
	[OriginalTaskId] [uniqueidentifier] NOT NULL,
	[InfluenceTaskId] [uniqueidentifier] NOT NULL,
	[OptType] [int] NOT NULL,
 CONSTRAINT [PK__TaskAllo__3214EC07AB0C4BEE_copy1_copy2_copy3] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[TaskMedicalReview]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[TaskMedicalReview](
	[Id] [uniqueidentifier] NOT NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
	[CreateTime] [datetime] NOT NULL,
	[UpdateTime] [datetime] NOT NULL,
	[UpdateUserId] [uniqueidentifier] NOT NULL,
	[AllocateTime] [datetime] NULL,
	[AuditState] [int] NOT NULL,
	[AuditSignTime] [datetime] NULL,
	[DoctorUserIdeaEnum] [int] NOT NULL,
	[MedicalManagerUserId] [uniqueidentifier] NULL,
	[VisitTaskId] [uniqueidentifier] NOT NULL,
	[TrialId] [uniqueidentifier] NOT NULL,
	[DoctorUserId] [uniqueidentifier] NOT NULL,
	[IsHaveQuestion] [bit] NOT NULL,
	[Questioning] [nvarchar](500) NOT NULL,
	[AuditAdviceEnum] [int] NOT NULL,
	[ImagePath] [nvarchar](max) NOT NULL,
	[IsClosedDialog] [bit] NOT NULL,
	[SaveQuestionTime] [datetime2](7) NULL,
	[DisagreeReason] [nvarchar](200) NOT NULL,
	[IsApplyHeavyReading] [bit] NOT NULL,
	[SaveConclusionTime] [datetime2](7) NULL,
	[FileName] [nvarchar](max) NOT NULL,
	[IsSendMessage] [bit] NOT NULL,
	[DialogCloseReason] [nvarchar](200) NOT NULL,
	[MedicalDialogCloseEnum] [int] NOT NULL,
	[IsInvalid] [bit] NOT NULL,
	[IsAutoGenerate] [bit] NOT NULL,
	[PDRelationTaskIdListStr] [nvarchar](510) NOT NULL,
 CONSTRAINT [PK__TaskAllo__3214EC07AB0C4BEE_copy1_copy2_copy1] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
/****** Object:  Table [dbo].[TaskMedicalReviewRule]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[TaskMedicalReviewRule](
	[Id] [uniqueidentifier] NOT NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
	[CreateTime] [datetime] NOT NULL,
	[UpdateTime] [datetime] NOT NULL,
	[UpdateUserId] [uniqueidentifier] NOT NULL,
	[DoctorUserId] [uniqueidentifier] NOT NULL,
	[IsEnable] [bit] NOT NULL,
	[Note] [nvarchar](255) NOT NULL,
	[TrialId] [uniqueidentifier] NOT NULL,
	[PlanVisitCount] [int] NOT NULL,
	[PlanJudgeCount] [int] NOT NULL,
	[PlanGlobalCount] [int] NOT NULL,
	[PlanTumorCount] [int] NOT NULL,
 CONSTRAINT [PK__TaskAllo__3214EC07AB0C4BEE_copy2] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[TrialClinicalDataSetCriterion]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[TrialClinicalDataSetCriterion](
	[Id] [uniqueidentifier] NOT NULL,
	[TrialClinicalDataSetId] [uniqueidentifier] NOT NULL,
	[TrialReadingCriterionId] [uniqueidentifier] NOT NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
	[CreateTime] [datetime] NOT NULL,
	[UpdateTime] [datetime] NOT NULL,
	[UpdateUserId] [uniqueidentifier] NOT NULL,
 CONSTRAINT [PK__TrialCli__3214EC07231CAA60] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[TrialCriterionDictionaryCode]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[TrialCriterionDictionaryCode](
	[Id] [uniqueidentifier] NOT NULL,
	[TrialCriterionId] [uniqueidentifier] NOT NULL,
	[Code] [nvarchar](50) NOT NULL,
	[CreateTime] [datetime2](7) NOT NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[TrialDictionary]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[TrialDictionary](
	[Id] [uniqueidentifier] NOT NULL,
	[DictionaryId] [uniqueidentifier] NOT NULL,
	[KeyName] [nvarchar](100) NOT NULL,
	[TrialId] [uniqueidentifier] NOT NULL,
 CONSTRAINT [PK_ProjectDictionary] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[TrialDocConfirmedUser]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[TrialDocConfirmedUser](
	[Id] [uniqueidentifier] NOT NULL,
	[SignFirstViewTime] [datetime] NULL,
	[ConfirmTime] [datetime] NULL,
	[ConfirmUserId] [uniqueidentifier] NOT NULL,
	[SignText] [nvarchar](512) NOT NULL,
	[TrialDocumentId] [uniqueidentifier] NOT NULL,
	[IsDeleted] [bit] NOT NULL,
	[CreateTime] [datetime] NOT NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
	[DeleteUserId] [uniqueidentifier] NULL,
	[DeletedTime] [datetime] NULL,
 CONSTRAINT [PK__ImageAcq__3214EC0734E8D562_copy2_copy1_copy1_copy1_copy1] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[TrialDocNeedConfirmedUserType]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[TrialDocNeedConfirmedUserType](
	[Id] [uniqueidentifier] NOT NULL,
	[NeedConfirmUserTypeId] [uniqueidentifier] NOT NULL,
	[TrialDocumentId] [uniqueidentifier] NOT NULL,
 CONSTRAINT [PK__ImageAcq__3214EC0734E8D562_copy2_copy1_copy1_copy1] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[TrialDocument]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[TrialDocument](
	[Id] [uniqueidentifier] NOT NULL,
	[DeletedTime] [datetime] NULL,
	[Name] [nvarchar](200) NOT NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
	[SignViewMinimumMinutes] [int] NOT NULL,
	[FileTypeId] [uniqueidentifier] NULL,
	[Path] [nvarchar](200) NOT NULL,
	[UpdateTime] [datetime] NOT NULL,
	[TrialId] [uniqueidentifier] NOT NULL,
	[DeleteUserId] [uniqueidentifier] NULL,
	[CreateTime] [datetime] NOT NULL,
	[IsDeleted] [bit] NOT NULL,
	[Type] [nvarchar](200) NOT NULL,
	[UpdateUserId] [uniqueidentifier] NOT NULL,
	[Description] [nvarchar](500) NOT NULL,
 CONSTRAINT [PK__ImageAcq__3214EC0734E8D562_copy2_copy1] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[TrialEmailNoticeConfig]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[TrialEmailNoticeConfig](
	[Id] [uniqueidentifier] NOT NULL,
	[AuthorizationCode] [nvarchar](255) NOT NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
	[IsUrgent] [bit] NOT NULL,
	[Code] [nvarchar](255) NOT NULL,
	[UpdateUserId] [uniqueidentifier] NOT NULL,
	[IsReturnRequired] [bit] NOT NULL,
	[UpdateTime] [datetime] NOT NULL,
	[CreateTime] [datetime] NOT NULL,
	[IsAutoSend] [bit] NOT NULL,
	[IsDistinguishCriteria] [bit] NOT NULL,
	[BusinessScenarioEnum] [int] NOT NULL,
	[TrialId] [uniqueidentifier] NOT NULL,
	[FilePath] [nvarchar](255) NOT NULL,
	[FileName] [nvarchar](255) NOT NULL,
	[CriterionTypeEnum] [int] NULL,
	[FromEmail] [nvarchar](255) NOT NULL,
	[FromName] [nvarchar](255) NOT NULL,
	[SMTPServerAddress] [nvarchar](255) NOT NULL,
	[SMTPServerPort] [int] NOT NULL,
	[TrialReadingCriterionId] [uniqueidentifier] NULL,
 CONSTRAINT [PK_IntoGroup_copy1_copy1] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[TrialEmailNoticeUser]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[TrialEmailNoticeUser](
	[Id] [uniqueidentifier] NOT NULL,
	[TrialEmailNoticeConfigId] [uniqueidentifier] NOT NULL,
	[EmailUserType] [int] NOT NULL,
	[UserType] [int] NOT NULL,
 CONSTRAINT [PK__TrialEma__3214EC073DDB294C] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[TrialExperience]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[TrialExperience](
	[Id] [uniqueidentifier] NOT NULL,
	[UpdateTime] [datetime] NOT NULL,
	[DoctorId] [uniqueidentifier] NOT NULL,
	[UpdateUserId] [uniqueidentifier] NOT NULL,
	[CreateTime] [datetime] NOT NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
	[PhaseId] [uniqueidentifier] NULL,
	[Term] [nvarchar](100) NOT NULL,
	[EvaluationContent] [nvarchar](512) NOT NULL,
	[VisitReadingCount] [int] NOT NULL,
	[StartTime] [datetime2](7) NULL,
	[EndTime] [datetime2](7) NULL,
 CONSTRAINT [PK_DoctorClinicalTrialExperience] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[TrialExperienceCriteria]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[TrialExperienceCriteria](
	[Id] [uniqueidentifier] ROWGUIDCOL  NOT NULL,
	[TrialExperienceId] [uniqueidentifier] NOT NULL,
	[EvaluationCriteriaId] [uniqueidentifier] NOT NULL,
	[DoctorId] [uniqueidentifier] NOT NULL,
 CONSTRAINT [PK__TrialExp__3214EC07246361C3] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[TrialExternalUser]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[TrialExternalUser](
	[Id] [uniqueidentifier] NOT NULL,
	[CreateTime] [datetime] NOT NULL,
	[ConfirmTime] [datetime] NULL,
	[Email] [nvarchar](255) NOT NULL,
	[UpdateUserId] [uniqueidentifier] NOT NULL,
	[FirstName] [varchar](255) NOT NULL,
	[InviteState] [int] NOT NULL,
	[Phone] [nvarchar](255) NOT NULL,
	[LastName] [varchar](255) NOT NULL,
	[ExpireTime] [datetime] NULL,
	[IsSystemUser] [bit] NOT NULL,
	[UpdateTime] [datetime] NOT NULL,
	[UserTypeId] [uniqueidentifier] NULL,
	[IsJoin] [bit] NOT NULL,
	[TrialId] [uniqueidentifier] NOT NULL,
	[SystemUserId] [uniqueidentifier] NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
	[RejectReason] [nvarchar](512) NULL,
	[OrganizationName] [nvarchar](255) NOT NULL,
 CONSTRAINT [PK_TrialSite_copy1_copy1_copy2] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[TrialFileUserType]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[TrialFileUserType](
	[Id] [uniqueidentifier] NOT NULL,
	[TrialFileId] [uniqueidentifier] NOT NULL,
	[UserTypeId] [nvarchar](200) NOT NULL,
	[CreateTime] [datetime] NOT NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
 CONSTRAINT [PK__ImageAcq__3214EC0734E8D562_copy1_copy1] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[TrialPaymentPrice ]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[TrialPaymentPrice ](
	[Id] [uniqueidentifier] NOT NULL,
	[TrialAdditional] [decimal](18, 2) NOT NULL,
	[SowPath] [nvarchar](500) NULL,
	[UpdateTime] [datetime] NULL,
	[CreateTime] [datetime] NULL,
	[UpdateUserId] [uniqueidentifier] NULL,
	[AdjustmentMultiple] [decimal](18, 2) NOT NULL,
	[CreateUserId] [uniqueidentifier] NULL,
	[IsNewTrial] [bit] NULL,
	[TrialId] [uniqueidentifier] NOT NULL,
	[SowName] [nvarchar](200) NULL,
 CONSTRAINT [PK_TrialExtension] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[TrialQCQuestion]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[TrialQCQuestion](
	[Id] [uniqueidentifier] NOT NULL,
	[CreateTime] [datetime] NOT NULL,
	[Type] [nvarchar](255) NOT NULL,
	[ParentTriggerValue] [nvarchar](255) NOT NULL,
	[QuestionName] [nvarchar](255) NOT NULL,
	[UpdateUserId] [uniqueidentifier] NOT NULL,
	[TypeValue] [nvarchar](255) NOT NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
	[TrialId] [uniqueidentifier] NOT NULL,
	[UpdateTime] [datetime] NOT NULL,
	[IsEnable] [bit] NOT NULL,
	[IsRequired] [bit] NOT NULL,
	[ShowOrder] [int] NOT NULL,
	[ParentId] [uniqueidentifier] NULL,
	[IsConfirm] [bit] NULL,
 CONSTRAINT [PK__TrialQCQ__3214EC079E774F9D] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[TrialQCQuestionAnswer]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[TrialQCQuestionAnswer](
	[Id] [uniqueidentifier] NOT NULL,
	[Answer] [nvarchar](255) NOT NULL,
	[UpdateUserId] [uniqueidentifier] NOT NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
	[QCProcessEnum ] [int] NOT NULL,
	[TrialId] [uniqueidentifier] NOT NULL,
	[CurrentQCEnum] [int] NOT NULL,
	[UpdateTime] [datetime] NOT NULL,
	[SubjectVisitId] [uniqueidentifier] NOT NULL,
	[TrialQCQuestionConfigureId] [uniqueidentifier] NOT NULL,
	[CreateTime] [datetime] NOT NULL,
	[ChildAnswer] [nvarchar](255) NOT NULL,
 CONSTRAINT [PK__TrialQCQ__3214EC079E774F9D_copy2] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[TrialRevenuesPrice]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[TrialRevenuesPrice](
	[Id] [uniqueidentifier] NOT NULL,
	[TimepointIn24H] [decimal](18, 2) NOT NULL,
	[UpdateUserId] [uniqueidentifier] NOT NULL,
	[AdjudicationIn24H] [decimal](18, 2) NOT NULL,
	[CreateTime] [datetime] NOT NULL,
	[Adjudication] [decimal](18, 2) NOT NULL,
	[Global] [decimal](18, 2) NOT NULL,
	[Timepoint] [decimal](18, 2) NOT NULL,
	[UpdateTime] [datetime] NOT NULL,
	[AdjudicationIn48H] [decimal](18, 2) NOT NULL,
	[Downtime] [decimal](18, 2) NOT NULL,
	[TimepointIn48H] [decimal](18, 2) NOT NULL,
	[TrialId] [uniqueidentifier] NOT NULL,
	[Training] [decimal](18, 2) NOT NULL,
	[RefresherTraining] [decimal](18, 2) NOT NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
 CONSTRAINT [PK_TrialCost] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[TrialRevenuesPriceVerification]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[TrialRevenuesPriceVerification](
	[Id] [uniqueidentifier] NOT NULL,
	[AdjudicationIn48H] [bit] NOT NULL,
	[YearMonth] [nvarchar](100) NOT NULL,
	[TimepointIn48H] [bit] NOT NULL,
	[Training] [bit] NOT NULL,
	[TimepointIn24H] [bit] NOT NULL,
	[TrialId] [uniqueidentifier] NOT NULL,
	[RefresherTraining] [bit] NOT NULL,
	[AdjudicationIn24H] [bit] NOT NULL,
	[WorkLoadDate] [datetime] NOT NULL,
	[Adjudication] [bit] NOT NULL,
	[Global] [bit] NOT NULL,
	[ReviewerId] [uniqueidentifier] NOT NULL,
	[Downtime] [bit] NOT NULL,
	[Timepoint] [bit] NOT NULL,
 CONSTRAINT [PK_TrialRevenuesPriceVerification] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[TrialSign]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[TrialSign](
	[Id] [uniqueidentifier] NOT NULL,
	[TrialId] [uniqueidentifier] NULL,
	[CreateUserId] [uniqueidentifier] NULL,
	[SignText] [nvarchar](1024) NULL,
	[IsCompleted] [bit] NULL,
	[SubjectVisitId] [uniqueidentifier] NULL,
	[SignCode] [nvarchar](255) NULL,
	[CreateTime] [datetime] NULL,
	[SignCodeId] [uniqueidentifier] NULL,
 CONSTRAINT [PK_CROCompany_copy1] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[TrialSiteEquipmentSurvey]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[TrialSiteEquipmentSurvey](
	[Id] [uniqueidentifier] NOT NULL,
	[ManufacturerName] [nvarchar](255) NOT NULL,
	[UpdateUserId] [uniqueidentifier] NOT NULL,
	[TrialSiteSurveyId] [uniqueidentifier] NOT NULL,
	[Parameters] [nvarchar](255) NOT NULL,
	[ScannerType] [varchar](255) NOT NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
	[EquipmentTypeId] [uniqueidentifier] NULL,
	[UpdateTime] [datetime] NOT NULL,
	[Note] [varchar](255) NOT NULL,
	[CreateTime] [datetime] NOT NULL,
 CONSTRAINT [PK_TrialSite_copy1_copy1_copy1] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[TrialSiteSurvey]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[TrialSiteSurvey](
	[Id] [uniqueidentifier] NOT NULL,
	[IsConfirmImagingTechnologist] [bit] NOT NULL,
	[SiteId] [uniqueidentifier] NOT NULL,
	[PreliminaryTime] [datetime] NULL,
	[LatestBackReason] [nvarchar](255) NOT NULL,
	[Phone] [nvarchar](255) NOT NULL,
	[UpdateTime] [datetime] NOT NULL,
	[DeleteUserId] [uniqueidentifier] NULL,
	[PreliminaryUserId] [uniqueidentifier] NULL,
	[UpdateUserId] [uniqueidentifier] NOT NULL,
	[State] [int] NOT NULL,
	[IsFollowStudyParameters] [bit] NOT NULL,
	[CreateTime] [datetime] NOT NULL,
	[NotFollowReson] [nvarchar](255) NOT NULL,
	[Email] [nvarchar](255) NOT NULL,
	[IsLocked] [bit] NOT NULL,
	[NotConfirmReson] [nvarchar](255) NOT NULL,
	[TrialId] [uniqueidentifier] NOT NULL,
	[ReviewerTime] [datetime] NULL,
	[IsDeleted] [bit] NOT NULL,
	[EfficacyEvaluatorType] [int] NOT NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
	[DeletedTime] [datetime] NULL,
	[AverageEngravingCycle] [int] NOT NULL,
	[ReviewerUserId] [uniqueidentifier] NULL,
	[UserName] [nvarchar](255) NOT NULL,
 CONSTRAINT [PK_TrialSite_copy1] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[TrialSiteUser]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[TrialSiteUser](
	[Id] [uniqueidentifier] NOT NULL,
	[DeletedTime] [datetime] NULL,
	[TrialId] [uniqueidentifier] NOT NULL,
	[UpdateUserId] [uniqueidentifier] NOT NULL,
	[DeleteUserId] [uniqueidentifier] NULL,
	[CreateTime] [datetime] NOT NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
	[IsDeleted] [bit] NOT NULL,
	[SiteId] [uniqueidentifier] NOT NULL,
	[UpdateTime] [datetime] NOT NULL,
	[UserId] [uniqueidentifier] NOT NULL,
 CONSTRAINT [PK_UserTrial_copy1] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[TrialSiteUserSurvey]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[TrialSiteUserSurvey](
	[Id] [uniqueidentifier] NOT NULL,
	[ConfirmTime] [datetime] NULL,
	[FirstName] [varchar](255) NOT NULL,
	[UserTypeId] [uniqueidentifier] NULL,
	[IsCorrect] [bit] NOT NULL,
	[OrganizationName] [nvarchar](255) NOT NULL,
	[InviteState] [int] NOT NULL,
	[UserName] [nvarchar](255) NOT NULL,
	[TrialRoleNameId] [uniqueidentifier] NULL,
	[RejectReason] [nvarchar](255) NULL,
	[TrialSiteSurveyId] [uniqueidentifier] NOT NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
	[IsJoin] [bit] NOT NULL,
	[CreateTime] [datetime] NOT NULL,
	[Email] [nvarchar](255) NOT NULL,
	[SystemUserId] [uniqueidentifier] NULL,
	[UpdateUserId] [uniqueidentifier] NOT NULL,
	[ExpireTime] [datetime] NULL,
	[UpdateTime] [datetime] NOT NULL,
	[IsGenerateAccount] [bit] NOT NULL,
	[IsGenerateSuccess] [bit] NOT NULL,
	[Phone] [nvarchar](255) NOT NULL,
	[LastName] [varchar](255) NOT NULL,
 CONSTRAINT [PK_TrialSite_copy1_copy1] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[TrialStateChange]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[TrialStateChange](
	[Id] [uniqueidentifier] NOT NULL,
	[NowState] [nvarchar](200) NOT NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
	[CreateTime] [datetime] NOT NULL,
	[OriginState] [nvarchar](200) NOT NULL,
	[Reason] [nvarchar](200) NOT NULL,
	[TrialId] [uniqueidentifier] NOT NULL,
 CONSTRAINT [PK__ImageAcq__3214EC0734E8D562_copy3] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[TrialStatus]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[TrialStatus](
	[Id] [uniqueidentifier] NOT NULL,
	[CreateTime] [datetime] NOT NULL,
	[TrialId] [uniqueidentifier] NOT NULL,
	[OptUserType] [int] NOT NULL,
	[TrialStatus] [int] NOT NULL,
	[Memo] [nvarchar](100) NOT NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
 CONSTRAINT [PK_TrialDetail] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[TrialUser]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[TrialUser](
	[Id] [uniqueidentifier] NOT NULL,
	[TrialId] [uniqueidentifier] NOT NULL,
	[JoinTime] [datetime] NULL,
	[UpdateUserId] [uniqueidentifier] NOT NULL,
	[RemoveTime] [datetime] NULL,
	[CreateTime] [datetime] NOT NULL,
	[DeletedTime] [datetime] NULL,
	[IsDeleted] [bit] NOT NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
	[UpdateTime] [datetime] NOT NULL,
	[DeleteUserId] [uniqueidentifier] NULL,
	[UserId] [uniqueidentifier] NOT NULL,
 CONSTRAINT [PK_UserTrial] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[TumorAssessment]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[TumorAssessment](
	[Id] [uniqueidentifier] NOT NULL,
	[TargetLesion] [int] NOT NULL,
	[NonTargetLesions] [int] NOT NULL,
	[NewLesion] [int] NOT NULL,
	[OverallEfficacy] [int] NOT NULL,
	[CriterionId] [uniqueidentifier] NOT NULL,
 CONSTRAINT [PK__TumorAss__3214EC0760934A33] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[User]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[User](
	[Id] [uniqueidentifier] NOT NULL,
	[Sex] [int] NOT NULL,
	[IsFirstAdd] [bit] NOT NULL,
	[UserCode] [nvarchar](100) NOT NULL,
	[OrganizationName] [nvarchar](200) NULL,
	[CreateTime] [datetime] NOT NULL,
	[LastName] [nvarchar](255) NOT NULL,
	[FirstName] [nvarchar](255) NOT NULL,
	[UpdateUserId] [uniqueidentifier] NOT NULL,
	[Phone] [nvarchar](100) NOT NULL,
	[PasswordChanged] [bit] NOT NULL,
	[UserTypeId] [uniqueidentifier] NOT NULL,
	[UserName] [nvarchar](255) NOT NULL,
	[DepartmentName] [nvarchar](100) NOT NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
	[UserTypeEnum] [int] NOT NULL,
	[PositionName] [nvarchar](100) NOT NULL,
	[SuperAdmin] [bit] NOT NULL,
	[Status] [int] NOT NULL,
	[IsZhiZhun] [bit] NULL,
	[Password] [nvarchar](255) NOT NULL,
	[LastLoginTime] [datetime] NULL,
	[UpdateTime] [datetime] NOT NULL,
	[EMail] [nvarchar](200) NOT NULL,
	[Code] [int] NULL,
	[EmailToken] [nvarchar](1020) NULL,
	[DoctorId] [uniqueidentifier] NULL,
	[IsTestUser] [bit] NOT NULL,
 CONSTRAINT [PK_SysUser_1] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[UserDoctor]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[UserDoctor](
	[Id] [uniqueidentifier] NOT NULL,
	[DoctorId] [uniqueidentifier] NOT NULL,
	[UserId] [uniqueidentifier] NOT NULL,
 CONSTRAINT [PK_UserDoctor] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[UserType]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[UserType](
	[Id] [uniqueidentifier] NOT NULL,
	[UserTypeShortName] [nvarchar](255) NOT NULL,
	[UserTypeEnum] [int] NOT NULL,
	[IsEnable] [bit] NOT NULL,
	[Type] [int] NOT NULL,
	[Description] [nvarchar](255) NOT NULL,
	[PermissionStr] [nvarchar](255) NOT NULL,
	[Order] [int] NOT NULL,
	[UserTypeName] [varchar](255) NOT NULL,
	[IsInternal] [bit] NOT NULL,
 CONSTRAINT [PK__UserType__3214EC07172CB0DA] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[UserTypeGroup]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[UserTypeGroup](
	[Id] [uniqueidentifier] NOT NULL,
	[DictionaryId] [uniqueidentifier] NOT NULL,
	[UserTypeId] [uniqueidentifier] NOT NULL,
 CONSTRAINT [PK_R_RolePermission_copy1] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[UserTypeMenu]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[UserTypeMenu](
	[Id] [uniqueidentifier] NOT NULL,
	[UserTypeId] [uniqueidentifier] NOT NULL,
	[MenuId] [uniqueidentifier] NOT NULL,
 CONSTRAINT [PK_R_RolePermission] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[Vacation]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Vacation](
	[Id] [uniqueidentifier] NOT NULL,
	[EndDate] [datetime] NOT NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
	[DoctorId] [uniqueidentifier] NOT NULL,
	[Status] [int] NOT NULL,
	[UpdateTime] [datetime] NOT NULL,
	[CreateTime] [datetime] NOT NULL,
	[StartDate] [datetime] NOT NULL,
	[UpdateUserId] [uniqueidentifier] NOT NULL,
 CONSTRAINT [PK_Holiday] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[VerificationCode]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[VerificationCode](
	[Id] [uniqueidentifier] NOT NULL,
	[ExpirationTime] [datetime] NOT NULL,
	[UserId] [uniqueidentifier] NOT NULL,
	[CreateUserId] [uniqueidentifier] NULL,
	[EmailOrPhone] [nvarchar](255) NULL,
	[Code] [nvarchar](100) NOT NULL,
	[CreateTime] [datetime] NULL,
	[CodeType] [int] NOT NULL,
	[HasSend] [bit] NOT NULL,
 CONSTRAINT [PK_VerificationCode] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[VisitPlanInfluenceStat]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[VisitPlanInfluenceStat](
	[Id] [uniqueidentifier] NOT NULL,
	[CreateTime] [datetime] NOT NULL,
	[InconsistentCount] [int] NOT NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
	[TrialId] [uniqueidentifier] NOT NULL,
 CONSTRAINT [PK_TrialInterview_copy2] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[VisitPlanInfluenceStudy]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[VisitPlanInfluenceStudy](
	[Id] [uniqueidentifier] NOT NULL,
	[Modality] [nvarchar](255) NOT NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
	[IsDicomStudy] [bit] NOT NULL,
	[IsOverWindowNowNotOverWindow] [bit] NOT NULL,
	[StudyId] [uniqueidentifier] NOT NULL,
	[VisitPlanInfluenceStatId] [uniqueidentifier] NULL,
	[HistoryWindow] [nvarchar](255) NOT NULL,
	[StudyTime] [datetime] NULL,
	[SubjectVisitId] [uniqueidentifier] NOT NULL,
	[CreateTime] [datetime] NOT NULL,
	[TrialId] [uniqueidentifier] NOT NULL,
	[NowWindow] [nvarchar](255) NOT NULL,
 CONSTRAINT [PK_TrialInterview_copy1] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[VisitStage]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[VisitStage](
	[Id] [uniqueidentifier] NOT NULL,
	[IsDeleted] [bit] NOT NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
	[IsBaseLine] [bit] NOT NULL,
	[Description] [text] NULL,
	[NeedGlobal] [bit] NOT NULL,
	[VisitDay] [int] NOT NULL,
	[DeleteUserId] [uniqueidentifier] NULL,
	[UpdateTime] [datetime] NOT NULL,
	[VisitWindowLeft] [int] NULL,
	[TrialId] [uniqueidentifier] NOT NULL,
	[IsConfirmed] [bit] NOT NULL,
	[VisitWindowRight] [int] NULL,
	[VisitName] [nvarchar](200) NOT NULL,
	[DeletedTime] [datetime] NULL,
	[VisitNum] [decimal](18, 1) NOT NULL,
	[IsHaveFirstConfirmed] [bit] NOT NULL,
	[UpdateUserId] [uniqueidentifier] NOT NULL,
	[CreateTime] [datetime] NOT NULL,
	[BlindName] [nvarchar](255) NOT NULL,
 CONSTRAINT [PK_TrialInterview] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
/****** Object:  Table [dbo].[VisitTaskReReading]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[VisitTaskReReading](
	[Id] [uniqueidentifier] NOT NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
	[CreateTime] [datetime] NOT NULL,
	[UpdateTime] [datetime] NOT NULL,
	[UpdateUserId] [uniqueidentifier] NOT NULL,
	[OriginalReReadingTaskId] [uniqueidentifier] NOT NULL,
	[RequestReReadingTime] [datetime] NOT NULL,
	[RequestReReadingReason] [nvarchar](1024) NOT NULL,
	[RequestReReadingResultEnum] [int] NOT NULL,
	[RequestReReadingType] [int] NOT NULL,
	[RequestReReadingUserId] [uniqueidentifier] NULL,
	[RequestReReadingConfirmUserId] [uniqueidentifier] NULL,
	[NewReReadingTaskId] [uniqueidentifier] NULL,
	[RootReReadingTaskId] [uniqueidentifier] NULL,
	[RequestReReadingRejectReason] [nvarchar](255) NOT NULL,
	[IsCopyOrigenalForms] [bit] NOT NULL,
	[IsCopyFollowForms] [bit] NOT NULL,
 CONSTRAINT [PK__TaskAllo__3214EC07AB0C4BEE_copy1_copy2] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[VolumeReward]    Script Date: 2023/6/21 10:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[VolumeReward](
	[Id] [uniqueidentifier] NOT NULL,
	[Price] [decimal](18, 2) NOT NULL,
	[UpdateTime] [datetime] NOT NULL,
	[CreateUserId] [uniqueidentifier] NOT NULL,
	[CreateTime] [datetime] NOT NULL,
	[Min] [int] NOT NULL,
	[Max] [int] NOT NULL,
	[UpdateUserId] [uniqueidentifier] NOT NULL,
 CONSTRAINT [PK_AwardPrice] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Attachment] ADD  DEFAULT (newid()) FOR [Id]
GO
ALTER TABLE [dbo].[Attachment] ADD  DEFAULT ('') FOR [Code]
GO
ALTER TABLE [dbo].[Attachment] ADD  DEFAULT ('') FOR [Type]
GO
ALTER TABLE [dbo].[Attachment] ADD  DEFAULT (getdate()) FOR [CreateTime]
GO
ALTER TABLE [dbo].[Attachment] ADD  DEFAULT (newid()) FOR [CreateUserId]
GO
ALTER TABLE [dbo].[Attachment] ADD  DEFAULT ((0)) FOR [IsOfficial]
GO
ALTER TABLE [dbo].[Attachment] ADD  DEFAULT ('') FOR [FileName]
GO
ALTER TABLE [dbo].[Attachment] ADD  DEFAULT ('') FOR [Path]
GO
ALTER TABLE [dbo].[Attachment] ADD  DEFAULT ((0)) FOR [Language]
GO
ALTER TABLE [dbo].[Attachment] ADD  DEFAULT (newid()) FOR [DoctorId]
GO
ALTER TABLE [dbo].[CheckChallengeDialog] ADD  DEFAULT (newid()) FOR [Id]
GO
ALTER TABLE [dbo].[CheckChallengeDialog] ADD  DEFAULT ((0)) FOR [UserTypeEnum]
GO
ALTER TABLE [dbo].[CheckChallengeDialog] ADD  DEFAULT ('') FOR [CreateUser]
GO
ALTER TABLE [dbo].[ClinicalDataSystemSet] ADD  DEFAULT ((0)) FOR [UploadRole]
GO
ALTER TABLE [dbo].[ClinicalDataSystemSet] ADD  DEFAULT ('') FOR [FileName]
GO
ALTER TABLE [dbo].[ClinicalDataSystemSet] ADD  DEFAULT ('') FOR [Path]
GO
ALTER TABLE [dbo].[ClinicalDataSystemSet] ADD  DEFAULT ('') FOR [CriterionEnumListStr]
GO
ALTER TABLE [dbo].[ClinicalDataTrialSet] ADD  DEFAULT ((0)) FOR [IsConfirm]
GO
ALTER TABLE [dbo].[ClinicalDataTrialSet] ADD  DEFAULT ((0)) FOR [UploadRole]
GO
ALTER TABLE [dbo].[ClinicalDataTrialSet] ADD  DEFAULT ('') FOR [FileName]
GO
ALTER TABLE [dbo].[ClinicalDataTrialSet] ADD  DEFAULT ('') FOR [Path]
GO
ALTER TABLE [dbo].[ClinicalDataTrialSet] ADD  DEFAULT ('') FOR [CriterionEnumListStr]
GO
ALTER TABLE [dbo].[CommonDocument] ADD  DEFAULT (newid()) FOR [Id]
GO
ALTER TABLE [dbo].[CommonDocument] ADD  DEFAULT ('') FOR [Path]
GO
ALTER TABLE [dbo].[CommonDocument] ADD  DEFAULT (getdate()) FOR [UpdateTime]
GO
ALTER TABLE [dbo].[CommonDocument] ADD  DEFAULT (newid()) FOR [CreateUserId]
GO
ALTER TABLE [dbo].[CommonDocument] ADD  DEFAULT ('') FOR [Name]
GO
ALTER TABLE [dbo].[CommonDocument] ADD  DEFAULT ((0)) FOR [IsDeleted]
GO
ALTER TABLE [dbo].[CommonDocument] ADD  DEFAULT (newid()) FOR [UpdateUserId]
GO
ALTER TABLE [dbo].[CommonDocument] ADD  DEFAULT (getdate()) FOR [CreateTime]
GO
ALTER TABLE [dbo].[CommonDocument] ADD  DEFAULT ('') FOR [Code]
GO
ALTER TABLE [dbo].[CommonDocument] ADD  DEFAULT ((-1)) FOR [CriterionTypeEnum]
GO
ALTER TABLE [dbo].[CommonDocument] ADD  DEFAULT ((0)) FOR [FileTypeEnum]
GO
ALTER TABLE [dbo].[CommonDocument] ADD  DEFAULT ((0)) FOR [BusinessScenarioEnum]
GO
ALTER TABLE [dbo].[CriterionNidus] ADD  DEFAULT ((0)) FOR [IsSystemCriterion]
GO
ALTER TABLE [dbo].[CROCompany] ADD  DEFAULT (newid()) FOR [Id]
GO
ALTER TABLE [dbo].[CROCompany] ADD  DEFAULT (getdate()) FOR [UpdateTime]
GO
ALTER TABLE [dbo].[CROCompany] ADD  DEFAULT (getdate()) FOR [CreateTime]
GO
ALTER TABLE [dbo].[CROCompany] ADD  DEFAULT ('') FOR [CROName]
GO
ALTER TABLE [dbo].[CROCompany] ADD  DEFAULT (newid()) FOR [CreateUserId]
GO
ALTER TABLE [dbo].[CROCompany] ADD  DEFAULT ('') FOR [CROCode]
GO
ALTER TABLE [dbo].[CROCompany] ADD  DEFAULT (newid()) FOR [UpdateUserId]
GO
ALTER TABLE [dbo].[CROCompany] ADD  DEFAULT ('') FOR [CRONameCN]
GO
ALTER TABLE [dbo].[DataInspection] ADD  DEFAULT (newid()) FOR [Id]
GO
ALTER TABLE [dbo].[DataInspection] ADD  DEFAULT ('') FOR [JsonDetail]
GO
ALTER TABLE [dbo].[DataInspection] ADD  DEFAULT ((0)) FOR [IsSign]
GO
ALTER TABLE [dbo].[DataInspection] ADD  DEFAULT (getdate()) FOR [CreateTime]
GO
ALTER TABLE [dbo].[DataInspection] ADD  DEFAULT ('00000000-0000-0000-0000-000000000000') FOR [CreateUserId]
GO
ALTER TABLE [dbo].[DataInspection] ADD  DEFAULT ('') FOR [EntityName]
GO
ALTER TABLE [dbo].[DataInspection] ADD  DEFAULT ('') FOR [CreateUserRealName]
GO
ALTER TABLE [dbo].[DicomInstance] ADD  DEFAULT ((0)) FOR [CPIStatus]
GO
ALTER TABLE [dbo].[DicomInstance] ADD  DEFAULT ((0)) FOR [Anonymize]
GO
ALTER TABLE [dbo].[DicomInstance] ADD  DEFAULT (getdate()) FOR [CreateTime]
GO
ALTER TABLE [dbo].[DicomInstance] ADD  DEFAULT (newsequentialid()) FOR [SeqId]
GO
ALTER TABLE [dbo].[DicomSeries] ADD  DEFAULT ('') FOR [BodyPartForEdit]
GO
ALTER TABLE [dbo].[DicomSeries] ADD  DEFAULT (getdate()) FOR [CreateTime]
GO
ALTER TABLE [dbo].[DicomSeries] ADD  DEFAULT ('') FOR [SeriesInstanceUid]
GO
ALTER TABLE [dbo].[DicomSeries] ADD  DEFAULT ('') FOR [SliceThickness]
GO
ALTER TABLE [dbo].[DicomSeries] ADD  DEFAULT (getdate()) FOR [UpdateTime]
GO
ALTER TABLE [dbo].[DicomSeries] ADD  DEFAULT ((0)) FOR [InstanceCount]
GO
ALTER TABLE [dbo].[DicomSeries] ADD  DEFAULT (newsequentialid()) FOR [SeqId]
GO
ALTER TABLE [dbo].[DicomSeries] ADD  DEFAULT ('') FOR [StudyInstanceUid]
GO
ALTER TABLE [dbo].[DicomSeries] ADD  DEFAULT ('') FOR [Description]
GO
ALTER TABLE [dbo].[DicomStudy] ADD  DEFAULT ('') FOR [PatientSex]
GO
ALTER TABLE [dbo].[DicomStudy] ADD  DEFAULT ('') FOR [Uploader]
GO
ALTER TABLE [dbo].[DicomStudy] ADD  DEFAULT ((0)) FOR [CheckPassed]
GO
ALTER TABLE [dbo].[DicomStudy] ADD  DEFAULT ('') FOR [Comment]
GO
ALTER TABLE [dbo].[DicomStudy] ADD  DEFAULT ((0)) FOR [Status]
GO
ALTER TABLE [dbo].[DicomStudy] ADD  DEFAULT ('') FOR [InstitutionName]
GO
ALTER TABLE [dbo].[DicomStudy] ADD  DEFAULT ('') FOR [QAComment]
GO
ALTER TABLE [dbo].[DicomStudy] ADD  DEFAULT ('') FOR [BodyPartForEdit]
GO
ALTER TABLE [dbo].[DicomStudy] ADD  DEFAULT ('') FOR [CheckResult]
GO
ALTER TABLE [dbo].[DicomStudy] ADD  DEFAULT ('') FOR [Modalities]
GO
ALTER TABLE [dbo].[DicomStudy] ADD  DEFAULT ('') FOR [PatientId]
GO
ALTER TABLE [dbo].[DicomStudy] ADD  DEFAULT ('00000000-0000-0000-0000-000000000000') FOR [UpdateUserId]
GO
ALTER TABLE [dbo].[DicomStudy] ADD  DEFAULT ('') FOR [PatientAge]
GO
ALTER TABLE [dbo].[DicomStudy] ADD  DEFAULT ((0)) FOR [SeriesCount]
GO
ALTER TABLE [dbo].[DicomStudy] ADD  DEFAULT (newid()) FOR [SubjectVisitId]
GO
ALTER TABLE [dbo].[DicomStudy] ADD  DEFAULT (getdate()) FOR [UpdateTime]
GO
ALTER TABLE [dbo].[DicomStudy] ADD  DEFAULT ((0)) FOR [InstanceCount]
GO
ALTER TABLE [dbo].[DicomStudy] ADD  DEFAULT ('') FOR [StudyInstanceUid]
GO
ALTER TABLE [dbo].[DicomStudy] ADD  DEFAULT ('00000000-0000-0000-0000-000000000000') FOR [CreateUserId]
GO
ALTER TABLE [dbo].[DicomStudy] ADD  DEFAULT ((0)) FOR [IsDeleted]
GO
ALTER TABLE [dbo].[DicomStudy] ADD  DEFAULT ('') FOR [Description]
GO
ALTER TABLE [dbo].[DicomStudy] ADD  DEFAULT ('') FOR [PatientName]
GO
ALTER TABLE [dbo].[DicomStudy] ADD  DEFAULT (getdate()) FOR [CreateTime]
GO
ALTER TABLE [dbo].[DicomStudy] ADD  DEFAULT ((0)) FOR [IsDoubleReview]
GO
ALTER TABLE [dbo].[DicomStudy] ADD  DEFAULT ('') FOR [StudyCode]
GO
ALTER TABLE [dbo].[DicomStudy] ADD  DEFAULT ('') FOR [BodyPartExamined]
GO
ALTER TABLE [dbo].[DicomStudy] ADD  DEFAULT (newsequentialid()) FOR [SeqId]
GO
ALTER TABLE [dbo].[DicomStudy] ADD  DEFAULT ((0)) FOR [Code]
GO
ALTER TABLE [dbo].[DicomStudy] ADD  DEFAULT ('') FOR [ModalityForEdit]
GO
ALTER TABLE [dbo].[Dictionary] ADD  DEFAULT (newid()) FOR [Id]
GO
ALTER TABLE [dbo].[Dictionary] ADD  DEFAULT ('') FOR [Code]
GO
ALTER TABLE [dbo].[Dictionary] ADD  DEFAULT ('') FOR [Value]
GO
ALTER TABLE [dbo].[Dictionary] ADD  DEFAULT ('') FOR [ValueCN]
GO
ALTER TABLE [dbo].[Dictionary] ADD  DEFAULT ((1)) FOR [IsEnable]
GO
ALTER TABLE [dbo].[Dictionary] ADD  DEFAULT ('') FOR [Description]
GO
ALTER TABLE [dbo].[Dictionary] ADD  DEFAULT ((0)) FOR [ShowOrder]
GO
ALTER TABLE [dbo].[Dictionary] ADD  DEFAULT ((0)) FOR [IsConfig]
GO
ALTER TABLE [dbo].[Dictionary] ADD  DEFAULT ('') FOR [ChildGroup]
GO
ALTER TABLE [dbo].[Dictionary] ADD  DEFAULT ((0)) FOR [ChildCodeEnum]
GO
ALTER TABLE [dbo].[Dictionary] ADD  DEFAULT ('00000000-0000-0000-0000-000000000000') FOR [CreateUserId]
GO
ALTER TABLE [dbo].[Dictionary] ADD  DEFAULT (getdate()) FOR [CreateTime]
GO
ALTER TABLE [dbo].[Dictionary] ADD  DEFAULT (getdate()) FOR [UpdateTime]
GO
ALTER TABLE [dbo].[Dictionary] ADD  DEFAULT ('00000000-0000-0000-0000-000000000000') FOR [UpdateUserId]
GO
ALTER TABLE [dbo].[Dictionary] ADD  DEFAULT ('') FOR [KeyName]
GO
ALTER TABLE [dbo].[Dictionary] ADD  DEFAULT ((0)) FOR [DataTypeEnum]
GO
ALTER TABLE [dbo].[Doctor] ADD  DEFAULT (newid()) FOR [Id]
GO
ALTER TABLE [dbo].[Doctor] ADD  DEFAULT ('False') FOR [ActivelyReading]
GO
ALTER TABLE [dbo].[Doctor] ADD  DEFAULT ('') FOR [Phone]
GO
ALTER TABLE [dbo].[Doctor] ADD  DEFAULT ((0)) FOR [GCP]
GO
ALTER TABLE [dbo].[Doctor] ADD  DEFAULT ('') FOR [HospitalOtherCN]
GO
ALTER TABLE [dbo].[Doctor] ADD  DEFAULT ('') FOR [PositionOtherCN]
GO
ALTER TABLE [dbo].[Doctor] ADD  DEFAULT ('') FOR [AdminComment]
GO
ALTER TABLE [dbo].[Doctor] ADD  DEFAULT ('') FOR [FirstName]
GO
ALTER TABLE [dbo].[Doctor] ADD  DEFAULT ((0)) FOR [Nation]
GO
ALTER TABLE [dbo].[Doctor] ADD  DEFAULT (getdate()) FOR [CreateTime]
GO
ALTER TABLE [dbo].[Doctor] ADD  DEFAULT ('') FOR [EMail]
GO
ALTER TABLE [dbo].[Doctor] ADD  DEFAULT ('') FOR [SubspecialityOther]
GO
ALTER TABLE [dbo].[Doctor] ADD  DEFAULT ((2)) FOR [ReviewStatus]
GO
ALTER TABLE [dbo].[Doctor] ADD  DEFAULT ('') FOR [OtherClinicalExperienceCN]
GO
ALTER TABLE [dbo].[Doctor] ADD  DEFAULT ('‘’') FOR [LastName]
GO
ALTER TABLE [dbo].[Doctor] ADD  DEFAULT ('') FOR [WeChat]
GO
ALTER TABLE [dbo].[Doctor] ADD  DEFAULT ('') FOR [SubspecialityOtherCN]
GO
ALTER TABLE [dbo].[Doctor] ADD  DEFAULT ('‘’') FOR [PhotoPath]
GO
ALTER TABLE [dbo].[Doctor] ADD  DEFAULT ('') FOR [Password]
GO
ALTER TABLE [dbo].[Doctor] ADD  DEFAULT ('00000000-0000-0000-0000-000000000000') FOR [CreateUserId]
GO
ALTER TABLE [dbo].[Doctor] ADD  DEFAULT ('') FOR [ReadingTypeOther]
GO
ALTER TABLE [dbo].[Doctor] ADD  DEFAULT ('') FOR [PositionOther]
GO
ALTER TABLE [dbo].[Doctor] ADD  DEFAULT ('') FOR [ResumePath]
GO
ALTER TABLE [dbo].[Doctor] ADD  DEFAULT ('') FOR [ChineseName]
GO
ALTER TABLE [dbo].[Doctor] ADD  DEFAULT ('') FOR [SpecialityOther]
GO
ALTER TABLE [dbo].[Doctor] ADD  DEFAULT ('') FOR [RankOther]
GO
ALTER TABLE [dbo].[Doctor] ADD  DEFAULT ('False') FOR [AcceptingNewTrial]
GO
ALTER TABLE [dbo].[Doctor] ADD  DEFAULT ('') FOR [DepartmentOther]
GO
ALTER TABLE [dbo].[Doctor] ADD  DEFAULT (getdate()) FOR [UpdateTime]
GO
ALTER TABLE [dbo].[Doctor] ADD  DEFAULT ('') FOR [HospitalOther]
GO
ALTER TABLE [dbo].[Doctor] ADD  DEFAULT ('') FOR [RankOtherCN]
GO
ALTER TABLE [dbo].[Doctor] ADD  DEFAULT ((0)) FOR [ResumeStatus]
GO
ALTER TABLE [dbo].[Doctor] ADD  DEFAULT ('00000000-0000-0000-0000-000000000000') FOR [UpdateUserId]
GO
ALTER TABLE [dbo].[Doctor] ADD  DEFAULT ('') FOR [DepartmentOtherCN]
GO
ALTER TABLE [dbo].[Doctor] ADD  DEFAULT ('') FOR [ReadingTypeOtherCN]
GO
ALTER TABLE [dbo].[Doctor] ADD  DEFAULT ('') FOR [OtherClinicalExperience]
GO
ALTER TABLE [dbo].[Doctor] ADD  DEFAULT ('') FOR [Introduction]
GO
ALTER TABLE [dbo].[Doctor] ADD  DEFAULT ('') FOR [SpecialityOtherCN]
GO
ALTER TABLE [dbo].[Doctor] ADD  DEFAULT ('') FOR [OtherSkills]
GO
ALTER TABLE [dbo].[Doctor] ADD  DEFAULT ((0)) FOR [IsVirtual]
GO
ALTER TABLE [dbo].[Doctor] ADD  DEFAULT ('') FOR [BlindName]
GO
ALTER TABLE [dbo].[Doctor] ADD  DEFAULT ('') FOR [Physician]
GO
ALTER TABLE [dbo].[Doctor] ADD  DEFAULT ('') FOR [PhysicianCN]
GO
ALTER TABLE [dbo].[Doctor] ADD  DEFAULT ('') FOR [BlindNameCN]
GO
ALTER TABLE [dbo].[Doctor] ADD  DEFAULT ('') FOR [BlindPublications]
GO
ALTER TABLE [dbo].[DoctorCriterionFile] ADD  DEFAULT ('') FOR [FileName]
GO
ALTER TABLE [dbo].[DoctorCriterionFile] ADD  DEFAULT ('') FOR [FilePath]
GO
ALTER TABLE [dbo].[DoctorCriterionFile] ADD  DEFAULT ((-1)) FOR [CriterionType]
GO
ALTER TABLE [dbo].[DoctorCriterionFile] ADD  DEFAULT ((0)) FOR [FileType]
GO
ALTER TABLE [dbo].[DoctorCriterionFile] ADD  DEFAULT (getdate()) FOR [CreateTime]
GO
ALTER TABLE [dbo].[DoctorCriterionFile] ADD  DEFAULT ((1)) FOR [IsEnable]
GO
ALTER TABLE [dbo].[DoctorCriterionFile] ADD  DEFAULT ('') FOR [CriterionName]
GO
ALTER TABLE [dbo].[DoctorDictionary] ADD  DEFAULT (newid()) FOR [Id]
GO
ALTER TABLE [dbo].[DoctorPayInformation] ADD  DEFAULT (newid()) FOR [Id]
GO
ALTER TABLE [dbo].[DoctorPayInformation] ADD  DEFAULT ('') FOR [BankName]
GO
ALTER TABLE [dbo].[DoctorPayInformation] ADD  DEFAULT ((0)) FOR [Additional]
GO
ALTER TABLE [dbo].[DoctorWorkload] ADD  DEFAULT (newid()) FOR [UpdateUserId]
GO
ALTER TABLE [dbo].[DoctorWorkload] ADD  DEFAULT ('') FOR [IsLock]
GO
ALTER TABLE [dbo].[DoctorWorkload] ADD  DEFAULT ((0)) FOR [RefresherTraining]
GO
ALTER TABLE [dbo].[DoctorWorkload] ADD  DEFAULT ('‘’') FOR [YearMonth]
GO
ALTER TABLE [dbo].[DoctorWorkload] ADD  DEFAULT (getdate()) FOR [CreateTime]
GO
ALTER TABLE [dbo].[DoctorWorkload] ADD  DEFAULT (getdate()) FOR [UpdateTime]
GO
ALTER TABLE [dbo].[DoctorWorkload] ADD  DEFAULT (newid()) FOR [CreateUserId]
GO
ALTER TABLE [dbo].[Education] ADD  DEFAULT ('') FOR [Degree]
GO
ALTER TABLE [dbo].[Education] ADD  DEFAULT ('') FOR [Country]
GO
ALTER TABLE [dbo].[Education] ADD  DEFAULT ('00000000-0000-0000-0000-000000000000') FOR [CreateUserId]
GO
ALTER TABLE [dbo].[Education] ADD  DEFAULT ('') FOR [MajorCN]
GO
ALTER TABLE [dbo].[Education] ADD  DEFAULT ('') FOR [ProvinceCN]
GO
ALTER TABLE [dbo].[Education] ADD  DEFAULT (getdate()) FOR [UpdateTime]
GO
ALTER TABLE [dbo].[Education] ADD  DEFAULT ('') FOR [DegreeCN]
GO
ALTER TABLE [dbo].[Education] ADD  DEFAULT ('') FOR [CountryCN]
GO
ALTER TABLE [dbo].[Education] ADD  DEFAULT ((1)) FOR [ShowOrder]
GO
ALTER TABLE [dbo].[Education] ADD  DEFAULT ('') FOR [Organization]
GO
ALTER TABLE [dbo].[Education] ADD  DEFAULT ('') FOR [City]
GO
ALTER TABLE [dbo].[Education] ADD  DEFAULT ('00000000-0000-0000-0000-000000000000') FOR [UpdateUserId]
GO
ALTER TABLE [dbo].[Education] ADD  DEFAULT ('') FOR [OrganizationCN]
GO
ALTER TABLE [dbo].[Education] ADD  DEFAULT ('') FOR [CityCN]
GO
ALTER TABLE [dbo].[Education] ADD  DEFAULT ('') FOR [Major]
GO
ALTER TABLE [dbo].[Education] ADD  DEFAULT ('') FOR [Province]
GO
ALTER TABLE [dbo].[EmailNoticeConfig] ADD  DEFAULT (newid()) FOR [Id]
GO
ALTER TABLE [dbo].[EmailNoticeConfig] ADD  DEFAULT ('00000000-0000-0000-0000-000000000000') FOR [CreateUserId]
GO
ALTER TABLE [dbo].[EmailNoticeConfig] ADD  DEFAULT ('') FOR [Code]
GO
ALTER TABLE [dbo].[EmailNoticeConfig] ADD  DEFAULT ('00000000-0000-0000-0000-000000000000') FOR [UpdateUserId]
GO
ALTER TABLE [dbo].[EmailNoticeConfig] ADD  DEFAULT ((0)) FOR [IsReturnRequired]
GO
ALTER TABLE [dbo].[EmailNoticeConfig] ADD  DEFAULT (getdate()) FOR [CreateTime]
GO
ALTER TABLE [dbo].[EmailNoticeConfig] ADD  DEFAULT ((0)) FOR [IsAutoSend]
GO
ALTER TABLE [dbo].[EmailNoticeConfig] ADD  DEFAULT ((0)) FOR [IsDeleted]
GO
ALTER TABLE [dbo].[EmailNoticeConfig] ADD  DEFAULT ((0)) FOR [IsDistinguishCriteria]
GO
ALTER TABLE [dbo].[EmailNoticeConfig] ADD  DEFAULT ((0)) FOR [BusinessScenarioEnum]
GO
ALTER TABLE [dbo].[Enroll] ADD  DEFAULT (newid()) FOR [Id]
GO
ALTER TABLE [dbo].[Enroll] ADD  DEFAULT ('00000000-0000-0000-0000-000000000000') FOR [CreateUserId]
GO
ALTER TABLE [dbo].[Enroll] ADD  DEFAULT (getdate()) FOR [UpdateTime]
GO
ALTER TABLE [dbo].[Enroll] ADD  DEFAULT ('00000000-0000-0000-0000-000000000000') FOR [UpdateUserId]
GO
ALTER TABLE [dbo].[Enroll] ADD  DEFAULT (getdate()) FOR [CreateTime]
GO
ALTER TABLE [dbo].[Enroll] ADD  DEFAULT ((0)) FOR [ReviewerReadingType]
GO
ALTER TABLE [dbo].[Enroll] ADD  DEFAULT ('') FOR [Memo]
GO
ALTER TABLE [dbo].[Enroll] ADD  DEFAULT ((0)) FOR [DoctorTrialState]
GO
ALTER TABLE [dbo].[EnrollDetail] ADD  DEFAULT (newid()) FOR [EnrollId]
GO
ALTER TABLE [dbo].[EnrollDetail] ADD  DEFAULT (newid()) FOR [CreateUserId]
GO
ALTER TABLE [dbo].[EnrollDetail] ADD  DEFAULT ((0)) FOR [OptUserType]
GO
ALTER TABLE [dbo].[EnrollDetail] ADD  DEFAULT ('') FOR [Memo]
GO
ALTER TABLE [dbo].[EnrollDetail] ADD  DEFAULT (newid()) FOR [TrialId]
GO
ALTER TABLE [dbo].[EnrollDetail] ADD  DEFAULT ((0)) FOR [EnrollStatus]
GO
ALTER TABLE [dbo].[EnrollDetail] ADD  DEFAULT (getdate()) FOR [CreateTime]
GO
ALTER TABLE [dbo].[EnrollDetail] ADD  DEFAULT (newid()) FOR [TrialDetailId]
GO
ALTER TABLE [dbo].[ExchangeRate] ADD  DEFAULT (newid()) FOR [Id]
GO
ALTER TABLE [dbo].[ExchangeRate] ADD  DEFAULT (getdate()) FOR [CreateTime]
GO
ALTER TABLE [dbo].[ExchangeRate] ADD  DEFAULT ('00000000-0000-0000-0000-000000000000') FOR [UpdateUserId]
GO
ALTER TABLE [dbo].[ExchangeRate] ADD  DEFAULT (getdate()) FOR [UpdateTime]
GO
ALTER TABLE [dbo].[ExchangeRate] ADD  DEFAULT ('00000000-0000-0000-0000-000000000000') FOR [CreateUserId]
GO
ALTER TABLE [dbo].[FrontAuditConfig] ADD  DEFAULT (newid()) FOR [Id]
GO
ALTER TABLE [dbo].[FrontAuditConfig] ADD  DEFAULT (getdate()) FOR [UpdateTime]
GO
ALTER TABLE [dbo].[FrontAuditConfig] ADD  DEFAULT ((0)) FOR [IsShowParent]
GO
ALTER TABLE [dbo].[FrontAuditConfig] ADD  DEFAULT (getdate()) FOR [CreateTime]
GO
ALTER TABLE [dbo].[FrontAuditConfig] ADD  DEFAULT ('') FOR [Value]
GO
ALTER TABLE [dbo].[FrontAuditConfig] ADD  DEFAULT ('00000000-0000-0000-0000-000000000000') FOR [UpdateUserId]
GO
ALTER TABLE [dbo].[FrontAuditConfig] ADD  DEFAULT ((1)) FOR [IsEnable]
GO
ALTER TABLE [dbo].[FrontAuditConfig] ADD  DEFAULT ('00000000-0000-0000-0000-000000000000') FOR [CreateUserId]
GO
ALTER TABLE [dbo].[FrontAuditConfig] ADD  DEFAULT ('') FOR [ValueCN]
GO
ALTER TABLE [dbo].[FrontAuditConfig] ADD  DEFAULT ('') FOR [Code]
GO
ALTER TABLE [dbo].[FrontAuditConfig] ADD  DEFAULT ('') FOR [Description]
GO
ALTER TABLE [dbo].[FrontAuditConfig] ADD  DEFAULT ('') FOR [TableConfigJsonStr]
GO
ALTER TABLE [dbo].[FrontAuditConfig] ADD  DEFAULT ('') FOR [UrlConfigJsonStr]
GO
ALTER TABLE [dbo].[FrontAuditConfig] ADD  DEFAULT ((0)) FOR [IsConfig]
GO
ALTER TABLE [dbo].[Hospital] ADD  DEFAULT (newid()) FOR [Id]
GO
ALTER TABLE [dbo].[Hospital] ADD  DEFAULT (newid()) FOR [CreateUserId]
GO
ALTER TABLE [dbo].[Hospital] ADD  DEFAULT ('') FOR [City]
GO
ALTER TABLE [dbo].[Hospital] ADD  DEFAULT ('') FOR [CountryCN]
GO
ALTER TABLE [dbo].[Hospital] ADD  DEFAULT ('') FOR [CityCN]
GO
ALTER TABLE [dbo].[Hospital] ADD  DEFAULT (' ') FOR [HospitalName]
GO
ALTER TABLE [dbo].[Hospital] ADD  DEFAULT ('') FOR [Province]
GO
ALTER TABLE [dbo].[Hospital] ADD  DEFAULT (getdate()) FOR [UpdateTime]
GO
ALTER TABLE [dbo].[Hospital] ADD  DEFAULT ('') FOR [UniversityAffiliatedCN]
GO
ALTER TABLE [dbo].[Hospital] ADD  DEFAULT ('') FOR [Country]
GO
ALTER TABLE [dbo].[Hospital] ADD  DEFAULT ('') FOR [HospitalNameCN]
GO
ALTER TABLE [dbo].[Hospital] ADD  DEFAULT ('') FOR [ProvinceCN]
GO
ALTER TABLE [dbo].[Hospital] ADD  DEFAULT (newid()) FOR [UpdateUserId]
GO
ALTER TABLE [dbo].[Hospital] ADD  DEFAULT ('') FOR [UniversityAffiliated]
GO
ALTER TABLE [dbo].[Hospital] ADD  DEFAULT (getdate()) FOR [CreateTime]
GO
ALTER TABLE [dbo].[ImageShare] ADD  DEFAULT ('') FOR [PassWord]
GO
ALTER TABLE [dbo].[Menu] ADD  DEFAULT (newid()) FOR [Id]
GO
ALTER TABLE [dbo].[Menu] ADD  DEFAULT ('') FOR [Path]
GO
ALTER TABLE [dbo].[Menu] ADD  DEFAULT ((1)) FOR [IsEnable]
GO
ALTER TABLE [dbo].[Menu] ADD  DEFAULT ('') FOR [ApiPath]
GO
ALTER TABLE [dbo].[Menu] ADD  DEFAULT ('') FOR [Meta]
GO
ALTER TABLE [dbo].[Menu] ADD  DEFAULT ((1)) FOR [IsDisplay]
GO
ALTER TABLE [dbo].[Menu] ADD  DEFAULT ('') FOR [Redirect]
GO
ALTER TABLE [dbo].[Menu] ADD  DEFAULT ('') FOR [Note]
GO
ALTER TABLE [dbo].[Menu] ADD  DEFAULT ('') FOR [MenuIcon]
GO
ALTER TABLE [dbo].[Menu] ADD  DEFAULT (getdate()) FOR [UpdateTime]
GO
ALTER TABLE [dbo].[Menu] ADD  DEFAULT ('') FOR [Component]
GO
ALTER TABLE [dbo].[Menu] ADD  DEFAULT ((0)) FOR [IsInTabDisplay]
GO
ALTER TABLE [dbo].[Menu] ADD  DEFAULT ((0)) FOR [IsExternalLink]
GO
ALTER TABLE [dbo].[Menu] ADD  DEFAULT ('') FOR [MenuName]
GO
ALTER TABLE [dbo].[Menu] ADD  DEFAULT ('') FOR [PermissionStr]
GO
ALTER TABLE [dbo].[Menu] ADD  DEFAULT ((0)) FOR [IsCache]
GO
ALTER TABLE [dbo].[Menu] ADD  DEFAULT (getdate()) FOR [CreateTime]
GO
ALTER TABLE [dbo].[Menu] ADD  DEFAULT ((0)) FOR [ShowOrder]
GO
ALTER TABLE [dbo].[Menu] ADD  DEFAULT ('') FOR [LanguageMark]
GO
ALTER TABLE [dbo].[NoneDicomStudy] ADD  DEFAULT ('') FOR [StudyCode]
GO
ALTER TABLE [dbo].[NoneDicomStudy] ADD  DEFAULT ('') FOR [VideoName]
GO
ALTER TABLE [dbo].[NoneDicomStudy] ADD  DEFAULT ('') FOR [VideoUrl]
GO
ALTER TABLE [dbo].[NoneDicomStudy] ADD  DEFAULT ('') FOR [VideoObjectName]
GO
ALTER TABLE [dbo].[NoneDicomStudy] ADD  DEFAULT ((0)) FOR [FileCount]
GO
ALTER TABLE [dbo].[OrganInfo] ADD  DEFAULT ('') FOR [PartEN]
GO
ALTER TABLE [dbo].[OrganInfo] ADD  DEFAULT ('') FOR [TULOCEN]
GO
ALTER TABLE [dbo].[OrganInfo] ADD  DEFAULT ('') FOR [TULATEN]
GO
ALTER TABLE [dbo].[OrganInfo] ADD  DEFAULT ((0)) FOR [IsLymphNodes]
GO
ALTER TABLE [dbo].[OrganInfo] ADD  DEFAULT (newid()) FOR [SystemCriterionId]
GO
ALTER TABLE [dbo].[OrganInfo] ADD  DEFAULT ((0)) FOR [IsCanEditPosition]
GO
ALTER TABLE [dbo].[OrganInfo] ADD  DEFAULT ('') FOR [Classification]
GO
ALTER TABLE [dbo].[OrganInfo] ADD  DEFAULT ('') FOR [ClassificationEN]
GO
ALTER TABLE [dbo].[OrganInfo] ADD  DEFAULT ((0)) FOR [ShowOrder]
GO
ALTER TABLE [dbo].[OrganTrialInfo] ADD  DEFAULT ((1)) FOR [IsEnable]
GO
ALTER TABLE [dbo].[Payment] ADD  DEFAULT ('00000000-0000-0000-0000-000000000000') FOR [CreateUserId]
GO
ALTER TABLE [dbo].[Payment] ADD  DEFAULT ((0)) FOR [PaymentCNY]
GO
ALTER TABLE [dbo].[Payment] ADD  DEFAULT ((0)) FOR [ActuallyPaidCNY]
GO
ALTER TABLE [dbo].[Payment] ADD  DEFAULT ((0)) FOR [AdjustmentCNY]
GO
ALTER TABLE [dbo].[Payment] ADD  DEFAULT ((0)) FOR [TaxCNY]
GO
ALTER TABLE [dbo].[Payment] ADD  DEFAULT ('') FOR [CalculateUser]
GO
ALTER TABLE [dbo].[Payment] ADD  DEFAULT ((0)) FOR [AdjustmentUSD]
GO
ALTER TABLE [dbo].[Payment] ADD  DEFAULT (getdate()) FOR [UpdateTime]
GO
ALTER TABLE [dbo].[Payment] ADD  DEFAULT ((0)) FOR [IsLock]
GO
ALTER TABLE [dbo].[Payment] ADD  DEFAULT ((0)) FOR [ExchangeRate]
GO
ALTER TABLE [dbo].[Payment] ADD  DEFAULT (N'‘’') FOR [Note]
GO
ALTER TABLE [dbo].[Payment] ADD  DEFAULT ('') FOR [YearMonth]
GO
ALTER TABLE [dbo].[Payment] ADD  DEFAULT ((0)) FOR [BankTransferCNY]
GO
ALTER TABLE [dbo].[Payment] ADD  DEFAULT ('00000000-0000-0000-0000-000000000000') FOR [UpdateUserId]
GO
ALTER TABLE [dbo].[Payment] ADD  DEFAULT (getdate()) FOR [YearMonthDate]
GO
ALTER TABLE [dbo].[Payment] ADD  DEFAULT (getdate()) FOR [CreateTime]
GO
ALTER TABLE [dbo].[PaymentAdjustment] ADD  DEFAULT (newid()) FOR [Id]
GO
ALTER TABLE [dbo].[PaymentAdjustment] ADD  DEFAULT ('') FOR [YearMonth]
GO
ALTER TABLE [dbo].[PaymentAdjustment] ADD  DEFAULT (newid()) FOR [CreateUserId]
GO
ALTER TABLE [dbo].[PaymentAdjustment] ADD  DEFAULT (newid()) FOR [ReviewerId]
GO
ALTER TABLE [dbo].[PaymentAdjustment] ADD  DEFAULT (getdate()) FOR [UpdateTime]
GO
ALTER TABLE [dbo].[PaymentAdjustment] ADD  DEFAULT ((0)) FOR [IsLock]
GO
ALTER TABLE [dbo].[PaymentAdjustment] ADD  DEFAULT ((0)) FOR [ExchangeRate]
GO
ALTER TABLE [dbo].[PaymentAdjustment] ADD  DEFAULT (getdate()) FOR [CreateTime]
GO
ALTER TABLE [dbo].[PaymentAdjustment] ADD  DEFAULT (newid()) FOR [TrialId]
GO
ALTER TABLE [dbo].[PaymentAdjustment] ADD  DEFAULT (newid()) FOR [UpdateUserId]
GO
ALTER TABLE [dbo].[PaymentAdjustment] ADD  DEFAULT ('') FOR [Note]
GO
ALTER TABLE [dbo].[PaymentDetail] ADD  DEFAULT (newid()) FOR [Id]
GO
ALTER TABLE [dbo].[PaymentDetail] ADD  DEFAULT ((0)) FOR [ExchangeRate]
GO
ALTER TABLE [dbo].[PaymentDetail] ADD  DEFAULT (getdate()) FOR [UpdateTime]
GO
ALTER TABLE [dbo].[PaymentDetail] ADD  DEFAULT ((0)) FOR [PaymentCNY]
GO
ALTER TABLE [dbo].[PaymentDetail] ADD  DEFAULT ('00000000-0000-0000-0000-000000000000') FOR [CreateUserId]
GO
ALTER TABLE [dbo].[PaymentDetail] ADD  DEFAULT ((0)) FOR [PaymentUSD]
GO
ALTER TABLE [dbo].[PaymentDetail] ADD  DEFAULT (getdate()) FOR [CreateTime]
GO
ALTER TABLE [dbo].[PaymentDetail] ADD  DEFAULT ('') FOR [YearMonth]
GO
ALTER TABLE [dbo].[PaymentDetail] ADD  DEFAULT ('00000000-0000-0000-0000-000000000000') FOR [UpdateUserId]
GO
ALTER TABLE [dbo].[Postgraduate] ADD  DEFAULT (newid()) FOR [Id]
GO
ALTER TABLE [dbo].[Postgraduate] ADD  DEFAULT ('') FOR [CountryCN]
GO
ALTER TABLE [dbo].[Postgraduate] ADD  DEFAULT ('') FOR [MajorCN]
GO
ALTER TABLE [dbo].[Postgraduate] ADD  DEFAULT ('') FOR [City]
GO
ALTER TABLE [dbo].[Postgraduate] ADD  DEFAULT ('') FOR [Training]
GO
ALTER TABLE [dbo].[Postgraduate] ADD  DEFAULT ('') FOR [School]
GO
ALTER TABLE [dbo].[Postgraduate] ADD  DEFAULT ('') FOR [SchoolCN]
GO
ALTER TABLE [dbo].[Postgraduate] ADD  DEFAULT ('00000000-0000-0000-0000-000000000000') FOR [CreateUserId]
GO
ALTER TABLE [dbo].[Postgraduate] ADD  DEFAULT ('') FOR [TrainingCN]
GO
ALTER TABLE [dbo].[Postgraduate] ADD  DEFAULT ('') FOR [Hospital]
GO
ALTER TABLE [dbo].[Postgraduate] ADD  DEFAULT ('') FOR [CityCN]
GO
ALTER TABLE [dbo].[Postgraduate] ADD  DEFAULT ('') FOR [Province]
GO
ALTER TABLE [dbo].[Postgraduate] ADD  DEFAULT (getdate()) FOR [UpdateTime]
GO
ALTER TABLE [dbo].[Postgraduate] ADD  DEFAULT ('') FOR [ProvinceCN]
GO
ALTER TABLE [dbo].[Postgraduate] ADD  DEFAULT ('00000000-0000-0000-0000-000000000000') FOR [UpdateUserId]
GO
ALTER TABLE [dbo].[Postgraduate] ADD  DEFAULT ('') FOR [HospitalCN]
GO
ALTER TABLE [dbo].[Postgraduate] ADD  DEFAULT (getdate()) FOR [CreateTime]
GO
ALTER TABLE [dbo].[Postgraduate] ADD  DEFAULT ('') FOR [Country]
GO
ALTER TABLE [dbo].[Postgraduate] ADD  DEFAULT ('') FOR [Major]
GO
ALTER TABLE [dbo].[PreviousHistory] ADD  DEFAULT ('') FOR [Path]
GO
ALTER TABLE [dbo].[PreviousHistory] ADD  DEFAULT ((0)) FOR [IsPD]
GO
ALTER TABLE [dbo].[PreviousHistory] ADD  DEFAULT ('') FOR [FileName]
GO
ALTER TABLE [dbo].[PreviousHistory] ADD  DEFAULT ('') FOR [Position]
GO
ALTER TABLE [dbo].[PreviousHistory] ADD  DEFAULT ((0)) FOR [IsSubjectLevel]
GO
ALTER TABLE [dbo].[PreviousOther] ADD  DEFAULT ('') FOR [FileName]
GO
ALTER TABLE [dbo].[PreviousOther] ADD  DEFAULT ('') FOR [TreatmentType]
GO
ALTER TABLE [dbo].[PreviousOther] ADD  DEFAULT ((0)) FOR [IsSubjectLevel]
GO
ALTER TABLE [dbo].[PreviousOther] ADD  DEFAULT ((0)) FOR [IsPD]
GO
ALTER TABLE [dbo].[PreviousOther] ADD  DEFAULT ('') FOR [Path]
GO
ALTER TABLE [dbo].[PreviousPDF] ADD  DEFAULT ('') FOR [Path]
GO
ALTER TABLE [dbo].[PreviousPDF] ADD  DEFAULT ('') FOR [FileName]
GO
ALTER TABLE [dbo].[PreviousSurgery] ADD  DEFAULT ('') FOR [OperationName]
GO
ALTER TABLE [dbo].[PreviousSurgery] ADD  DEFAULT ((0)) FOR [IsSubjectLevel]
GO
ALTER TABLE [dbo].[PreviousSurgery] ADD  DEFAULT ('') FOR [FileName]
GO
ALTER TABLE [dbo].[PreviousSurgery] ADD  DEFAULT ('') FOR [Path]
GO
ALTER TABLE [dbo].[QCChallenge] ADD  DEFAULT (newid()) FOR [Id]
GO
ALTER TABLE [dbo].[QCChallenge] ADD  DEFAULT ('') FOR [ReUploader]
GO
ALTER TABLE [dbo].[QCChallenge] ADD  DEFAULT ('') FOR [ActionContent]
GO
ALTER TABLE [dbo].[QCChallenge] ADD  DEFAULT ('') FOR [Content]
GO
ALTER TABLE [dbo].[QCChallenge] ADD  DEFAULT ((0)) FOR [CloseResonEnum]
GO
ALTER TABLE [dbo].[QCChallenge] ADD  DEFAULT ((0)) FOR [UserTypeEnum]
GO
ALTER TABLE [dbo].[QCChallengeDialog] ADD  DEFAULT (newid()) FOR [Id]
GO
ALTER TABLE [dbo].[QCChallengeDialog] ADD  DEFAULT ('') FOR [CreateUser]
GO
ALTER TABLE [dbo].[QCChallengeDialog] ADD  DEFAULT ((0)) FOR [UserTypeEnum]
GO
ALTER TABLE [dbo].[RankPrice] ADD  DEFAULT (newid()) FOR [Id]
GO
ALTER TABLE [dbo].[RankPrice] ADD  DEFAULT ('') FOR [RankName]
GO
ALTER TABLE [dbo].[RankPrice] ADD  DEFAULT (getdate()) FOR [UpdateTime]
GO
ALTER TABLE [dbo].[RankPrice] ADD  DEFAULT ((0)) FOR [RefresherTraining]
GO
ALTER TABLE [dbo].[RankPrice] ADD  DEFAULT (getdate()) FOR [CreateTime]
GO
ALTER TABLE [dbo].[ReadingClinicalData] ADD  DEFAULT ((0)) FOR [IsSign]
GO
ALTER TABLE [dbo].[ReadingClinicalData] ADD  DEFAULT ((0)) FOR [ReadingClinicalDataState]
GO
ALTER TABLE [dbo].[ReadingClinicalData] ADD  DEFAULT ((0)) FOR [FileCount]
GO
ALTER TABLE [dbo].[ReadingCriterionDictionary] ADD  DEFAULT ((1)) FOR [IsSystemCriterion]
GO
ALTER TABLE [dbo].[ReadingCriterionDictionary] ADD  DEFAULT ('') FOR [ParentCode]
GO
ALTER TABLE [dbo].[ReadingCriterionDictionary] ADD  DEFAULT ((0)) FOR [IsBaseLineUse]
GO
ALTER TABLE [dbo].[ReadingCriterionDictionary] ADD  DEFAULT ((0)) FOR [IsFollowVisitUse]
GO
ALTER TABLE [dbo].[ReadingCriterionPage] ADD  DEFAULT ('') FOR [PageName]
GO
ALTER TABLE [dbo].[ReadingCriterionPage] ADD  DEFAULT ((0)) FOR [IsEnable]
GO
ALTER TABLE [dbo].[ReadingCriterionPage] ADD  DEFAULT ((0)) FOR [IsPublicPage]
GO
ALTER TABLE [dbo].[ReadingCriterionPage] ADD  DEFAULT ((0)) FOR [ShowOrder]
GO
ALTER TABLE [dbo].[ReadingGlobalTaskInfo] ADD  DEFAULT ('') FOR [Answer]
GO
ALTER TABLE [dbo].[ReadingGlobalTaskInfo] ADD  DEFAULT ((0)) FOR [GlobalAnswerType]
GO
ALTER TABLE [dbo].[ReadingMedicalReviewDialog] ADD  DEFAULT ('') FOR [Content]
GO
ALTER TABLE [dbo].[ReadingMedicalReviewDialog] ADD  DEFAULT ((0)) FOR [IsHaveQuestion]
GO
ALTER TABLE [dbo].[ReadingMedicalReviewDialog] ADD  DEFAULT ('') FOR [Questioning]
GO
ALTER TABLE [dbo].[ReadingMedicalReviewDialog] ADD  DEFAULT ((0)) FOR [AuditAdviceEnum]
GO
ALTER TABLE [dbo].[ReadingMedicalReviewDialog] ADD  DEFAULT ('') FOR [DisagreeReason]
GO
ALTER TABLE [dbo].[ReadingMedicalReviewDialog] ADD  DEFAULT ((0)) FOR [IsApplyHeavyReading]
GO
ALTER TABLE [dbo].[ReadingMedicalReviewDialog] ADD  DEFAULT ((0)) FOR [DoctorUserIdeaEnum]
GO
ALTER TABLE [dbo].[ReadingMedicineQuestionAnswer] ADD  DEFAULT ('') FOR [Answer]
GO
ALTER TABLE [dbo].[ReadingMedicineSystemQuestion] ADD  DEFAULT ((1)) FOR [ReadingCategory]
GO
ALTER TABLE [dbo].[ReadingMedicineSystemQuestion] ADD  DEFAULT ((1)) FOR [IsGeneral]
GO
ALTER TABLE [dbo].[ReadingMedicineTrialQuestion] ADD  DEFAULT ((0)) FOR [IsConfirm]
GO
ALTER TABLE [dbo].[ReadingMedicineTrialQuestion] ADD  DEFAULT ((1)) FOR [ReadingCategory]
GO
ALTER TABLE [dbo].[ReadingMedicineTrialQuestion] ADD  DEFAULT (newid()) FOR [TrialReadingCriterionId]
GO
ALTER TABLE [dbo].[ReadingOncologyTaskInfo] ADD  DEFAULT ('') FOR [EvaluationResult]
GO
ALTER TABLE [dbo].[ReadingOncologyTaskInfo] ADD  DEFAULT ('') FOR [EvaluationReason]
GO
ALTER TABLE [dbo].[ReadingPeriodPlan] ADD  DEFAULT ('00000000-0000-0000-0000-000000000000') FOR [UpdateUserId]
GO
ALTER TABLE [dbo].[ReadingPeriodPlan] ADD  DEFAULT (getdate()) FOR [UpdateTime]
GO
ALTER TABLE [dbo].[ReadingPeriodPlan] ADD  DEFAULT ((0)) FOR [IsDeleted]
GO
ALTER TABLE [dbo].[ReadingPeriodSet] ADD  DEFAULT ((0)) FOR [ReadingSetType]
GO
ALTER TABLE [dbo].[ReadingPeriodSet] ADD  DEFAULT ((0)) FOR [IsGlobal]
GO
ALTER TABLE [dbo].[ReadingPeriodSet] ADD  DEFAULT ('00000000-0000-0000-0000-000000000000') FOR [UpdateUserId]
GO
ALTER TABLE [dbo].[ReadingPeriodSet] ADD  DEFAULT (getdate()) FOR [UpdateTime]
GO
ALTER TABLE [dbo].[ReadingPeriodSet] ADD  DEFAULT ((0)) FOR [IsDeleted]
GO
ALTER TABLE [dbo].[ReadingQuestionCriterionSystem] ADD  DEFAULT ((0)) FOR [IsEnable]
GO
ALTER TABLE [dbo].[ReadingQuestionCriterionSystem] ADD  DEFAULT ((0)) FOR [IsCompleteConfig]
GO
ALTER TABLE [dbo].[ReadingQuestionCriterionSystem] ADD  DEFAULT ((0)) FOR [ShowOrder]
GO
ALTER TABLE [dbo].[ReadingQuestionCriterionSystem] ADD  DEFAULT (getdate()) FOR [ConfirmTime]
GO
ALTER TABLE [dbo].[ReadingQuestionCriterionSystem] ADD  DEFAULT ((0)) FOR [CriterionType]
GO
ALTER TABLE [dbo].[ReadingQuestionCriterionSystem] ADD  DEFAULT ((0)) FOR [IsOncologyReading]
GO
ALTER TABLE [dbo].[ReadingQuestionCriterionSystem] ADD  DEFAULT ((0)) FOR [IsMustGlobalReading]
GO
ALTER TABLE [dbo].[ReadingQuestionCriterionSystem] ADD  DEFAULT ((0)) FOR [IseCRFShowInDicomReading]
GO
ALTER TABLE [dbo].[ReadingQuestionCriterionTrial] ADD  DEFAULT ((0)) FOR [IsConfirm]
GO
ALTER TABLE [dbo].[ReadingQuestionCriterionTrial] ADD  DEFAULT ((0)) FOR [IsCompleteConfig]
GO
ALTER TABLE [dbo].[ReadingQuestionCriterionTrial] ADD  DEFAULT ((0)) FOR [ShowOrder]
GO
ALTER TABLE [dbo].[ReadingQuestionCriterionTrial] ADD  DEFAULT ((1)) FOR [FormType]
GO
ALTER TABLE [dbo].[ReadingQuestionCriterionTrial] ADD  DEFAULT ((1)) FOR [DigitPlaces]
GO
ALTER TABLE [dbo].[ReadingQuestionCriterionTrial] ADD  DEFAULT ('') FOR [EvaluationResult]
GO
ALTER TABLE [dbo].[ReadingQuestionCriterionTrial] ADD  DEFAULT ('') FOR [EvaluationReason]
GO
ALTER TABLE [dbo].[ReadingQuestionCriterionTrial] ADD  DEFAULT ((0)) FOR [IsShowDetail]
GO
ALTER TABLE [dbo].[ReadingQuestionCriterionTrial] ADD  DEFAULT (getdate()) FOR [SynchronizeTime]
GO
ALTER TABLE [dbo].[ReadingQuestionCriterionTrial] ADD  DEFAULT ((0)) FOR [CriterionType]
GO
ALTER TABLE [dbo].[ReadingQuestionCriterionTrial] ADD  DEFAULT ((1)) FOR [ImagePlatform]
GO
ALTER TABLE [dbo].[ReadingQuestionCriterionTrial] ADD  DEFAULT ((0)) FOR [ReadingTaskViewEnum]
GO
ALTER TABLE [dbo].[ReadingQuestionCriterionTrial] ADD  DEFAULT ((1)) FOR [IsReadingShowSubjectInfo]
GO
ALTER TABLE [dbo].[ReadingQuestionCriterionTrial] ADD  DEFAULT ((1)) FOR [IsReadingShowPreviousResults]
GO
ALTER TABLE [dbo].[ReadingQuestionCriterionTrial] ADD  DEFAULT ((0)) FOR [ArbitrationRule]
GO
ALTER TABLE [dbo].[ReadingQuestionCriterionTrial] ADD  DEFAULT ((2)) FOR [ReadingType]
GO
ALTER TABLE [dbo].[ReadingQuestionCriterionTrial] ADD  DEFAULT ((1)) FOR [IsGlobalReading]
GO
ALTER TABLE [dbo].[ReadingQuestionCriterionTrial] ADD  DEFAULT ((1)) FOR [IsArbitrationReading]
GO
ALTER TABLE [dbo].[ReadingQuestionCriterionTrial] ADD  DEFAULT ((1)) FOR [IsOncologyReading]
GO
ALTER TABLE [dbo].[ReadingQuestionCriterionTrial] ADD  DEFAULT ((1)) FOR [IsReadingTaskViewInOrder]
GO
ALTER TABLE [dbo].[ReadingQuestionCriterionTrial] ADD  DEFAULT ((0)) FOR [TaskAllocateObjEnum]
GO
ALTER TABLE [dbo].[ReadingQuestionCriterionTrial] ADD  DEFAULT ((1)) FOR [IsFollowGlobalVisitAutoAssign]
GO
ALTER TABLE [dbo].[ReadingQuestionCriterionTrial] ADD  DEFAULT ((1)) FOR [IsFollowVisitAutoAssign]
GO
ALTER TABLE [dbo].[ReadingQuestionCriterionTrial] ADD  DEFAULT ((1)) FOR [IsFollowJudgeTaskAutoAssign]
GO
ALTER TABLE [dbo].[ReadingQuestionCriterionTrial] ADD  DEFAULT ((2)) FOR [FollowJudgeTaskAutoAssignDefaultState]
GO
ALTER TABLE [dbo].[ReadingQuestionCriterionTrial] ADD  DEFAULT ((2)) FOR [FollowVisitAutoAssignDefaultState]
GO
ALTER TABLE [dbo].[ReadingQuestionCriterionTrial] ADD  DEFAULT ((2)) FOR [FollowGlobalVisitAutoAssignDefaultState]
GO
ALTER TABLE [dbo].[ReadingQuestionCriterionTrial] ADD  DEFAULT ((0)) FOR [IsConfirmMedicineQuestion]
GO
ALTER TABLE [dbo].[ReadingQuestionCriterionTrial] ADD  DEFAULT ((0)) FOR [IsMustGlobalReading]
GO
ALTER TABLE [dbo].[ReadingQuestionCriterionTrial] ADD  DEFAULT ((0)) FOR [IseCRFShowInDicomReading]
GO
ALTER TABLE [dbo].[ReadingQuestionCriterionTrial] ADD  DEFAULT ((1)) FOR [IsReadingPeriod]
GO
ALTER TABLE [dbo].[ReadingQuestionCriterionTrial] ADD  DEFAULT ((0)) FOR [IsSigned]
GO
ALTER TABLE [dbo].[ReadingQuestionSystem] ADD  DEFAULT ((0)) FOR [IsJudgeQuestion]
GO
ALTER TABLE [dbo].[ReadingQuestionSystem] ADD  DEFAULT ('') FOR [Remark]
GO
ALTER TABLE [dbo].[ReadingQuestionSystem] ADD  DEFAULT (N'') FOR [GroupName]
GO
ALTER TABLE [dbo].[ReadingQuestionSystem] ADD  DEFAULT ((1)) FOR [ImageCount]
GO
ALTER TABLE [dbo].[ReadingQuestionSystem] ADD  DEFAULT ((0)) FOR [ShowQuestion]
GO
ALTER TABLE [dbo].[ReadingQuestionSystem] ADD  DEFAULT ((0)) FOR [MaxQuestionCount]
GO
ALTER TABLE [dbo].[ReadingQuestionSystem] ADD  DEFAULT ((0)) FOR [IsShowInDicom]
GO
ALTER TABLE [dbo].[ReadingQuestionSystem] ADD  DEFAULT ((0)) FOR [GlobalReadingShowType]
GO
ALTER TABLE [dbo].[ReadingQuestionSystem] ADD  DEFAULT ('') FOR [DefaultValue]
GO
ALTER TABLE [dbo].[ReadingQuestionSystem] ADD  DEFAULT ((0)) FOR [DataSource]
GO
ALTER TABLE [dbo].[ReadingQuestionSystem] ADD  DEFAULT ('') FOR [QuestionEnName]
GO
ALTER TABLE [dbo].[ReadingQuestionSystem] ADD  DEFAULT ('') FOR [GroupEnName]
GO
ALTER TABLE [dbo].[ReadingQuestionSystem] ADD  DEFAULT ((0)) FOR [LimitEdit]
GO
ALTER TABLE [dbo].[ReadingQuestionTrial] ADD  DEFAULT ((0)) FOR [IsJudgeQuestion]
GO
ALTER TABLE [dbo].[ReadingQuestionTrial] ADD  DEFAULT (N'‘’') FOR [Remark]
GO
ALTER TABLE [dbo].[ReadingQuestionTrial] ADD  DEFAULT (N'‘’') FOR [GroupName]
GO
ALTER TABLE [dbo].[ReadingQuestionTrial] ADD  DEFAULT ('') FOR [AnswerGroup]
GO
ALTER TABLE [dbo].[ReadingQuestionTrial] ADD  DEFAULT ('') FOR [AnswerCombination]
GO
ALTER TABLE [dbo].[ReadingQuestionTrial] ADD  DEFAULT ((0)) FOR [JudgeType]
GO
ALTER TABLE [dbo].[ReadingQuestionTrial] ADD  DEFAULT ((0)) FOR [ImageCount]
GO
ALTER TABLE [dbo].[ReadingQuestionTrial] ADD  DEFAULT ((0)) FOR [ShowQuestion]
GO
ALTER TABLE [dbo].[ReadingQuestionTrial] ADD  DEFAULT ((0)) FOR [MaxQuestionCount]
GO
ALTER TABLE [dbo].[ReadingQuestionTrial] ADD  DEFAULT ((0)) FOR [IsShowInDicom]
GO
ALTER TABLE [dbo].[ReadingQuestionTrial] ADD  DEFAULT ((0)) FOR [GlobalReadingShowType]
GO
ALTER TABLE [dbo].[ReadingQuestionTrial] ADD  DEFAULT ('') FOR [DefaultValue]
GO
ALTER TABLE [dbo].[ReadingQuestionTrial] ADD  DEFAULT ('') FOR [CalculateQuestions]
GO
ALTER TABLE [dbo].[ReadingQuestionTrial] ADD  DEFAULT ((0)) FOR [DataSource]
GO
ALTER TABLE [dbo].[ReadingQuestionTrial] ADD  DEFAULT ('') FOR [CustomUnit]
GO
ALTER TABLE [dbo].[ReadingQuestionTrial] ADD  DEFAULT ((0)) FOR [LimitEdit]
GO
ALTER TABLE [dbo].[ReadingQuestionTrial] ADD  DEFAULT ('') FOR [QuestionEnName]
GO
ALTER TABLE [dbo].[ReadingQuestionTrial] ADD  DEFAULT ('') FOR [GroupEnName]
GO
ALTER TABLE [dbo].[ReadingQuestionTrial] ADD  DEFAULT ((0)) FOR [IsCopyLesions]
GO
ALTER TABLE [dbo].[ReadingTableAnswerRowInfo] ADD  DEFAULT ((0)) FOR [IsCurrentTaskAdd]
GO
ALTER TABLE [dbo].[ReadingTableAnswerRowInfo] ADD  DEFAULT ((0)) FOR [IsCanEditPosition]
GO
ALTER TABLE [dbo].[ReadingTableAnswerRowInfo] ADD  DEFAULT ((0)) FOR [FristAddTaskNum]
GO
ALTER TABLE [dbo].[ReadingTableAnswerRowInfo] ADD  DEFAULT ((1)) FOR [IsDicomReading]
GO
ALTER TABLE [dbo].[ReadingTableAnswerRowInfo] ADD  DEFAULT ('') FOR [BlindName]
GO
ALTER TABLE [dbo].[ReadingTableAnswerRowInfo] ADD  DEFAULT ('00000000-0000-0000-0000-000000000000') FOR [UpdateUserId]
GO
ALTER TABLE [dbo].[ReadingTableAnswerRowInfo] ADD  DEFAULT (getdate()) FOR [UpdateTime]
GO
ALTER TABLE [dbo].[ReadingTableAnswerRowInfo] ADD  DEFAULT ((0)) FOR [IsDeleted]
GO
ALTER TABLE [dbo].[ReadingTableAnswerRowInfo] ADD  DEFAULT ('') FOR [OrderMark]
GO
ALTER TABLE [dbo].[ReadingTableAnswerRowInfo] ADD  DEFAULT ('') FOR [PicturePath]
GO
ALTER TABLE [dbo].[ReadingTableAnswerRowInfo] ADD  DEFAULT ('00000000-0000-0000-0000-000000000000') FOR [FristAddTaskId]
GO
ALTER TABLE [dbo].[ReadingTableQuestionAnswer] ADD  DEFAULT (newid()) FOR [RowId]
GO
ALTER TABLE [dbo].[ReadingTableQuestionAnswer] ADD  DEFAULT ('00000000-0000-0000-0000-000000000000') FOR [UpdateUserId]
GO
ALTER TABLE [dbo].[ReadingTableQuestionAnswer] ADD  DEFAULT (getdate()) FOR [UpdateTime]
GO
ALTER TABLE [dbo].[ReadingTableQuestionAnswer] ADD  DEFAULT ((0)) FOR [IsDeleted]
GO
ALTER TABLE [dbo].[ReadingTableQuestionSystem] ADD  DEFAULT ((0)) FOR [IsDepend]
GO
ALTER TABLE [dbo].[ReadingTableQuestionSystem] ADD  DEFAULT ((0)) FOR [DataSource]
GO
ALTER TABLE [dbo].[ReadingTableQuestionSystem] ADD  DEFAULT ('') FOR [QuestionEnName]
GO
ALTER TABLE [dbo].[ReadingTableQuestionSystem] ADD  DEFAULT ((0)) FOR [LimitEdit]
GO
ALTER TABLE [dbo].[ReadingTableQuestionTrial] ADD  DEFAULT ((0)) FOR [IsDepend]
GO
ALTER TABLE [dbo].[ReadingTableQuestionTrial] ADD  DEFAULT ('') FOR [CalculateQuestions]
GO
ALTER TABLE [dbo].[ReadingTableQuestionTrial] ADD  DEFAULT ((0)) FOR [DataSource]
GO
ALTER TABLE [dbo].[ReadingTableQuestionTrial] ADD  DEFAULT ('') FOR [CustomUnit]
GO
ALTER TABLE [dbo].[ReadingTableQuestionTrial] ADD  DEFAULT ((0)) FOR [LimitEdit]
GO
ALTER TABLE [dbo].[ReadingTableQuestionTrial] ADD  DEFAULT ('') FOR [QuestionEnName]
GO
ALTER TABLE [dbo].[ReadingTableQuestionTrial] ADD  DEFAULT ((0)) FOR [IsCopy]
GO
ALTER TABLE [dbo].[ReadingTaskQuestionAnswer] ADD  DEFAULT ((0)) FOR [IsGlobalChange]
GO
ALTER TABLE [dbo].[ReadModule] ADD  DEFAULT ((0)) FOR [ModuleType]
GO
ALTER TABLE [dbo].[ReadModule] ADD  DEFAULT ((0)) FOR [Status]
GO
ALTER TABLE [dbo].[ReadModule] ADD  DEFAULT ((0)) FOR [ReadingSetType]
GO
ALTER TABLE [dbo].[ReadModule] ADD  DEFAULT ((3)) FOR [ReadingStatus]
GO
ALTER TABLE [dbo].[ReadModule] ADD  DEFAULT ('00000000-0000-0000-0000-000000000000') FOR [UpdateUserId]
GO
ALTER TABLE [dbo].[ReadModule] ADD  DEFAULT (getdate()) FOR [UpdateTime]
GO
ALTER TABLE [dbo].[ReadModule] ADD  DEFAULT ((0)) FOR [IsDeleted]
GO
ALTER TABLE [dbo].[ResearchPublication] ADD  DEFAULT (newid()) FOR [Id]
GO
ALTER TABLE [dbo].[ResearchPublication] ADD  DEFAULT ('') FOR [PublicationsCN]
GO
ALTER TABLE [dbo].[ResearchPublication] ADD  DEFAULT ('00000000-0000-0000-0000-000000000000') FOR [UpdateUserId]
GO
ALTER TABLE [dbo].[ResearchPublication] ADD  DEFAULT (getdate()) FOR [CreateTime]
GO
ALTER TABLE [dbo].[ResearchPublication] ADD  DEFAULT ('') FOR [Grants]
GO
ALTER TABLE [dbo].[ResearchPublication] ADD  DEFAULT ('') FOR [AwardsHonorsCN]
GO
ALTER TABLE [dbo].[ResearchPublication] ADD  DEFAULT ('') FOR [Publications]
GO
ALTER TABLE [dbo].[ResearchPublication] ADD  DEFAULT (getdate()) FOR [UpdateTime]
GO
ALTER TABLE [dbo].[ResearchPublication] ADD  DEFAULT ('00000000-0000-0000-0000-000000000000') FOR [CreateUserId]
GO
ALTER TABLE [dbo].[ResearchPublication] ADD  DEFAULT ('') FOR [ResearchCN]
GO
ALTER TABLE [dbo].[ResearchPublication] ADD  DEFAULT ('') FOR [GrantsCN]
GO
ALTER TABLE [dbo].[ResearchPublication] ADD  DEFAULT ('') FOR [AwardsHonors]
GO
ALTER TABLE [dbo].[ResearchPublication] ADD  DEFAULT ('') FOR [Research]
GO
ALTER TABLE [dbo].[SaveChangesAudits] ADD  DEFAULT ('') FOR [ErrorMessage]
GO
ALTER TABLE [dbo].[ShortcutKey] ADD  DEFAULT ('') FOR [Code]
GO
ALTER TABLE [dbo].[Site] ADD  DEFAULT (newid()) FOR [Id]
GO
ALTER TABLE [dbo].[Site] ADD  DEFAULT ('') FOR [ContactName]
GO
ALTER TABLE [dbo].[Site] ADD  DEFAULT (getdate()) FOR [CreateTime]
GO
ALTER TABLE [dbo].[Site] ADD  DEFAULT (newid()) FOR [HospitalId]
GO
ALTER TABLE [dbo].[Site] ADD  DEFAULT ('') FOR [Country]
GO
ALTER TABLE [dbo].[Site] ADD  DEFAULT ('') FOR [City]
GO
ALTER TABLE [dbo].[Site] ADD  DEFAULT (newid()) FOR [CreateUserId]
GO
ALTER TABLE [dbo].[Site] ADD  DEFAULT ('') FOR [DirectorPhone]
GO
ALTER TABLE [dbo].[Site] ADD  DEFAULT (getdate()) FOR [UpdateTime]
GO
ALTER TABLE [dbo].[Site] ADD  DEFAULT ((1)) FOR [State]
GO
ALTER TABLE [dbo].[Site] ADD  DEFAULT ('') FOR [SiteCode]
GO
ALTER TABLE [dbo].[Site] ADD  DEFAULT (newid()) FOR [UpdateUserId]
GO
ALTER TABLE [dbo].[Site] ADD  DEFAULT ('') FOR [Address]
GO
ALTER TABLE [dbo].[Site] ADD  DEFAULT ('') FOR [DirectorName]
GO
ALTER TABLE [dbo].[Site] ADD  DEFAULT ('') FOR [UniqueCode]
GO
ALTER TABLE [dbo].[Site] ADD  DEFAULT ('') FOR [ContactPhone]
GO
ALTER TABLE [dbo].[Site] ADD  DEFAULT ('') FOR [SiteName]
GO
ALTER TABLE [dbo].[Site] ADD  DEFAULT ('') FOR [AliasName]
GO
ALTER TABLE [dbo].[Site] ADD  DEFAULT ((0)) FOR [Code]
GO
ALTER TABLE [dbo].[Site] ADD  DEFAULT ('') FOR [TestName]
GO
ALTER TABLE [dbo].[Site] ADD  DEFAULT ('') FOR [Province]
GO
ALTER TABLE [dbo].[Sponsor] ADD  DEFAULT (newid()) FOR [Id]
GO
ALTER TABLE [dbo].[Sponsor] ADD  DEFAULT (newid()) FOR [CreateUserId]
GO
ALTER TABLE [dbo].[Sponsor] ADD  DEFAULT (getdate()) FOR [CreateTime]
GO
ALTER TABLE [dbo].[Sponsor] ADD  DEFAULT (newid()) FOR [UpdateUserId]
GO
ALTER TABLE [dbo].[Sponsor] ADD  DEFAULT (getdate()) FOR [UpdateTime]
GO
ALTER TABLE [dbo].[Sponsor] ADD  DEFAULT ('') FOR [SponsorName]
GO
ALTER TABLE [dbo].[Sponsor] ADD  DEFAULT ('') FOR [SponsorNameCN]
GO
ALTER TABLE [dbo].[Sponsor] ADD  DEFAULT ('') FOR [SponsorCode]
GO
ALTER TABLE [dbo].[StudyMonitor] ADD  DEFAULT (newid()) FOR [Id]
GO
ALTER TABLE [dbo].[StudyMonitor] ADD  DEFAULT ('00000000-0000-0000-0000-000000000000') FOR [CreateUserId]
GO
ALTER TABLE [dbo].[StudyMonitor] ADD  DEFAULT ((1)) FOR [IsDicom]
GO
ALTER TABLE [dbo].[StudyMonitor] ADD  DEFAULT ((0)) FOR [IsDicomReUpload]
GO
ALTER TABLE [dbo].[StudyMonitor] ADD  DEFAULT ((0)) FOR [TotalMillisecondsInterval]
GO
ALTER TABLE [dbo].[StudyMonitor] ADD  DEFAULT ((0)) FOR [FileCount]
GO
ALTER TABLE [dbo].[StudyMonitor] ADD  DEFAULT (getdate()) FOR [UpdateTime]
GO
ALTER TABLE [dbo].[StudyMonitor] ADD  DEFAULT ('') FOR [IP]
GO
ALTER TABLE [dbo].[StudyMonitor] ADD  DEFAULT ('') FOR [StudyCode]
GO
ALTER TABLE [dbo].[StudyMonitor] ADD  DEFAULT (getdate()) FOR [CreateTime]
GO
ALTER TABLE [dbo].[StudyMonitor] ADD  DEFAULT ((1)) FOR [IsSuccess]
GO
ALTER TABLE [dbo].[StudyMonitor] ADD  DEFAULT ('') FOR [Note]
GO
ALTER TABLE [dbo].[StudyMonitor] ADD  DEFAULT ((0)) FOR [FailedFileCount]
GO
ALTER TABLE [dbo].[Subject] ADD  DEFAULT (newid()) FOR [Id]
GO
ALTER TABLE [dbo].[Subject] ADD  DEFAULT ('') FOR [LastName]
GO
ALTER TABLE [dbo].[Subject] ADD  DEFAULT ((0)) FOR [StudyCount]
GO
ALTER TABLE [dbo].[Subject] ADD  DEFAULT ((0)) FOR [IsMissingImages]
GO
ALTER TABLE [dbo].[Subject] ADD  DEFAULT ('') FOR [MedicalNo]
GO
ALTER TABLE [dbo].[Subject] ADD  DEFAULT ('') FOR [ShortName]
GO
ALTER TABLE [dbo].[Subject] ADD  DEFAULT ('') FOR [Reason]
GO
ALTER TABLE [dbo].[Subject] ADD  DEFAULT (newid()) FOR [SiteId]
GO
ALTER TABLE [dbo].[Subject] ADD  DEFAULT ('') FOR [Height]
GO
ALTER TABLE [dbo].[Subject] ADD  DEFAULT (newid()) FOR [Code]
GO
ALTER TABLE [dbo].[Subject] ADD  DEFAULT ('') FOR [Age]
GO
ALTER TABLE [dbo].[Subject] ADD  DEFAULT (getdate()) FOR [UpdateTime]
GO
ALTER TABLE [dbo].[Subject] ADD  DEFAULT (newid()) FOR [CreateUserId]
GO
ALTER TABLE [dbo].[Subject] ADD  DEFAULT ('') FOR [Sex]
GO
ALTER TABLE [dbo].[Subject] ADD  DEFAULT (newid()) FOR [LatestSubjectVisitId]
GO
ALTER TABLE [dbo].[Subject] ADD  DEFAULT ((0)) FOR [IsEnrollmentConfirm]
GO
ALTER TABLE [dbo].[Subject] ADD  DEFAULT (getdate()) FOR [CreateTime]
GO
ALTER TABLE [dbo].[Subject] ADD  DEFAULT ('') FOR [FirstName]
GO
ALTER TABLE [dbo].[Subject] ADD  DEFAULT ((0)) FOR [IsUrgent]
GO
ALTER TABLE [dbo].[Subject] ADD  DEFAULT ((1)) FOR [Status]
GO
ALTER TABLE [dbo].[Subject] ADD  DEFAULT (newid()) FOR [UpdateUserId]
GO
ALTER TABLE [dbo].[Subject] ADD  DEFAULT ((0)) FOR [IsDeleted]
GO
ALTER TABLE [dbo].[Subject] ADD  DEFAULT (newid()) FOR [TrialId]
GO
ALTER TABLE [dbo].[Subject] ADD  DEFAULT ((1)) FOR [IsEnrollment]
GO
ALTER TABLE [dbo].[Subject] ADD  DEFAULT ((0)) FOR [IsAssignDoctorUser]
GO
ALTER TABLE [dbo].[Subject] ADD  DEFAULT ((0)) FOR [IsReReadingOrBackInfluenceAnalysis]
GO
ALTER TABLE [dbo].[SubjectUser] ADD  DEFAULT (newid()) FOR [TrialId]
GO
ALTER TABLE [dbo].[SubjectUser] ADD  DEFAULT ((0)) FOR [ArmEnum]
GO
ALTER TABLE [dbo].[SubjectUser] ADD  DEFAULT ((0)) FOR [IsConfirmed]
GO
ALTER TABLE [dbo].[SubjectVisit] ADD  DEFAULT (newid()) FOR [Id]
GO
ALTER TABLE [dbo].[SubjectVisit] ADD  DEFAULT (newid()) FOR [SubjectId]
GO
ALTER TABLE [dbo].[SubjectVisit] ADD  DEFAULT ((0)) FOR [IsTake]
GO
ALTER TABLE [dbo].[SubjectVisit] ADD  DEFAULT ((0)) FOR [IsQCConfirmedReupload]
GO
ALTER TABLE [dbo].[SubjectVisit] ADD  DEFAULT ((0)) FOR [IsUrgent]
GO
ALTER TABLE [dbo].[SubjectVisit] ADD  DEFAULT ((0)) FOR [IsLostVisit]
GO
ALTER TABLE [dbo].[SubjectVisit] ADD  DEFAULT ((1)) FOR [VisitNum]
GO
ALTER TABLE [dbo].[SubjectVisit] ADD  DEFAULT ((0)) FOR [IsFinalVisit]
GO
ALTER TABLE [dbo].[SubjectVisit] ADD  DEFAULT ((0)) FOR [AuditState]
GO
ALTER TABLE [dbo].[SubjectVisit] ADD  DEFAULT ('') FOR [VisitName]
GO
ALTER TABLE [dbo].[SubjectVisit] ADD  DEFAULT (newid()) FOR [TrialId]
GO
ALTER TABLE [dbo].[SubjectVisit] ADD  DEFAULT ('') FOR [BlindName]
GO
ALTER TABLE [dbo].[SubjectVisit] ADD  DEFAULT ((0)) FOR [IsBaseLine]
GO
ALTER TABLE [dbo].[SubjectVisit] ADD  DEFAULT (getdate()) FOR [CreateTime]
GO
ALTER TABLE [dbo].[SubjectVisit] ADD  DEFAULT ((0)) FOR [IsDeleted]
GO
ALTER TABLE [dbo].[SubjectVisit] ADD  DEFAULT ((0)) FOR [CheckTime]
GO
ALTER TABLE [dbo].[SubjectVisit] ADD  DEFAULT ((0)) FOR [InPlan]
GO
ALTER TABLE [dbo].[SubjectVisit] ADD  DEFAULT ((0)) FOR [CheckState]
GO
ALTER TABLE [dbo].[SubjectVisit] ADD  DEFAULT ((0)) FOR [SubmitState]
GO
ALTER TABLE [dbo].[SubjectVisit] ADD  DEFAULT ((0)) FOR [IsConfirmedClinicalData]
GO
ALTER TABLE [dbo].[SubjectVisit] ADD  DEFAULT ('') FOR [AnonymousVisitName]
GO
ALTER TABLE [dbo].[SubjectVisit] ADD  DEFAULT ((0)) FOR [CheckChallengeState]
GO
ALTER TABLE [dbo].[SubjectVisit] ADD  DEFAULT ('') FOR [CheckResult]
GO
ALTER TABLE [dbo].[SubjectVisit] ADD  DEFAULT ((0)) FOR [VisitExecuted]
GO
ALTER TABLE [dbo].[SubjectVisit] ADD  DEFAULT (getdate()) FOR [UpdateTime]
GO
ALTER TABLE [dbo].[SubjectVisit] ADD  DEFAULT ((0)) FOR [PDState]
GO
ALTER TABLE [dbo].[SubjectVisit] ADD  DEFAULT ('') FOR [SVUPDES]
GO
ALTER TABLE [dbo].[SubjectVisit] ADD  DEFAULT ((0)) FOR [IsEnrollmentConfirm]
GO
ALTER TABLE [dbo].[SubjectVisit] ADD  DEFAULT ((-1)) FOR [VisitDay]
GO
ALTER TABLE [dbo].[SubjectVisit] ADD  DEFAULT (newid()) FOR [CreateUserId]
GO
ALTER TABLE [dbo].[SubjectVisit] ADD  DEFAULT ((0)) FOR [IsVisitTaskGenerated]
GO
ALTER TABLE [dbo].[SubjectVisit] ADD  DEFAULT ((0)) FOR [ReadingStatus]
GO
ALTER TABLE [dbo].[SubjectVisit] ADD  DEFAULT ((0)) FOR [IsPMBackOrReReading]
GO
ALTER TABLE [dbo].[SystemAnonymization] ADD  DEFAULT (newid()) FOR [Id]
GO
ALTER TABLE [dbo].[SystemAnonymization] ADD  DEFAULT ((0)) FOR [IsFixed]
GO
ALTER TABLE [dbo].[SystemAnonymization] ADD  DEFAULT ('') FOR [Group]
GO
ALTER TABLE [dbo].[SystemAnonymization] ADD  DEFAULT ('') FOR [ReplaceValue]
GO
ALTER TABLE [dbo].[SystemAnonymization] ADD  DEFAULT ((0)) FOR [IsEnable]
GO
ALTER TABLE [dbo].[SystemAnonymization] ADD  DEFAULT (newid()) FOR [UpdateUserId]
GO
ALTER TABLE [dbo].[SystemAnonymization] ADD  DEFAULT ('') FOR [ValueRepresentation]
GO
ALTER TABLE [dbo].[SystemAnonymization] ADD  DEFAULT (newid()) FOR [CreateUserId]
GO
ALTER TABLE [dbo].[SystemAnonymization] ADD  DEFAULT ('') FOR [Element]
GO
ALTER TABLE [dbo].[SystemAnonymization] ADD  DEFAULT ('') FOR [TagDescription]
GO
ALTER TABLE [dbo].[SystemAnonymization] ADD  DEFAULT ('') FOR [TagDescriptionCN]
GO
ALTER TABLE [dbo].[SystemAnonymization] ADD  DEFAULT (getdate()) FOR [UpdateTime]
GO
ALTER TABLE [dbo].[SystemBasicData] ADD  DEFAULT (newid()) FOR [Id]
GO
ALTER TABLE [dbo].[SystemBasicData] ADD  DEFAULT ('00000000-0000-0000-0000-000000000000') FOR [CreateUserId]
GO
ALTER TABLE [dbo].[SystemBasicData] ADD  DEFAULT ((1)) FOR [IsEnable]
GO
ALTER TABLE [dbo].[SystemBasicData] ADD  DEFAULT ('') FOR [Description]
GO
ALTER TABLE [dbo].[SystemBasicData] ADD  DEFAULT (NULL) FOR [ParentId]
GO
ALTER TABLE [dbo].[SystemBasicData] ADD  DEFAULT ('') FOR [Name]
GO
ALTER TABLE [dbo].[SystemBasicData] ADD  DEFAULT ('00000000-0000-0000-0000-000000000000') FOR [UpdateUserId]
GO
ALTER TABLE [dbo].[SystemBasicData] ADD  DEFAULT ('') FOR [Code]
GO
ALTER TABLE [dbo].[SystemBasicData] ADD  DEFAULT (getdate()) FOR [CreateTime]
GO
ALTER TABLE [dbo].[SystemBasicData] ADD  DEFAULT ('') FOR [ValueCN]
GO
ALTER TABLE [dbo].[SystemBasicData] ADD  DEFAULT ((0)) FOR [ShowOrder]
GO
ALTER TABLE [dbo].[SystemBasicData] ADD  DEFAULT ('') FOR [Value]
GO
ALTER TABLE [dbo].[SystemBasicData] ADD  DEFAULT (getdate()) FOR [UpdateTime]
GO
ALTER TABLE [dbo].[SystemDocConfirmedUser] ADD  DEFAULT (newid()) FOR [Id]
GO
ALTER TABLE [dbo].[SystemDocConfirmedUser] ADD  DEFAULT ('') FOR [SignText]
GO
ALTER TABLE [dbo].[SystemDocNeedConfirmedUserType] ADD  DEFAULT (newid()) FOR [Id]
GO
ALTER TABLE [dbo].[SystemDocument] ADD  DEFAULT (newid()) FOR [Id]
GO
ALTER TABLE [dbo].[SystemDocument] ADD  DEFAULT (getdate()) FOR [CreateTime]
GO
ALTER TABLE [dbo].[SystemDocument] ADD  DEFAULT (newid()) FOR [UpdateUserId]
GO
ALTER TABLE [dbo].[SystemDocument] ADD  DEFAULT ('') FOR [Type]
GO
ALTER TABLE [dbo].[SystemDocument] ADD  DEFAULT ('') FOR [Name]
GO
ALTER TABLE [dbo].[SystemDocument] ADD  DEFAULT (newid()) FOR [CreateUserId]
GO
ALTER TABLE [dbo].[SystemDocument] ADD  DEFAULT ('') FOR [Path]
GO
ALTER TABLE [dbo].[SystemDocument] ADD  DEFAULT (getdate()) FOR [UpdateTime]
GO
ALTER TABLE [dbo].[SystemNotice] ADD  DEFAULT (newid()) FOR [Id]
GO
ALTER TABLE [dbo].[SystemNotice] ADD  DEFAULT (getdate()) FOR [UpdateTime]
GO
ALTER TABLE [dbo].[SystemNotice] ADD  DEFAULT (getdate()) FOR [CreateTime]
GO
ALTER TABLE [dbo].[SystemNotice] ADD  DEFAULT ('') FOR [FileName]
GO
ALTER TABLE [dbo].[SystemNotice] ADD  DEFAULT ('') FOR [Path]
GO
ALTER TABLE [dbo].[SystemNotice] ADD  DEFAULT ('') FOR [NoticeContent]
GO
ALTER TABLE [dbo].[SystemNoticeUserRead] ADD  DEFAULT (newid()) FOR [Id]
GO
ALTER TABLE [dbo].[SystemNoticeUserRead] ADD  DEFAULT (getdate()) FOR [CreateTime]
GO
ALTER TABLE [dbo].[SystemNoticeUserType] ADD  DEFAULT (newid()) FOR [Id]
GO
ALTER TABLE [dbo].[SystemNoticeUserType] ADD  DEFAULT (getdate()) FOR [CreateTime]
GO
ALTER TABLE [dbo].[TaskAllocationRule] ADD  DEFAULT ((1)) FOR [IsEnable]
GO
ALTER TABLE [dbo].[TaskAllocationRule] ADD  DEFAULT ('') FOR [Note]
GO
ALTER TABLE [dbo].[TaskAllocationRule] ADD  DEFAULT ((0)) FOR [IsJudgeDoctor]
GO
ALTER TABLE [dbo].[TaskAllocationRule] ADD  DEFAULT ((0)) FOR [PlanSubjectCount]
GO
ALTER TABLE [dbo].[TaskConsistentRule] ADD  DEFAULT ((1)) FOR [IsEnable]
GO
ALTER TABLE [dbo].[TaskConsistentRule] ADD  DEFAULT ('') FOR [Note]
GO
ALTER TABLE [dbo].[TaskConsistentRule] ADD  DEFAULT ((0)) FOR [BlindSubjectNumberOfPlaces]
GO
ALTER TABLE [dbo].[TaskConsistentRule] ADD  DEFAULT ('') FOR [BlindTrialSiteCode]
GO
ALTER TABLE [dbo].[TaskConsistentRule] ADD  DEFAULT ((0)) FOR [IsSelfAnalysis]
GO
ALTER TABLE [dbo].[TaskInfluence] ADD  DEFAULT ((0)) FOR [OptType]
GO
ALTER TABLE [dbo].[TaskMedicalReview] ADD  DEFAULT ((0)) FOR [AuditState]
GO
ALTER TABLE [dbo].[TaskMedicalReview] ADD  DEFAULT ((0)) FOR [IsHaveQuestion]
GO
ALTER TABLE [dbo].[TaskMedicalReview] ADD  DEFAULT ('') FOR [Questioning]
GO
ALTER TABLE [dbo].[TaskMedicalReview] ADD  DEFAULT ((0)) FOR [AuditAdviceEnum]
GO
ALTER TABLE [dbo].[TaskMedicalReview] ADD  DEFAULT ((0)) FOR [IsClosedDialog]
GO
ALTER TABLE [dbo].[TaskMedicalReview] ADD  DEFAULT ('') FOR [DisagreeReason]
GO
ALTER TABLE [dbo].[TaskMedicalReview] ADD  DEFAULT ((0)) FOR [IsApplyHeavyReading]
GO
ALTER TABLE [dbo].[TaskMedicalReview] ADD  DEFAULT ((0)) FOR [IsSendMessage]
GO
ALTER TABLE [dbo].[TaskMedicalReview] ADD  DEFAULT ('') FOR [DialogCloseReason]
GO
ALTER TABLE [dbo].[TaskMedicalReview] ADD  DEFAULT ((0)) FOR [MedicalDialogCloseEnum]
GO
ALTER TABLE [dbo].[TaskMedicalReview] ADD  DEFAULT ((0)) FOR [IsInvalid]
GO
ALTER TABLE [dbo].[TaskMedicalReview] ADD  DEFAULT ((0)) FOR [IsAutoGenerate]
GO
ALTER TABLE [dbo].[TaskMedicalReview] ADD  DEFAULT ('') FOR [PDRelationTaskIdListStr]
GO
ALTER TABLE [dbo].[TaskMedicalReviewRule] ADD  DEFAULT ((1)) FOR [IsEnable]
GO
ALTER TABLE [dbo].[TaskMedicalReviewRule] ADD  DEFAULT ('') FOR [Note]
GO
ALTER TABLE [dbo].[Trial] ADD  DEFAULT (newid()) FOR [Id]
GO
ALTER TABLE [dbo].[Trial] ADD  DEFAULT ((1)) FOR [IsNoticeSubjectCodeRule]
GO
ALTER TABLE [dbo].[Trial] ADD  DEFAULT ('') FOR [TrialSiteSurveyUserRoles ]
GO
ALTER TABLE [dbo].[Trial] ADD  DEFAULT ((0)) FOR [IsCRAAuditClinicalInformation]
GO
ALTER TABLE [dbo].[Trial] ADD  DEFAULT ((0)) FOR [IsSubjectSexView]
GO
ALTER TABLE [dbo].[Trial] ADD  DEFAULT ('') FOR [ExperimentName]
GO
ALTER TABLE [dbo].[Trial] ADD  DEFAULT ((0)) FOR [PlanVisitCount]
GO
ALTER TABLE [dbo].[Trial] ADD  DEFAULT ((0)) FOR [IsEnrollementQualificationConfirm]
GO
ALTER TABLE [dbo].[Trial] ADD  DEFAULT ('') FOR [ImageQCSignText]
GO
ALTER TABLE [dbo].[Trial] ADD  DEFAULT ((0)) FOR [IsQCQuestionConfirmed]
GO
ALTER TABLE [dbo].[Trial] ADD  DEFAULT ((0)) FOR [IsSubjectExpeditedView]
GO
ALTER TABLE [dbo].[Trial] ADD  DEFAULT ('‘’') FOR [TrialStatusStr]
GO
ALTER TABLE [dbo].[Trial] ADD  DEFAULT ((0)) FOR [VisitPlanConfirmed]
GO
ALTER TABLE [dbo].[Trial] ADD  DEFAULT ((0)) FOR [PlanSubjectCount]
GO
ALTER TABLE [dbo].[Trial] ADD  DEFAULT ((0)) FOR [IsTrialProcessConfirmed]
GO
ALTER TABLE [dbo].[Trial] ADD  DEFAULT ('EOT') FOR [OutEnrollmentVisitName]
GO
ALTER TABLE [dbo].[Trial] ADD  DEFAULT ('') FOR [Modalitys]
GO
ALTER TABLE [dbo].[Trial] ADD  DEFAULT ((0)) FOR [IsImageReplicationAcrossTrial]
GO
ALTER TABLE [dbo].[Trial] ADD  DEFAULT ((1)) FOR [IsHaveFirstGiveMedicineDate]
GO
ALTER TABLE [dbo].[Trial] ADD  DEFAULT ('') FOR [TrialCode]
GO
ALTER TABLE [dbo].[Trial] ADD  DEFAULT ((0)) FOR [IsPDProgressView]
GO
ALTER TABLE [dbo].[Trial] ADD  DEFAULT ('') FOR [TrialSiteSurveyEquipmentType]
GO
ALTER TABLE [dbo].[Trial] ADD  DEFAULT ((0)) FOR [IsUrgent]
GO
ALTER TABLE [dbo].[Trial] ADD  DEFAULT (getdate()) FOR [UpdateTime]
GO
ALTER TABLE [dbo].[Trial] ADD  DEFAULT ('') FOR [Indication]
GO
ALTER TABLE [dbo].[Trial] ADD  DEFAULT ('') FOR [MainResearchUnit]
GO
ALTER TABLE [dbo].[Trial] ADD  DEFAULT ((0)) FOR [PlanSiteCount]
GO
ALTER TABLE [dbo].[Trial] ADD  DEFAULT ('') FOR [DocumentConfirmSignText]
GO
ALTER TABLE [dbo].[Trial] ADD  DEFAULT ((0)) FOR [IsSubjectSecondCodeView]
GO
ALTER TABLE [dbo].[Trial] ADD  DEFAULT ((0)) FOR [IsVerifyVisitImageDate]
GO
ALTER TABLE [dbo].[Trial] ADD  DEFAULT ((1)) FOR [IsTrialStart]
GO
ALTER TABLE [dbo].[Trial] ADD  DEFAULT ((0)) FOR [Code]
GO
ALTER TABLE [dbo].[Trial] ADD  DEFAULT ((0)) FOR [IsTrialUrgentConfirmed]
GO
ALTER TABLE [dbo].[Trial] ADD  DEFAULT ('') FOR [ChallengeTypes]
GO
ALTER TABLE [dbo].[Trial] ADD  DEFAULT ('') FOR [ResearchProgramNo]
GO
ALTER TABLE [dbo].[Trial] ADD  DEFAULT ((0)) FOR [IsHaveSubjectAge]
GO
ALTER TABLE [dbo].[Trial] ADD  DEFAULT ((0)) FOR [ReadingMode]
GO
ALTER TABLE [dbo].[Trial] ADD  DEFAULT (getdate()) FOR [CreateTime]
GO
ALTER TABLE [dbo].[Trial] ADD  DEFAULT ((1)) FOR [DigitPlaces]
GO
ALTER TABLE [dbo].[Trial] ADD  DEFAULT ('') FOR [BodyPartTypes]
GO
ALTER TABLE [dbo].[Trial] ADD  DEFAULT ('') FOR [HeadPI]
GO
ALTER TABLE [dbo].[Trial] ADD  DEFAULT ((0)) FOR [AttendedReviewerType]
GO
ALTER TABLE [dbo].[Trial] ADD  DEFAULT ((0)) FOR [ClinicalInformationTransmissionEnum]
GO
ALTER TABLE [dbo].[Trial] ADD  DEFAULT ((0)) FOR [IsTrialBasicLogicConfirmed]
GO
ALTER TABLE [dbo].[Trial] ADD  DEFAULT ((0)) FOR [TaskAllocateObjEnum]
GO
ALTER TABLE [dbo].[Trial] ADD  DEFAULT ((0)) FOR [FollowVisitAutoAssignDefaultState]
GO
ALTER TABLE [dbo].[Trial] ADD  DEFAULT ((0)) FOR [IsFollowVisitAutoAssign]
GO
ALTER TABLE [dbo].[Trial] ADD  DEFAULT ((0)) FOR [IsFollowGlobalVisitAutoAssign]
GO
ALTER TABLE [dbo].[Trial] ADD  DEFAULT ((0)) FOR [FollowGlobalVisitAutoAssignDefaultState]
GO
ALTER TABLE [dbo].[Trial] ADD  DEFAULT ((0)) FOR [IsFollowJudgeTaskAutoAssign]
GO
ALTER TABLE [dbo].[Trial] ADD  DEFAULT ((0)) FOR [FollowJudgeTaskAutoAssignDefaultState]
GO
ALTER TABLE [dbo].[Trial] ADD  DEFAULT ((0)) FOR [IsImageIabeled]
GO
ALTER TABLE [dbo].[Trial] ADD  DEFAULT ('') FOR [BlindBaseLineName]
GO
ALTER TABLE [dbo].[Trial] ADD  DEFAULT ('') FOR [BlindFollowUpPrefix]
GO
ALTER TABLE [dbo].[Trial] ADD  DEFAULT ('') FOR [EmailFromEmail]
GO
ALTER TABLE [dbo].[Trial] ADD  DEFAULT ('') FOR [EmailFromName]
GO
ALTER TABLE [dbo].[Trial] ADD  DEFAULT ('') FOR [EmailAuthorizationCode]
GO
ALTER TABLE [dbo].[Trial] ADD  DEFAULT ('') FOR [EmailSMTPServerAddress]
GO
ALTER TABLE [dbo].[Trial] ADD  DEFAULT ((0)) FOR [IsConfigureEmail]
GO
ALTER TABLE [dbo].[TrialDictionary] ADD  DEFAULT (newid()) FOR [Id]
GO
ALTER TABLE [dbo].[TrialDocConfirmedUser] ADD  DEFAULT (newid()) FOR [Id]
GO
ALTER TABLE [dbo].[TrialDocConfirmedUser] ADD  DEFAULT ('') FOR [SignText]
GO
ALTER TABLE [dbo].[TrialDocNeedConfirmedUserType] ADD  DEFAULT (newid()) FOR [Id]
GO
ALTER TABLE [dbo].[TrialDocument] ADD  DEFAULT (newid()) FOR [Id]
GO
ALTER TABLE [dbo].[TrialDocument] ADD  DEFAULT ('') FOR [Name]
GO
ALTER TABLE [dbo].[TrialDocument] ADD  DEFAULT (newid()) FOR [CreateUserId]
GO
ALTER TABLE [dbo].[TrialDocument] ADD  DEFAULT ('') FOR [Path]
GO
ALTER TABLE [dbo].[TrialDocument] ADD  DEFAULT (getdate()) FOR [UpdateTime]
GO
ALTER TABLE [dbo].[TrialDocument] ADD  DEFAULT (getdate()) FOR [CreateTime]
GO
ALTER TABLE [dbo].[TrialDocument] ADD  DEFAULT ((0)) FOR [IsDeleted]
GO
ALTER TABLE [dbo].[TrialDocument] ADD  DEFAULT ('') FOR [Type]
GO
ALTER TABLE [dbo].[TrialDocument] ADD  DEFAULT (newid()) FOR [UpdateUserId]
GO
ALTER TABLE [dbo].[TrialEmailNoticeConfig] ADD  DEFAULT (newid()) FOR [Id]
GO
ALTER TABLE [dbo].[TrialEmailNoticeConfig] ADD  DEFAULT ('') FOR [AuthorizationCode]
GO
ALTER TABLE [dbo].[TrialEmailNoticeConfig] ADD  DEFAULT ('00000000-0000-0000-0000-000000000000') FOR [CreateUserId]
GO
ALTER TABLE [dbo].[TrialEmailNoticeConfig] ADD  DEFAULT ('') FOR [Code]
GO
ALTER TABLE [dbo].[TrialEmailNoticeConfig] ADD  DEFAULT ('00000000-0000-0000-0000-000000000000') FOR [UpdateUserId]
GO
ALTER TABLE [dbo].[TrialEmailNoticeConfig] ADD  DEFAULT ((0)) FOR [IsReturnRequired]
GO
ALTER TABLE [dbo].[TrialEmailNoticeConfig] ADD  DEFAULT (getdate()) FOR [CreateTime]
GO
ALTER TABLE [dbo].[TrialEmailNoticeConfig] ADD  DEFAULT ((0)) FOR [IsAutoSend]
GO
ALTER TABLE [dbo].[TrialEmailNoticeConfig] ADD  DEFAULT ((0)) FOR [IsDistinguishCriteria]
GO
ALTER TABLE [dbo].[TrialEmailNoticeConfig] ADD  DEFAULT ((0)) FOR [BusinessScenarioEnum]
GO
ALTER TABLE [dbo].[TrialEmailNoticeConfig] ADD  DEFAULT ('') FOR [FilePath]
GO
ALTER TABLE [dbo].[TrialEmailNoticeConfig] ADD  DEFAULT ('') FOR [FileName]
GO
ALTER TABLE [dbo].[TrialEmailNoticeConfig] ADD  DEFAULT ((0)) FOR [CriterionTypeEnum]
GO
ALTER TABLE [dbo].[TrialEmailNoticeConfig] ADD  DEFAULT ('') FOR [FromEmail]
GO
ALTER TABLE [dbo].[TrialEmailNoticeConfig] ADD  DEFAULT ('') FOR [FromName]
GO
ALTER TABLE [dbo].[TrialEmailNoticeConfig] ADD  DEFAULT ('') FOR [SMTPServerAddress]
GO
ALTER TABLE [dbo].[TrialEmailNoticeConfig] ADD  DEFAULT ((0)) FOR [SMTPServerPort]
GO
ALTER TABLE [dbo].[TrialEmailNoticeUser] ADD  DEFAULT ((0)) FOR [UserType]
GO
ALTER TABLE [dbo].[TrialExperience] ADD  DEFAULT (getdate()) FOR [UpdateTime]
GO
ALTER TABLE [dbo].[TrialExperience] ADD  DEFAULT ('00000000-0000-0000-0000-000000000000') FOR [UpdateUserId]
GO
ALTER TABLE [dbo].[TrialExperience] ADD  DEFAULT (getdate()) FOR [CreateTime]
GO
ALTER TABLE [dbo].[TrialExperience] ADD  DEFAULT ('00000000-0000-0000-0000-000000000000') FOR [CreateUserId]
GO
ALTER TABLE [dbo].[TrialExperience] ADD  DEFAULT ('') FOR [Term]
GO
ALTER TABLE [dbo].[TrialExperience] ADD  DEFAULT ('') FOR [EvaluationContent]
GO
ALTER TABLE [dbo].[TrialExperience] ADD  DEFAULT ((0)) FOR [VisitReadingCount]
GO
ALTER TABLE [dbo].[TrialExperienceCriteria] ADD  DEFAULT (newid()) FOR [Id]
GO
ALTER TABLE [dbo].[TrialExternalUser] ADD  DEFAULT (newid()) FOR [Id]
GO
ALTER TABLE [dbo].[TrialExternalUser] ADD  DEFAULT (getdate()) FOR [CreateTime]
GO
ALTER TABLE [dbo].[TrialExternalUser] ADD  DEFAULT ('') FOR [Email]
GO
ALTER TABLE [dbo].[TrialExternalUser] ADD  DEFAULT ((0)) FOR [InviteState]
GO
ALTER TABLE [dbo].[TrialExternalUser] ADD  DEFAULT ('') FOR [Phone]
GO
ALTER TABLE [dbo].[TrialExternalUser] ADD  DEFAULT ((0)) FOR [IsSystemUser]
GO
ALTER TABLE [dbo].[TrialExternalUser] ADD  DEFAULT ((0)) FOR [IsJoin]
GO
ALTER TABLE [dbo].[TrialExternalUser] ADD  DEFAULT (newid()) FOR [CreateUserId]
GO
ALTER TABLE [dbo].[TrialExternalUser] ADD  DEFAULT ('') FOR [RejectReason]
GO
ALTER TABLE [dbo].[TrialExternalUser] ADD  DEFAULT ('') FOR [OrganizationName]
GO
ALTER TABLE [dbo].[TrialFileUserType] ADD  DEFAULT (newid()) FOR [Id]
GO
ALTER TABLE [dbo].[TrialFileUserType] ADD  DEFAULT (newid()) FOR [TrialFileId]
GO
ALTER TABLE [dbo].[TrialFileUserType] ADD  DEFAULT ('') FOR [UserTypeId]
GO
ALTER TABLE [dbo].[TrialFileUserType] ADD  DEFAULT (getdate()) FOR [CreateTime]
GO
ALTER TABLE [dbo].[TrialFileUserType] ADD  DEFAULT (newid()) FOR [CreateUserId]
GO
ALTER TABLE [dbo].[TrialPaymentPrice ] ADD  DEFAULT (newid()) FOR [Id]
GO
ALTER TABLE [dbo].[TrialPaymentPrice ] ADD  DEFAULT ((0)) FOR [TrialAdditional]
GO
ALTER TABLE [dbo].[TrialPaymentPrice ] ADD  DEFAULT ('') FOR [SowPath]
GO
ALTER TABLE [dbo].[TrialPaymentPrice ] ADD  DEFAULT ((1)) FOR [AdjustmentMultiple]
GO
ALTER TABLE [dbo].[TrialPaymentPrice ] ADD  DEFAULT ((0)) FOR [IsNewTrial]
GO
ALTER TABLE [dbo].[TrialPaymentPrice ] ADD  DEFAULT ('') FOR [SowName]
GO
ALTER TABLE [dbo].[TrialQCQuestionAnswer] ADD  DEFAULT ('') FOR [ChildAnswer]
GO
ALTER TABLE [dbo].[TrialRevenuesPrice] ADD  DEFAULT (newid()) FOR [Id]
GO
ALTER TABLE [dbo].[TrialRevenuesPrice] ADD  DEFAULT ((0)) FOR [TimepointIn24H]
GO
ALTER TABLE [dbo].[TrialRevenuesPrice] ADD  DEFAULT ('00000000-0000-0000-0000-000000000000') FOR [UpdateUserId]
GO
ALTER TABLE [dbo].[TrialRevenuesPrice] ADD  DEFAULT ((0)) FOR [AdjudicationIn24H]
GO
ALTER TABLE [dbo].[TrialRevenuesPrice] ADD  DEFAULT (getdate()) FOR [CreateTime]
GO
ALTER TABLE [dbo].[TrialRevenuesPrice] ADD  DEFAULT ((0)) FOR [Adjudication]
GO
ALTER TABLE [dbo].[TrialRevenuesPrice] ADD  DEFAULT ((0)) FOR [Global]
GO
ALTER TABLE [dbo].[TrialRevenuesPrice] ADD  DEFAULT ((0)) FOR [Timepoint]
GO
ALTER TABLE [dbo].[TrialRevenuesPrice] ADD  DEFAULT (getdate()) FOR [UpdateTime]
GO
ALTER TABLE [dbo].[TrialRevenuesPrice] ADD  DEFAULT ((0)) FOR [AdjudicationIn48H]
GO
ALTER TABLE [dbo].[TrialRevenuesPrice] ADD  DEFAULT ((0)) FOR [Downtime]
GO
ALTER TABLE [dbo].[TrialRevenuesPrice] ADD  DEFAULT ((0)) FOR [TimepointIn48H]
GO
ALTER TABLE [dbo].[TrialRevenuesPrice] ADD  DEFAULT (newid()) FOR [TrialId]
GO
ALTER TABLE [dbo].[TrialRevenuesPrice] ADD  DEFAULT ((0)) FOR [Training]
GO
ALTER TABLE [dbo].[TrialRevenuesPrice] ADD  DEFAULT ((0)) FOR [RefresherTraining]
GO
ALTER TABLE [dbo].[TrialRevenuesPrice] ADD  DEFAULT ('00000000-0000-0000-0000-000000000000') FOR [CreateUserId]
GO
ALTER TABLE [dbo].[TrialRevenuesPriceVerification] ADD  DEFAULT (newid()) FOR [Id]
GO
ALTER TABLE [dbo].[TrialRevenuesPriceVerification] ADD  DEFAULT ((0)) FOR [RefresherTraining]
GO
ALTER TABLE [dbo].[TrialSign] ADD  DEFAULT (newid()) FOR [Id]
GO
ALTER TABLE [dbo].[TrialSign] ADD  DEFAULT (newid()) FOR [CreateUserId]
GO
ALTER TABLE [dbo].[TrialSign] ADD  DEFAULT ('') FOR [SignText]
GO
ALTER TABLE [dbo].[TrialSign] ADD  DEFAULT ((0)) FOR [IsCompleted]
GO
ALTER TABLE [dbo].[TrialSign] ADD  DEFAULT ('') FOR [SignCode]
GO
ALTER TABLE [dbo].[TrialSign] ADD  DEFAULT (getdate()) FOR [CreateTime]
GO
ALTER TABLE [dbo].[TrialSite] ADD  DEFAULT (newid()) FOR [Id]
GO
ALTER TABLE [dbo].[TrialSite] ADD  DEFAULT ((0)) FOR [IsDeleted]
GO
ALTER TABLE [dbo].[TrialSite] ADD  DEFAULT (newid()) FOR [CreateUserId]
GO
ALTER TABLE [dbo].[TrialSite] ADD  DEFAULT ('') FOR [TrialSiteCode]
GO
ALTER TABLE [dbo].[TrialSite] ADD  DEFAULT ('') FOR [TrialSiteAliasName]
GO
ALTER TABLE [dbo].[TrialSite] ADD  DEFAULT (getdate()) FOR [CreateTime]
GO
ALTER TABLE [dbo].[TrialSiteEquipmentSurvey] ADD  DEFAULT (newid()) FOR [Id]
GO
ALTER TABLE [dbo].[TrialSiteEquipmentSurvey] ADD  DEFAULT ('') FOR [ManufacturerName]
GO
ALTER TABLE [dbo].[TrialSiteEquipmentSurvey] ADD  DEFAULT ('') FOR [Parameters]
GO
ALTER TABLE [dbo].[TrialSiteEquipmentSurvey] ADD  DEFAULT (newid()) FOR [CreateUserId]
GO
ALTER TABLE [dbo].[TrialSiteEquipmentSurvey] ADD  DEFAULT (getdate()) FOR [CreateTime]
GO
ALTER TABLE [dbo].[TrialSiteSurvey] ADD  DEFAULT (newid()) FOR [Id]
GO
ALTER TABLE [dbo].[TrialSiteSurvey] ADD  DEFAULT ('') FOR [LatestBackReason]
GO
ALTER TABLE [dbo].[TrialSiteSurvey] ADD  DEFAULT ('') FOR [Phone]
GO
ALTER TABLE [dbo].[TrialSiteSurvey] ADD  DEFAULT ((0)) FOR [State]
GO
ALTER TABLE [dbo].[TrialSiteSurvey] ADD  DEFAULT (getdate()) FOR [CreateTime]
GO
ALTER TABLE [dbo].[TrialSiteSurvey] ADD  DEFAULT ('') FOR [NotFollowReson]
GO
ALTER TABLE [dbo].[TrialSiteSurvey] ADD  DEFAULT ('') FOR [Email]
GO
ALTER TABLE [dbo].[TrialSiteSurvey] ADD  DEFAULT ((0)) FOR [IsLocked]
GO
ALTER TABLE [dbo].[TrialSiteSurvey] ADD  DEFAULT ('') FOR [NotConfirmReson]
GO
ALTER TABLE [dbo].[TrialSiteSurvey] ADD  DEFAULT ((0)) FOR [IsDeleted]
GO
ALTER TABLE [dbo].[TrialSiteSurvey] ADD  DEFAULT ((0)) FOR [EfficacyEvaluatorType]
GO
ALTER TABLE [dbo].[TrialSiteSurvey] ADD  DEFAULT (newid()) FOR [CreateUserId]
GO
ALTER TABLE [dbo].[TrialSiteSurvey] ADD  DEFAULT ((0)) FOR [AverageEngravingCycle]
GO
ALTER TABLE [dbo].[TrialSiteSurvey] ADD  DEFAULT ('') FOR [UserName]
GO
ALTER TABLE [dbo].[TrialSiteUser] ADD  DEFAULT (newid()) FOR [Id]
GO
ALTER TABLE [dbo].[TrialSiteUser] ADD  DEFAULT ('00000000-0000-0000-0000-000000000000') FOR [UpdateUserId]
GO
ALTER TABLE [dbo].[TrialSiteUser] ADD  DEFAULT (getdate()) FOR [CreateTime]
GO
ALTER TABLE [dbo].[TrialSiteUser] ADD  DEFAULT ('00000000-0000-0000-0000-000000000000') FOR [CreateUserId]
GO
ALTER TABLE [dbo].[TrialSiteUser] ADD  DEFAULT ((0)) FOR [IsDeleted]
GO
ALTER TABLE [dbo].[TrialSiteUser] ADD  DEFAULT (newid()) FOR [SiteId]
GO
ALTER TABLE [dbo].[TrialSiteUser] ADD  DEFAULT (getdate()) FOR [UpdateTime]
GO
ALTER TABLE [dbo].[TrialSiteUserSurvey] ADD  DEFAULT (newid()) FOR [Id]
GO
ALTER TABLE [dbo].[TrialSiteUserSurvey] ADD  DEFAULT ((0)) FOR [IsCorrect]
GO
ALTER TABLE [dbo].[TrialSiteUserSurvey] ADD  DEFAULT ('') FOR [OrganizationName]
GO
ALTER TABLE [dbo].[TrialSiteUserSurvey] ADD  DEFAULT ((0)) FOR [InviteState]
GO
ALTER TABLE [dbo].[TrialSiteUserSurvey] ADD  DEFAULT ('') FOR [UserName]
GO
ALTER TABLE [dbo].[TrialSiteUserSurvey] ADD  DEFAULT ('') FOR [RejectReason]
GO
ALTER TABLE [dbo].[TrialSiteUserSurvey] ADD  DEFAULT (newid()) FOR [CreateUserId]
GO
ALTER TABLE [dbo].[TrialSiteUserSurvey] ADD  DEFAULT ((0)) FOR [IsJoin]
GO
ALTER TABLE [dbo].[TrialSiteUserSurvey] ADD  DEFAULT (getdate()) FOR [CreateTime]
GO
ALTER TABLE [dbo].[TrialSiteUserSurvey] ADD  DEFAULT ('') FOR [Email]
GO
ALTER TABLE [dbo].[TrialSiteUserSurvey] ADD  DEFAULT ((0)) FOR [IsGenerateAccount]
GO
ALTER TABLE [dbo].[TrialSiteUserSurvey] ADD  DEFAULT ((0)) FOR [IsGenerateSuccess]
GO
ALTER TABLE [dbo].[TrialSiteUserSurvey] ADD  DEFAULT ('') FOR [Phone]
GO
ALTER TABLE [dbo].[TrialStateChange] ADD  DEFAULT (newid()) FOR [Id]
GO
ALTER TABLE [dbo].[TrialStateChange] ADD  DEFAULT ('') FOR [NowState]
GO
ALTER TABLE [dbo].[TrialStateChange] ADD  DEFAULT (newid()) FOR [CreateUserId]
GO
ALTER TABLE [dbo].[TrialStateChange] ADD  DEFAULT (getdate()) FOR [CreateTime]
GO
ALTER TABLE [dbo].[TrialStateChange] ADD  DEFAULT ('') FOR [OriginState]
GO
ALTER TABLE [dbo].[TrialStateChange] ADD  DEFAULT ('') FOR [Reason]
GO
ALTER TABLE [dbo].[TrialStateChange] ADD  DEFAULT (newid()) FOR [TrialId]
GO
ALTER TABLE [dbo].[TrialStatus] ADD  DEFAULT (newid()) FOR [Id]
GO
ALTER TABLE [dbo].[TrialStatus] ADD  DEFAULT (getdate()) FOR [CreateTime]
GO
ALTER TABLE [dbo].[TrialStatus] ADD  DEFAULT ((0)) FOR [OptUserType]
GO
ALTER TABLE [dbo].[TrialStatus] ADD  DEFAULT ('') FOR [Memo]
GO
ALTER TABLE [dbo].[TrialUser] ADD  DEFAULT (newid()) FOR [Id]
GO
ALTER TABLE [dbo].[TrialUser] ADD  DEFAULT ('00000000-0000-0000-0000-000000000000') FOR [UpdateUserId]
GO
ALTER TABLE [dbo].[TrialUser] ADD  DEFAULT (getdate()) FOR [CreateTime]
GO
ALTER TABLE [dbo].[TrialUser] ADD  DEFAULT ((0)) FOR [IsDeleted]
GO
ALTER TABLE [dbo].[TrialUser] ADD  DEFAULT ('00000000-0000-0000-0000-000000000000') FOR [CreateUserId]
GO
ALTER TABLE [dbo].[TrialUser] ADD  DEFAULT (getdate()) FOR [UpdateTime]
GO
ALTER TABLE [dbo].[TumorAssessment] ADD  DEFAULT (newid()) FOR [CriterionId]
GO
ALTER TABLE [dbo].[User] ADD  DEFAULT (newid()) FOR [Id]
GO
ALTER TABLE [dbo].[User] ADD  DEFAULT ((1)) FOR [Sex]
GO
ALTER TABLE [dbo].[User] ADD  DEFAULT ((0)) FOR [IsFirstAdd]
GO
ALTER TABLE [dbo].[User] ADD  DEFAULT ('') FOR [UserCode]
GO
ALTER TABLE [dbo].[User] ADD  DEFAULT ('') FOR [OrganizationName]
GO
ALTER TABLE [dbo].[User] ADD  DEFAULT (getdate()) FOR [CreateTime]
GO
ALTER TABLE [dbo].[User] ADD  DEFAULT (' ') FOR [LastName]
GO
ALTER TABLE [dbo].[User] ADD  DEFAULT ('') FOR [FirstName]
GO
ALTER TABLE [dbo].[User] ADD  DEFAULT ('') FOR [Phone]
GO
ALTER TABLE [dbo].[User] ADD  DEFAULT ((0)) FOR [PasswordChanged]
GO
ALTER TABLE [dbo].[User] ADD  DEFAULT (' ') FOR [UserName]
GO
ALTER TABLE [dbo].[User] ADD  DEFAULT ('') FOR [DepartmentName]
GO
ALTER TABLE [dbo].[User] ADD  DEFAULT ((0)) FOR [UserTypeEnum]
GO
ALTER TABLE [dbo].[User] ADD  DEFAULT ('') FOR [PositionName]
GO
ALTER TABLE [dbo].[User] ADD  DEFAULT ((0)) FOR [SuperAdmin]
GO
ALTER TABLE [dbo].[User] ADD  DEFAULT ((1)) FOR [Status]
GO
ALTER TABLE [dbo].[User] ADD  DEFAULT ('False') FOR [IsZhiZhun]
GO
ALTER TABLE [dbo].[User] ADD  DEFAULT (' ') FOR [Password]
GO
ALTER TABLE [dbo].[User] ADD  DEFAULT (getdate()) FOR [UpdateTime]
GO
ALTER TABLE [dbo].[User] ADD  DEFAULT ('') FOR [EMail]
GO
ALTER TABLE [dbo].[User] ADD  DEFAULT ('') FOR [EmailToken]
GO
ALTER TABLE [dbo].[User] ADD  DEFAULT ((0)) FOR [IsTestUser]
GO
ALTER TABLE [dbo].[UserDoctor] ADD  DEFAULT (newid()) FOR [Id]
GO
ALTER TABLE [dbo].[UserType] ADD  DEFAULT (newid()) FOR [Id]
GO
ALTER TABLE [dbo].[UserType] ADD  DEFAULT ('') FOR [UserTypeShortName]
GO
ALTER TABLE [dbo].[UserType] ADD  DEFAULT ((0)) FOR [UserTypeEnum]
GO
ALTER TABLE [dbo].[UserType] ADD  DEFAULT ((1)) FOR [IsEnable]
GO
ALTER TABLE [dbo].[UserType] ADD  DEFAULT ((0)) FOR [Type]
GO
ALTER TABLE [dbo].[UserType] ADD  DEFAULT ('') FOR [Description]
GO
ALTER TABLE [dbo].[UserType] ADD  DEFAULT ('') FOR [PermissionStr]
GO
ALTER TABLE [dbo].[UserType] ADD  DEFAULT ((0)) FOR [Order]
GO
ALTER TABLE [dbo].[UserType] ADD  DEFAULT ((0)) FOR [IsInternal]
GO
ALTER TABLE [dbo].[Vacation] ADD  DEFAULT (newid()) FOR [Id]
GO
ALTER TABLE [dbo].[Vacation] ADD  DEFAULT ('00000000-0000-0000-0000-000000000000') FOR [CreateUserId]
GO
ALTER TABLE [dbo].[Vacation] ADD  DEFAULT ((1)) FOR [Status]
GO
ALTER TABLE [dbo].[Vacation] ADD  DEFAULT (getdate()) FOR [UpdateTime]
GO
ALTER TABLE [dbo].[Vacation] ADD  DEFAULT (getdate()) FOR [CreateTime]
GO
ALTER TABLE [dbo].[Vacation] ADD  DEFAULT ('00000000-0000-0000-0000-000000000000') FOR [UpdateUserId]
GO
ALTER TABLE [dbo].[VerificationCode] ADD  DEFAULT (newid()) FOR [Id]
GO
ALTER TABLE [dbo].[VerificationCode] ADD  DEFAULT (getdate()) FOR [ExpirationTime]
GO
ALTER TABLE [dbo].[VerificationCode] ADD  DEFAULT (newid()) FOR [UserId]
GO
ALTER TABLE [dbo].[VerificationCode] ADD  DEFAULT ('') FOR [EmailOrPhone]
GO
ALTER TABLE [dbo].[VerificationCode] ADD  DEFAULT ('') FOR [Code]
GO
ALTER TABLE [dbo].[VerificationCode] ADD  DEFAULT ((0)) FOR [CodeType]
GO
ALTER TABLE [dbo].[VerificationCode] ADD  DEFAULT ((0)) FOR [HasSend]
GO
ALTER TABLE [dbo].[VisitPlanInfluenceStat] ADD  DEFAULT (newid()) FOR [Id]
GO
ALTER TABLE [dbo].[VisitPlanInfluenceStat] ADD  DEFAULT (getdate()) FOR [CreateTime]
GO
ALTER TABLE [dbo].[VisitPlanInfluenceStat] ADD  DEFAULT (newid()) FOR [CreateUserId]
GO
ALTER TABLE [dbo].[VisitPlanInfluenceStudy] ADD  DEFAULT (newid()) FOR [Id]
GO
ALTER TABLE [dbo].[VisitPlanInfluenceStudy] ADD  DEFAULT ('') FOR [Modality]
GO
ALTER TABLE [dbo].[VisitPlanInfluenceStudy] ADD  DEFAULT (newid()) FOR [CreateUserId]
GO
ALTER TABLE [dbo].[VisitPlanInfluenceStudy] ADD  DEFAULT ((0)) FOR [IsDicomStudy]
GO
ALTER TABLE [dbo].[VisitPlanInfluenceStudy] ADD  DEFAULT ((0)) FOR [IsOverWindowNowNotOverWindow]
GO
ALTER TABLE [dbo].[VisitPlanInfluenceStudy] ADD  DEFAULT ('') FOR [HistoryWindow]
GO
ALTER TABLE [dbo].[VisitPlanInfluenceStudy] ADD  DEFAULT (getdate()) FOR [CreateTime]
GO
ALTER TABLE [dbo].[VisitPlanInfluenceStudy] ADD  DEFAULT ('') FOR [NowWindow]
GO
ALTER TABLE [dbo].[VisitStage] ADD  DEFAULT (newid()) FOR [Id]
GO
ALTER TABLE [dbo].[VisitStage] ADD  DEFAULT ((0)) FOR [IsDeleted]
GO
ALTER TABLE [dbo].[VisitStage] ADD  DEFAULT (newid()) FOR [CreateUserId]
GO
ALTER TABLE [dbo].[VisitStage] ADD  DEFAULT ((0)) FOR [IsBaseLine]
GO
ALTER TABLE [dbo].[VisitStage] ADD  DEFAULT ('') FOR [Description]
GO
ALTER TABLE [dbo].[VisitStage] ADD  DEFAULT ((0)) FOR [NeedGlobal]
GO
ALTER TABLE [dbo].[VisitStage] ADD  DEFAULT ('') FOR [VisitDay]
GO
ALTER TABLE [dbo].[VisitStage] ADD  DEFAULT (getdate()) FOR [UpdateTime]
GO
ALTER TABLE [dbo].[VisitStage] ADD  DEFAULT (newid()) FOR [TrialId]
GO
ALTER TABLE [dbo].[VisitStage] ADD  DEFAULT ((0)) FOR [IsConfirmed]
GO
ALTER TABLE [dbo].[VisitStage] ADD  DEFAULT ('') FOR [VisitName]
GO
ALTER TABLE [dbo].[VisitStage] ADD  DEFAULT ((0)) FOR [VisitNum]
GO
ALTER TABLE [dbo].[VisitStage] ADD  DEFAULT ((0)) FOR [IsHaveFirstConfirmed]
GO
ALTER TABLE [dbo].[VisitStage] ADD  DEFAULT (newid()) FOR [UpdateUserId]
GO
ALTER TABLE [dbo].[VisitStage] ADD  DEFAULT (getdate()) FOR [CreateTime]
GO
ALTER TABLE [dbo].[VisitStage] ADD  DEFAULT ('') FOR [BlindName]
GO
ALTER TABLE [dbo].[VisitTask] ADD  DEFAULT ((0)) FOR [TaskAllocationState]
GO
ALTER TABLE [dbo].[VisitTask] ADD  DEFAULT ((0)) FOR [ReadingTaskState]
GO
ALTER TABLE [dbo].[VisitTask] ADD  DEFAULT ((0)) FOR [IsJudgeTaskReturn]
GO
ALTER TABLE [dbo].[VisitTask] ADD  DEFAULT ((0)) FOR [TaskState]
GO
ALTER TABLE [dbo].[VisitTask] ADD  DEFAULT ((0)) FOR [IsReReadingCreate]
GO
ALTER TABLE [dbo].[VisitTask] ADD  DEFAULT ((0)) FOR [ReReadingApplyState]
GO
ALTER TABLE [dbo].[VisitTask] ADD  DEFAULT ((0)) FOR [IsAnalysisCreate]
GO
ALTER TABLE [dbo].[VisitTask] ADD  DEFAULT ((0)) FOR [VisitTaskNum]
GO
ALTER TABLE [dbo].[VisitTask] ADD  DEFAULT ('') FOR [BlindSubjectCode]
GO
ALTER TABLE [dbo].[VisitTask] ADD  DEFAULT ('') FOR [BlindTrialSiteCode]
GO
ALTER TABLE [dbo].[VisitTask] ADD  DEFAULT ((0)) FOR [IsPMSetBack]
GO
ALTER TABLE [dbo].[VisitTask] ADD  DEFAULT ((0)) FOR [IsReadClinicalData]
GO
ALTER TABLE [dbo].[VisitTask] ADD  DEFAULT ((0)) FOR [IsClinicalDataSign]
GO
ALTER TABLE [dbo].[VisitTask] ADD  DEFAULT ((0)) FOR [IsNeedClinicalDataSign]
GO
ALTER TABLE [dbo].[VisitTask] ADD  DEFAULT ((0)) FOR [IsFrontTaskNeedSignButNotSign]
GO
ALTER TABLE [dbo].[VisitTask] ADD  DEFAULT ('') FOR [TaskUrgentRemake]
GO
ALTER TABLE [dbo].[VisitTask] ADD  DEFAULT ((1)) FOR [IsCanEditUrgentState]
GO
ALTER TABLE [dbo].[VisitTaskReReading] ADD  DEFAULT ('') FOR [RequestReReadingReason]
GO
ALTER TABLE [dbo].[VisitTaskReReading] ADD  DEFAULT ((0)) FOR [RequestReReadingResultEnum]
GO
ALTER TABLE [dbo].[VisitTaskReReading] ADD  DEFAULT ((0)) FOR [RequestReReadingType]
GO
ALTER TABLE [dbo].[VisitTaskReReading] ADD  DEFAULT ('') FOR [RequestReReadingRejectReason]
GO
ALTER TABLE [dbo].[VisitTaskReReading] ADD  DEFAULT ((0)) FOR [IsCopyOrigenalForms]
GO
ALTER TABLE [dbo].[VisitTaskReReading] ADD  DEFAULT ((0)) FOR [IsCopyFollowForms]
GO
ALTER TABLE [dbo].[VolumeReward] ADD  DEFAULT (newid()) FOR [Id]
GO
/****** Object:  StoredProcedure [dbo].[GetDictionarEnum]    Script Date: 2023/6/21 10:29:22 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[GetDictionarEnum]
@Code nvarchar(200)
as
declare  @print nvarchar(4000)=''
set @print=' /// <summary>
    /// '+ (select top 1  Description  from  dictionary where code=@Code) +'
    /// </summary>
	  public enum '+@Code+'
    {'set @print+=STUFF((SELECT ',' + '

/// <summary>
        /// '+ValueCN+'
        /// </summary>
        '+[Value]+' = '+ CONVERT(nvarchar(150),Code)  FROM  dictionary where ParentId in (select  id  from  dictionary where code=@Code)  order by code FOR XML PATH('')),1,1,'')+'
		';
 set @print+=' }';
set @print=REPLACE(@print,'&lt;','<') set @print=REPLACE(@print,'&#x0D;','')set @print=REPLACE(@print,'&gt;','>')
 print @print;
GO
/****** Object:  StoredProcedure [dbo].[procGetTableColumn]    Script Date: 2023/6/21 10:29:22 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[procGetTableColumn]
(
--hwt 2022-04-27
@TableName Nvarchar(200)
)
as
begin
    SELECT Name   = a.name, Remake   = isnull(g.[value],'')  FROM syscolumns a left join  systypes b on  a.xusertype=b.xusertype inner join   sysobjects d  on  a.id=d.id  and d.xtype = 'U' and  d.name<>'dtproperties' left join   syscomments e   on   a.cdefault=e.id left join  sys.extended_properties   g  on  a.id=G.major_id and a.colid=g.minor_id left join sys.extended_properties f on  d.id=f.major_id and f.minor_id=0 where d.name=@TableName  order by   a.id,a.colorder;
end
GO
/****** Object:  StoredProcedure [dbo].[procGetTableList]    Script Date: 2023/6/21 10:29:22 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[procGetTableList]
--hwt 2022-04-17
as
begin
    select   CASE WHEN A.COLORDER = 1 THEN D.NAME ELSE '' END Name,  CASE WHEN A.COLORDER = 1 THEN  CONVERT(varchar(200),ISNULL(F.VALUE,''))  ELSE '' END Remake  FROM SYSCOLUMNS A  INNER JOIN SYSOBJECTS D  ON  A.ID = D.ID  AND D.XTYPE = 'U' AND D.NAME <> 'DTPROPERTIES' LEFT JOIN  sys.extended_properties F  ON  D.ID = F.major_id AND F.minor_id = 0 where a.colorder = 1 ORDER BY D.NAME,  A.ID,A.COLORDER
end
GO
/****** Object:  StoredProcedure [dbo].[sp_alterdiagram]    Script Date: 2023/6/21 10:29:22 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[sp_alterdiagram]
	(
		@diagramname 	sysname,
		@owner_id	int	= null,
		@version 	int,
		@definition 	varbinary(max)
	)
	WITH EXECUTE AS 'dbo'
	AS
	BEGIN
		set nocount on
	
		declare @theId 			int
		declare @retval 		int
		declare @IsDbo 			int
		
		declare @UIDFound 		int
		declare @DiagId			int
		declare @ShouldChangeUID	int
	
		if(@diagramname is null)
		begin
			RAISERROR ('Invalid ARG', 16, 1)
			return -1
		end
	
		execute as caller;
		select @theId = DATABASE_PRINCIPAL_ID();	 
		select @IsDbo = IS_MEMBER(N'db_owner'); 
		if(@owner_id is null)
			select @owner_id = @theId;
		revert;
	
		select @ShouldChangeUID = 0
		select @DiagId = diagram_id, @UIDFound = principal_id from dbo.sysdiagrams where principal_id = @owner_id and name = @diagramname 
		
		if(@DiagId IS NULL or (@IsDbo = 0 and @theId <> @UIDFound))
		begin
			RAISERROR ('Diagram does not exist or you do not have permission.', 16, 1);
			return -3
		end
	
		if(@IsDbo <> 0)
		begin
			if(@UIDFound is null or USER_NAME(@UIDFound) is null) -- invalid principal_id
			begin
				select @ShouldChangeUID = 1 ;
			end
		end

		-- update dds data			
		update dbo.sysdiagrams set definition = @definition where diagram_id = @DiagId ;

		-- change owner
		if(@ShouldChangeUID = 1)
			update dbo.sysdiagrams set principal_id = @theId where diagram_id = @DiagId ;

		-- update dds version
		if(@version is not null)
			update dbo.sysdiagrams set version = @version where diagram_id = @DiagId ;

		return 0
	END
GO
/****** Object:  StoredProcedure [dbo].[sp_creatediagram]    Script Date: 2023/6/21 10:29:22 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[sp_creatediagram]
	(
		@diagramname 	sysname,
		@owner_id		int	= null, 	
		@version 		int,
		@definition 	varbinary(max)
	)
	WITH EXECUTE AS 'dbo'
	AS
	BEGIN
		set nocount on
	
		declare @theId int
		declare @retval int
		declare @IsDbo	int
		declare @userName sysname
		if(@version is null or @diagramname is null)
		begin
			RAISERROR (N'E_INVALIDARG', 16, 1);
			return -1
		end
	
		execute as caller;
		select @theId = DATABASE_PRINCIPAL_ID(); 
		select @IsDbo = IS_MEMBER(N'db_owner');
		revert; 
		
		if @owner_id is null
		begin
			select @owner_id = @theId;
		end
		else
		begin
			if @theId <> @owner_id
			begin
				if @IsDbo = 0
				begin
					RAISERROR (N'E_INVALIDARG', 16, 1);
					return -1
				end
				select @theId = @owner_id
			end
		end
		-- next 2 line only for test, will be removed after define name unique
		if EXISTS(select diagram_id from dbo.sysdiagrams where principal_id = @theId and name = @diagramname)
		begin
			RAISERROR ('The name is already used.', 16, 1);
			return -2
		end
	
		insert into dbo.sysdiagrams(name, principal_id , version, definition)
				VALUES(@diagramname, @theId, @version, @definition) ;
		
		select @retval = @@IDENTITY 
		return @retval
	END
GO
/****** Object:  StoredProcedure [dbo].[sp_dropdiagram]    Script Date: 2023/6/21 10:29:22 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[sp_dropdiagram]
	(
		@diagramname 	sysname,
		@owner_id	int	= null
	)
	WITH EXECUTE AS 'dbo'
	AS
	BEGIN
		set nocount on
		declare @theId 			int
		declare @IsDbo 			int
		
		declare @UIDFound 		int
		declare @DiagId			int
	
		if(@diagramname is null)
		begin
			RAISERROR ('Invalid value', 16, 1);
			return -1
		end
	
		EXECUTE AS CALLER;
		select @theId = DATABASE_PRINCIPAL_ID();
		select @IsDbo = IS_MEMBER(N'db_owner'); 
		if(@owner_id is null)
			select @owner_id = @theId;
		REVERT; 
		
		select @DiagId = diagram_id, @UIDFound = principal_id from dbo.sysdiagrams where principal_id = @owner_id and name = @diagramname 
		if(@DiagId IS NULL or (@IsDbo = 0 and @UIDFound <> @theId))
		begin
			RAISERROR ('Diagram does not exist or you do not have permission.', 16, 1)
			return -3
		end
	
		delete from dbo.sysdiagrams where diagram_id = @DiagId;
	
		return 0;
	END
GO
/****** Object:  StoredProcedure [dbo].[sp_helpdiagramdefinition]    Script Date: 2023/6/21 10:29:22 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[sp_helpdiagramdefinition]
	(
		@diagramname 	sysname,
		@owner_id	int	= null 		
	)
	WITH EXECUTE AS N'dbo'
	AS
	BEGIN
		set nocount on

		declare @theId 		int
		declare @IsDbo 		int
		declare @DiagId		int
		declare @UIDFound	int
	
		if(@diagramname is null)
		begin
			RAISERROR (N'E_INVALIDARG', 16, 1);
			return -1
		end
	
		execute as caller;
		select @theId = DATABASE_PRINCIPAL_ID();
		select @IsDbo = IS_MEMBER(N'db_owner');
		if(@owner_id is null)
			select @owner_id = @theId;
		revert; 
	
		select @DiagId = diagram_id, @UIDFound = principal_id from dbo.sysdiagrams where principal_id = @owner_id and name = @diagramname;
		if(@DiagId IS NULL or (@IsDbo = 0 and @UIDFound <> @theId ))
		begin
			RAISERROR ('Diagram does not exist or you do not have permission.', 16, 1);
			return -3
		end

		select version, definition FROM dbo.sysdiagrams where diagram_id = @DiagId ; 
		return 0
	END
GO
/****** Object:  StoredProcedure [dbo].[sp_helpdiagrams]    Script Date: 2023/6/21 10:29:22 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[sp_helpdiagrams]
	(
		@diagramname sysname = NULL,
		@owner_id int = NULL
	)
	WITH EXECUTE AS N'dbo'
	AS
	BEGIN
		DECLARE @user sysname
		DECLARE @dboLogin bit
		EXECUTE AS CALLER;
			SET @user = USER_NAME();
			SET @dboLogin = CONVERT(bit,IS_MEMBER('db_owner'));
		REVERT;
		SELECT
			[Database] = DB_NAME(),
			[Name] = name,
			[ID] = diagram_id,
			[Owner] = USER_NAME(principal_id),
			[OwnerID] = principal_id
		FROM
			sysdiagrams
		WHERE
			(@dboLogin = 1 OR USER_NAME(principal_id) = @user) AND
			(@diagramname IS NULL OR name = @diagramname) AND
			(@owner_id IS NULL OR principal_id = @owner_id)
		ORDER BY
			4, 5, 1
	END
GO
/****** Object:  StoredProcedure [dbo].[sp_renamediagram]    Script Date: 2023/6/21 10:29:22 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[sp_renamediagram]
	(
		@diagramname 		sysname,
		@owner_id		int	= null,
		@new_diagramname	sysname
	
	)
	WITH EXECUTE AS 'dbo'
	AS
	BEGIN
		set nocount on
		declare @theId 			int
		declare @IsDbo 			int
		
		declare @UIDFound 		int
		declare @DiagId			int
		declare @DiagIdTarg		int
		declare @u_name			sysname
		if((@diagramname is null) or (@new_diagramname is null))
		begin
			RAISERROR ('Invalid value', 16, 1);
			return -1
		end
	
		EXECUTE AS CALLER;
		select @theId = DATABASE_PRINCIPAL_ID();
		select @IsDbo = IS_MEMBER(N'db_owner'); 
		if(@owner_id is null)
			select @owner_id = @theId;
		REVERT;
	
		select @u_name = USER_NAME(@owner_id)
	
		select @DiagId = diagram_id, @UIDFound = principal_id from dbo.sysdiagrams where principal_id = @owner_id and name = @diagramname 
		if(@DiagId IS NULL or (@IsDbo = 0 and @UIDFound <> @theId))
		begin
			RAISERROR ('Diagram does not exist or you do not have permission.', 16, 1)
			return -3
		end
	
		-- if((@u_name is not null) and (@new_diagramname = @diagramname))	-- nothing will change
		--	return 0;
	
		if(@u_name is null)
			select @DiagIdTarg = diagram_id from dbo.sysdiagrams where principal_id = @theId and name = @new_diagramname
		else
			select @DiagIdTarg = diagram_id from dbo.sysdiagrams where principal_id = @owner_id and name = @new_diagramname
	
		if((@DiagIdTarg is not null) and  @DiagId <> @DiagIdTarg)
		begin
			RAISERROR ('The name is already used.', 16, 1);
			return -2
		end		
	
		if(@u_name is null)
			update dbo.sysdiagrams set [name] = @new_diagramname, principal_id = @theId where diagram_id = @DiagId
		else
			update dbo.sysdiagrams set [name] = @new_diagramname where diagram_id = @DiagId
		return 0
	END
GO
/****** Object:  StoredProcedure [dbo].[sp_upgraddiagrams]    Script Date: 2023/6/21 10:29:22 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[sp_upgraddiagrams]
	AS
	BEGIN
		IF OBJECT_ID(N'dbo.sysdiagrams') IS NOT NULL
			return 0;
	
		CREATE TABLE dbo.sysdiagrams
		(
			name sysname NOT NULL,
			principal_id int NOT NULL,	-- we may change it to varbinary(85)
			diagram_id int PRIMARY KEY IDENTITY,
			version int,
	
			definition varbinary(max)
			CONSTRAINT UK_principal_name UNIQUE
			(
				principal_id,
				name
			)
		);


		/* Add this if we need to have some form of extended properties for diagrams */
		/*
		IF OBJECT_ID(N'dbo.sysdiagram_properties') IS NULL
		BEGIN
			CREATE TABLE dbo.sysdiagram_properties
			(
				diagram_id int,
				name sysname,
				value varbinary(max) NOT NULL
			)
		END
		*/

		IF OBJECT_ID(N'dbo.dtproperties') IS NOT NULL
		begin
			insert into dbo.sysdiagrams
			(
				[name],
				[principal_id],
				[version],
				[definition]
			)
			select	 
				convert(sysname, dgnm.[uvalue]),
				DATABASE_PRINCIPAL_ID(N'dbo'),			-- will change to the sid of sa
				0,							-- zero for old format, dgdef.[version],
				dgdef.[lvalue]
			from dbo.[dtproperties] dgnm
				inner join dbo.[dtproperties] dggd on dggd.[property] = 'DtgSchemaGUID' and dggd.[objectid] = dgnm.[objectid]	
				inner join dbo.[dtproperties] dgdef on dgdef.[property] = 'DtgSchemaDATA' and dgdef.[objectid] = dgnm.[objectid]
				
			where dgnm.[property] = 'DtgSchemaNAME' and dggd.[uvalue] like N'_EA3E6268-D998-11CE-9454-00AA00A3F36E_' 
			return 2;
		end
		return 1;
	END
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'前端使用' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'CheckChallengeDialog', @level2type=N'COLUMN',@level2name=N'IsCRCNeedReply'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'删除人' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'CommonDocument', @level2type=N'COLUMN',@level2name=N'DeleteUserId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'一致性核查文件' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ConsistencyCheckFile', @level2type=N'COLUMN',@level2name=N'Id'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'文件名称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ConsistencyCheckFile', @level2type=N'COLUMN',@level2name=N'FileName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'文件路径' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ConsistencyCheckFile', @level2type=N'COLUMN',@level2name=N'FilePath'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'相对路径' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ConsistencyCheckFile', @level2type=N'COLUMN',@level2name=N'RelativePath'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'创建人' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ConsistencyCheckFile', @level2type=N'COLUMN',@level2name=N'CreateUserId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'创建时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ConsistencyCheckFile', @level2type=N'COLUMN',@level2name=N'CreateTime'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'项目ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ConsistencyCheckFile', @level2type=N'COLUMN',@level2name=N'TrialId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'创建人姓名' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'DataInspection', @level2type=N'COLUMN',@level2name=N'CreateUserName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'父ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'DataInspection', @level2type=N'COLUMN',@level2name=N'ParentId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'标识' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'DataInspection', @level2type=N'COLUMN',@level2name=N'Identification'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否是前端添加' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'DataInspection', @level2type=N'COLUMN',@level2name=N'IsFrontAdd'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'上一条json' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'DataInspection', @level2type=N'COLUMN',@level2name=N'LastJsonDetail'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'访视计划ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'DataInspection', @level2type=N'COLUMN',@level2name=N'VisitStageId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'通用ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'DataInspection', @level2type=N'COLUMN',@level2name=N'GeneralId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'子类' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'DataInspection', @level2type=N'COLUMN',@level2name=N'ChildrenTypeId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'角色名称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'DataInspection', @level2type=N'COLUMN',@level2name=N'RoleName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'批次Id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'DataInspection', @level2type=N'COLUMN',@level2name=N'BatchId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'影像Instance表
' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'DicomInstance'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'删除人' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'DicomSeries', @level2type=N'COLUMN',@level2name=N'DeleteUserId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'影像Series表' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'DicomSeries'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'上传  备注' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'DicomStudy', @level2type=N'COLUMN',@level2name=N'Comment'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'qa 不通过 备注' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'DicomStudy', @level2type=N'COLUMN',@level2name=N'QAComment'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'废弃 截止日期' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'DicomStudy', @level2type=N'COLUMN',@level2name=N'DeadlineTime'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'删除人' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'DicomStudy', @level2type=N'COLUMN',@level2name=N'DeleteUserId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'DicomTag.StudyID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'DicomStudy', @level2type=N'COLUMN',@level2name=N'StudyId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'上传时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'DicomStudy', @level2type=N'COLUMN',@level2name=N'UploadedTime'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'序列Id 避免内存移动' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'DicomStudy', @level2type=N'COLUMN',@level2name=N'SeqId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'影像检查表' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'DicomStudy'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'系统字典表' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Dictionary'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'停机时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Enroll', @level2type=N'COLUMN',@level2name=N'Downtime'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'裁定48小时' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Enroll', @level2type=N'COLUMN',@level2name=N'Adjudication48H'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'复练' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Enroll', @level2type=N'COLUMN',@level2name=N'RefresherTraining'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'裁定24小时' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Enroll', @level2type=N'COLUMN',@level2name=N'Adjudication24H'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'时间点24小时' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Enroll', @level2type=N'COLUMN',@level2name=N'Timepoint24H'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'裁定' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Enroll', @level2type=N'COLUMN',@level2name=N'Adjudication'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'价格' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Enroll', @level2type=N'COLUMN',@level2name=N'AdjustmentMultiple'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'时间点' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Enroll', @level2type=N'COLUMN',@level2name=N'Timepoint'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'总体' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Enroll', @level2type=N'COLUMN',@level2name=N'Global'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'时间点48小时' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Enroll', @level2type=N'COLUMN',@level2name=N'Timepoint48H'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'0代表裁判和Tp 都可以  1、代表Tp  2 代表裁判' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Enroll', @level2type=N'COLUMN',@level2name=N'ReviewerReadingType'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'培训' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Enroll', @level2type=N'COLUMN',@level2name=N'Training'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否加入计划' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'FrontAuditConfig', @level2type=N'COLUMN',@level2name=N'IsJoinPlan'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'枚举字典Code' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'FrontAuditConfig', @level2type=N'COLUMN',@level2name=N'DictionaryCode'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否有签名' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'FrontAuditConfig', @level2type=N'COLUMN',@level2name=N'IsHaveSign'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'外键Value' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'FrontAuditConfig', @level2type=N'COLUMN',@level2name=N'ForeignKeyValue'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否有原因' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'FrontAuditConfig', @level2type=N'COLUMN',@level2name=N'IsHaveReason'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'数据类型' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'FrontAuditConfig', @level2type=N'COLUMN',@level2name=N'DataType'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'标识' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'FrontAuditConfig', @level2type=N'COLUMN',@level2name=N'Identification'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'外键Text' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'FrontAuditConfig', @level2type=N'COLUMN',@level2name=N'ForeignKeyText'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否完成' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'FrontAuditConfig', @level2type=N'COLUMN',@level2name=N'IsFinish'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'枚举字典Type' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'FrontAuditConfig', @level2type=N'COLUMN',@level2name=N'DictionaryType'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'外键表' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'FrontAuditConfig', @level2type=N'COLUMN',@level2name=N'ForeignKeyTableName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'接口名' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'FrontAuditConfig', @level2type=N'COLUMN',@level2name=N'InterfaceName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'日期格式' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'FrontAuditConfig', @level2type=N'COLUMN',@level2name=N'DateType'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'子数据Value' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'FrontAuditConfig', @level2type=N'COLUMN',@level2name=N'ChildDataValue'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'子数据lable' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'FrontAuditConfig', @level2type=N'COLUMN',@level2name=N'ChildDataLabel'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'字典名称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'FrontAuditConfig', @level2type=N'COLUMN',@level2name=N'DictionaryKey'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否为特殊类型' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'FrontAuditConfig', @level2type=N'COLUMN',@level2name=N'IsSpecialType'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'菜单表' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Menu'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'器官表主键' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'OrganInfo', @level2type=N'COLUMN',@level2name=N'Id'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'部位' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'OrganInfo', @level2type=N'COLUMN',@level2name=N'Part'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'位置' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'OrganInfo', @level2type=N'COLUMN',@level2name=N'TULAT'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'主键' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'OrganTrialInfo', @level2type=N'COLUMN',@level2name=N'Id'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'器官Id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'OrganTrialInfo', @level2type=N'COLUMN',@level2name=N'OrganInfoId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'项目Id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'OrganTrialInfo', @level2type=N'COLUMN',@level2name=N'TrialId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'临床数据类型Id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'PreviousHistory', @level2type=N'COLUMN',@level2name=N'ClinicalDataTrialSetId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'临床数据类型Id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'PreviousOther', @level2type=N'COLUMN',@level2name=N'ClinicalDataTrialSetId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'临床数据类型Id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'PreviousSurgery', @level2type=N'COLUMN',@level2name=N'ClinicalDataTrialSetId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'记录重传人' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'QCChallenge', @level2type=N'COLUMN',@level2name=N'ReUploader'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'行动事项' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'QCChallenge', @level2type=N'COLUMN',@level2name=N'ActionContent'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'质疑内容' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'QCChallenge', @level2type=N'COLUMN',@level2name=N'Content'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用于双审的时候 区分 第一个人和第二个人的数据' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'QCChallenge', @level2type=N'COLUMN',@level2name=N'CurrentQCEnum'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'额外补充' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'QCChallenge', @level2type=N'COLUMN',@level2name=N'Note'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'下拉框、文本、单选、多选' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'QCQuestion', @level2type=N'COLUMN',@level2name=N'Type'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'阅片计划ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ReadingPeriodPlan', @level2type=N'COLUMN',@level2name=N'Id'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'阅片期配置ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ReadingPeriodPlan', @level2type=N'COLUMN',@level2name=N'ReadingPeriodSetId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'访视Id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ReadingPeriodPlan', @level2type=N'COLUMN',@level2name=N'SubjectVisitId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'创建时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ReadingPeriodPlan', @level2type=N'COLUMN',@level2name=N'CreateTime'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'创建人' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ReadingPeriodPlan', @level2type=N'COLUMN',@level2name=N'CreateUserId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'阅片期ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ReadingPeriodSite', @level2type=N'COLUMN',@level2name=N'Id'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'阅片期配置ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ReadingPeriodSite', @level2type=N'COLUMN',@level2name=N'ReadingPeriodSetId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'中心ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ReadingPeriodSite', @level2type=N'COLUMN',@level2name=N'SiteId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'创建时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ReadingPeriodSite', @level2type=N'COLUMN',@level2name=N'CreateTime'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'创建人' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ReadingPeriodSite', @level2type=N'COLUMN',@level2name=N'CreateUserId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'阅片问题表' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ReadingQuestionTrial'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'病灶问题答案表' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ReadingTableAnswerRowInfo'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'主键' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ReadingTableQuestionAnswer', @level2type=N'COLUMN',@level2name=N'Id'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'问题Id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ReadingTableQuestionAnswer', @level2type=N'COLUMN',@level2name=N'QuestionId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'任务Id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ReadingTableQuestionAnswer', @level2type=N'COLUMN',@level2name=N'VisitTaskId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'项目Id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ReadingTableQuestionAnswer', @level2type=N'COLUMN',@level2name=N'TrialId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'行号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ReadingTableQuestionAnswer', @level2type=N'COLUMN',@level2name=N'RowIndex'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'答案' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ReadingTableQuestionAnswer', @level2type=N'COLUMN',@level2name=N'Answer'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'创建时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ReadingTableQuestionAnswer', @level2type=N'COLUMN',@level2name=N'CreateTime'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'创建人' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ReadingTableQuestionAnswer', @level2type=N'COLUMN',@level2name=N'CreateUserId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'病灶问题表' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ReadingTableQuestionTrial'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'阅片问题答案表' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ReadingTaskQuestionAnswer'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'阅片模块ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ReadModule', @level2type=N'COLUMN',@level2name=N'Id'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'受试者ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ReadModule', @level2type=N'COLUMN',@level2name=N'SubjectId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'模块类型' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ReadModule', @level2type=N'COLUMN',@level2name=N'ModuleType'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'模块名称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ReadModule', @level2type=N'COLUMN',@level2name=N'ModuleName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否加急' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ReadModule', @level2type=N'COLUMN',@level2name=N'IsUrgent'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'访视ID' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ReadModule', @level2type=N'COLUMN',@level2name=N'SubjectVisitId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'状态' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ReadModule', @level2type=N'COLUMN',@level2name=N'Status'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'创建时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ReadModule', @level2type=N'COLUMN',@level2name=N'CreateTime'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'创建人' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ReadModule', @level2type=N'COLUMN',@level2name=N'CreateUserId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'暂时未用' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Site', @level2type=N'COLUMN',@level2name=N'State'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Dicom/非Dicom' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'StudyMonitor', @level2type=N'COLUMN',@level2name=N'StudyId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'废弃' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Subject', @level2type=N'COLUMN',@level2name=N'StudyCount'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'受试者名称缩写' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Subject', @level2type=N'COLUMN',@level2name=N'ShortName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'出组原因' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Subject', @level2type=N'COLUMN',@level2name=N'Reason'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'废弃' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Subject', @level2type=N'COLUMN',@level2name=N'Modalities'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'知情同意书签署日期' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Subject', @level2type=N'COLUMN',@level2name=N'SignDate'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N' 最新受试者访视' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Subject', @level2type=N'COLUMN',@level2name=N'LatestSubjectVisitId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'删除人' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Subject', @level2type=N'COLUMN',@level2name=N'DeleteUserId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'废弃' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Subject', @level2type=N'COLUMN',@level2name=N'IsAssignDoctorUser'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'患者表' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Subject'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'患者医生阅片分配关系表' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'SubjectUser'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'复审时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'SubjectVisit', @level2type=N'COLUMN',@level2name=N'ReviewAuditTime'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否领取' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'SubjectVisit', @level2type=N'COLUMN',@level2name=N'IsTake'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否紧急' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'SubjectVisit', @level2type=N'COLUMN',@level2name=N'IsUrgent'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否最终访视' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'SubjectVisit', @level2type=N'COLUMN',@level2name=N'IsFinalVisit'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'起始日期' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'SubjectVisit', @level2type=N'COLUMN',@level2name=N'SVSTDTC'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'审核状态（初审、复审等中间状态）' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'SubjectVisit', @level2type=N'COLUMN',@level2name=N'AuditState'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'一致性核查时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'SubjectVisit', @level2type=N'COLUMN',@level2name=N'CheckTime'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否是计划内' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'SubjectVisit', @level2type=N'COLUMN',@level2name=N'InPlan'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'废弃' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'SubjectVisit', @level2type=N'COLUMN',@level2name=N'ClinicalDataSignUserId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'一致性核查核查状态' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'SubjectVisit', @level2type=N'COLUMN',@level2name=N'CheckState'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'提交状态' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'SubjectVisit', @level2type=N'COLUMN',@level2name=N'SubmitState'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'初审时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'SubjectVisit', @level2type=N'COLUMN',@level2name=N'PreliminaryAuditTime'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'提交时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'SubjectVisit', @level2type=N'COLUMN',@level2name=N'SubmitTime'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'通过原因' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'SubjectVisit', @level2type=N'COLUMN',@level2name=N'ManualPassReason'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'核查质疑状态' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'SubjectVisit', @level2type=N'COLUMN',@level2name=N'CheckChallengeState'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'质疑状态' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'SubjectVisit', @level2type=N'COLUMN',@level2name=N'ChallengeState'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'一致性核查核查结果' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'SubjectVisit', @level2type=N'COLUMN',@level2name=N'CheckResult'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'访视是否执行' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'SubjectVisit', @level2type=N'COLUMN',@level2name=N'VisitExecuted'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'废弃' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'SubjectVisit', @level2type=N'COLUMN',@level2name=N'ClinicalDataSignTime'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'关闭一致性质疑原因' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'SubjectVisit', @level2type=N'COLUMN',@level2name=N'CloseTheReason'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'当前QC领取人过期时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'SubjectVisit', @level2type=N'COLUMN',@level2name=N'CurrentActionUserExpireTime'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'PD进展' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'SubjectVisit', @level2type=N'COLUMN',@level2name=N'PDState'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'删除人' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'SubjectVisit', @level2type=N'COLUMN',@level2name=N'DeleteUserId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'计划外访视描述' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'SubjectVisit', @level2type=N'COLUMN',@level2name=N'SVUPDES'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'未申请回退\申请回退\同意回退' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'SubjectVisit', @level2type=N'COLUMN',@level2name=N'RequestBackState'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'审核人' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'SubjectVisit', @level2type=N'COLUMN',@level2name=N'Auditor'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'患者批次表' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'SubjectVisit'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'匿名化配置表' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'SystemAnonymization'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否废除' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'SystemDocConfirmedUser', @level2type=N'COLUMN',@level2name=N'IsDeleted'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'删除人' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'SystemDocument', @level2type=N'COLUMN',@level2name=N'DeleteUserId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'计划比率  ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'TaskAllocationRule', @level2type=N'COLUMN',@level2name=N'PlanReadingRatio'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'入组表Id   可以去掉 TrialId  DoctorUserId' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'TaskAllocationRule', @level2type=N'COLUMN',@level2name=N'EnrollId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'对影响任务进行的操作' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'TaskInfluence', @level2type=N'COLUMN',@level2name=N'OptType'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N' 是否 提醒受试者编号规则  ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Trial', @level2type=N'COLUMN',@level2name=N'IsNoticeSubjectCodeRule'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'删除人' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Trial', @level2type=N'COLUMN',@level2name=N'DeleteUserId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否审核 临床信息' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Trial', @level2type=N'COLUMN',@level2name=N'IsCRAAuditClinicalInformation'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'状态枚举，入组那块' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Trial', @level2type=N'COLUMN',@level2name=N'TrialEnrollStatus'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'对应文档名称 废弃' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Trial', @level2type=N'COLUMN',@level2name=N'MessageFromClientName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'文档存储路径  废弃' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Trial', @level2type=N'COLUMN',@level2name=N'ReviewProtocol'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否 影像导出' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Trial', @level2type=N'COLUMN',@level2name=N'IsImageExport'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否有 入组性确认' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Trial', @level2type=N'COLUMN',@level2name=N'IsEnrollementQualificationConfirm'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'影像质控签名' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Trial', @level2type=N'COLUMN',@level2name=N'ImageQCSignText'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'受试者编号具体规则' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Trial', @level2type=N'COLUMN',@level2name=N'SubjectCodeRule'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'项目启动  暂停 状态字符串' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Trial', @level2type=N'COLUMN',@level2name=N'TrialStatusStr'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'访视计划是否已经确认' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Trial', @level2type=N'COLUMN',@level2name=N'VisitPlanConfirmed'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'单双重' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Trial', @level2type=N'COLUMN',@level2name=N'ReviewModeId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'出组后计划外访视名称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Trial', @level2type=N'COLUMN',@level2name=N'OutEnrollmentVisitName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'非dicom 编辑modality' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Trial', @level2type=N'COLUMN',@level2name=N'Modalitys'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'跨项目复制' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Trial', @level2type=N'COLUMN',@level2name=N'IsImageReplicationAcrossTrial'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否 有基准时间（首次给药时间）' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Trial', @level2type=N'COLUMN',@level2name=N'IsHaveFirstGiveMedicineDate'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'编码' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Trial', @level2type=N'COLUMN',@level2name=N'TrialCode'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'质疑默认超时时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Trial', @level2type=N'COLUMN',@level2name=N'ChangeDefalutDays'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'病因' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Trial', @level2type=N'COLUMN',@level2name=N'Indication'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'加急' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Trial', @level2type=N'COLUMN',@level2name=N'Expedited'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'项目类型 1 正式项目、0 非正式项目 ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Trial', @level2type=N'COLUMN',@level2name=N'TrialType'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'文档确认签名' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Trial', @level2type=N'COLUMN',@level2name=N'DocumentConfirmSignText'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否 验证拍片日期  ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Trial', @level2type=N'COLUMN',@level2name=N'IsVerifyVisitImageDate'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'废弃' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Trial', @level2type=N'COLUMN',@level2name=N'IsTrialStart'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'文档存储路径  废弃' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Trial', @level2type=N'COLUMN',@level2name=N'MessageFromClient'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'QC流程  0 不审，1 单审，2双审  ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Trial', @level2type=N'COLUMN',@level2name=N'QCProcessEnum'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'QC质疑类型 用 | 分割' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Trial', @level2type=N'COLUMN',@level2name=N'ChallengeTypes'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否有  受试者年龄' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Trial', @level2type=N'COLUMN',@level2name=N'IsHaveSubjectAge'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'对应文档名称  废弃' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Trial', @level2type=N'COLUMN',@level2name=N'ReviewProtocolName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否 影像一致性核查' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Trial', @level2type=N'COLUMN',@level2name=N'IsImageConsistencyVerification'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'QC 编辑影像时 部位类型' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Trial', @level2type=N'COLUMN',@level2name=N'BodyPartTypes'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'0中国医生 1美国医生  2既有中国医生，也有美国医生' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Trial', @level2type=N'COLUMN',@level2name=N'AttendedReviewerType'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'临床信息传输 1：系统录入2：系统录入+PDF 0：无' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Trial', @level2type=N'COLUMN',@level2name=N'ClinicalInformationTransmissionEnum'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'项目完成时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Trial', @level2type=N'COLUMN',@level2name=N'TrialFinishTime'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'项目表' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Trial'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否废除' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'TrialDocConfirmedUser', @level2type=N'COLUMN',@level2name=N'IsDeleted'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'删除人' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'TrialDocument', @level2type=N'COLUMN',@level2name=N'DeleteUserId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'邀请状态' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'TrialExternalUser', @level2type=N'COLUMN',@level2name=N'InviteState'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否为新项目' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'TrialPaymentPrice ', @level2type=N'COLUMN',@level2name=N'IsNewTrial'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'下拉框、文本、单选、多选' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'TrialQCQuestion', @level2type=N'COLUMN',@level2name=N'Type'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否确认' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'TrialQCQuestion', @level2type=N'COLUMN',@level2name=N'IsConfirm'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'false代表没有价格' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'TrialRevenuesPriceVerification', @level2type=N'COLUMN',@level2name=N'Timepoint'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'删除人' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'TrialSite', @level2type=N'COLUMN',@level2name=N'DeleteUserId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'删除人' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'TrialSiteSurvey', @level2type=N'COLUMN',@level2name=N'DeleteUserId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'删除人' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'TrialSiteUser', @level2type=N'COLUMN',@level2name=N'DeleteUserId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'删除人' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'TrialUser', @level2type=N'COLUMN',@level2name=N'DeleteUserId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'项目参与人员表' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'TrialUser'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'主键' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'TumorAssessment', @level2type=N'COLUMN',@level2name=N'Id'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'靶病灶' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'TumorAssessment', @level2type=N'COLUMN',@level2name=N'TargetLesion'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'非靶病灶' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'TumorAssessment', @level2type=N'COLUMN',@level2name=N'NonTargetLesions'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'新病灶' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'TumorAssessment', @level2type=N'COLUMN',@level2name=N'NewLesion'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'整体疗效' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'TumorAssessment', @level2type=N'COLUMN',@level2name=N'OverallEfficacy'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用户表
' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'User'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'UserTypeId  和之前字典表对应Id一直，免除Id数据维护' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'UserType', @level2type=N'COLUMN',@level2name=N'Id'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用户类型名称简写' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'UserType', @level2type=N'COLUMN',@level2name=N'UserTypeShortName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'此数据固定，不能更改，和代码耦合' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'UserType', @level2type=N'COLUMN',@level2name=N'UserTypeEnum'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'项目/医生/管理员' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'UserType', @level2type=N'COLUMN',@level2name=N'Type'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用于前端界面下拉框展示排序' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'UserType', @level2type=N'COLUMN',@level2name=N'Order'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'名称、描述可以更改' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'UserType', @level2type=N'COLUMN',@level2name=N'UserTypeName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否是内部用户类型' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'UserType', @level2type=N'COLUMN',@level2name=N'IsInternal'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用户类型（角色表）' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'UserType'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用户类型所属组表' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'UserTypeGroup'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'用户类型菜单关系表' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'UserTypeMenu'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'删除人' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'VisitStage', @level2type=N'COLUMN',@level2name=N'DeleteUserId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'0 代表 单重   否则就是 任务 1 任务  2 ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'VisitTask', @level2type=N'COLUMN',@level2name=N'ArmEnum'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'裁判任务Id  自关联' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'VisitTask', @level2type=N'COLUMN',@level2name=N'JudgeVisitTaskId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'待阅片  阅片中 已签名' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'VisitTask', @level2type=N'COLUMN',@level2name=N'ReadingTaskState'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'任务产生的访视Id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'VisitTask', @level2type=N'COLUMN',@level2name=N'SourceSubjectVisitId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'任务产生的读片模块Id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'VisitTask', @level2type=N'COLUMN',@level2name=N'SouceReadModuleId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'裁判任务回退 废弃' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'VisitTask', @level2type=N'COLUMN',@level2name=N'IsJudgeTaskReturn'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'随访任务号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'VisitTask', @level2type=N'COLUMN',@level2name=N'VisitTaskNum'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'标识 是哪个医生产生（自身一致性分析产生，还是组内产生）' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'VisitTask', @level2type=N'COLUMN',@level2name=N'TaskConsistentRuleId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'全局的任务这个值才有意义' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'VisitTask', @level2type=N'COLUMN',@level2name=N'IsGlobalHaveUpdate'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'IR 是否阅读临床数据' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'VisitTask', @level2type=N'COLUMN',@level2name=N'IsReadClinicalData'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否签名完 配置的临床数据' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'VisitTask', @level2type=N'COLUMN',@level2name=N'IsClinicalDataSign'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否需要临床数据签名(根据项目配置)' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'VisitTask', @level2type=N'COLUMN',@level2name=N'IsNeedClinicalDataSign'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'前序任务需要签名 但是没有签名  （签名的时候维护该字段）' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'VisitTask', @level2type=N'COLUMN',@level2name=N'IsFrontTaskNeedSignButNotSign'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'阅片任务表' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'VisitTask'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'重阅原始任务Id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'VisitTaskReReading', @level2type=N'COLUMN',@level2name=N'OriginalReReadingTaskId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'请求重阅人' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'VisitTaskReReading', @level2type=N'COLUMN',@level2name=N'RequestReReadingUserId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'重阅确认人' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'VisitTaskReReading', @level2type=N'COLUMN',@level2name=N'RequestReReadingConfirmUserId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否复制之前任务表单数据' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'VisitTaskReReading', @level2type=N'COLUMN',@level2name=N'IsCopyOrigenalForms'
GO
USE [master]
GO
ALTER DATABASE [$(dbName)] SET  READ_WRITE 
GO
