Codes mapping
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:
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 (@code, @cutomerQuantity, @quantity, @date, @date)
Note: All fields are required.
To update existing Quantity Mapping, run the query with the following template:
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:
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:
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:
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:
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:
declare @customerCode nvarchar(100) = '9999-9999-999'; declare @code nvarchar(100) = '1111-1111-111'; 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:
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:
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:
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:
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:
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:
declare @customerCode nvarchar(100) = '9999-9999-999'; declare @hcpcsCode nvarchar(100) = 'A1111'; 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:
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:
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:
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:
declare @customerCodeToDelete nvarchar(100) = '9999-9999-999'; DELETE FROM MappingCustomHcpcsCodes WHERE CustomerCode = @customerCodeToDelete