RecordsSummary.java
01 package com.bea.medrec.value;
02 
03 import java.io.Serializable;
04 
05 /**
06  <p>Encapsulates patient's medical record summary.
07  * Includes List of abbreviated records and
08  * List of current and recent prescriptions.</p>
09  *
10  @author Copyright (c) 2006 by BEA Systems. All Rights Reserved.
11  */
12 public final class RecordsSummary implements Serializable {
13 
14   private Record[] records;
15   private Prescription[] prescriptions;
16 
17   public RecordsSummary() {
18   }
19 
20   public RecordsSummary(Record[] records, Prescription[] prescriptions) {
21     this.records = records;
22     this.prescriptions = prescriptions;
23   }
24 
25   public Record[] getRecords() {
26     return this.records;
27   }
28 
29   public Prescription[] getPrescriptions() {
30     return this.prescriptions;
31   }
32 
33   public void setRecords(Record[] records) {
34     this.records = records;
35   }
36 
37   public void setPrescriptions(Prescription[] prescriptions) {
38     this.prescriptions = prescriptions;
39   }
40 
41   // Utility methods
42   public int recordsSize() {
43     if (records == null)
44       return 0;
45     else
46       return records.length;
47   }
48 
49   public int prescriptionSize() {
50     if (prescriptions == null)
51       return 0;
52     else
53       return prescriptions.length;
54   }
55 
56   public String toString() {
57     StringBuffer str = new StringBuffer();
58     str.append("RecordsSummary [");
59     str.append("Num of Records: "+recordsSize());
60     str.append(" | Num of Prescriptions: "+prescriptionSize());
61     str.append("]");
62 
63     return str.toString();
64   }
65 }