XML extract itemgroupdata issue using PGSQL 9.5

Hi,

Is anyone else seeing the same extract issues using PostgreSQL 9.5 as reported here?
https://jira.openclinica.com/browse/OC-8141

Comments

  • haenselhaensel Posts: 550 ✭✭
    Hi skwaler

    I totally lost track of this bug but we where able to reproduce the issue with our own testdata. The reason for this bug is that the code expects that the database query results are sorted but they aren't. The bugfix is relatively simple. You need to sort the query results before handling them over to OpenClinica.
    Since creating a merge request was a waste of time in the past, I'll provide the diff right here. This is the bugfix that works for OC-3.12.2.
    diff --git a/core/src/main/java/org/akaza/openclinica/dao/extract/OdmExtractDAO.java b/core/src/main/java/org/akaza/openclinica/dao/extract/OdmExtractDAO.java
    index 8bc0eb4..ea5b2d8 100644
    --- a/core/src/main/java/org/akaza/openclinica/dao/extract/OdmExtractDAO.java
    +++ b/core/src/main/java/org/akaza/openclinica/dao/extract/OdmExtractDAO.java
    @@ -3677,7 +3677,8 @@ public class OdmExtractDAO extends DatasetDAO {
                                    + this.getEventGroupItemSqlSS(studyIds, sedIds, itemIds, dateConstraint, datasetItemStatusId,
                                                    studySubjectIds)
                                    + " )cvit left join (select item.item_id, mu.oc_oid from versioning_map vm, item, measurement_unit mu where vm.item_id in "
    -                               + itemIds + " and vm.item_id = item.item_id and item.units = mu.name )mu on cvit.item_id = mu.item_id";
    +                               + itemIds + " and vm.item_id = item.item_id and item.units = mu.name )mu on cvit.item_id = mu.item_id"
    +                               + " ORDER BY cvit.event_crf_id, cvit.item_group_id, cvit.item_id, cvit.item_data_ordinal";
            }
     
            protected String getItemGroupAndItemMetaWithUnitSql(String crfVersionIds) {
    
    Regards,
    Christian
  • skwalerskwaler Posts: 47
    Nice job Christian

    Could you create a pull request for the devs to consider?
  • haenselhaensel Posts: 550 ✭✭
    haensel said:


    Since creating a merge request was a waste of time in the past, I'll provide the diff right here.

    I attached the diff file to the Jira issue. If some official oc developer is asking for it I'll create a merge request.


    Regards,
    Christian

  • skwalerskwaler Posts: 47
    Cal can you get the devs to look at this to include in the next release?
  • sdibonasdibona Posts: 10
    Hello Christian,

    I am one of the OpenClinica engineers working on the 3.x releases. As skwalerWould you please open a pull request for your fix? We would like to review and test it for inclusion in a release.

    Thank you!
    Steve DiBona
  • skwalerskwaler Posts: 47
    Steve

    Christian posted the patch file to the jira issue. Can't you just use that?

  • haenselhaensel Posts: 550 ✭✭
    Hi Steve

    I created a pull request (#858).

    Regards,
    Christian
  • sdibonasdibona Posts: 10
    Hello Christian,

    Thank you for entering the pull request. I will try to get that reviewed and merged ASAP.

    Hello skwaler,

    I would have if Christian didn't respond, but he did shortly after you posted. We prefer pull requests because they provide an accurate history of where code changes originate from and also to give credit to those who contribute the change.

    Thanks,
    Steve
Sign In or Register to comment.