Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

Rule-based specimen label format (v6.0)

By default, when label formats are defined in the CP, it applies to all the specimens in that CP irrespective of other conditions like specimen type. Admins can configure conditional rules to generate the specimen label formats.

...

Expand
titleClick here for JSON examples...


Code Block
titleExample 1
{
      "name": "auto-allocation",
      "data": {
        "rules": [
          {
            "criteria": "specimen.eventLabel == 'Visit' && specimen.initialQty == 1 && specimen.type == 'Plasma' && ['EP01', 'LP01'].indexOf(specimen.reqCode) != -1",
            "name": "ContainerType",
            "params": {
              "name": "-10G_Box"
            }
          },
          {
            "criteria": "specimen.eventLabel == 'Visit' && specimen.initialQty == 1 && specimen.type == 'Plasma' && ['EP02', 'LP02'].indexOf(specimen.reqCode) != -1",
            "name": "ContainerType",
            "params": {
              "name": "-10B_Box"
            }
          },
          {
            "criteria": "specimen.initialQty == 0.1 && specimen.type == 'Serum' && ['S02', 'S03', 'S04'].indexOf(specimen.reqCode) != -1",
            "name": "ContainerType",
            "params": {
              "name": "-10G_Box"
            }
          },
          {
            "criteria": "specimen.initialQty == 0.1 && specimen.type == 'Serum' && ['S18', 'S19'].indexOf(specimen.reqCode) != -1 && visit.site == 'USB Biobank'",
            "name": "ContainerType",
            "params": {
              "name": "-10R_Box"
            }
          },
          {
            "criteria": "specimen.initialQty == 0.1 && specimen.type == 'Plasma' && ['EP14', 'LP15'].indexOf(specimen.reqCode) != -1",
            "name": "ContainerType",
            "params": {
              "name": "-10W_Box"
            }
          },
          {
            "criteria": "specimen.initialQty == 2.5 && specimen.reqCode=='RNA'",
            "name": "ContainerType",
            "params": {
              "name": "-7Y_Box"
            }
          },
          {
            "criteria": "specimen.type == 'Urine (complete)' && specimen.initialQty == 20",
            "name": "ContainerType",
            "params": {
              "name": "-4W_Box"
            }
          }
     }
  ]
}


Code Block
titleExample 2
{
      "name": "auto-allocation",
      "view": null,
      "ctrl": null,
      "data": {
        "rules": [
          {
            "criteria": "specimen.initialQty == 1 && specimen.type == 'Plasma' && ['EP21', 'EP20', 'LP21'].indexOf(specimen.reqCode) != -1",
            "name": "ContainerType",
            "params": {
              "name": "-10G_Box"
            }
          },
          {
            "criteria": "specimen.initialQty == 1 && specimen.type == 'Plasma' && ['EP19', 'LP20'].indexOf(specimen.reqCode) != -1",
            "name": "ContainerType",
            "params": {
              "name": "-10B_Box"
            }
          },
          {
            "criteria": "specimen.initialQty == 0.1 && specimen.type == 'Plasma' && ['EP01', 'EP02', 'EP03', 'EP04', 'EP05', 'EP06', 'EP07', 'EP08', 'LP01', 'LP02', 'LP03', 'LP04', 'LP05', 'LP06', 'LP07', 'LP08', 'LP09'].indexOf(specimen.reqCode) != -1",
            "name": "ContainerType",
            "params": {
              "name": "-10G_Box"
            }
          },
          {
            "criteria": "specimen.initialQty == 0.1 && specimen.type == 'Serum' && ['S02', 'S03', 'S04', 'S05', 'S06', 'S07', 'S08', 'S09', 'S10', 'S11', 'S12', 'S13', 'S14', 'S15', 'S16', 'S17'].indexOf(specimen.reqCode) != -1",
            "name": "ContainerType",
            "params": {
              "name": "-10G_Box"
            }
          },
          {
            "criteria": "specimen.initialQty == 1 && specimen.type == 'Serum' && ['S48', 'S49', 'S50', 'S51'].indexOf(specimen.reqCode) != -1",
            "name": "ContainerType",
            "params": {
              "name": "-10G_Box"
            }
          },
          {
            "criteria": "specimen.initialQty == 0.1 && specimen.type == 'Plasma' && ['EP09', 'EP10', 'EP11', 'EP12', 'EP13', 'LP10', 'LP11', 'LP12', 'LP13', 'LP14'].indexOf(specimen.reqCode) != -1",
            "name": "ContainerType",
            "params": {
              "name": "-10R_Box"
            }
          },
          {
            "criteria": "specimen.initialQty == 0.1 && specimen.type == 'Serum' && ['S18', 'S19', 'S20', 'S21', 'S22', 'S23', 'S24', 'S25', 'S26', 'S27'].indexOf(specimen.reqCode) != -1",
            "name": "ContainerType",
            "params": {
              "name": "-10R_Box"
            }
          },
          {
            "criteria": "specimen.initialQty == 0.1 && specimen.type == 'Plasma' && ['EP14', 'EP15', 'EP16', 'EP17', 'EP18', 'LP15', 'LP16', 'LP17', 'LP18', 'LP19'].indexOf(specimen.reqCode) != -1",
            "name": "ContainerType",
            "params": {
              "name": "-10W_Box"
            }
          },
          {
            "criteria": "specimen.initialQty == 0.1 && specimen.type == 'Serum' && ['S28', 'S29', 'S30', 'S31', 'S32', 'S33', 'S34', 'S35', 'S36', 'S37'].indexOf(specimen.reqCode) != -1",
            "name": "ContainerType",
            "params": {
              "name": "-10W_Box"
            }
          },
          {
            "criteria": "specimen.initialQty == 0.1 && specimen.type == 'Serum' && ['S38', 'S39', 'S40', 'S41', 'S42', 'S43', 'S44', 'S45', 'S46','S47'].indexOf(specimen.reqCode) != -1",
            "name": "ContainerType",
            "params": {
              "name": "-10Y_Box"
            }
          },
 
          {
            "criteria": "specimen.initialQty == 1 && specimen.type == 'Serum' && ['S'].indexOf(specimen.reqCode) != -1",
            "name": "ContainerType",
            "params": {
              "name": "-7B_Box"
            }
          },
          {
            "criteria": "specimen.initialQty == 2.5 && specimen.reqCode=='RNA'",
            "name": "ContainerType",
            "params": {
              "name": "-7Y_Box"
            }
          },
          {
            "criteria": "specimen.type == 'Urine (complete)' && specimen.initialQty == 20",
            "name": "ContainerType",
            "params": {
              "name": "-4W_Box"
            }
          },
          {
            "criteria": "['U02', 'U03', 'U04', 'U05', 'U06'].indexOf(specimen.reqCode) != -1",
            "name": "ContainerType",
            "params": {
              "name": "-10G_Box"
            }
          },
          {
            "criteria": "['U07', 'U08', 'U09', 'U10', 'U11'].indexOf(specimen.reqCode) != -1",
            "name": "ContainerType",
            "params": {
              "name": "-10R_Box"
            }
          },
          {
            "criteria": "['U12', 'U13', 'U14', 'U15', 'U16'].indexOf(specimen.reqCode) != -1",
            "name": "ContainerType",
            "params": {
              "name": "-10W_Box"
            }
          },
          {
            "criteria": "['U17', 'U18', 'U19'].indexOf(specimen.reqCode) != -1",
            "name": "ContainerType",
            "params": {
              "name": "-10Y_Box"
            }
          },
          {
            "criteria": "['U20'].indexOf(specimen.reqCode) != -1",
            "name": "ContainerType",
            "params": {
              "name": "-10B_Box"
            }
          },
          {
            "criteria": "['U'].indexOf(specimen.reqCode) != -1",
            "name": "ContainerType",
            "params": {
              "name": "-7B_Box"
            }
          },
          {
            "criteria": "['WB1', 'WB2'].indexOf(specimen.reqCode) != -1",
            "name": "ContainerType",
            "params": {
              "name": "-7R_Box"
            }
          },
          {
            "criteria": "specimen.type == 'Cell-free (spun) Urine' && ['FU01', 'FU02', 'FU03', 'FU04', 'FU05'].indexOf(specimen.reqCode) != -1",
            "name": "ContainerType",
            "params": {
              "name": "-10G_Box"
            }
          },
          {
            "criteria": "specimen.type == 'Cell-free (spun) Urine' && ['FU06', 'FU07', 'FU08', 'FU09', 'FU10'].indexOf(specimen.reqCode) != -1",
            "name": "ContainerType",
            "params": {
              "name": "-10R_Box"
            }
          },
          {
            "criteria": "specimen.type == 'Cell-free (spun) Urine' && ['FU11', 'FU12', 'FU13', 'FU14', 'FU15'].indexOf(specimen.reqCode) != -1",
            "name": "ContainerType",
            "params": {
              "name": "-10W_Box"
            }
          }
        ]
      }
    }

Screenshot: Auto allocation

Image Modified

Code Block
titleExample 3: Dimensionless container type
{
  "name" : "auto-allocation",
  "view" : null,
  "ctrl" : null,
  "data" : {
    "rules" : [
    {
          "criteria": "['PD1','PD2'].indexOf(specimen.reqCode) != -1",
          "name": "ContainerType",
          "params": {
            "name": "Aditi JSON Box"
          }
        },
    {
          "criteria": "specimen.type == 'Urine (complete)' && specimen.initialQty == 20",
          "name": "ContainerType",
          "params": {
            "name": "Ahk -20 box"
          }
        },
        {
              "criteria": "specimen.type == 'Serum' && specimen.lineage == 'New'",
              "name": "ContainerType",
              "params": {
                "name": "Dimensionless_CT2"
              }
            },
            {
          "criteria" : "specimen.biohazards.indexOf('Tuberculosis') != -1",
          "name" : "ContainerType",
          "params" : {
            "name" : "Dimensionless_CT"
          }
        }
   ]
  }
}

Screenshot: Auto allocation

Image Added




Lock fields at the participant level

...