Skip to content

META-224:Exporting metadata packages on-the-fly should not require yo…#45

Open
reagan-meant wants to merge 1 commit into
openmrs:masterfrom
reagan-meant:META-224
Open

META-224:Exporting metadata packages on-the-fly should not require yo…#45
reagan-meant wants to merge 1 commit into
openmrs:masterfrom
reagan-meant:META-224

Conversation

@reagan-meant
Copy link
Copy Markdown
Contributor

META-224:Exporting metadata packages on-the-fly should not require you to specify ids/uuids of existing items. Left legacy compatibility when they are specified
https://issues.openmrs.org/browse/META-224

}
}
}
if(uuids==null && ids==null && modifiedSince!=null) {
Copy link
Copy Markdown
Member

@mozzy11 mozzy11 Oct 31, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@reagan-meant , wont you also need to check whether type is not null ??

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mozzy11 type has to always be specified...it isn't optional

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we actually can allow modifiedSince to be null... in which case it would fetch all objects of a certain type.

}
if(uuids==null && ids==null && modifiedSince!=null) {
List<Object> items=Handler.getItems(type, true, null, null, null);
if (items != null) {
Copy link
Copy Markdown
Member

@mozzy11 mozzy11 Oct 31, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did you have to hard code the boolean includeRetired to true ? . i would think we could have it as a variable that has a default behaviour may be false
but can also optionally be configurable via the URL ie

http://localhost:8080/openmrs/ws/rest/metadatasharing/package/new.form?type=org.openmrs.Concept&modifiedSince=01/01/2012&IncludeRetired=True

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mozzy11 That makes sense...I will change to that...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mozzy11 How is this now?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ya looks fine

@reagan-meant reagan-meant force-pushed the META-224 branch 2 times, most recently from 295dad4 to fc0cc85 Compare November 3, 2019 10:21
Copy link
Copy Markdown
Member

@mogoodrich mogoodrich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One small comment, but generally looks good me!

Also, do we currently have a "real-world" user for this use case? It would be good to have someone test it will real data.

}
}
}
if(uuids==null && ids==null && modifiedSince!=null) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we actually can allow modifiedSince to be null... in which case it would fetch all objects of a certain type.

@reagan-meant
Copy link
Copy Markdown
Contributor Author

@mogoodrich I have included your new suggestion of modifiedSince being null and given a detailed description in the issue's comments

Copy link
Copy Markdown
Member

@mogoodrich mogoodrich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks @mozzy11 !

I can go ahead and merge if there are no objections?

@mozzy11
Copy link
Copy Markdown
Member

mozzy11 commented Nov 14, 2019

sure look fine. no objections

@reagan-meant
Copy link
Copy Markdown
Contributor Author

I am delighted to hear that and thanks for the guidance too @mogoodrich @mozzy11

Copy link
Copy Markdown
Member

@mogoodrich mogoodrich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, took me a while to get to this... I made one suggestion for an optimization, but otherwise looks good to me! Thanks @reagan-meant !

List<Object> items=Handler.getItems(type, includeRetired, null, null, null);
if (items != null) {
for(Object item: items ) {
if (OpenmrsUtil.compareWithNullAsEarliest(Handler.getDateChanged(item),
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we modify this test to be if "modifiedSince == null || OpenmrsUtil.compareWithNullAsEarliest...". Then we should be able to get rid of the second block (lines 241 thru 248) entirely?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mogoodrich I will make the changes shortly...

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @reagan-meant !

@reagan-meant
Copy link
Copy Markdown
Contributor Author

@mogoodrich Does this suffice?

Copy link
Copy Markdown
Member

@mogoodrich mogoodrich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks @reagan-meant !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants