I think that when upgrading it is okay to leave the encounter of the DC
orders we create during data migration blank. I'm afraid that encounter is
required on all orders in the data model though.

-Darius (by phone)
On Dec 25, 2013 3:10 PM, "wluyima" <notifications@github.com> wrote:

> In
> api/src/main/java/org/openmrs/util/databasechange/CreateDiscontinueOrders.java:
>
> > +        } catch (SQLException e) {
> > +            throw new CustomChangeException(e);
> > +        } catch (DatabaseException e) {
> > +            throw new CustomChangeException(e);
> > +        }
> > +    }
> > +
> > +    private void createDiscontinueOrders(JdbcConnection connection, List<DiscontinuedOrder> discontinuedOrders) throws CustomChangeException, SQLException, DatabaseException {
> > +        final int batchSize = 1000;
> > +        int index = 0;
> > +        PreparedStatement insertStatement = null;
> > +        Boolean autoCommit = null;
> > +        try {
> > +            autoCommit = connection.getAutoCommit();
> > +            connection.setAutoCommit(false);
> > +            insertStatement = connection.prepareStatement("Insert into orders(previous_order_id, concept_id, patient_id, encounter_id, " +
>
> @djazayeri <https://github.com/djazayeri> , @bmamlin<https://github.com/bmamlin>do we need to set encounter_id for DC orders?
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/openmrs/openmrs-core/pull/495/files#r8551832>
> .
>