DECLARE @ResourceLocalizedValues TABLE (
    [LanguageId]     INT            NOT NULL,
    [EntityType]     INT            NOT NULL,
    [ResourceKey]    NVARCHAR (200) NOT NULL,
    [LocalizedValue] NVARCHAR (MAX) NOT NULL,
    [Description]    NVARCHAR (200) NULL
)

INSERT @ResourceLocalizedValues([LanguageId], [EntityType], [ResourceKey], [LocalizedValue]) VALUES (1, 7, 'TeleHealthMeasurement_Weight',                 'Weight')
INSERT @ResourceLocalizedValues([LanguageId], [EntityType], [ResourceKey], [LocalizedValue]) VALUES (1, 7, 'TeleHealthMeasurement_OxygenSaturation',       'Oxygen Saturation')
INSERT @ResourceLocalizedValues([LanguageId], [EntityType], [ResourceKey], [LocalizedValue]) VALUES (1, 7, 'TeleHealthMeasurement_PulseRate',              'Pulse Rate')
INSERT @ResourceLocalizedValues([LanguageId], [EntityType], [ResourceKey], [LocalizedValue]) VALUES (1, 7, 'TeleHealthMeasurement_SystolicBloodPressure',  'Systolic Blood Pressure')
INSERT @ResourceLocalizedValues([LanguageId], [EntityType], [ResourceKey], [LocalizedValue]) VALUES (1, 7, 'TeleHealthMeasurement_DiastolicBloodPressure', 'Diastolic Blood Pressure')
INSERT @ResourceLocalizedValues([LanguageId], [EntityType], [ResourceKey], [LocalizedValue]) VALUES (1, 7, 'TeleHealthMeasurement_BodyTemperature',        'Body Temperature')
INSERT @ResourceLocalizedValues([LanguageId], [EntityType], [ResourceKey], [LocalizedValue]) VALUES (1, 7, 'TeleHealthMeasurement_GlucoseLevel',           'Glucose Level')
INSERT @ResourceLocalizedValues([LanguageId], [EntityType], [ResourceKey], [LocalizedValue]) VALUES (1, 7, 'TeleHealthMeasurement_PulseInRange',           'Pulse In Range')
INSERT @ResourceLocalizedValues([LanguageId], [EntityType], [ResourceKey], [LocalizedValue]) VALUES (1, 7, 'TeleHealthMeasurement_IrregularPulse',         'Irregular Pulse')
INSERT @ResourceLocalizedValues([LanguageId], [EntityType], [ResourceKey], [LocalizedValue]) VALUES (1, 7, 'TeleHealthMeasurement_GlucoseLevelMeasurement','Glucose Level Measurement')

INSERT @ResourceLocalizedValues([LanguageId], [EntityType], [ResourceKey], [LocalizedValue]) VALUES (1, 8, 'TeleHealthMeasurement_Weight',                 'Weight')
INSERT @ResourceLocalizedValues([LanguageId], [EntityType], [ResourceKey], [LocalizedValue]) VALUES (1, 8, 'TeleHealthMeasurement_OxygenSaturation',       'Oxygen Saturation')
INSERT @ResourceLocalizedValues([LanguageId], [EntityType], [ResourceKey], [LocalizedValue]) VALUES (1, 8, 'TeleHealthMeasurement_PulseRate',              'Pulse Rate')
INSERT @ResourceLocalizedValues([LanguageId], [EntityType], [ResourceKey], [LocalizedValue]) VALUES (1, 8, 'TeleHealthMeasurement_SystolicBloodPressure',  'Systolic Blood Pressure')
INSERT @ResourceLocalizedValues([LanguageId], [EntityType], [ResourceKey], [LocalizedValue]) VALUES (1, 8, 'TeleHealthMeasurement_DiastolicBloodPressure', 'Diastolic Blood Pressure')
INSERT @ResourceLocalizedValues([LanguageId], [EntityType], [ResourceKey], [LocalizedValue]) VALUES (1, 8, 'TeleHealthMeasurement_BodyTemperature',        'Body Temperature')
INSERT @ResourceLocalizedValues([LanguageId], [EntityType], [ResourceKey], [LocalizedValue]) VALUES (1, 8, 'TeleHealthMeasurement_GlucoseLevel',           'Glucose Level')
INSERT @ResourceLocalizedValues([LanguageId], [EntityType], [ResourceKey], [LocalizedValue]) VALUES (1, 8, 'TeleHealthMeasurement_PulseInRange',           'Pulse In Range')
INSERT @ResourceLocalizedValues([LanguageId], [EntityType], [ResourceKey], [LocalizedValue]) VALUES (1, 8, 'TeleHealthMeasurement_IrregularPulse',         'Irregular Pulse')
INSERT @ResourceLocalizedValues([LanguageId], [EntityType], [ResourceKey], [LocalizedValue]) VALUES (1, 8, 'TeleHealthMeasurement_GlucoseLevelMeasurement','Glucose Level Measurement')

MERGE INTO [dbo].[ResourceLocalizedValues] AS TARGET  
USING @ResourceLocalizedValues AS SOURCE  
ON TARGET.[LanguageId] = SOURCE.[LanguageId]
	AND TARGET.[EntityType] = SOURCE.[EntityType]
	AND TARGET.[ResourceKey] = SOURCE.[ResourceKey]
WHEN NOT MATCHED BY TARGET THEN
INSERT ([LanguageId], [EntityType], [ResourceKey], [LocalizedValue])
VALUES (SOURCE.[LanguageId], SOURCE.[EntityType], SOURCE.[ResourceKey], SOURCE.[LocalizedValue])
WHEN MATCHED THEN    
UPDATE SET	TARGET.[LocalizedValue] = SOURCE.[LocalizedValue]
OUTPUT $ACTION, SOURCE.*;



