Sha256: 04c23c5aedc341111b681c1f19954120a1f796976415201083553ca8dce17529

Contents?: true

Size: 1.6 KB

Versions: 8

Compression:

Stored size: 1.6 KB

Contents

const mongoose = require('mongoose');

const [Number, String, Mixed, ObjectId] = [
  mongoose.Schema.Types.Number,
  mongoose.Schema.Types.String,
  mongoose.Schema.Types.Mixed,
  mongoose.Schema.Types.ObjectId,
];

const IndividualResultSchema = mongoose.Schema(
  {
    // Population Attributes
    STRAT: Number,
    IPP: Number,
    DENOM: Number,
    NUMER: Number,
    NUMEX: Number,
    DENEX: Number,
    DENEXCEP: Number,
    MSRPOPL: Number,
    OBSERV: Number,
    MSRPOPLEX: Number,

    // Result Attributes
    clause_results: Mixed,
    episode_results: Mixed,
    statement_results: Mixed,

    // This field is for application specific information only. If both Bonnie and
    // Cypress use a common field, it should be made a field on this model,
    // and not put into extendedData.
    extendedData: {
      type: Mixed,
      default: {},
    },

    // Calculation State attributes
    state: {
      type: String,
      enum: ['queued', 'running', 'complete', 'cancelled', 'failed'],
      default: 'queued',
    },

    // Relations to other model classes
    // 'alias' field makes it so you can call obj.measure, and get the object referenced by measure_id
    measure_id: { type: ObjectId, ref: 'Measure', alias: 'measure' },
    patient_id: { type: ObjectId, ref: 'Patient', alias: 'patient' },

  },
  // Options
  {
    timestamps: { createdAt: 'created_at', updatedAt: 'updated_at' }, // These are the Mongoid conventions for timestamps
  }
);

module.exports.IndividualResultSchema = IndividualResultSchema;
module.exports.IndividualResult = mongoose.model('individual_result', IndividualResultSchema);

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
cqm-models-1.0.3 app/assets/javascripts/IndividualResult.js
cqm-models-1.0.2 app/assets/javascripts/IndividualResult.js
cqm-models-1.0.1 app/assets/javascripts/IndividualResult.js
cqm-models-1.0.0 app/assets/javascripts/IndividualResult.js
cqm-models-0.8.4 app/assets/javascripts/IndividualResult.js
cqm-models-0.8.3 app/assets/javascripts/IndividualResult.js
cqm-models-0.8.2 app/assets/javascripts/IndividualResult.js
cqm-models-0.8.1 app/assets/javascripts/IndividualResult.js