 

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

INSERT @PanelInformationValidationSchemaDefaultValues values (N'SafetyAndSOS_Location_DefaultValues', N'[{"type": "All","valueType":"string","value": "Unknown"}]')

INSERT @PanelInformationValidationSchemaDefaultValues values (N'SafetyAndSOS_BypassMode_DefaultValues', N'[{"type": "All","valueType":"bool","value": false}]')

INSERT @PanelInformationValidationSchemaDefaultValues values (N'SafetyAndSOS_AnswerCall_DefaultValues', N'[{"type": "All","value": true}]')

INSERT @PanelInformationValidationSchemaDefaultValues values (N'SafetyAndSOS_BypassExtremeTemperature_DefaultValues', N'[{"type": "Dependent","dependent": "SafetyAndSOS_HardwareType","value": false,"dependentOn": ["Sk2","IUNGO","RFDHost","Vpd","Spb","Mgls"],"interdependencies": [{"forValue": "Mgls","dependent": "SafetyAndSOS_InputType","isExists": true,"dependentOn": ["WaterDetector","GasDetector","FireDetector","PanicDetector"]}]},{"type": "Dependent","dependent": "SafetyAndSOS_HardwareType","value": true,"dependentOn": ["Mgls","Ep","EpPlus","Epa"],"interdependencies": [{"forValue": "Mgls","dependent": "SafetyAndSOS_InputType","isExists": true,"dependentOn": ["EpilepsyDetector","EnuresisDetector"]}]}]')

INSERT @PanelInformationValidationSchemaDefaultValues values (N'SafetyAndSOS_FallDetection_DefaultValues',N'[{"type": "DependentValue","dependent": "SafetyAndSOS_HardwareType","dependentOn": ["Epa"],"takeValueFrom": "PeripheralsConfiguration_EmergencyPendant_FallDetection_DeafultFallDetection"},{"type": "Dependent","dependent": "SafetyAndSOS_HardwareType","dependentOn": ["RFDHost"],"value": true}]')

INSERT @PanelInformationValidationSchemaDefaultValues values (N'SafetyAndSOS_DebugMode_DefaultValues', N'[{"type": "All","value": false}]')

INSERT @PanelInformationValidationSchemaDefaultValues values (N'SafetyAndSOS_LED_DefaultValues', N'[{"type": "Dependent","dependent": "SafetyAndSOS_HardwareType","value": true,"dependentOn": ["Vpd","Spb"]},{"type": "Dependent","dependent": "SafetyAndSOS_HardwareType","value": false,"dependentOn": ["Mgls","RFDHost"]}]')

INSERT @PanelInformationValidationSchemaDefaultValues values (N'SafetyAndSOS_VoiceTriggering_DefaultValues', N'[{"type": "All","value": true}]')

INSERT @PanelInformationValidationSchemaDefaultValues values (N'SafetyAndSOS_ScoreForAtLeastOnePhrase_DefaultValues', N'[{"type": "DependentValue","takeValueFrom": "PeripheralsConfiguration_VPD_VoicePhraseDetection_DefaultScoreForAtLeastOnePhrase"}]')

INSERT @PanelInformationValidationSchemaDefaultValues values (N'SafetyAndSOS_ScoreForBothPhrases_DefaultValues', N'[{"type": "DependentValue","takeValueFrom": "PeripheralsConfiguration_VPD_VoicePhraseDetection_DefaultScoreForBothPhrases"}]')

INSERT @PanelInformationValidationSchemaDefaultValues values (N'SafetyAndSOS_DetectorDelay_DefaultValues', N'[{"type": "All","value": 60}]')

INSERT @PanelInformationValidationSchemaDefaultValues values (N'SafetyAndSOS_EnableTelemetryMessages_DefaultValues', N'[{"type": "All","value": true}]')

INSERT @PanelInformationValidationSchemaDefaultValues values (N'Dialer_Destinations_Port_DefaultValues', N'[{"type": "Dependent","dependent": "Dialer_Destinations_CommType","dependentOn": ["ReceiverEvents"],"value": 10060},{"type": "Dependent","dependent": "Dialer_Destinations_CommType","dependentOn": ["CareAtHomeInformation","Media","Debug"],"value": 5666},{"type": "Dependent","dependent": "Dialer_Destinations_CommType","dependentOn": ["Stun"],"value": 3478},{"type": "Dependent","dependent": "Dialer_Destinations_Protocol","dependentOn": ["SiaIp"],"value": 3061},{"type": "Dependent","dependent": "Dialer_Destinations_Protocol","dependentOn": ["Scaip"],"value": 5060},{"type": "Dependent","dependent": "Dialer_Destinations_Interface","dependentOn": ["Sms"],"value": null}]')


INSERT @PanelInformationValidationSchemaDefaultValues values (N'Communication_VoiceOverIp_PrimaryServer_Port_DefaultValues', N'[{"type": "All","value": 5060}]')
INSERT @PanelInformationValidationSchemaDefaultValues values (N'Communication_VoiceOverIp_BackupServer_Port_DefaultValues', N'[{"type": "All","value": 5060}]')


INSERT @PanelInformationValidationSchemaDefaultValues values (N'VoiceAndLEDVoice_Voice_VoiceReminders_ReportMissedReminder_DefaultValues', N'[{"type": "DependentValue","takeValueFrom": "VoiceAndLEDVoice_Voice_EnableGroups_ReportMissedRemiders"}]')

INSERT @PanelInformationValidationSchemaDefaultValues values (N'ControlPanel_KeepAlive_Enable_DefaultValues', N'[{"type": "All","valueType": "bool","value": false}]')

INSERT @PanelInformationValidationSchemaDefaultValues values (N'ControlPanel_RepetitiveSupervisionLoss_Enable_DefaultValues', N'[{"type": "All","value": false}]')

INSERT @PanelInformationValidationSchemaDefaultValues values (N'ControlPanel_RepetitiveSupervisionLoss_Interval_DefaultValues', N'[{"type": "All","value": 1}]')


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.*;

