| | 82 | |
|---|
| | 83 | /** |
|---|
| | 84 | * Performs a shallow copy of this Order. Does NOT copy orderId. |
|---|
| | 85 | * |
|---|
| | 86 | * @return a shallow copy of this Order |
|---|
| | 87 | */ |
|---|
| | 88 | public Order copy() { |
|---|
| | 89 | return copyHelper(new Order()); |
|---|
| | 90 | } |
|---|
| | 91 | |
|---|
| | 92 | /** |
|---|
| | 93 | * The purpose of this method is to allow subclasses of Order to delegate a portion of |
|---|
| | 94 | * their copy() method back to the superclass, in case the base class implementation changes. |
|---|
| | 95 | * |
|---|
| | 96 | * @param ret an Order that will have the state of <code>this</code> copied into it |
|---|
| | 97 | * @return the Order that was passed in, with state copied into it |
|---|
| | 98 | */ |
|---|
| | 99 | protected Order copyHelper(Order target) { |
|---|
| | 100 | target.setPatient(getPatient()); |
|---|
| | 101 | target.setOrderType(getOrderType()); |
|---|
| | 102 | target.setConcept(getConcept()); |
|---|
| | 103 | target.setInstructions(getInstructions()); |
|---|
| | 104 | target.setStartDate(getStartDate()); |
|---|
| | 105 | target.setAutoExpireDate(getAutoExpireDate()); |
|---|
| | 106 | target.setEncounter(getEncounter()); |
|---|
| | 107 | target.setOrderer(getOrderer()); |
|---|
| | 108 | target.setCreator(getCreator()); |
|---|
| | 109 | target.setDateCreated(getDateCreated()); |
|---|
| | 110 | target.setDiscontinued(getDiscontinued()); |
|---|
| | 111 | target.setDiscontinuedDate(getDiscontinuedDate()); |
|---|
| | 112 | target.setDiscontinuedReason(getDiscontinuedReason()); |
|---|
| | 113 | target.setDiscontinuedBy(getDiscontinuedBy()); |
|---|
| | 114 | target.setVoided(getVoided()); |
|---|
| | 115 | target.setVoidedBy(getVoidedBy()); |
|---|
| | 116 | target.setDateVoided(getDateVoided()); |
|---|
| | 117 | target.setVoidReason(getVoidReason()); |
|---|
| | 118 | return target; |
|---|
| | 119 | } |
|---|