Class: Api::V2::QcResultResource

Inherits:
BaseResource
  • Object
show all
Defined in:
app/resources/api/v2/qc_result_resource.rb

Overview

For more details on JSON:API, see the JSON:API Specifications or check out the JSONAPI::Resources package for Sequencescape's implementation.

Examples:

PATCH request to update an existing QC result

PATCH /api/v2/qc_results/20
{
  "data": {
    "id": 20,
    "type": "qc_results",
    "attributes": {
      "key": "measurement_key",
      "value": "12.3",
      "units": "ng/µL",
      "cv": "5.5",
      "assay_type": "PCR",
      "assay_version": "v1.0"
    }
  }
}

Instance Attribute Summary collapse

Method Summary

Methods inherited from BaseResource

apply_includes, creatable_fields, default_includes, #fetchable_fields, inclusions, resolve_relationship_names_to_relations, updatable_fields

Instance Attribute Details

#assay_typeString

The type of assay used for the QC result (e.g., “PCR”).

Returns:

  • (String)


118
# File 'app/resources/api/v2/qc_result_resource.rb', line 118

attribute :assay_type

#assay_versionString

The version of the assay used for the QC result (e.g., “v1.0”).

Returns:

  • (String)


123
# File 'app/resources/api/v2/qc_result_resource.rb', line 123

attribute :assay_version

#assetAssetResource (readonly)

TODO:

deprecate, fix, or update this relationship to be read-only

Note:

This relationship appears to be redundant. Instead, an Asset barcode or uuid attribute must be provided in the request, which will be used to associate the QC result with the asset.

The Asset associated with the QC result.

Returns:



140
# File 'app/resources/api/v2/qc_result_resource.rb', line 140

has_one :asset

#created_atDateTime (readonly)

The timestamp indicating when this metadata entry was created.

Returns:

  • (DateTime)

    The creation time of the metadata record.



128
# File 'app/resources/api/v2/qc_result_resource.rb', line 128

attribute :created_at, readonly: true

#cvString, Numeric

The coefficient of variation for the QC result (e.g., “5.5”).

Returns:

  • (String, Numeric)


113
# File 'app/resources/api/v2/qc_result_resource.rb', line 113

attribute :cv

#keyString

Note:

This is a required attribute.

The attribute being measured. Eg. Concentration

Returns:

  • (String)


96
# File 'app/resources/api/v2/qc_result_resource.rb', line 96

attribute :key

#unitsString

Note:

This is a required attribute.

The units in which the measurement was recorded (e.g., “ng/µL”).

Returns:

  • (String)


108
# File 'app/resources/api/v2/qc_result_resource.rb', line 108

attribute :units

#valueString, Numeric

Note:

This is a required attribute.

The measured value of the QC result recorded

Returns:

  • (String, Numeric)


102
# File 'app/resources/api/v2/qc_result_resource.rb', line 102

attribute :value