text: /**
   * @name exports
   * @summary ClaimResponseAddItemDetail Class
   */
  module.exports = class ClaimResponseAddItemDetail {
    constructor(opts) {
      // Create an object to store all props
      Object.defineProperty(this, '__data', { value: {} });
  
      // Define getters and setters as enumerable
  
      Object.defineProperty(this, '_id', {
        enumerable: true,
        get: () => this.__data._id,
        set: (value) => {
          if (value === undefined || value === null) {
            return;
          }
  
          let Element = require('./element.js');
          this.__data._id = new Element(value);
        },
      });
  
      Object.defineProperty(this, 'id', {
        enumerable: true,
        get: () => this.__data.id,
        set: (value) => {
          if (value === undefined || value === null) {
            return;
          }
  
          this.__data.id = value;
        },
      });
  
      Object.defineProperty(this, 'extension', {
        enumerable: true,
        get: () => this.__data.extension,
        set: (value) => {
          if (value === undefined || value === null) {
            return;
          }
  
          let Extension = require('./extension.js');
          this.__data.extension = Array.isArray(value)
            ? value.map((v) => new Extension(v))
            : [new Extension(value)];
        },
      });
  
      Object.defineProperty(this, 'modifierExtension', {
        enumerable: true,
        get: () => this.__data.modifierExtension,
        set: (value) => {
          if (value === undefined || value === null) {
            return;
          }
  
          let Extension = require('./extension.js');
          this.__data.modifierExtension = Array.isArray(value)
            ? value.map((v) => new Extension(v))
            : [new Extension(value)];
        },
      });
      // valueSetReference: http://hl7.org/fhir/ValueSet/ex-revenue-center
      Object.defineProperty(this, 'revenue', {
        enumerable: true,
        get: () => this.__data.revenue,
        set: (value) => {
          if (value === undefined || value === null) {
            return;
          }
  
          let CodeableConcept = require('./codeableconcept.js');
          this.__data.revenue = new CodeableConcept(value);
        },
      });
      // valueSetReference: http://hl7.org/fhir/ValueSet/benefit-subcategory
      Object.defineProperty(this, 'category', {
        enumerable: true,
        get: () => this.__data.category,
        set: (value) => {
          if (value === undefined || value === null) {
            return;
          }
  
          let CodeableConcept = require('./codeableconcept.js');
          this.__data.category = new CodeableConcept(value);
        },
      });
      // valueSetReference: http://hl7.org/fhir/ValueSet/service-uscls
      Object.defineProperty(this, 'service', {
        enumerable: true,
        get: () => this.__data.service,
        set: (value) => {
          if (value === undefined || value === null) {
            return;
          }
  
          let CodeableConcept = require('./codeableconcept.js');
          this.__data.service = new CodeableConcept(value);
        },
      });
      // valueSetReference: http://hl7.org/fhir/ValueSet/claim-modifiers
      Object.defineProperty(this, 'modifier', {
        enumerable: true,
        get: () => this.__data.modifier,
        set: (value) => {
          if (value === undefined || value === null) {
            return;
          }
  
          let CodeableConcept = require('./codeableconcept.js');
          this.__data.modifier = Array.isArray(value)
            ? value.map((v) => new CodeableConcept(v))
            : [new CodeableConcept(value)];
        },
      });
  
      Object.defineProperty(this, 'fee', {
        enumerable: true,
        get: () => this.__data.fee,
        set: (value) => {
          if (value === undefined || value === null) {
            return;
          }
  
          let Money = require('./money.js');
          this.__data.fee = new Money(value);
        },
      });
  
      Object.defineProperty(this, '_noteNumber', {
        enumerable: true,
        get: () => this.__data._noteNumber,
        set: (value) => {
          if (value === undefined || value === null) {
            return;
          }
  
          let Element = require('./element.js');
          this.__data._noteNumber = new Element(value);
        },
      });
  
      Object.defineProperty(this, 'noteNumber', {
        enumerable: true,
        get: () => this.__data.noteNumber,
        set: (value) => {
          if (value === undefined || value === null) {
            return;
          }
  
          this.__data.noteNumber = Array.isArray(value) ? value.map((v) => v) : [value];
        },
      });
  
      Object.defineProperty(this, 'adjudication', {
        enumerable: true,
        get: () => this.__data.adjudication,
        set: (value) => {
          if (value === undefined || value === null) {
            return;
          }
  
          let ClaimResponseItemAdjudication = require('./claimresponseitemadjudication.js');
          this.__data.adjudication = Array.isArray(value)
            ? value.map((v) => new ClaimResponseItemAdjudication(v))
            : [new ClaimResponseItemAdjudication(value)];
        },
      });
  
      // Merge in any defaults
      Object.assign(this, opts);
  
      // Define a default non-writable resourceType property
      Object.defineProperty(this, 'resourceType', {
        value: 'ClaimResponseAddItemDetail',
        enumerable: true,
        writable: false,
      });
    }
  
    static get resourceType() {
      return 'ClaimResponseAddItemDetail';
    }
  
    toJSON() {
      return {
        id: this.id,
        extension: this.extension && this.extension.map((v) => v.toJSON()),
        modifierExtension: this.modifierExtension && this.modifierExtension.map((v) => v.toJSON()),
        revenue: this.revenue && this.revenue.toJSON(),
        category: this.category && this.category.toJSON(),
        service: this.service && this.service.toJSON(),
        modifier: this.modifier && this.modifier.map((v) => v.toJSON()),
        fee: this.fee && this.fee.toJSON(),
        _noteNumber: this._noteNumber && this._noteNumber.toJSON(),
        noteNumber: this.noteNumber,
        adjudication: this.adjudication && this.adjudication.map((v) => v.toJSON()),
      };
    }
  };
  