HIBCPASCodetext
Source: ComplexBarcode.
Class for encoding and decoding the text embedded in the HIBC PAS code.
This sample shows how to encode and decode HIBC PAS using HIBCPASCodetext.let complexCodetext = new HIBCPASComplexCodetext(); complexCodetext.setDataLocation(HIBCPASDataLocation.PATIENT); complexCodetext.addRecord(HIBCPASDataType.LABELER_IDENTIFICATION_CODE, "A123"); complexCodetext.addRecord(HIBCPASDataType.MANUFACTURER_SERIAL_NUMBER, "SERIAL123"); complexCodetext.setBarcodeType(EncodeTypes.HIBC_DATA_MATRIX_PAS); let generator = new ComplexBarcodeGenerator(complexCodetext); { BarCodeReader reader = new BarCodeReader(generator.generateBarCodeImage(BarCodeImageFormat.PNG), null, DecodeType.HIBC_DATA_MATRIX_PAS); { reader.readBarCodes(); let codetext = reader.getFoundBarCodes()[0].getCodeText(); let readCodetext = ComplexCodetextReader.tryDecodeHIBCPAS(codetext); print("Data location: " + readCodetext.getDataLocation()); print("Data type: " + readCodetext.getRecords()[0].getDataType()); print("Data: " + readCodetext.getRecords()[0].getData()); print("Data type: " + readCodetext.getRecords()[1].getDataType()); print("Data: " + readCodetext.getRecords()[1].getData()); } }
new HIBCPASCodetext()
Methods
construct()
HIBCPASRecord constructor
addHIBCPASRecord(record)
Adds new record
Parameter
Name | Type | Optional | Description |
---|---|---|---|
record |
|
|
Record to be added |
addRecord(dataType, data)
Adds new record
Parameters
Name | Type | Optional | Description |
---|---|---|---|
dataType |
|
|
Type of data |
data |
|
|
Data string |
clear()
Clears records list
equals(obj)
Returns a value indicating whether this instance is equal to a specified {@code HIBCPASCodetext} value.
Parameter
Name | Type | Optional | Description |
---|---|---|---|
obj |
|
|
An {@code HIBCPASCodetext} value to compare to this instance. |
- Returns
-
{@code true} if obj has the same value as this instance; otherwise, {@code false}.
getBarcodeType()
Gets barcode type.
- Returns
-
Barcode type.
getConstructedCodetext()
Constructs codetext
- Returns
-
Constructed codetext
getDataLocation()
Identifies data location.
getRecords()
Gets records list
- Returns
-
List of records
hashCode()
Returns the hash code for this instance.
- Returns
-
A 32-bit signed integer hash code.
initFromString(constructedCodetext)
Initializes instance from constructed codetext.
Parameter
Name | Type | Optional | Description |
---|---|---|---|
constructedCodetext |
|
|
Constructed codetext. |
setBarcodeType()
Gets or sets barcode type. HIBC PAS codetext can be encoded using HIBCCode39PAS, HIBCCode128PAS, HIBCAztec:PAS, HIBCDataMatrixPAS and HIBCQRPAS encode types. Default value: HIBCCode39PAS.
- Returns
-
Barcode type.
setDataLocation()
Identifies data location.