I have a requirement as under ;
1. I present empty text box to user;
2. The default cursor is in empty text box.
3. The user with the help of bar code scanner scans the barcode. Once barcode is scanned the enter key event is auto generated. the call back function is executed on each scanning
4. The text box is emptyed and is ready for next scan
I have tried this as under ;
IF object_id('DIXIT_DBR_AC001','P') IS NOT NULL
DROP PROCEDURE [DIXIT_DBR_AC001]
GO
CREATE PROCEDURE DIXIT_DBR_AC001
AS
BEGIN
DECLARE @BarCode char(15)
select 'dbr.editable', 'barcode', 'Dixit_DBR_AccessionOut_Insert', 'inbarcode=barcode', 'event=enter' , "options={type:'textarea',submit: 'OK', style : 'display: inline'}";
SET @BarCode = ' ' ;
select 'dbr.pageview';
SELECT @BarCode as barcode ;
select 'dbr.title', 'Last 50 Tubes'
SELECT TOP 50 id, OrgID, VisitID, VisitNumber, barcode, OutDateTime, [NAME]
FROM LIMS_LIVE.dbo.Accession_Out_Dixit
ORDER BY OutDateTime DESC
END
IF object_id('Dixit_DBR_AccessionOut_Insert','P') IS NOT NULL
DROP PROCEDURE [Dixit_DBR_AccessionOut_Insert]
GO
CREATE PROCEDURE Dixit_DBR_AccessionOut_Insert
@inbarcode char(15)
AS
BEGIN
MERGE INTO Accession_Out_Dixit AS TARGET USING
(
SELECT PV.OrganizationID OrgID,
PV.PatientVisitID VisitID,
PV.VisitNumber ,
PIS.[BarcodeNumber] barcode ,
getDate() OutDateTime ,
P.Name
FROM Patient P (NOLOCK)
INNER JOIN PatientVisit PV (NOLOCK) ON PV.OrganizationID = P.OrganizationID
AND PV.PatientID = P.PatientID
INNER JOIN PatientInvSample PIS (NOLOCK) ON PV.OrganizationID = PIS.OrgID
AND PIS.PatientVisitID = PV.PatientVisitID
WHERE PIS.[BarcodeNumber] = @inbarcode
) AS SOURCE
ON
TARGET.OrgID = SOURCE.OrgID
AND TARGET.VisitID = SOURCE.VisitID
AND TARGET.barcode = SOURCE.barcode
WHEN MATCHED THEN UPDATE SET
TARGET.OutDateTime = SOURCE.OutDateTime
, TARGET.Name = SOURCE.Name
WHEN NOT MATCHED THEN INSERT
(
OrgID,
VisitID,
VisitNumber,
barcode,
OutDateTime ,
Name
)
VALUES
(
SOURCE.OrgID,
SOURCE.VisitID,
SOURCE.VisitNumber,
SOURCE.barcode,
SOURCE.OutDateTime ,
SOURCE.Name
) ;
select 'dbr.refresh', 0;
END
GO
Is is possible such utility to be designed in MyDBR