Clone
 

chongsun ahn <cahn922@yahoo.com> in openlmis-hapifhir

Mark integration test folders as test source not source

OLMIS-5383 Update new identifier setting

OLMIS-5383 Add resource id to identifier list

So that reference data can save facilities and geographic zones.

OLMIS-5383 Fixes based on review feedback

Changed from using the FHIR client to using DAOs directly. This has made the loading slower, as updates have gone from batch to individual.

OLMIS-5383 Add tests for sonar

OLMIS-5383 Wait until reference data is up before loading FHIR demo data

In case the FHIR service is up before the reference data service.

OLMIS-5383 Ignore line which gives Sonar branch warning

Also remove ignored test.

OLMIS-5383 Attempted sonar fix

Try to catch all exceptions to remove code branch.

OLMIS-5383 Yet more sonar fixes

OLMIS-5383 More sonar fixes

OLMIS-5383 Fix sonar

OLMIS-5383 Add more unit tests

OLMIS-5383 More sonar fixes

OLMIS-5383 Add tests and improve code

From sonar.

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.

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.

Add HTTP caching and DTOs to style guide

Cross reference to performance docs. If HTTP caching is being implemented, need to check and potentially fix DTOs.

Update style guide: UUIDs should end in "Id"

OLMIS-1933 Change infrastructure/dev images from latest to 1

Moving away from latest to versioned image.

OLMIS-1933 Change postgres image from latest to 9.4

Moving away from latest to versioned image.

OLMIS-1741 Rename blue to reference distribution

Blue is being deprecated in favor of reference distribution/ref distro.

OLMIS-832 Update based on review feedback

Wordsmithing.

OLMIS-832 Add info about Transifex and the build

Add info about what happens in Transifex when the message source is modified.

OLMIS-1560 Update Flyway document

Update after discussion and incorporation of review comments.

OLMIS-1560 Document high level guide on writing schema migrations

Also linked from style guide.

Update style guide: UUID columns should end in id

Update style guide with guidelines for right names

Establish a standardized pattern for right names.

OLMIS-1162 Update style guide to talk about JSON value responses

We should enforce consistency in returning JSON values in endpoints by recommending they are wrapped in a JSON object. This is to be compliant with all JSON parsers.

OLMIS-894 Update style guide

Add entry about JSON schemas for RAML be put in separate JSON files.

Update style guide after review comments

Clarify no DTOs even for relationships in exporter/importer interfaces. Clarify resource as REST resource.