A method of hermetically sealing electronic components of a wiring harness and integrating the wiring harness into a surgical device includes: positioning a tube around a printed circuit board and a first end section of a first flex cable of a wiring harness that is electrically coupled to a first end portion of the printed circuit board at a first connection area such that a first end portion of the tube extends axially beyond the first end section of the first flex cable and a second end portion of the tube extends axially beyond a second end portion of the printed circuit board; and filling at least a portion of the tube with an encapsulate to form a hermetic seal within the tube.