cancel
Showing results for 
Search instead for 
Did you mean: 

Unity script is not working for bar code process

Panchanathan_Th
Champ on-the-rise
Champ on-the-rise

Hi All,

I have tried to add the Bar Code values to keywords by Unity scripts(using Data Capture server) and its behaving differently.For example My batch have 3 documents(3 patient records) and each document have multiple pages(Document 1 have 5 pages, document 2 and 3 have 4 pages) as well. I am using "Patch Code" for Document separation here.

Document 1 : Have 3 bar codes from different pages (page 1,3 and 4)

Document 2: Have  2 bar codes from different pages 

Document 3 : Have  1 bar code on the first page

All these above mentioned bar codes are placed on the same position of each pages (Top-Right corner of each pages)

When i tried to Add the keyword "Patient MRN" from the Bar code value through the unity scripts(IScanQueueBarcodeProcessingUnity)  as given below, The Patient MRN Keywords got added but the main problems are described below

1. 3 Patient MRN keywords got added for document 1 (It is expected as the Document 1 have 3 bar codes from 3 different pages)

2. 5 patient MRN Keywords got added for document 2 (It supposed be 2 Patient MRN keywords because Document 2 have only 2 bar codes but the keyword values from Document 1 also added )

3. 6 Patient MRN keywords added for document 3 ( which is all from the document 1 and 2)

Unity Script: (OnItemExecute Method)

BarcodeDocumentUpdates updateKeyword = args.Results.BarcodeDocumentUpdates;
KeywordType keywordType_MRN= app.Core.KeywordTypes.Find("Patient MRN");
Keyword keyword_MRN = keywordType_MRN.CreateKeyword(args.Barcode.Value);
updateKeyword.AddKeyword(keyword_MRN);

 


Please let me know whether my above script coding is not correct in order to achieve my requirement. if so then can you please give me the sample code to do this. 

1 REPLY 1

David_Whelan
Star Contributor
Star Contributor

Just to note, the above code seems to work fine for me within the OnItemExecute method of the IScanQueueBarcodeProcessingEventScript hook.