Overview
This section contains instructions on how to update mapping for activity codes and quantity.
Quantity mapping
To insert a new Quantity Mapping, run the query with the following template:
Code Block |
---|
language | sql |
---|
title | Add New Quantity Mapping |
---|
|
declare @code nvarchar(100) = '1111-1111-111';
declare @cutomerQuantity float = 10;
declare @quantity float = 1;
declare @date datetime = GetDate();
INSERT INTO MappingQuantities (Code, CustomerQuantity, Quantity, UpdateDate, CreationDate) VALUES ('1111-1111-111'@code, 10@cutomerQuantity, 1@quantity, @date, @date) |
Note: All fields are required.
To update existing Quantity Mapping, run the query with the following template:
Code Block |
---|
language | sql |
---|
title | Update Existing Quantity Mapping |
---|
|
UPDATE MappingQuantities SET Code = '1111-1111-222', CustomerQuantity = 10, Quantity = 2, UpdateDate = GetDate() WHERE Code = '1111-1111-111' |
Note: You can update as many fields as you need but you must edit UpdateDate field in each query too. If you want to update only Quantity field, run the query with the following template:
Code Block |
---|
language | sql |
---|
title | Update Quantity Mapping |
---|
|
UPDATE MappingQuantities SET Quantity = 2, UpdateDate = GetDate() WHERE Code = '1111-1111-111' |
To delete an existing Quantity Mapping, run the query with the following template:
Code Block |
---|
language | sql |
---|
title | Delete Quantity Mapping |
---|
|
declare @codeToDelete nvarchar(100) = '1111-1111-111';
declare @date datetime = GetDate();
UPDATE MappingQuantities SET UpdateDate = @date, DeleteDate = @date, IsDeleted = 1 WHERE Code = @codeToDelete |
Note: This query marks the record as deleted but doesn't delete it from the database. If you need to delete it from the database, run the query with the following template:
Code Block |
---|
language | sql |
---|
title | Delete Quantity Mapping |
---|
|
declare @codeToDelete nvarchar(100) = '1111-1111-111';
DELETE FROM MappingQuantities WHERE Code = @codeToDelete |
Code mapping
To insert a new Code Mapping, run the query with the following template:
Code Block |
---|
language | sql |
---|
title | Add New Code Mapping |
---|
|
declare @customerCode nvarchar(100) = '9999-9999-999';
declare @code nvarchar(100) = '1111-1111-111';
declare @cutomerQuantity float = 10;
declare @quantity float = 1;
declare @date datetime = GetDate();
INSERT INTO MappingCodes (CustomerCode, Code, CustomerQuantity, Quantity, UpdateDate, CreationDate) VALUES (@customerCode, @code, @cutomerQuantity, @quantity, @date, @date) |
Note: CustomerQuantity and Quantity field are optional. You can insert NULL value for these fields as in the example below:
Code Block |
---|
language | sql |
---|
title | Add Code Mapping |
---|
|
declare @customerCode nvarchar(100) = '9999-9999-999',;
declare @code nvarchar(100) = '1111-1111-111', 10, 1;
declare @cutomerQuantity float = NULL;
declare @quantity float = NULL;
declare @date datetime = GetDate();
INSERT INTO MappingCodes (CustomerCode, Code, CustomerQuantity, Quantity, UpdateDate, CreationDate) VALUES (@customerCode, @code, @cutomerQuantity, @quantity, @date, @date) |
To update an existing Code Mapping, run the query with the following template:
Code Block |
---|
language | sql |
---|
title | Update Existing Code Mapping |
---|
|
UPDATE MappingCodes SET CustomerCode = '9999-9999-111', Code = '1111-1111-222', CustomerQuantity = 8, Quantity = 2, UpdateDate = GetDate() WHERE CustomerCode = '9999-9999-999' |
Note: You can update as many fields as you need but you must edit UpdateDate field in each query too. If you want to update only Quantity field, run the query with the following template:
Code Block |
---|
language | sql |
---|
title | Update Code Mapping |
---|
|
UPDATE MappingCodes SET Quantity = 2, UpdateDate = GetDate() WHERE CustomerCode = '9999-9999-999' |
To delete an existing Quantity Mapping, run the query with the following template:
Code Block |
---|
language | sql |
---|
title | Delete Code Mapping |
---|
|
declare @customerCodeToDelete nvarchar(100) = '9999-9999-999';
declare @date datetime = GetDate();
UPDATE MappingCodes SET UpdateDate = @date, DeleteDate = @date, IsDeleted = 1 WHERE CustomerCode = @customerCodeToDelete |
Note: This query marks the record as deleted but doesn't delete it from the database. If you need to delete it from the database, run the query with the following template:
Code Block |
---|
language | sql |
---|
title | Delete Code Mapping |
---|
|
declare @customerCodeToDelete nvarchar(100) = '9999-9999-999';
DELETE FROM MappingCodes WHERE CustomerCode = @customerCodeToDelete |
HCPCS code mapping
To insert a new HCPCS Code Mapping, run the query with the following template:
Code Block |
---|
language | sql |
---|
title | Add New HCPCS Code Mapping |
---|
|
declare @customerCode nvarchar(100) = '9999-9999-999';
declare @hcpcsCode nvarchar(100) = 'A1111';
declare @lawsonNo int = 11111;
declare @cutomerQuantity float = 10;
declare @quantity float = 1;
declare @packagePrice float = 25.73;
declare @date datetime = GetDate();
INSERT INTO MappingCustomHcpcsCodes (CustomerCode, HcpcsCode, LawsonNo, CustomerQuantity, Quantity, PackagePrice, UpdateDate, CreationDate)
VALUES (@customerCode, @hcpcsCode, @lawsonNo, @cutomerQuantity, @quantity, @packagePrice, @date, @date) |
Note: LawsonNo field is optional. You can insert NULL value for it as in the example below:
Code Block |
---|
language | sql |
---|
title | Add HCPCS Code Mapping |
---|
|
declare @customerCode nvarchar(100) = '9999-9999-999',;
declare @hcpcsCode nvarchar(100) = 'A1111', '11111', 10, 1, 25.73, ;
declare @lawsonNo int = NULL;
declare @cutomerQuantity float = 10;
declare @quantity float = 1;
declare @packagePrice float = 25.73;
declare @date datetime = GetDate();
INSERT INTO MappingCustomHcpcsCodes (CustomerCode, HcpcsCode, LawsonNo, CustomerQuantity, Quantity, PackagePrice, UpdateDate, CreationDate)
VALUES (@customerCode, @hcpcsCode, @lawsonNo, @cutomerQuantity, @quantity, @packagePrice, @date, @date) |
To update an existing HCPCS Code Mapping, run the query with the following template:
Code Block |
---|
language | sql |
---|
title | Update Existing HCPCS Code Mapping |
---|
|
UPDATE MappingCustomHcpcsCodes SET CustomerCode = '9999-9999-111', HcpcsCode = 'A1112', LawsonNo = '11112', CustomerQuantity = 8, Quantity = 2,
PackagePrice = 25.52, UpdateDate = GetDate()
WHERE CustomerCode = '9999-9999-999' |
Note: You can update as many fields as you need but you must edit UpdateDate field in each query too. If you want to update only Quantity field, run the query with the following template:
Code Block |
---|
language | sql |
---|
title | Update HCPCS Code Mapping |
---|
|
UPDATE MappingCustomHcpcsCodes SET Quantity = 2, UpdateDate = GetDate() WHERE CustomerCode = '9999-9999-999' |
To delete an existing HCPCS Code Mapping, run the query with the following template:
Code Block |
---|
language | sql |
---|
title | Delete HCPCS Code Mapping |
---|
|
declare @customerCodeToDelete nvarchar(100) = '9999-9999-999';
declare @date datetime = GetDate();
UPDATE MappingCustomHcpcsCodes SET UpdateDate = @date, DeleteDate = @date, IsDeleted = 1 WHERE CustomerCode = @customerCodeToDelete |
Note: This query marks the record as deleted but doesn't delete it from the database. If you need to delete it from the database, run the query with the following template:
Code Block |
---|
language | sql |
---|
title | Delete HCPCS Code Mapping |
---|
|
declare @customerCodeToDelete nvarchar(100) = '9999-9999-999';
DELETE FROM MappingCustomHcpcsCodes WHERE CustomerCode = @customerCodeToDelete |