Drafting Jobs from Schedule Jobs

Overview

Whilst schedule jobs are used to schedule automatic production or internal job registration using the system scheduler and batch processor, they can also be used to interactively create draft jobs which are then enacted into registered production or internal jobs.

A draft job is a transient job that is created interactively from a schedule job, upon which its registration details, samples and tests can be modified prior to it being enacted to create samples in a production or internal job.

Scope

Draft jobs are created with lab-scope only as they are drawn from lab-scope schedule jobs, and contain details about samples collected during a specific production or internal process.

Process

As soon as a schedule job is configured as required in the CCREGN—Job application, a draft job can be created from it. The creation of the draft job does not destroy the schedule job, that is, the schedule job can be used over and over again to create as many draft jobs as required on demand.

A draft job can only be made from a schedule job where the schedule job is active for manual registration and the related destination job does not exist as yet.

Draft samples are added to the draft job based upon the stream samples in the schedule job.

A draft job's registration details, samples and tests, etc., can be updated and saved, and at that point in time, or at a later point in time, be enacted to create the actual destination job and samples.

Upon Drafting a Job from a Schedule Job

Upon drafting a job from a schedule job:

  • The draft job's Job Code is created.

  • The draft job's Job Name is set to the draft job Job Code, but is hidden from view as this is not important.

  • The draft job's Job Type is set to Draft.

  • The draft job's Description is generated using the schedule job's Production Job Description Name Syntax Code, which may or may not use the schedule job's Job Name Offset. If the syntax is subsequently not found, or the Description cannot be determined, the Description is populated from the schedule job's Description .

  • The draft job's Required for is set to the schedule job's Required for, but may be updated in the draft job. This setting determines the required Job Type for the destination job, either Production or Internal.

  • The system attempts to locate an existing target job. If a target job is found, then the draft job shows the content of the target job with the samples from the schedule job appended. If a target job is not found, then the draft job shows the samples from the schedule job. That is, the draft job shows what the target job would look like after the draft job is enacted.

  • The event is audited. Refer to Reviewing Operational Data Audits.

  • The job is opened for update. Refer to Maintaining Jobs.

Create a draft job from a schedule job

As soon as the draft job is updated as required, it can either be closed for later use or immediately enacted to create samples in a target production of internal job. Refer to Registering Jobs from Draft Jobs.

Draft Job Name

The system generates the Production Job Name from the schedule job's Production Job Name Syntax Code, which may or may not use the schedule job's Job Name Offset.

Example: Where the schedule job's Production Job Name Syntax Code references a syntax containing MILL $dd$MM$yy$hh$mm -$Job.JobNameOffset.asEllipseValue, the Job Name Offset is -1H, and the scheduled date is 24th August/ 017 at 10:00, then the Production Job Name is determined as MILL2408170900.

An error is raised if the syntax is subsequently not found, or the Production Job Name cannot be determined.

If the samples are required for a production job and an internal job exists with the same name as the destination job's name, or if the samples are required for an internal job and a production job exists with the same name as the destination job's name, then an error is returned regarding a mis-match in job type. If the destination job with the required job type already exists, a message is displayed on the screen to indicate that the job already exists (in which case, the new samples is appended to the destination job).

Populating the Draft Job when a Matching Destination Job Exists

If the system locates a lab-scope job with a Job Name matching the Production Job Name, then the details are taken from that job. The following fields are updated also:

  • Workflow Status—Set to Registered.
  • Registered On date-time—Set to the Sampled On date as entered in the Create Draft dialog box + the schedule job's Job Name Offset.
  • Received On date-time—If the schedule job's Auto-receive Job is selected, then set to the Sampled On date-time (as entered in the Create Draft dialog box) + the schedule job's Job Name Offset, otherwise left empty (and all downstream dates, that is, Required Date, Agreed Date, and Possible Date are left empty also).
  • All dates are set in the same manner as when Registering Jobs from Template Jobs.
  • The draft job inherits the following details from the schedule job:
    • Primary Details
    • Job Stakeholders—Job stakeholders in the destination job are displayed read-only and the Already Exists is selected. Draft job stakeholders that do not exist already in the destination job are added and the Already Exists check box is cleared. Existence is matched on the job stakeholder’s Client Code + Contact Code + User Code + Scope Type + Report Template Code + File Name + File Name Syntax Code + Language.
    • Job Invoices—Job invoices in the destination job are displayed read-only.
    • Job Biofields—Job biofields in the destination job are displayed read-only and the Already Exists is selected. Draft job biofields that do not exist already in the destination job are added and the Already Exists check box is cleared. Existence is matched on the job biofield’s Code.
    • Notes—Job notes in the destination job are displayed read-only.
    • Paperwork & Labels—Paperwork and labels in the destination job are displayed read-only and the Already Exists is selected. Draft job paperwork and labels that do not exist already in the destination job are added and the Already Exists check box is cleared. Existence is matched on the job paperwork’s Report Template Code + Output Format + File Name + File Name Syntax Code + Language.
    • i18n.
    • Samples:
      • Draft job samples that exist already in the destination job are not displayed.
      • Draft job samples that do not exist already in the destination job are displayed, but only if the stream sample's Is Active for Manual Registration is selected.
      • Existence is matched on the sample’s Client Sample Name (see below for details on generating the sample's Client Sample Name) within the destination job.

If no error is raised, then the process proceeds.

Populating the Draft Job when a Matching Destination Job Does Not Exist

If the system does not locate a lab-scope job with a Job Name matching the Production Job Name, then the details are taken from the schedule job. The following fields are updated also:

  • Description—Generated using the schedule job's Production Job Description Name Syntax Code, which may or may not use the schedule job's Job Name Offset. If the syntax is subsequently not found, or the Description cannot be determined, the Description is populated from the schedule job's Description.
  • Workflow Status—Set to Registered.
  • Registered On date-time—Set to the Sampled On date as entered in the Create Draft dialog box + the schedule job's Job Name Offset.
  • Received On date-time—If the schedule job's Auto-receive Job is selected, then set to the Sampled On date as entered in the Create Draft dialog box + the schedule job's Job Name Offset, otherwise left empty (and all downstream dates, that is, Required Date, Agreed Date, and Possible Date are left empty also).
  • The draft job inherits the following details from the schedule job:
    • Primary details, including Is Auto Paperwork and Auto Append QC
    • Reporting (Job Stakeholders)
    • Job invoices
    • Job biofields
    • Notes
    • Paperwork & labels
    • i18n
    • Samples:
      • Samples are created, but only if the stream sample's Is Active for Manual Registration is selected.
      • Workflow Status—Set to Registered.
      • Registered On date-time—Set to the Sampled On date as entered in the Create Draft dialog box + the schedule job's Job Name Offset.
      • Received On date-time—Set to the Sampled On date as entered in the Create Draft dialog box + the schedule job's Job Name Offset.
  • Other dates are set in the same manner as when Registering Jobs from Template Jobs.
  • For each sample, sample details are taken from the stream sample within the schedule job:
    • Primary Details
    • Sample Biofields
    • Notes
    • Specifications
    • Portions
    • i18n.

Draft Samples' Client Sample Name

The system generates the Client Sample Name from the stream sample's Production Client Sample Name Syntax Code, which may or may not use the stream sample's Sampling Start Offset and Sampling Date Offset, which are referenced in the syntax using $Sample.SamplingStartOffset.asEllipseValue, and $Sample.SamplingDateOffset.asEllipseValue.

Example: Where the stream sample's Production Client Sample Name Syntax Code references a syntax containing MILL_Sample.SampledOn.asEllipseValue_($Sample.SampledOn.asEllipseValue- $Sample. SamplingDateOffset.asEllipseValue, a Sampling Date Offset of 1H, and the Sampled On date as entered in the Create Draft dialog box is 24th August 2017 at 10:00, then the Client Sample Name is determined as MILL_POINT2408171100.

If the stream sample's Production Client Sample Name Syntax Code is empty, the destination sample's Client Sample Name is set to the stream sample's Client Sample Name. (Note that a schedule sample's Client Sample Name cannot be cleared.)

An error is raised if the syntax is subsequently not found, or the sample's Client Sample Name cannot be determined.

Creating the Sample in the Draft Job when a Matching Sample Does Not Exist within the Destination Job

For any sample created within the draft job:

  • Sample Code—Generated as per usual for any sample, that is, using the syntax that is in scope and has a Syntax Type of Sample and a Syntax Code of SAMPLE_NAME_SYNTAX.
  • Sample Name—Generated as per usual for any sample.
  • Client Sample Name—Generated.
  • Description - Generated using the schedule sample’s Production Sample Description Syntax Code, which may or may not use the stream sample's Sampling Start Offset and Sampling Date Offset. If the syntax is subsequently not found, or the Description cannot be determined, the Description is populated from the schedule job's Description.

    Note: Where the stream sample's Production Client Sample Name Syntax Code and Production Sample Description Syntax Code are using the same syntax code, then the destination sample's Client Sample Name and Description display same value.

  • Workflow Status—Set to Registered.
  • Registered On—Set to the Sampled On date entered in the Create Draft dialog box.
  • Sampled On—Set to the Sampled On date entered in the Create Draft dialog box.
  • Sampling Started On—Set to the Sampled On date as entered in the Create Draft dialog box + the stream sample's (Sampling Start OffsetSampling Date Offset)*

    * This currently uses the Sampling Start Offset only, and does not respect the sampling window.

  • Received On—If the stream sample's Auto-receive Sample is selected, then set to the Sampled On date entered in the Create Draft dialog box, otherwise left empty (and all downstream dates, that is, Required Date, Agreed Date, and Possible Date are left empty also).
  • Other dates are set in the same manner as when Registering Jobs from Template Jobs.
  • For each sample, sample details are taken from the stream sample within the schedule job:

Check Conditions for Registering Schemes and Analytes for a Sample

For each scheme within the stream sample, if the scheme's Include in Manual Reg is selected, then the scheme is copied to the draft sample, and for each analyte within the stream sample, if the analyte's Include in Manual Reg is selected, then the analyte is copied to the draft sample scheme.

Creating a Scheme within a Stream Sample in the Draft Job

The scheme is created for the sample in the draft job. The sample scheme details are taken from the stream sample scheme within the schedule job:

  • Primary Details
  • Template Sample Code
  • Workflow Status
  • Paperworks?
  • Labels?
  • Linked scheme relationships
  • Precursor scheme relationships
  • i18n.

If the job scheme record exists already in the destination job, then the draft job scheme details are taken from that job scheme, where appropriate.

If the job scheme record does not exist already in the destination job, or the destination job does not exist as yet, then the draft job scheme details are taken from the schedule job scheme, where appropriate.

Creating an Analyte within a Stream Sample Scheme in the Draft Job

The analyte is created for the sample scheme in the draft job. The sample scheme analyte details are taken from the stream sample scheme analyte within the schedule job:

  • Primary Details
  • Template Sample Code
  • Workflow Status
  • i18n.

If the job scheme analyte record exists already in the destination job, then the draft job scheme analyte details are taken from that job scheme analyte, where appropriate.

If the job scheme analyte record does not exist already in the destination job, or the destination job does not exist as yet, then the draft job scheme analyte details are taken from the schedule job scheme analyte, where appropriate.

Creating Duplicate QC Samples for a Stream Sample or Replicate QC Samples for a Stream Sample Scheme in the Draft Job

For a sample that is included in manual registration, if the stream sample's No. of Duplicates is greater than 0, and the Dup QC Type Code is set, then the defined number of duplicate QC draft samples are created. Duplicate QC samples are added to the current job scheme in the draft job and to all linked schemes and sequel schemes in the draft job. Replicate QC samples are also created for these duplicate QC samples as follows.

For a scheme that is included in manual registration, if the stream sample scheme's No. of Replicates is greater than 0, and the Replicate QC Type Code is set, then the defined number of replicate QC draft samples are created. Replicate QC samples are added to the current job scheme in the draft job and to all linked schemes and sequel schemes in the draft job.

Refer the default settings for duplicate or replicate QC samples.