Skip to content

Main content

Product Label Unit Token Tool

Preserve literal supplied product-label quantities and units without dose conversion or safety/efficacy assessment.

Loading tool…

Description

Check unitToken by exact membership in allowedUnits.

Exact label matching answers whether supplied strings agree under a chosen vocabulary. It preserves a useful distinction between missing, unknown, ambiguous, and unrecognized records.

Check unitToken by exact membership in allowedUnits.

When to use this tool

Use Product Label Unit Token when you need an explicit record-label comparison or deterministic key.

How to use the tool and how it works

  1. Enter amountToken, unitToken, source, allowedUnits. Use the units and conventions below.
  2. Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
  3. Read unitListed, sourceKey, amountPreserved. Inspect unitListed before interpreting the associated values.

Check unitToken by exact membership in allowedUnits. Preserve amountToken unchanged and serialize source with unitToken as a JSON array key.1

Input fieldMeaning and unitsAccepted input
amountTokenAmount TokenRequired. Text; maximum UTF-16 length 8192.
unitTokenUnit TokenRequired. Text; maximum UTF-16 length 8192.
sourceSource identifier or source selector, interpreted under the calculation above.Required. Text; maximum UTF-16 length 8192.
allowedUnitsAllowed UnitsRequired. Array of text; maximum UTF-16 length 8192; maximum items 256.
Output fieldInterpretationReturned shape
unitListedUnit ListedRequired. Boolean.
sourceKeySerialized source-scoped key preserving the supplied token.Required. Text; maximum UTF-16 length 8192.
amountPreservedAmount PreservedRequired. Text; maximum UTF-16 length 8192.
json
{
  "input": {
    "amountToken": "10",
    "unitToken": "mg",
    "source": "label-A",
    "allowedUnits": [
      "mg",
      "g"
    ]
  },
  "output": {
    "unitListed": true,
    "sourceKey": "[\"label-A\",\"mg\"]",
    "amountPreserved": "10"
  }
}

Limitations and assumptions

  • This does not parse the amount or verify a recognized unit's physical meaning.
  • Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.

Alternative or Complementary methods

Normalize or reconcile identifiers only under a documented policy, then verify the underlying source records separately.

References

  1. Calculation and input contract: naturopathy/product-label-unit-token — tool.io

Similar or alternative tools