001 package com.bea.medrec.value;
002
003 import java.util.Calendar;
004
005 /**
006 * <p>This class represents information about a prescription.</p>
007 *
008 * @author Copyright (c) 2006 by BEA Systems. All Rights Reserved.
009 */
010 public final class Prescription extends BaseVO {
011 // Attributes
012 private Integer patientId;
013 private Integer recordId;
014 private Calendar datePrescribed;
015 private String drug;
016 private String dosage;
017 private String frequency;
018 private Integer refillsRemaining;
019 private String instructions;
020
021 // Constructors
022 public Prescription() {
023 }
024
025 public Prescription(Integer patientId,
026 Integer recordId,
027 Calendar datePrescribed,
028 String drug,
029 String dosage,
030 String frequency,
031 Integer refillsRemaining,
032 String instructions) {
033 this.patientId = patientId;
034 this.recordId = recordId;
035 this.datePrescribed = datePrescribed;
036 this.drug = drug;
037 this.dosage = dosage;
038 this.frequency = frequency;
039 this.refillsRemaining = refillsRemaining;
040 this.instructions = instructions;
041 }
042
043 public Prescription(Integer patientId,
044 Calendar datePrescribed,
045 String drug,
046 String dosage,
047 String frequency,
048 Integer refillsRemaining,
049 String instructions) {
050 this.patientId = patientId;
051 this.datePrescribed = datePrescribed;
052 this.drug = drug;
053 this.dosage = dosage;
054 this.frequency = frequency;
055 this.refillsRemaining = refillsRemaining;
056 this.instructions = instructions;
057 }
058
059 // Getters
060 public Integer getPatientId() {
061 return this.patientId;
062 }
063
064 public Integer getRecordId() {
065 return this.recordId;
066 }
067
068 public Calendar getDatePrescribed() {
069 return this.datePrescribed;
070 }
071
072 public String getDrug() {
073 return this.drug;
074 }
075
076 public String getDosage() {
077 return this.dosage;
078 }
079
080 public String getFrequency() {
081 return this.frequency;
082 }
083
084 public Integer getRefillsRemaining() {
085 return this.refillsRemaining;
086 }
087
088 public String getInstructions() {
089 return this.instructions;
090 }
091
092 // Setters
093 public void setPatientId(Integer patientId) {
094 this.patientId = patientId;
095 }
096
097 public void setRecordId(Integer recordId) {
098 this.recordId = recordId;
099 }
100
101 public void setDatePrescribed(Calendar datePrescribed) {
102 this.datePrescribed = datePrescribed;
103 }
104
105 public void setDrug(String drug) {
106 this.drug = drug;
107 }
108
109 public void setDosage(String dosage) {
110 this.dosage = dosage;
111 }
112
113 public void setFrequency(String frequency) {
114 this.frequency = frequency;
115 }
116
117 public void setRefillsRemaining(Integer refillsRemaining) {
118 this.refillsRemaining = refillsRemaining;
119 }
120
121 public void setInstructions(String instructions) {
122 this.instructions = instructions;
123 }
124
125 // Utility
126 public String toString() {
127 StringBuffer str = new StringBuffer();
128 str.append("PRESCRIPTIONS [Id: "+super.getId());
129 str.append(" | PatId: "+getPatientId());
130 str.append(" | RecId: "+getRecordId());
131 str.append(" | Calendar: " +
132 (datePrescribed == null ? "null" : getDisplayDate(datePrescribed)));
133 str.append(" | Drug: "+drug);
134 str.append(" | Dosage: "+dosage);
135 str.append(" | Freq: "+frequency);
136 str.append(" | Refills: "+refillsRemaining);
137 str.append(" | Instructions: "+instructions);
138 str.append("]");
139 return str.toString();
140 }
141
142 }
|