Clone Tools
  • last updated a few seconds ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
Yea, a lot of things I discovered when I went through the code. The documentation could be better https://review.openlmis.org/static/ogdo0b/2static/images/wiki/icons/emoticons/wink.gif

Yea, a lot of things I discovered when I went through the code. The documentation could be better

Great, thanks!

Great, thanks!

Reverted.

Reverted.

Done.

Done.

Seems like this approach works, although I can only do individual updates, which makes it slower. Too bad I didn't know about this until now; I could've saved at least a week's worth of work.

Seems like this approach works, although I can only do individual updates, which makes it slower. Too bad I didn't know about this until now; I could've saved at least a week's worth of work.

Made into a constant. It's an identifier for FHIR that indicates the value is a URI.

Made into a constant. It's an identifier for FHIR that indicates the value is a URI.

Renamed.

Renamed.

Could we place it in a constant? I honestly don't know what does this string mean. https://review.openlmis.org/static/ogdo0b/2static/images/wiki/icons/emoticons/sad.gif

Could we place it in a constant? I honestly don't know what does this string mean.

Perhaps we could call them "buildLocation" or "convertToLocation", as we're not really getting it from anywhere.

Perhaps we could call them "buildLocation" or "convertToLocation", as we're not really getting it from anywhere.

I found it when I created IT for location resource - to verify that authorization works correctly. It seems like after a request is checked and verified by the server the correct DAO service is use...

I found it when I created IT for location resource - to verify that authorization works correctly. It seems like after a request is checked and verified by the server the correct DAO service is used to do necessary actions like create, update and so on. I can't be sure if executing a method from the DAO is everything that we need - maybe a request handler do something more after saving a resource - but if yes then the loading process could be faster.

Can you explain this further? I have not seen any examples of how to do this.

Can you explain this further? I have not seen any examples of how to do this.

I don't see other changes so do we really need this change? Why it was made? I know that there is an issue with power mock and sonar coverage

I don't see other changes so do we really need this change? Why it was made? I know that there is an issue with power mock and sonar coverage

We always add equals, hashcode and toString methods (generated by Lombok annotations). Don't forget about tests

We always add equals, hashcode and toString methods (generated by Lombok annotations). Don't forget about tests

I am not sure why we load demo data via FHIR endpoint instead of using DAO: @Autowired @Qualifier("myLocationDaoDstu3") private IFhirResourceDao<Location> locationDao;

I am not sure why we load demo data via FHIR endpoint instead of using DAO:

@Autowired
@Qualifier("myLocationDaoDstu3")
private IFhirResourceDao<Location> locationDao;
should we add this to other services?

should we add this to other services?

we can get fhir context by using getFhirContext()

we can get fhir context by using getFhirContext()

OLMIS-5383 Automatically load demo data from reference data
OLMIS-5383 Automatically load demo data from reference data
OLMIS-5383 Load HAPI FHIR demo data

Squashed commit of the following:

commit 990052b75013e5d83cc1bc07fe284c894a1666bf

Author: Chongsun Ahn <cahn922@yahoo.com>

Date: Thu Oct 18 14:55:08 2018 -0700

OLMIS-5383 Add unit tests for location loading service

Need to refactor for tests to work.

commit acba0475b337bf117f63a6c59fe58c06e20e6dbd

Author: Chongsun Ahn <cahn922@yahoo.com>

Date: Wed Oct 17 22:09:29 2018 -0700

OLMIS-5383 Automatically load reference data demo data

Load test data on demo-data Spring profile. Some notes:

* Geographic zones are sorted by level, lower (country) levels first, so that higher levels can refer to them, when saving.

* Call to the FHIR service is done in a transaction, so a bunch of resources can be saved at once, instead of saving each one individually.

* Zones and facilities are chunked so that the request body that is POSTed to the FHIR service is not too large.

* When configuring the FHIR client, the socket timeout has been raised from 10 seconds to 30 seconds, because sometimes the client times out before the FHIR service responds.

* An Auth interceptor is used to add an access token to the call.

Some additional things are added in order to get this to work:

* FHIR service is now wrapping the request in a transaction, but since the demo data loading is using a transaction as well and HAPI FHIR transactions are set to Propagation never (https://github.com/jamesagnew/hapi-fhir/blob/master/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/dstu3/FhirSystemDaoDstu3.java#L82), this causes an error. The workaround is to check if the HTTP request is a transaction (request body has XML Bundle of type "transaction"). If so, do not try to wrap the request in a transaction.

* Since you cannot read the request body without consuming the contents, a custom HttpServletRequestWrapper is added to make a copy of the body.

* For some reason, the JTS Point class cannot be deserialized properly, so a custom deserializer is added to do so.

  1. … 9 more files in changeset.
OLMIS-5383 Automatically load reference data demo data

Load test data on demo-data Spring profile. Some notes:

* Geographic zones are sorted by level, lower (country) levels first, so that higher levels can refer to them, when saving.

* Call to the FHIR service is done in a transaction, so a bunch of resources can be saved at once, instead of saving each one individually.

* Zones and facilities are chunked so that the request body that is POSTed to the FHIR service is not too large.

* When configuring the FHIR client, the socket timeout has been raised from 10 seconds to 30 seconds, because sometimes the client times out before the FHIR service responds.

* An Auth interceptor is used to add an access token to the call.

Some additional things are added in order to get this to work:

* FHIR service is now wrapping the request in a transaction, but since the demo data loading is using a transaction as well and HAPI FHIR transactions are set to Propagation never (https://github.com/jamesagnew/hapi-fhir/blob/master/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/dstu3/FhirSystemDaoDstu3.java#L82), this causes an error. The workaround is to check if the HTTP request is a transaction (request body has XML Bundle of type "transaction"). If so, do not try to wrap the request in a transaction.

* Since you cannot read the request body without consuming the contents, a custom HttpServletRequestWrapper is added to make a copy of the body.

* For some reason, the JTS Point class cannot be deserialized properly, so a custom deserializer is added to do so.

  1. … 9 more files in changeset.
OLMIS-4295: updated checkstyle to new google style

fixed LICENCE header

fixed import order

fixed minor code style issues

  1. … 30 more files in changeset.
OLMIS-1686: Add checkstyle check for copyright header

  1. … 1 more file in changeset.
OLMIS-1184 Template Service needs strict checkstyle

  1. … 3 more files in changeset.
OLMIS-753, added unused import to pmd ruleset

OLMIS-753: Configure PMD ruleset

  1. … 1 more file in changeset.
OLMIS-753 Add PMD

  1. … 1 more file in changeset.
OLMIS-722 Add checkstyle checking to build

Add checkstyle checking to the gradle build. Fix some source code which does not fit Google Java code style.

    • -0
    • +210
    ./checkstyle/checkstyle.xml
  1. … 9 more files in changeset.