 

DECLARE @PanelInformationValidationSchemaDefaultValues TABLE (
	ParameterType [nvarchar](100) NULL,
	DefaultValue [nvarchar](max) NOT NULL
)

insert @PanelInformationValidationSchemaDefaultValues values ('ControlPanel_DTMF_Keys_SwitchToFullDuplex_DefaultValues','[{"type": "All","value":"Default"}]')
insert @PanelInformationValidationSchemaDefaultValues values ('ControlPanel_DTMF_Keys_HalfDuplexOperatorSpeaks_DefaultValues','[{"type": "All","value":"Default"}]')
insert @PanelInformationValidationSchemaDefaultValues values ('ControlPanel_DTMF_Keys_HalfDuplexOperatorListens_DefaultValues','[{"type": "All","value":"Default"}]')
insert @PanelInformationValidationSchemaDefaultValues values ('ControlPanel_DTMF_Keys_IncreaseSpeakerVolume_DefaultValues','[{"type": "All","value":"Default"}]')
insert @PanelInformationValidationSchemaDefaultValues values ('ControlPanel_DTMF_Keys_DecreaseSpeakerVolume_DefaultValues','[{"type": "All","value":"Default"}]')
insert @PanelInformationValidationSchemaDefaultValues values ('ControlPanel_DTMF_Keys_DisconnectTheCall_DefaultValues','[{"type": "All","value":"Default"}]')
insert @PanelInformationValidationSchemaDefaultValues values ('ControlPanel_DTMF_Keys_AlternateDisconnect_DefaultValues','[{"type": "All","value":"No Action"}]')
insert @PanelInformationValidationSchemaDefaultValues values ('ControlPanel_DTMF_Keys_SwitchToControlPanel_DefaultValues','[{"type": "All","value":"No Action"}]')
insert @PanelInformationValidationSchemaDefaultValues values ('ControlPanel_DTMF_Keys_SwitchToNextVoiceDevice_DefaultValues','[{"type": "All","value":"No Action"}]')

insert @PanelInformationValidationSchemaDefaultValues values ('ActivitySensors_ClearPossibleFall_DefaultValues','[{"type": "All","value":false}]')
insert @PanelInformationValidationSchemaDefaultValues values ('ActivitySensors_ExternalMagnet_DefaultValues','[{"type":"Dependent","dependent":"ActivitySensors_HardwareType","value":true,"dependentOn":["Mgls"],"interdependencies":[{"forValue":"Mgls","dependent":"ActivitySensors_ActivityType","isExists":true,"dependentOn":["BED_SENSOR"]}]},{"type":"Dependent","dependent":"SafetyAndSOS_HardwareType","value":false,"dependentOn":["Mgls","Pir","BleDevice"],"interdependencies":[{"forValue":"Mgls","dependent":"ActivitySensors_ActivityType","isExists":false,"dependentOn":["BED_SENSOR"]}]}]')
insert @PanelInformationValidationSchemaDefaultValues values ('ActivitySensors_SendDetections_DefaultValues','[{"type": "All","value":true}]')
insert @PanelInformationValidationSchemaDefaultValues values ('ActivitySensors_ResetsWandering_DefaultValues','[{"type": "All","value":true}]')
insert @PanelInformationValidationSchemaDefaultValues values ('ActivitySensors_Group_DefaultValues','[{"type": "All","value":1}]')
insert @PanelInformationValidationSchemaDefaultValues values ('ActivitySensors_LED_DefaultValues','[{"type":"Dependent","dependent":"ActivitySensors_HardwareType","value":true,"dependentOn":["Mgls"]},{"type":"Dependent","dependent":"SafetyAndSOS_HardwareType","value":false,"dependentOn":["Pir","BleDevice"]}]')


MERGE INTO [dbo].PanelInformationValidationSchemaDefaultValues AS TARGET  
USING @PanelInformationValidationSchemaDefaultValues AS SOURCE  
ON TARGET.ParameterType = SOURCE.ParameterType
WHEN NOT MATCHED BY TARGET THEN
INSERT (ParameterType,DefaultValue)
VALUES (SOURCE.ParameterType,SOURCE.DefaultValue )
WHEN MATCHED THEN    
UPDATE SET	TARGET.DefaultValue = source.DefaultValue

OUTPUT $action, SOURCE.*;

