Emre Dincturk 4feb489735
6486 implement patient merge (#6568)
* begin with failing test

* wpi merge operation provider

* wip code resolve references and some refactoring

* respect status code set in providers

* more validation and code to update resources after refs are updated

* added source-delete parameter and some validation tests on result-patient

* update test

* update test

* return target patient as output parameter, do not add replacedby link to target if src is to be deleted

* output definition

* ignore identifiers in ref, more unit tests, return target in preview mode

* output definition

* return input parameters in the merge operation output

* copy identifiers from source to target (no duplicate check)

* add shared identifier

* add shared identifier

* moar asserts

* moar asserts

* fixing result patient

* fixing result patient

* fixing result patient

* add duplicate check when copying source identifiers to target

* copy result-patient before passing it to service

* add preview to test

* update preview asserts

* move IReplaceReferencesSvc to storage-package, and call replaceReference in patient merge

* moar tests

* cleanup

* add task test

* add replace references test

* kebab-case replace references

* add sync -> async switch

* test

* test

* start migrating to stream

* validate result-patient does not have link to source if delete-source is true

* add update count to msg in preview mode

* spotless

* change page size -> batch size and create new default max in storage settings

* spotless

* switched to patch transaction

* switched to patch transaction

* switched to patch transaction

* switched to patch transaction

* strip version from returned task

* spotless

* spotless

* async replace references test passes

* align tests

* test small batch size

* do src and target updates in trx, add validation src is not already replaced

* start building batch 2
improve dao

* start building batch 2
improve dao

* start building batch 2
improve dao

* move test setup out to helper

* move replace references tests out

* switch helper to use dao

* incresed unit test coverage

* build out batch

* build out batch

* update test to add link to result-patient only if the source is not to be deleted

* batch passes test

* batch passes test

* batch passes test

* made patient-merge return the Task returned from replace references

* batch passes test

* batch passes test

* consolidate async and sync supporting methods into a single storage service

* consolidate async and sync supporting methods into a single storage service

* add merge batch job

* add merge batch job

* added FIXMES for ED

* added FIXMES for ED

* update test to not validate task in preview mode

* mark identfier copied from source to target as old

* copyright headers

* runMaintenancePass before checking merge task status, and renamed test method for merge

* fix test

* fix test

* default

* invoke async merge job in merge service

* starting work on new docs

* starting work on new docs

* document $replace-references

* separate default from max

* fixme

* moar fixme

* moar fixme

* ken last fixme

* return 202 status on async merge, update MergeBatchTest to do more validations

* async success message, inject mergeservice, add async merge unit tests

* make validatePatchResultBundle static again

* added test for adding reference while merge in progress, and merge error handler

* fixed

* fixed

* added error handler to replace references job

* review

* javadoc

* organize imports

* make ValidationResult immutable

* make ValidationResult immutable

* rename ReplaceReferencesRequest

* rename ReplaceReferencesRequest

* rename MergeResourceHelper

* rename MergeResourceHelper

* javadoc

* split merge validation service out from merge service

* split merge validation service out from merge service

* split merge validation service out from merge service

* review feedback

* review feedback

* rename param constants

* rename param constants

* remove IdentifierUtil for visibility

* remove IdentifierUtil for visibility

* final review of hapi side

* review feedback

* review feedback

* fix checkstyle errors, rename MergeOperationInputParameters and add Msg.code

* fix replace reference parameter type, and some copyright headers

* review feedback

* review feedback

* review feedback

* review feedback

* review feedback

* review feedback

* review feedback

* review feedback

* move $merge into JPA R4

* move $merge into JPA R4

* still need to return 412

* still need to return 412

* return 412

* moar tests

* moar tests

* fix async batch size

* fix async batch size

* fix async batch size

* exception code

* exception code

* fix bean wiring

* fix bean wiring

* fix test

* fix test

* fix test

* fix test

* fix test

* bump pom versions

---------

Co-authored-by: Ken Stevens <ken@smiledigitalhealth.com>
2024-12-24 17:47:48 -05:00

206 lines
5.6 KiB
XML

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId>
<version>7.7.16-SNAPSHOT</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent>
<artifactId>hapi-fhir-converter</artifactId>
<packaging>bundle</packaging>
<dependencies>
<dependency>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir-base</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>org.hl7.fhir.convertors</artifactId>
<version>${fhir_core_version}</version>
</dependency>
<!-- Server -->
<dependency>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir-server</artifactId>
<version>${project.version}</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir-structures-dstu2</artifactId>
<version>${project.version}</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir-structures-hl7org-dstu2</artifactId>
<version>${project.version}</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir-structures-dstu2.1</artifactId>
<version>${project.version}</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir-structures-dstu3</artifactId>
<version>${project.version}</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir-structures-r4</artifactId>
<version>${project.version}</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir-structures-r5</artifactId>
<version>${project.version}</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir-validation-resources-dstu2</artifactId>
<version>${project.version}</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir-validation-resources-dstu3</artifactId>
<version>${project.version}</version>
<optional>true</optional>
</dependency>
<!--
Gson is needed for some utility classes in org.hl7.fhir.convertors, so
this is necessary for the JavaDocs to build
-->
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.fhir</groupId>
<artifactId>ucum</artifactId>
<optional>true</optional>
<exclusions>
<exclusion>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- Testing -->
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir-client</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.xmlunit</groupId>
<artifactId>xmlunit-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir-test-utilities</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<name>HAPI FHIR - Converter</name>
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>false</filtering>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<instructions>
<Import-Package>
ca.uhn.fhir.rest.server*;resolution:=optional,
jakarta.servlet.http;resolution:=optional,
*
</Import-Package>
</instructions>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
<includeDependencySources>true</includeDependencySources>
<dependencySourceIncludes>
<include>ca.uhn.hapi.fhir:org.hl7.fhir.convertors</include>
</dependencySourceIncludes>
<additionalDependencies>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-compress</artifactId>
<version>${commons_compress_version}</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.22</version>
</dependency>
<dependency>
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
<version>22.0.0</version>
</dependency>
</additionalDependencies>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>CI</id>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>animal-sniffer-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>