Module: Lab::Lims::AcknowledgementSerializer

Extended by:
Utils
Defined in:
app/services/lab/lims/acknowledgement_serializer.rb

Overview

Serialize a Lab::LabResult to LIMS’ acknowledgement format

Constant Summary

Constants included from Utils

Utils::LIMS_LOG_PATH, Utils::TEST_NAME_MAPPINGS

Class Method Summary collapse

Methods included from Utils

find_concept_by_name, lab_user, logger, parse_date, structify, translate_test_name

Class Method Details

.serialize_acknowledgement(acknowledgement) ⇒ Object



11
12
13
14
15
16
17
18
19
# File 'app/services/lab/lims/acknowledgement_serializer.rb', line 11

def serialize_acknowledgement(acknowledgement)
  serialized_acknowledgement = Lims::Utils.structify(acknowledgement)
  {
    tracking_number: Lab::LabOrder.find(serialized_acknowledgement.order_id).accession_number,
    test: ::ConceptName.where(concept_id: serialized_acknowledgement.test).first.name,
    date_acknowledged: format_date(serialized_acknowledgement.date_received),
    recipient_type: serialized_acknowledgement.acknowledgement_type
  }
end