openlmis-hapifhir

Clone Tools
  • last updated a few seconds ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
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.

OLMIS-5447: added check if transaction is rollback only
OLMIS-5447: added check if transaction is rollback only
OLMIS-5447: added check if transaction is rollback only

I created the review to make sure Lukas and you are aware of the auto-commit configuration changes. I will close this review.

I created the review to make sure Lukas and you are aware of the auto-commit configuration changes. I will close this review.

removed misleading method

removed misleading method

added

added

removed

removed

OLMIS-5415: added missing tests

OLMIS-5415: removed misleading private method

OLMIS-5415: added javadoc to ExternalApiException

OLMIS-5415: commit and rollback only if transaction is not completed

The name might be a little misleading. Wouldn't it make more sense to name it something telling us we're doing a request here?

The name might be a little misleading. Wouldn't it make more sense to name it something telling us we're doing a request here?

I think that this hides an important problem (201 being returned before the object is created). This information should definitely be propagated up and investigated.

I think that this hides an important problem (201 being returned before the object is created). This information should definitely be propagated up and investigated.

no, because we don't set id in the URL (the first parameter) and we use POST which basically is used to create objects. I created this private method to avoid code duplication.

no, because we don't set id in the URL (the first parameter) and we use POST which basically is used to create objects. I created this private method to avoid code duplication.

To make sure that a location on the FHIR server will be created. On CI there were situations where one request returns 201 status code but next one - which retrieve the object - returns 404 status ...

To make sure that a location on the FHIR server will be created. On CI there were situations where one request returns 201 status code but next one - which retrieve the object - returns 404 status code. I didn't have this locally so I thought that maybe we do something too fast in tests

This could use a Javadoc as the other newly-added exception have.

This could use a Javadoc as the other newly-added exception have.

Does this mean we will be able to update with this method aswell?

Does this mean we will be able to update with this method aswell?

I don't quite understand what needs to be reviewed here?

I don't quite understand what needs to be reviewed here?

Nevermind, I can see now.

Nevermind, I can see now.

Do we need this?

Do we need this?

What is it for?

What is it for?

OLMIS-5598: enable subscriptions in openlmis-hapifhir
OLMIS-5598: enable subscriptions in openlmis-hapifhir
OLMIS-5598: enable subscriptions in openlmis-hapifhir

Disable datasource auto-commit settings so that postgres specific error is avoided

-- Caused by: org.postgresql.util.PSQLException: Large Objects may not be used in auto-commit mode.

Remove code that requires manual activation of subscriptions.

done

done