Created
November 11, 2016 20:00
-
-
Save marianoqueirel/895f4aa2f23b3fdb6c1715ece2c2f9c0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
import mongoose from 'mongoose'; | |
const STATUS = ['registered', 'partial', 'final', 'corrected', 'appended', 'cancelled', 'entered-in-error']; | |
const REQUEST = ['DiagnosticOrder', 'ProcedureRequest']; | |
/* | |
* AU -> Audiology | NRS -> Nursing Service Measures | |
* BG -> Blood Gases | OSL -> Outside Lab | |
* BLB -> Blood Bank | OT -> Occupational Therapy | |
* CG -> Cytogenetics | OTH -> Other | |
* CH -> Chemistry | OUS -> OB Ultrasound | |
* CP -> Cytopathology | PF -> Pulmonary Function | |
* CT -> CAT Scan | PHR -> Pharmacy | |
* CTH -> Cardiac Catheterization | PHY -> Physician (Hx.Dx,admission note,etc) | |
* CUS -> Cardiac Ultrasound | PT -> Physical Therapy | |
* EC -> Electrocardiac(e.g.EKG,EEC,Holter) | RAD -> Radiology | |
* EN -> Electroneuro (EEG, EMG,EP,PSG) | RC -> Respiratory Care (therapy) | |
* GE -> Genetics | RT -> Radiation Therapy | |
* HM -> Hematology | RUS -> Radiology Ultrasound | |
* ICU -> Bedside ICU Monitoring | RX -> Radiograph | |
* IMM -> Immunology | SP -> Surgical Pathology | |
* LAB -> Laboratory | SR -> Serology | |
* MB -> Microbiology | TX -> Toxicology | |
* MCB -> Mycobacteriology | VR -> Virology | |
* MYC -> Mycology | VUS -> Vascular Ultrasound | |
* NMR -> Nuclear Magnetic Resonance | XRC -> Cineradiograph | |
* NMS -> Nuclear Medicine Scan | |
*/ | |
const CATEGORY = ['AU', 'BG', 'BLB', 'CG', 'CH', 'CP', 'CT', 'CTH', 'CUS', 'EC', 'EN', 'GE', 'HM', 'ICU', 'IMM', 'LAB', | |
'MB', 'MCB', 'MYC', 'NMR', 'NMS', 'NRS', 'OSL', 'OT', 'OTH', 'OUS', 'PF', 'PHR', 'PHY', 'PT', 'RAD', | |
'RC', 'RT', 'RUS', 'RX', 'SP', 'SR', 'TX', 'VR', 'VUS', 'XRC']; | |
const DiagnosticReportSchema = new mongoose.Schema({ | |
status: {type: String, required: true, enum: STATUS}, | |
category: {type: String, required: true, enum: CATEGORY}, | |
code: {type: mongoose.Schema.Types.ObjectId, ref: 'Procedure', required: true}, | |
subject: {type: mongoose.Schema.Types.ObjectId, ref: 'Patient', required: true}, | |
effectiveDate: {type: Date, required: true}, | |
issued: {type: Date, required: true}, | |
performer: {type: mongoose.Schema.Types.ObjectId, ref: 'Practitioner'}, | |
request: [{ | |
kind: {type: String, enum: REQUEST}, | |
item: {type: mongoose.Schema.Types.ObjectId, refPath: 'request.kind'}, | |
_id: false | |
}], | |
image: [{link: String, comment: String, _id: false}], | |
conclusion: {type: String}, | |
codedDiagnosis: [{type: mongoose.Schema.Types.ObjectId, ref: 'Disease', _id: false}] | |
}); | |
export default mongoose.model('DiagnosticReport', DiagnosticReportSchema); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment