USE [Clinica]
GO
/****** Object:  Table [Clinica].[Prestacion]    Script Date: 18-08-2025 21:40:49 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [Clinica].[Prestacion](
	[IdPrestacion] [int] IDENTITY(1,1) NOT NULL,
	[Descripcion] [varchar](256) NOT NULL,
	[CodigoInterno] [varchar](256) NOT NULL,
	[CodigoFonasa] [varchar](256) NOT NULL,
	[IdTipoPrestacion] [int] NOT NULL,
	[IndVigente] [tinyint] NOT NULL,
	[IndEliminado] [tinyint] NOT NULL,
	[IdTipoExamen] [int] NULL,
	[IdTipoTitulo] [int] NULL,
	[Orden] [int] NOT NULL,
	[ValorHospitalizacionParticularHabil] [int] NULL,
	[ValorHospitalizacionParticularInhabil] [int] NULL,
	[ValorHospitalizacionFonasaHabil] [int] NULL,
	[ValorHospitalizacionFonasaInhabil] [int] NULL,
	[ValorHospitalizacionIsapreHabil] [int] NULL,
	[ValorHospitalizacionIsapreInhabil] [int] NULL,
	[ValorUrgenciaParticularHabil] [int] NULL,
	[ValorUrgenciaParticularInhabil] [int] NULL,
	[ValorUrgenciaFonasaHabil] [int] NULL,
	[ValorUrgenciaFonasaInhabil] [int] NULL,
	[ValorUrgenciaIsapreHabil] [int] NULL,
	[ValorUrgenciaIsapreInhabil] [int] NULL,
	[ValorAmbulatorioParticularHabil] [int] NULL,
	[ValorAmbulatorioParticularInhabil] [int] NULL,
	[ValorAmbulatorioFonasaHabil] [int] NULL,
	[ValorAmbulatorioFonasaInhabil] [int] NULL,
	[ValorAmbulatorioIsapreHabil] [int] NULL,
	[ValorAmbulatorioIsapreInhabil] [int] NULL,
 CONSTRAINT [PK__Prestaci__63EE2834E6B9EC97] PRIMARY KEY CLUSTERED 
(
	[IdPrestacion] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
GO
ALTER TABLE [Clinica].[Prestacion] ADD  CONSTRAINT [DF__Prestacio__Descr__59C55456]  DEFAULT ('') FOR [Descripcion]
GO
ALTER TABLE [Clinica].[Prestacion] ADD  CONSTRAINT [DF_Prestacion_CodigoInterno]  DEFAULT ('') FOR [CodigoInterno]
GO
ALTER TABLE [Clinica].[Prestacion] ADD  CONSTRAINT [DF_Prestacion_CodigoFonasa]  DEFAULT ('') FOR [CodigoFonasa]
GO
ALTER TABLE [Clinica].[Prestacion] ADD  CONSTRAINT [DF__Prestacio__IndVi__5BAD9CC8]  DEFAULT ((1)) FOR [IndVigente]
GO
ALTER TABLE [Clinica].[Prestacion] ADD  CONSTRAINT [DF__Prestacio__IndEl__5CA1C101]  DEFAULT ((0)) FOR [IndEliminado]
GO
ALTER TABLE [Clinica].[Prestacion] ADD  CONSTRAINT [DF__Prestacio__Orden__15FA39EE]  DEFAULT ((0)) FOR [Orden]
GO
ALTER TABLE [Clinica].[Prestacion]  WITH CHECK ADD  CONSTRAINT [FK__Prestacio__IdTip__0D64F3ED] FOREIGN KEY([IdTipoExamen])
REFERENCES [Clinica].[TipoExamen] ([IdTipoExamen])
GO
ALTER TABLE [Clinica].[Prestacion] CHECK CONSTRAINT [FK__Prestacio__IdTip__0D64F3ED]
GO
ALTER TABLE [Clinica].[Prestacion]  WITH CHECK ADD  CONSTRAINT [FK__Prestacio__IdTip__150615B5] FOREIGN KEY([IdTipoTitulo])
REFERENCES [Clinica].[TipoTitulo] ([IdTipoTitulo])
GO
ALTER TABLE [Clinica].[Prestacion] CHECK CONSTRAINT [FK__Prestacio__IdTip__150615B5]
GO
ALTER TABLE [Clinica].[Prestacion]  WITH CHECK ADD  CONSTRAINT [FK__Prestacio__IdTip__5AB9788F] FOREIGN KEY([IdTipoPrestacion])
REFERENCES [Clinica].[TipoPrestacion] ([IdTipoPrestacion])
GO
ALTER TABLE [Clinica].[Prestacion] CHECK CONSTRAINT [FK__Prestacio__IdTip__5AB9788F]
GO
