Downloads Documentation Community Contribute Demo






Show Sidebar
Login | Register
Show
Ignore:
Timestamp:
05/18/08 13:16:49 (8 months ago)
Author:
djazayeri
Message:

Fixing #746 - Merge Patients should merge orders, program enrollment, person attributes, and relationship
Also allowing identifiers for voided patients to be reassigned to non-voided patients

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • openmrs/trunk/src/api/org/openmrs/Order.java

    r4095 r4245  
    8080                this.orderId = orderId; 
    8181        } 
     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        } 
    82120 
    83121        /**